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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
Repo cleanup: prune throwaway scripts, refresh stale docs and dead refs
nirholas9ccbdf9c61f3
diff --git a/ISSUES.md b/ISSUES.mdindex 27c58d451..d6133a0d2 100644--- a/ISSUES.md+++ b/ISSUES.md@@ -14,44 +14,29 @@ work that is still open.## Open-The 2026-07-04 production log export (10h window, ~14.7k lines) surfaced a batch-of issues. Every code-side defect was fixed in the same day's commit (retention-coverage, cache flapping, embed WASM OOM, auth 500s, agora uuid 500, custody-504, holders 429 storm, forge-smoke crash). What remains below requires-**operator action in deployment environments** — it cannot be fixed from this-repo:+Re-verified against the live Cloud Run services on 2026-07-22. The 2026-07-04+log-export batch is now mostly closed: `JWT_SECRET` and `WALLET_ENCRYPTION_KEY`+are set on `three-ws-api` (wallet sign-in and custodial provisioning work),+`ADMIN_CODE` is set on `hyperfy-world` (world.three.ws build rights are gated+again), and the reconstruct lane has a real fallback via+`GCP_RECONSTRUCTION_URL`. What remains requires owner/operator action outside+this repo:-1. **`JWT_SECRET` unset in production** — every `GET /api/auth/siwe/nonce` and- `/api/auth/siws/nonce` failed (122 hits in the window); wallet sign-in is- down until it's set. Now surfaces as `503 not_configured` with a deduped ops- alert instead of anonymous 500s. Action: set `JWT_SECRET` on the Cloud Run- service (`gcloud run services update three-ws-api --region us-central1- --update-env-vars JWT_SECRET=$(openssl rand -base64 64)`).-2. **`WALLET_ENCRYPTION_KEY` unset** — custodial agent wallet provisioning is- deferred at create time (the secret-box refuses the JWT_SECRET fallback in- production, by design). Action: set it (`openssl rand -base64 48`).-3. **world.three.ws serving UNPROTECTED** — the live Cloud Run revision lost- `ADMIN_CODE`; every visitor has build rights (41 warnings across the- window). Action: re-run `deploy/world/apply-hardening.sh`.-4. **`OPENAI_API_KEY` invalid + OpenRouter out of credits** — the brain chain's- primary fails ("Incorrect API key provided") and the openrouter mirror- rejects with insufficient credits; traffic survives on the free fallback- chain (Groq/NIM). Action: rotate the OpenAI key, top up OpenRouter credits.-5. **Reconstruct lane has no paid fallback** — `/api/avatars/reconstruct`- returned 502 whenever the HuggingFace Spaces chain failed because neither- `REPLICATE_API_TOKEN` nor `GCP_RECONSTRUCTION_URL` is configured; consider- also widening `HF_RECONSTRUCT_SPACES` to include `stabilityai/TripoSR`.-6. **Neon branch pinned over the storage cap** — 582MB ≥ 470MB for the full- window. Retention now prunes four previously-uncovered table families and- sweeps orphaned satellites, and its pressure alert names the largest tables.- If size stays above the mark after a few cycles, bump the Neon plan or- `DB_RETENTION_HIGH_WATER_MB`.-7. **Helius quota exhaustion** — balances + DAS walks hit "max usage reached"- (32 warnings). Cadence pressure was cut code-side (holders snapshot now has- one scheduler + a 10-min 429 cooldown); if throttling persists, bump the- Helius plan.--The `character-studio/` lint debt (the last open item of the prior batch) was-cleared 2026-06-21 — `eslint character-studio/src` now reports **0 problems**.-Details in the 2026-06 archive-(`git show b80c1c379^:docs/internal/ISSUES-ARCHIVE-2026-06.md`).+1. **LLM paid backstops are dead** (owner billing decision). `OPENAI_API_KEY`+ is set on the service but the account returns `billing_not_active` 429s, so+ every OpenAI paid backstop is out. The OpenRouter platform key burned its+ credit on paid-model routing (invisible in metering: llm-pricing records+ OpenRouter as $0). Traffic survives on the free lanes (Groq/NIM plus the+ vertex-gemini credits anchor). Action: reactivate OpenAI billing and/or+ fund the OpenRouter key, or accept free-lane-only service.+2. **Neon storage over the high-water mark; write crons silently no-op**+ (found 2026-07-21). Database size exceeds the 2048MB high-water, which+ makes six write crons no-op without alerting, and `db-retention`'s plain+ `VACUUM` never returns space to the OS, so the condition cannot self-heal.+ `intel-learn` also OOMs on an unbounded 64k-row query while the cap holds.+ Action: bump the Neon plan or approve a destructive prune; until then the+ affected crons stay dark.+3. **Helius quota exhaustion, still live** (observed 2026-07-22: mainnet and+ devnet RPC 429 "max usage reached"; balances and solana-rpc fail over to+ public RPC with the designed 10min/360min cooldowns). Action: bump the+ Helius plan if the 429s persist at this volume.diff --git a/api/_mcp3d/vertex-imagen.js b/api/_mcp3d/vertex-imagen.jsindex 315996891..b262ca487 100644--- a/api/_mcp3d/vertex-imagen.js+++ b/api/_mcp3d/vertex-imagen.js@@ -37,15 +37,14 @@// VERTEX_IMAGEN_EDIT_MODEL — override the edit model// (default: gemini-2.5-flash-image)// VERTEX_IMAGEN_LOCATION — location for the image models only (falls back-// to GOOGLE_CLOUD_LOCATION). Set to "global" to-// run gemini-3-pro-image-preview, which is not-// served regionally (E2E-verified 2026-07-16:-// 2048x2048 out of both generate and edit).+// to GOOGLE_CLOUD_LOCATION). Some preview image+// models are served only from "global", not+// regionally; set it here if the configured+// model requires that.// VERTEX_IMAGE_SIZE — requested output resolution, "1K"/"2K"/"4K"// (default: 2K). gemini-2.5-flash-image ignores-// it (always 1024px); gemini-3-pro-image honors-// it. Models that reject the knob get one retry-// without it.+// it (always 1024px); models that reject the+// knob get one retry without it.//// Output: a base64 image returned inline as a data: URI. The caller// (text-to-image.js) uploads it to R2/S3 before handing it to the 3D backend.diff --git a/api/brain/chat.js b/api/brain/chat.jsindex 646a134f9..6836d9ec3 100644--- a/api/brain/chat.js+++ b/api/brain/chat.js@@ -249,7 +249,8 @@ const PROVIDERS = {env.GROK_API_KEY? createOpenAI({ apiKey: env.GROK_API_KEY, baseURL: 'https://api.x.ai/v1' }).chat('grok-4.1-fast'): null,- openrouterModel: 'x-ai/grok-4.1-fast',+ // OpenRouter dropped x-ai/grok-4.1-fast from its catalog (verified+ // 2026-07-22), so this tier is native xAI only, with no mirror route.},'groq-llama': {label: 'Llama 3.3 70B',diff --git a/character-studio/src/components/App.module.css b/character-studio/src/components/App.module.cssdeleted file mode 100644index e69de29bb..000000000diff --git a/contracts/DEPLOYMENTS.md b/contracts/DEPLOYMENTS.mdindex 40bf974dc..f55e14752 100644--- a/contracts/DEPLOYMENTS.md+++ b/contracts/DEPLOYMENTS.md@@ -61,8 +61,8 @@ Polygon Amoy (80002), Avalanche Fuji (43113).The platform validator is the EVM key that signs glTF/schema validationattestations (`recordValidation`) when an agent is registered. It must beallow-listed via `addValidator(<addr>)` by the registry owner on every chain it-attests on, funded with gas, and stored as the `VALIDATOR_PRIVATE_KEY` secret in-Vercel (never committed). Provision/rotate with+attests on, funded with gas, and stored as the `VALIDATOR_PRIVATE_KEY` env var on the+`three-ws-api` Cloud Run service (never committed). Provision/rotate with[`scripts/erc8004/provision-validator-key.mjs`](../scripts/erc8004/provision-validator-key.mjs).| Address | Allow-listed chains | Notes |diff --git a/contracts/skill-license/DEPLOYMENT.md b/contracts/skill-license/DEPLOYMENT.mdindex b93aea413..9b5b14be1 100644--- a/contracts/skill-license/DEPLOYMENT.md+++ b/contracts/skill-license/DEPLOYMENT.md@@ -65,7 +65,8 @@ the admin.## 4. Wire the backend-Set on the server (Vercel):+Set on the server (the `three-ws-api` Cloud Run service, via+`gcloud run services update three-ws-api --region us-central1 --update-env-vars ...`):| Env | Value ||---|---|diff --git a/docs/ALL.md b/docs/ALL.mdindex c478625fd..64ce567b5 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-18 from **348 files** (~5077 KB).+> Single-file snapshot of every document under [`docs/`](.). Generated 2026-07-22 from **361 files** (~5196 KB).> The individual source files remain the canonical, editable copies — this file is a read-only aggregate.## Table of contents@@ -17,187 +17,195 @@- [agent-abilities.md](#sec-007)- [agent-manifest.md](#sec-050)- [agent-reputation.md](#sec-051)-- [agent-shell.md](#sec-052)-- [agent-skills.md](#sec-053)-- [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-screen-control.md](#sec-052)+- [agent-shell.md](#sec-053)+- [agent-skills.md](#sec-054)+- [agent-sniper.md](#sec-055)+- [agent-studio.md](#sec-056)+- [agent-system.md](#sec-057)+- [agent-wallets.md](#sec-058)+- [agents-vs-avatars.md](#sec-059)+- [agi.md](#sec-060)+- [agora.md](#sec-061)+- [alpha-copilot.md](#sec-074)+- [animation-studio.md](#sec-075)+- [animations.md](#sec-076)+- [api-reference.md](#sec-077)+- [ar-studio.md](#sec-079)+- [ar.md](#sec-080)+- [architecture.md](#sec-081)+- [assistant-widget.md](#sec-082)+- [authentication.md](#sec-083)+- [autonomous-economy.md](#sec-084)+- [autonomous-x402.md](#sec-085)+- [autopilot.md](#sec-086)+- [avatar-creation.md](#sec-087)+- [avatar-inspector.md](#sec-088)+- [avatar-pipeline.md](#sec-089)+- [avatar-reconstruction.md](#sec-090)+- [avatar-studio.md](#sec-091)+- [avatar-thumbnails.md](#sec-092)+- [aws-builder-center-marketplace-x402.md](#sec-093)+- [aws-builder-center-mcp-agents.md](#sec-094)+- [aws-marketplace-listing-kit.md](#sec-095)+- [aws-marketplace.md](#sec-096)+- [aws-partner-spotlight.md](#sec-097)+- [bnb-babt-findings.md](#sec-098)+- [bnb-payments.md](#sec-099)+- [bnb-vault.md](#sec-100)+- [bnb-world.md](#sec-101)+- [brain.md](#sec-102)+- [btn-pill-migration.md](#sec-103)+- [build.md](#sec-104)+- [capture.md](#sec-105)+- [changelog.md](#sec-106)+- [character-studio.md](#sec-107)+- [chatgpt-ar.md](#sec-108)+- [circulation-engine.md](#sec-109)+- [clash.md](#sec-110)+- [clip-director.md](#sec-111)+- [coin-launches.md](#sec-112)+- [coin-pages.md](#sec-113)+- [coinmarketcap-article-play.md](#sec-114)+- [coinmarketcap-article.md](#sec-115)+- [compose.md](#sec-116)+- [concierge.md](#sec-117)+- [configuration.md](#sec-118)+- [contributing.md](#sec-125)+- [cosmos.md](#sec-126)+- [crypto-api.md](#sec-127)+- [custody.md](#sec-128)+- [daily-forge.md](#sec-129)+- [demo-routes.md](#sec-130)+- [deployment.md](#sec-131)+- [diorama.md](#sec-132)+- [do-i-need-crypto.md](#sec-133)+- [economy-heartbeat.md](#sec-134)+- [economy-master.md](#sec-135)+- [editor.md](#sec-136)+- [embedding.md](#sec-137)+- [embody.md](#sec-138)+- [erc8004.md](#sec-139)+- [examples.md](#sec-141)+- [fact-check.md](#sec-142)+- [financial-controls.md](#sec-143)+- [forge-background-generation.md](#sec-144)+- [forge-off.md](#sec-145)+- [forge-pipeline.md](#sec-146)+- [forge.md](#sec-147)+- [galaxy.md](#sec-148)+- [genesis.md](#sec-149)+- [genome.md](#sec-150)+- [guardian.md](#sec-151)+- [hold-to-access.md](#sec-152)+- [how-forge-works.md](#sec-153)+- [how-it-works.md](#sec-154)+- [i18n.md](#sec-155)+- [ibm-x402-mcp.md](#sec-156)+- [ibm.md](#sec-157)+- [image-to-3d.md](#sec-158)+- [integrations.md](#sec-159)+- [introduction.md](#sec-160)+- [irl.md](#sec-161)+- [js-api.md](#sec-163)+- [labor-market.md](#sec-164)+- [launch-usecases.md](#sec-165)+- [layers.md](#sec-166)+- [lipsync.md](#sec-167)+- [listings.md](#sec-168)+- [make-your-agent.md](#sec-169)+- [market-data-api.md](#sec-170)+- [marketplace.md](#sec-171)+- [mcp-3d-studio.md](#sec-172)+- [mcp-agent.md](#sec-173)+- [mcp-studio.md](#sec-174)+- [mcp-tools.md](#sec-175)+- [mcp-x402-bazaar.md](#sec-176)+- [mcp.md](#sec-177)+- [memetic-launcher.md](#sec-178)+- [memory.md](#sec-179)+- [meta-allocator.md](#sec-180)+- [mint-mark.md](#sec-181)+- [mocap-studio.md](#sec-182)+- [money-feed.md](#sec-183)+- [money-map.md](#sec-184)+- [motion-swap.md](#sec-185)+- [multi-agent.md](#sec-186)+- [news-rights.md](#sec-187)+- [nvidia-inception.md](#sec-188)+- [nvidia-models.md](#sec-189)+- [nvidia-nemotron-spotlight.md](#sec-190)+- [okx-marketplace.md](#sec-191)+- [onchain-agents.md](#sec-192)+- [oracle.md](#sec-201)+- [package-extraction.md](#sec-202)+- [pay-skills-listing.md](#sec-204)+- [permissions.md](#sec-205)+- [persona-hub.md](#sec-206)+- [plan-checkout.md](#sec-207)+- [popular-3d-github-repos.md](#sec-208)+- [premium.md](#sec-209)+- [provenance.md](#sec-210)+- [pump-fun-mcp-edge.md](#sec-211)+- [pump-launch-repos.md](#sec-212)+- [pump-launcher.md](#sec-213)+- [pump-platform-fee.md](#sec-214)+- [quick-start.md](#sec-235)+- [radar.md](#sec-236)+- [remix.md](#sec-237)+- [reputation.md](#sec-238)+- [restyle.md](#sec-239)+- [risk-acknowledgment.md](#sec-240)+- [robinhood-chain-markets.md](#sec-241)+- [sas-attestations.md](#sec-242)+- [scene-studio.md](#sec-243)+- [sdk.md](#sec-244)+- [security.md](#sec-245)+- [selfie-to-avatar.md](#sec-246)+- [share-and-embed.md](#sec-247)+- [sign-language.md](#sec-248)+- [signals.md](#sec-249)+- [sketchfab.md](#sec-250)+- [skills.md](#sec-251)+- [smart-contracts.md](#sec-252)+- [smart-money.md](#sec-253)+- [social-layer.md](#sec-254)+- [solana-pumpfun.md](#sec-255)+- [solana-reputation.md](#sec-256)+- [solana.md](#sec-257)+- [spatial-mcp.md](#sec-258)+- [splat.md](#sec-260)+- [start-here.md](#sec-261)+- [strategy-objects.md](#sec-262)+- [syndication.md](#sec-263)+- [talking-avatar-video.md](#sec-264)+- [terminal.md](#sec-265)+- [three-microbuy.md](#sec-266)+- [token-gated-3d-embeds.md](#sec-267)+- [trader-card.md](#sec-268)+- [trading-arenas.md](#sec-269)+- [trading-copilot.md](#sec-270)+- [trading-experiment.md](#sec-271)+- [trading-surfaces.md](#sec-272)+- [troubleshooting.md](#sec-273)+- [trust-primitives.md](#sec-274)+- [ui-juice.md](#sec-328)+- [validation.md](#sec-341)+- [vanity.md](#sec-342)+- [viewer.md](#sec-343)+- [voice-lab.md](#sec-344)+- [web-component.md](#sec-345)+- [widget-api.md](#sec-346)+- [widget-studio.md](#sec-347)+- [widgets.md](#sec-348)+- [x402-buyer.md](#sec-349)+- [x402-dev-tools.md](#sec-350)+- [x402-distribution.md](#sec-351)+- [x402-endpoints.md](#sec-352)+- [x402-revenue.md](#sec-353)+- [x402-ring-economy.md](#sec-354)+- [x402-studio.md](#sec-355)+- [x402.md](#sec-356)### agent-abilities@@ -246,155 +254,160 @@### agora-- [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)+- [agora/tasks/00-INDEX.md](#sec-062)+- [agora/tasks/01-verify-foundation.md](#sec-063)+- [agora/tasks/02-life-engine.md](#sec-064)+- [agora/tasks/03-task-supply.md](#sec-065)+- [agora/tasks/04-professions.md](#sec-066)+- [agora/tasks/05-commons-scaffold.md](#sec-067)+- [agora/tasks/06-economy-visuals.md](#sec-068)+- [agora/tasks/07-verify-and-passport.md](#sec-069)+- [agora/tasks/08-humans-first-class.md](#sec-070)+- [agora/tasks/09-arena-and-guilds.md](#sec-071)+- [agora/tasks/10-agora-mcp.md](#sec-072)+- [agora/tasks/11-production-hardening.md](#sec-073)### api-- [api/forge-x402.md](#sec-076)+- [api/forge-x402.md](#sec-078)### content-- [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)+- [content/use-cases/README.md](#sec-119)+- [content/use-cases/ai-agent-developer.md](#sec-120)+- [content/use-cases/brand-marketer.md](#sec-121)+- [content/use-cases/crypto-community.md](#sec-122)+- [content/use-cases/game-studio.md](#sec-123)+- [content/use-cases/indie-creator.md](#sec-124)### erc8004-- [erc8004/validation-attestation.md](#sec-136)+- [erc8004/validation-attestation.md](#sec-140)### irl-- [irl/THREAT-MODEL.md](#sec-158)+- [irl/THREAT-MODEL.md](#sec-162)### 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)+- [openai-pr/00-START-HERE.md](#sec-193)+- [openai-pr/01-orphan-widget-resolution.md](#sec-194)+- [openai-pr/02-wellknown-manifest-conflict.md](#sec-195)+- [openai-pr/03-forge-free-tier-truth.md](#sec-196)+- [openai-pr/04-openai-surface-test-coverage.md](#sec-197)+- [openai-pr/05-custom-gpt-openapi-serving.md](#sec-198)+- [openai-pr/06-docs-accuracy-reconciliation.md](#sec-199)+- [openai-pr/07-final-verification-and-submit.md](#sec-200)### partners-- [partners/sperax-proposal.md](#sec-196)+- [partners/sperax-proposal.md](#sec-203)### pumpfun-program-- [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)+- [pumpfun-program/README.md](#sec-215)+- [pumpfun-program/UPSTREAM-buy-sell-v2-announcement.md](#sec-216)+- [pumpfun-program/UPSTREAM-pumpswap-virtual-quote-reserves.md](#sec-217)+- [pumpfun-program/docs/BREAKING_FEE_RECIPIENT.md](#sec-218)+- [pumpfun-program/docs/CPI_README.md](#sec-219)+- [pumpfun-program/docs/FAQ.md](#sec-220)+- [pumpfun-program/docs/FEE_PROGRAM_README.md](#sec-221)+- [pumpfun-program/docs/FEE_RECIPIENTS.md](#sec-222)+- [pumpfun-program/docs/PUMP_CASHBACK_README.md](#sec-223)+- [pumpfun-program/docs/PUMP_CREATOR_FEE_README.md](#sec-224)+- [pumpfun-program/docs/PUMP_PROGRAM_README.md](#sec-225)+- [pumpfun-program/docs/PUMP_SWAP_CREATOR_FEE_README.md](#sec-226)+- [pumpfun-program/docs/PUMP_SWAP_README.md](#sec-227)+- [pumpfun-program/docs/PUMP_SWAP_SDK_README.md](#sec-228)+- [pumpfun-program/docs/instructions/BUY.md](#sec-229)+- [pumpfun-program/docs/instructions/CLAIM_CASHBACK.md](#sec-230)+- [pumpfun-program/docs/instructions/COIN_CREATION.md](#sec-231)+- [pumpfun-program/docs/instructions/COLLECT_CREATOR_FEE.md](#sec-232)+- [pumpfun-program/docs/instructions/CREATOR_FEE_SHARING.md](#sec-233)+- [pumpfun-program/docs/instructions/SELL.md](#sec-234)### specs-- [specs/agent-trading.md](#sec-250)+- [specs/agent-trading.md](#sec-259)### tutorials-- [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)+- [tutorials/add-a-3d-assistant.md](#sec-275)+- [tutorials/agent-personality.md](#sec-276)+- [tutorials/agent-reputation.md](#sec-277)+- [tutorials/animate-your-avatar.md](#sec-278)+- [tutorials/arm-an-agent-sniper.md](#sec-279)+- [tutorials/build-a-scene.md](#sec-280)+- [tutorials/build-a-site-concierge.md](#sec-281)+- [tutorials/claim-threews-name.md](#sec-282)+- [tutorials/connect-ai-brain.md](#sec-283)+- [tutorials/create-and-edit-memory.md](#sec-284)+- [tutorials/custom-skill.md](#sec-285)+- [tutorials/customize-appearance.md](#sec-286)+- [tutorials/deploy-to-vercel-custom-domain.md](#sec-287)+- [tutorials/embed-in-30-seconds.md](#sec-288)+- [tutorials/embed-on-website.md](#sec-289)+- [tutorials/emotion-from-data.md](#sec-290)+- [tutorials/first-agent.md](#sec-291)+- [tutorials/first-prompt-to-3d.md](#sec-292)+- [tutorials/generate-3d-api.md](#sec-293)+- [tutorials/getting-started.md](#sec-294)+- [tutorials/greeting-and-first-speech.md](#sec-295)+- [tutorials/image-to-3d.md](#sec-296)+- [tutorials/import-avatar-url.md](#sec-297)+- [tutorials/js-api-events.md](#sec-298)+- [tutorials/mcp-server-for-your-agent.md](#sec-299)+- [tutorials/mine-vanity-address.md](#sec-300)+- [tutorials/mint-pumpfun-token.md](#sec-301)+- [tutorials/multi-agent-coordination.md](#sec-302)+- [tutorials/nvidia-3d-free.md](#sec-303)+- [tutorials/nvidia-nim-self-host.md](#sec-304)+- [tutorials/paid-x402-endpoint.md](#sec-305)+- [tutorials/pay-for-x402-service.md](#sec-306)+- [tutorials/personal-ai-site.md](#sec-307)+- [tutorials/place-agent-irl.md](#sec-308)+- [tutorials/prompts-for-3d.md](#sec-309)+- [tutorials/register-onchain.md](#sec-310)+- [tutorials/self-host-agent-backend.md](#sec-311)+- [tutorials/selfie-to-avatar.md](#sec-312)+- [tutorials/share-your-agent.md](#sec-313)+- [tutorials/shopify-store-guide-advanced.md](#sec-314)+- [tutorials/shopify-store-guide.md](#sec-315)+- [tutorials/skill-with-database-auth.md](#sec-316)+- [tutorials/solana-agent-reputation.md](#sec-317)+- [tutorials/sperax-tour.md](#sec-318)+- [tutorials/swap-avatar-in-studio.md](#sec-319)+- [tutorials/text-to-3d.md](#sec-320)+- [tutorials/trigger-from-page-events.md](#sec-321)+- [tutorials/upload-custom-glb.md](#sec-322)+- [tutorials/view-in-ar.md](#sec-323)+- [tutorials/voice-and-lipsync.md](#sec-324)+- [tutorials/walk-companion.md](#sec-325)+- [tutorials/web-component-end-to-end.md](#sec-326)+- [tutorials/x402-server-sdk.md](#sec-327)### ux-flows-- [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)+- [ux-flows/01-onboarding-creation.md](#sec-329)+- [ux-flows/02-forge-text-to-3d.md](#sec-330)+- [ux-flows/03-3d-editing-viewer.md](#sec-331)+- [ux-flows/04-embed-widget-studio.md](#sec-332)+- [ux-flows/05-discovery-social.md](#sec-333)+- [ux-flows/06-marketplace-skills.md](#sec-334)+- [ux-flows/07-crypto-trading-analytics.md](#sec-335)+- [ux-flows/08-coin-launch-wallets.md](#sec-336)+- [ux-flows/09-x402-agent-commerce.md](#sec-337)+- [ux-flows/10-chat-brain-labs.md](#sec-338)+- [ux-flows/11-account-dashboard.md](#sec-339)+- [ux-flows/12-home-and-content.md](#sec-340)### zauth-- [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)+- [zauth/database.md](#sec-357)+- [zauth/index.md](#sec-358)+- [zauth/provider-hub.md](#sec-359)+- [zauth/reposcan.md](#sec-360)+- [zauth/vector.md](#sec-361)---@@ -13381,6 +13394,132 @@ That portability is what lets a three.ws agent be trusted by an agent that has n<a id="sec-052"></a>+> **Source:** `docs/agent-screen-control.md` · [↑ table of contents](#table-of-contents)++# Take the wheel: drive your agent's computer++Every agent on three.ws has a live screen. On the [agent screen](https://three.ws/agent-screen) and the [live wall](https://three.ws/agents-live) you can *watch* an agent do real web work in a real browser: navigate to a site, type into a search box, read back the results. This page is about the other half, **driving it yourself**.++If you own the agent, you can grab the wheel of its live cast browser and control it directly: real mouse, click and drag, scroll, keyboard, and navigation. The agent's autonomous task steps aside while you drive, and picks back up the moment you let go.++This is the first slice of a larger idea, giving every agent its own computer that both the agent and its owner can operate. Today that computer is a cloud browser; the same control channel is what a full desktop will ride on next.++---++## Try it (no code)++1. Open your agent's screen: `https://three.ws/agent-screen?agentId=<your-agent-id>`, or click through from the [live wall](https://three.ws/agents-live).+2. Sign in as the agent's owner. A **Take control** button appears in the top-left of the screen (owners only, it is not shown to other viewers).+3. Wait for the screen to go **LIVE** (a caster spins up a real browser for any agent someone is watching), then click **Take control**.+4. The screen gets a green ring and you are driving:+ - **Move / click / drag** anywhere on the screen.+ - **Scroll** with your mouse wheel or trackpad.+ - **Type** with your keyboard; use the on-screen **URL bar** to navigate anywhere, and the **←** / **⟳** buttons for back and reload.+5. Click **Release control** (or just close the tab) to hand the browser back to the agent.++While you hold the wheel the agent stops its own task so you are not fighting over the cursor. A line in the activity log records the handoff both ways.++---++## The safety model++Remote-controlling a computer is exactly as dangerous as it sounds, so the design is safety-first.++- **Owner-only.** Watching an agent is public. Driving is not. Control is gated on agent ownership (the same check that guards trading and wallet actions), verified when you take the wheel.+- **The cast browser holds no wallet and no keys.** This is the property that makes remote control safe to ship: the browser you drive is a sandboxed, throwaway Chromium with no access to the agent's custodial wallet or signing keys. Driving it **cannot** sign a transaction, move funds, or touch the chain. Money stays behind the agent runtime and the on-chain wall, no matter what you (or a compromised session) do in the browser.+- **A short-lived capability lease, not your session.** Taking the wheel mints a random **lease token** scoped to exactly one agent's control for a few seconds, renewed while you drive and dropped when you release. The high-frequency input stream authenticates with that token, so it never rides your login cookie, and the capability expires on its own if you walk away.+- **Every event is sanitized at the boundary.** Coordinates are range-clamped, keys and typed text are whitelisted and length-bounded, and navigation is **SSRF-guarded**: the browser can never be steered to `localhost`, a private range, or a cloud metadata endpoint. Only public `http(s)` destinations are allowed.+- **One driver at a time.** A live lease blocks a second session from grabbing the same agent's wheel.++---++## For developers: the control API++Two endpoints back the feature. You will not normally call them by hand (the [/agent-screen](https://three.ws/agent-screen) UI does), but they are a clean, documented surface.++### `POST /api/agent-screen-control`++All calls take a JSON body with `agentId` and an `action`.++**Acquire the wheel** (session cookie + `X-CSRF-Token`, owner only):++```bash+# 1. get a CSRF token (returns { token })+curl -s https://three.ws/api/csrf-token -b cookies.txt++# 2. acquire+curl -s https://three.ws/api/agent-screen-control \+ -b cookies.txt -H 'x-csrf-token: <token>' \+ -H 'content-type: application/json' \+ -d '{ "agentId": "<uuid>", "action": "acquire" }'+# → { "ok": true, "leaseToken": "…", "viewport": { "width": 1280, "height": 720 }, "holdMs": 15000 }+```++**Send input** (bearer = the lease token; no CSRF needed):++```bash+curl -s https://three.ws/api/agent-screen-control \+ -H 'authorization: Bearer <leaseToken>' \+ -H 'content-type: application/json' \+ -d '{ "agentId": "<uuid>", "action": "input", "events": [+ { "t": "click", "x": 0.5, "y": 0.4, "button": "left" },+ { "t": "text", "text": "hello" },+ { "t": "key", "key": "Enter" }+ ] }'+# → { "ok": true, "accepted": 3 }+```++`renew` refreshes an idle lease; `release` drops it immediately. Both take the bearer lease token.++**Event shapes** (coordinates are normalized `0..1` against the streamed viewport):++| `t` | fields | meaning |+|-----|--------|---------|+| `move` | `x, y` | move the cursor |+| `down` / `up` | `x, y, button` | press / release (drag = down, moves, up) |+| `click` | `x, y, button` | click |+| `scroll` | `x, y, dy` | wheel by `dy` px (clamped) |+| `key` | `key` | one non-text key: `Enter`, `Backspace`, `Tab`, `Delete`, `Escape`, arrows, `Home`/`End`, `PageUp`/`PageDown` |+| `text` | `text` | type literal characters (≤ 256) |+| `nav` | `url` | navigate (public `http(s)` only) |+| `back` / `forward` / `reload` | (none) | history / reload |++`button` is `left` (default), `right`, or `middle`. Unknown event types, out-of-range values, non-whitelisted keys, and blocked nav targets are dropped silently; a fat-fingered event never fails the rest of the gesture.++### `POST /api/agent-screen-control-drain`++The caster pool's read side, machine-to-machine only (authenticated with `SCREEN_WORKER_SECRET`, the same secret the pool uses to push frames). It takes `{ agentIds: [...] }` and returns, per agent, whether a human holds the wheel and the queued input events to dispatch, popping them from the queue. Ordinary clients never call this.++---++## How it fits together++```+ you (owner) three.ws caster pool (Chromium)+ ─────────── ──────── ──────────────────────+ Take control ──acquire──▶ mint lease (Redis)+ mouse/keys ───input(batch)─▶ sanitize → queue (Redis)+ ◀─drain── poll every ~250ms+ ──events─▶ dispatch into the real page+ watch it move ◀──── frame stream (SSE) ◀──────── screenshot after each action+```++The frame stream ([how the live screen works](./agent-shell.md)) carries pixels out; this control channel carries input back. Same agent, same browser, opposite directions.++---++## Limits and what is next++- **Latency** is a few hundred milliseconds (a queued, polled channel), which feels like a responsive remote desktop for browsing, not like a local mouse. A future WebRTC transport will tighten it for a full desktop.+- **One browser tab** per agent today. Full app / shell / file access is the next slice, on the same control channel with a streamed Linux desktop.+- **DNS-rebinding** on `nav` is out of scope for this version; the host guard checks the literal hostname, and the browser runs with no credentials to lose.++Related: [the agent shell and live screen](./agent-shell.md), the [live agents wall](https://three.ws/agents-live).++---++<a id="sec-053"></a>+> **Source:** `docs/agent-shell.md` · [↑ table of contents](#table-of-contents)# The agent shell — your agent, the command line, and persistent navigation@@ -13512,7 +13651,7 @@ navigates), [STRUCTURE.md](../STRUCTURE.md) (surface map).----<a id="sec-053"></a>+<a id="sec-054"></a>> **Source:** `docs/agent-skills.md` · [↑ table of contents](#table-of-contents)@@ -13631,7 +13770,149 @@ All three run free against the hosted studio endpoint----<a id="sec-054"></a>+<a id="sec-055"></a>++> **Source:** `docs/agent-sniper.md` · [↑ table of contents](#table-of-contents)++# Agent Sniper: autonomous on-chain trading, fully explained++Every three.ws agent has its own custodial Solana wallet. The Agent Sniper is the subsystem that lets that wallet trade autonomously: it watches the pump.fun launch firehose in real time, scores every new coin against an owner-armed strategy, runs an on-chain safety simulation before committing a single lamport, executes the buy from the agent's own wallet, manages the position through a strict exit ladder, and writes every decision it takes to a hash-chained reasoning ledger you can audit later.++This doc explains the whole system, walks through the first live trade an agent closed on the platform (a real +42.38% exit, receipts included), and lays out where the system goes next.++Related surfaces: [the trading surfaces](./trading-surfaces.md) (Radar, Coin Intelligence, Mission Control), [trading experiment](./trading-experiment.md) (the laddered-exit research policy), [agent wallets](./agent-wallets.md) (how custody works), and the worker itself at `workers/agent-sniper/` (its README is the operator reference).++---++## The pipeline, end to end++A snipe is not one decision. It is a chain of gates, and a coin must pass every one of them:++1. **Trigger.** A long-lived worker holds the PumpPortal new-mint feed open (`trigger: "new_mint"`), or watches for a creator's first-ever fee claim (`trigger: "first_claim"`), or fires from intel/alpha/radar signals. It is deliberately not a cron: a periodic tick cannot snipe a launch.+2. **Entry scoring** (`workers/agent-sniper/scorer.js`, pure function, no I/O). The coin must be SOL-quoted, inside the strategy's market-cap band, pass creator-history checks, and carry socials if the strategy demands them. Every skip is recorded with a reason string, so you can see why a coin was passed over, not just which ones were bought.+3. **Fleet safety band.** Worker-level env clamps (`SNIPER_MIN_MC_FLOOR_USD` / `SNIPER_MAX_MC_CEIL_USD`) tighten every strategy at once. A per-strategy bound can only narrow this band, never widen it. Unknown market cap fails closed: the sniper never buys a coin it cannot price.+4. **Mayhem gate** (`workers/agent-sniper/mayhem-gate.js`). Pump.fun "Mayhem mode" tokens are excluded by owner rule. The flag is not in the firehose, so the worker reads it from the on-chain bonding curve, one cached RPC read per mint.+5. **Trade firewall** (`api/_lib/trade-firewall.js`). Before broadcasting, the executor runs a real simulated buy-then-sell on-chain. If the token cannot be sold back (honeypot), or the round trip loses abnormally (rug mechanics), the strategy's `firewall_level` decides: `block` aborts the buy, `warn` proceeds with a lowered confidence score.+6. **Execution** (`workers/agent-sniper/executor.js`, the only file that signs). The agent's key is decrypted from its at-rest AES-256-GCM secret box, the v0 transaction is signed and broadcast with the strategy's slippage and priority-fee settings, and an idempotency lock guarantees one buy per mint per strategy.+7. **The decision ledger.** Every trade appends an entry to `agent_decisions`: the inputs (trigger, firewall verdict and score, price impact, size), a plain-language rationale, a falsifiable prediction, and a mechanically computed confidence. Entries are hash-chained (`prev_hash` to `entry_hash`), so the reasoning history cannot be silently rewritten.+8. **Position management** (`workers/agent-sniper/positions.js` + `exit-logic.js`). A sweep re-quotes every open position against the bonding curve (or the AMM after graduation), updates the high-water mark, and decides exits in strict priority order: **stop-loss, then signal-flip, then trailing-stop, then take-profit, then timeout**. The laddered variant recovers initial cost at a configured multiple and lets a moon bag ride the trailing stop.+9. **Custody audit.** Key recovery, the spend, and the exit each write an `agent_custody_events` row, and the wallet's balance is committed into the platform's custody attestation Merkle tree every epoch.++Nothing in this pipeline is a mock. The firewall simulation is a real on-chain simulation, the buy is a real mainnet transaction, and the ledger rows reference real signatures you can open in any explorer.++## Case study: the first live trade++On 2026-07-19 at 02:26:00 UTC, the platform's own agent ("three", trading from its custodial wallet `3334ZPryymmAuoRx13pBfB2kepL2ULexoirjwqhFKrsc`) sniped a brand-new pump.fun launch on a `new_mint` trigger and closed it 30 minutes later at **+42.38%**.++The full record, straight from the database and the chain:++| Field | Value |+|---|---|+| Entry | 2026-07-19 02:26:00 UTC, 0.05 SOL committed |+| Entry price impact | 0.05% (ceiling was 10%) |+| Execution | protected route, landed in 1,709 ms, priority fee 1,000 microlamports, no MEV tip |+| Firewall | simulated buy-and-sell verdict `allow`, score 100 |+| Ledger confidence | 0.698 |+| Peak | +46.5% (73,231,688 lamports) |+| Exit | 2026-07-19 02:56:04 UTC, reason `timeout`, full position |+| Realized | +21,191,138 lamports = +0.0212 SOL = **+42.38%** |+| Buy signature | [`3Y6NqS8…CEGrzRY`](https://solscan.io/tx/3Y6NqS8CV3K1j5sBZYsuQjpipZeY2wckCz3h99vGA6ZbwJgMpeUjkVm43zffeV52Kc2jWRUn4d4rzcTxoCEGrzRY) |+| Sell signature | [`mLmGA7F…jeyhH`](https://solscan.io/tx/mLmGA7FeHFUEDdQagavVZCH2aExmMssjsVxWiRCSxRZwvbxDS1Xfnvan63ab5FkrKnQ7koEu4yxwgVJYXajeyhH) |+| Live decision ledger | [three.ws/ledger/4c0e4d18-0544-4c95-a0db-a16896b029be](https://three.ws/ledger/4c0e4d18-0544-4c95-a0db-a16896b029be) |++The decision-ledger rationale the agent recorded at entry, verbatim:++> "Sniped $BITS on a new_mint trigger with 0.05% price impact; firewall verdict allow (score 100). Committed 0.0500 SOL expecting a profitable exit."++The strategy that produced it was armed on 2026-07-10 with: 0.05 SOL per trade, 0.2 SOL daily budget, one concurrent position, a $5k to $25k market-cap band, socials required, dev-dump avoidance on, firewall on `block`, 30% stop-loss, 25% trailing stop, no take-profit, and a 30-minute maximum hold.++### What the trade actually teaches++Honesty is the point of publishing this, so here is the unvarnished read:++- **The safety stack did its job.** The firewall's simulated round trip is what separates "sniping new launches" from "donating to rug creators". Score 100 meant the token was provably sellable before the buy was broadcast.+- **The exit was luck-shaped.** The position exited on `timeout`, not on a profit rule. With `take_profit_pct` unset, nothing could lock in the +46.5% peak; the position simply ran out its 30-minute clock while still green. A configured take-profit or a tighter trailing stop converts that from luck into policy.+- **One trade is not a track record.** This strategy scanned launches for roughly nine days before one coin passed every gate. That selectivity is the system working as designed (most new mints fail the socials gate, the band, or the firewall), but it also means the sample size is one. Treat the 42% as an existence proof of the pipeline, not an expected return.+- **Small size was correct.** 0.05 SOL per trade meant the whole experiment risked less than a coffee. The pipeline is now proven end to end; size can scale deliberately.++### Audit it yourself++Every layer of the trade above is independently checkable. You do not need our word for any of it:++- **The agent's public reasoning ledger** is live at [three.ws/ledger/4c0e4d18-0544-4c95-a0db-a16896b029be](https://three.ws/ledger/4c0e4d18-0544-4c95-a0db-a16896b029be). It renders this exact decision with its rationale, prediction, confidence, and (once reconciled) the real outcome, hash-chained to the agent's prior history and independently verifiable via `GET /api/ledger/verify/4c0e4d18-0544-4c95-a0db-a16896b029be`. The API behind it: `GET /api/ledger/4c0e4d18-0544-4c95-a0db-a16896b029be?kind=snipe`.+- **The two transactions** resolve on any Solana explorer: [buy](https://solscan.io/tx/3Y6NqS8CV3K1j5sBZYsuQjpipZeY2wckCz3h99vGA6ZbwJgMpeUjkVm43zffeV52Kc2jWRUn4d4rzcTxoCEGrzRY) and [sell](https://solscan.io/tx/mLmGA7FeHFUEDdQagavVZCH2aExmMssjsVxWiRCSxRZwvbxDS1Xfnvan63ab5FkrKnQ7koEu4yxwgVJYXajeyhH).+- The position row lives in `agent_sniper_positions` with entry/exit prices, the peak, and the realized PnL.+- The reasoning entry lives in `agent_decisions`, hash-chained to the agent's prior history.+- The spend and key-recovery events live in `agent_custody_events`, and the wallet appears in the epoch custody attestations (`custody_attestation_leaves`).++## Track every wallet, every decision++The case study above audits one trade. [/sniper/experiments](/sniper/experiments) is the live version of that audit for the whole fleet, updated every 30 seconds:++- **Every arm's wallet, in the open.** Each row shows its Solana address (truncated, linked to Solscan) and its real-time SOL balance — no login, no DB query, just what the chain says right now. A "Fleet SOL on hand" tile totals it across every armed wallet.+- **The funding source too.** The fleet's dry wallets are kept above their floor by one master wallet (`SNIPER_AUTO_FUND`, `workers/agent-sniper/auto-funder.js`). Its address and live balance are published in the same view, so funding flow into the fleet is as auditable as the fleet itself.+- **A "ledger →" link on every arm** goes straight to that agent's full Reasoning Ledger (`/reasoning-ledger?agent=<id>&kind=snipe`, backed by `GET /api/ledger/:agentId`): the complete, tamper-evident, hash-chained history of every buy decision that agent has made — the trigger, price impact, firewall verdict, and (for LLM-judged arms) the model's thesis and confidence at the moment it decided, plus the reconciled real outcome once the position closes (win or loss, exact SOL, the sell signature). Nothing is aggregated away; a loss is exactly as visible as a win.+- **The judgment ledger** (rendered lower on the same page) scores every LLM verdict — buys AND skips — against what the coin actually did, independent of position size, so a model's calibration is measurable even before its trades close.++This is deliberately the same infrastructure the case study above uses, generalized: `agent_decisions` + `decision_outcomes` (the reasoning ledger), `sniper_llm_verdicts` (the judgment ledger), and `api/cron/reconcile-decisions` (closes the loop from an open prediction to a proven outcome, then anchors the chain head on-chain via SPL-Memo so the history is independently verifiable at `GET /api/ledger/verify/:agentId`).++## Configuration reference++The strategy row (`agent_sniper_strategies`, armed via `POST /api/sniper/strategy`) is the whole policy. The load-bearing fields:++| Field | What it does |+|---|---|+| `trigger` | `new_mint`, `first_claim`, `intel_confirmed`, `graduation_ride` (buy at migration, sell into pump.fun's 5-minute BOOST buyback window), alpha/radar variants |+| `per_trade_lamports` / `daily_budget_lamports` | Position size and the hard daily spend ceiling |+| `max_concurrent_positions` | Open-position cap |+| `min_market_cap_usd` / `max_market_cap_usd` | Entry band; tightened by the fleet-wide safety band |+| `require_socials` | Reject coins with no Twitter/Telegram/website |+| `avoid_dev_dump` | Reject coins whose creator already sold (defaults on) |+| `firewall_level` | `block` (abort on a failed simulation) or `warn` |+| `slippage_bps` / `max_price_impact_pct` | Execution guards |+| `stop_loss_pct` | Hard floor below entry, always evaluated first |+| `trailing_stop_pct` | Percent off the position's high-water mark |+| `take_profit_pct` | Profit ceiling. **Set this.** Null means winners are only ever closed by the trailing stop or the clock |+| `max_hold_seconds` | The timeout backstop; closes the position regardless of PnL |+| `initials_out_multiple` / `moonbag_min_pct` | The laddered exit: recover cost at N times entry, let the rest ride |+| `kill_switch` / `enabled` | Two independent off switches |++Exit rules are evaluated in a fixed order (stop-loss, signal-flip, trailing-stop, take-profit, timeout) by a pure, unit-tested function (`workers/agent-sniper/exit-logic.js`), so a backtest and the live worker agree on exactly when a position closes.++## How the fleet improves itself++The hard-config sniper is the control group: its constants (band edges, stop percentages, hold time) are frozen at arm time, so it cannot react to regime changes. A band that is right at midnight is wrong at noon, and the only fix used to be a human editing numbers. That is no longer the case. The fleet now improves itself through three layers, each running above the same execution stack and each bounded so it can only ever tune what a human owner already tunes.++**Layer 1: LLM-judged entry (`decision_mode = 'llm'`).** An arm can skip the rule shields and instead ask a model (an OpenRouter slug, via the platform's LLM failover chain) to judge each launch, returning `{ buy, confidence, thesis }`. The verdict is persisted and later scored against what the coin actually did (`sniper_evolution_log` / the judgment ledger), so a model's calls are measured independent of trade size. The deterministic rails (firewall, Mayhem exclusion, budgets, concurrency) still apply to LLM arms identically.++**Layer 2: intra-arm optimizer (`api/cron/sniper-optimize.js` + `api/_lib/sniper-optimizer.js`).** On a cadence it reads each arm's own real trading record over a trailing window, including the exit-reason distribution, and proposes bounded adjustments to that arm's *inward* knobs: take-profit, trailing/stop percentages, hold time, entry-quality thresholds, and per-trade size. Every proposal is clamped to a hard range and to a small per-run step, so one run can never lurch an arm to an extreme. It runs **shadow by default** (`SNIPER_OPTIMIZER_MODE`): it persists what it *would* do to `agent_sniper_optimizer_runs` and mutates nothing, so you can watch it make tuning calls before it ever touches a live arm. In `apply` mode it enacts changes only for arms that opted in (`auto_optimize = true`), and logs each change to the agent's tamper-evident Reasoning Ledger (`kind = 'optimize'`) next to the trades it learned from. This is the layer that would have caught the first trade's missing take-profit automatically.++**Layer 3: portfolio evolution (`scripts/sniper-evolve.mjs` + `api/cron/sniper-evolve.js`).** Across arms, it scores each arm's fitness against the ground-truth base rate (what fraction of launches actually win, from `pump_coin_outcomes`) using Wilson confidence bounds, then reallocates the fleet's daily budget toward higher-fitness arms, retires an arm proven worse than a coin flip, and revives a retired arm after a cooldown to re-test it. It runs autonomously on a 12-hour cron (dry-run unless `SNIPER_EVOLVE_APPLY=1`) and is also runnable by hand (`node scripts/sniper-evolve.mjs --apply`); both paths share the one `runEvolve()` engine. Every move is journaled to `sniper_evolution_log` with before/after and evidence.++The division of labor is deliberate and enforced by construction: the optimizer moves per-arm entry/exit knobs and never touches budget or on/off; evolution moves budget and on/off and never touches a per-arm knob. Neither can write a safety field (`firewall_level`, `max_price_impact_pct`, `stop_loss_pct` is bounded, the daily cap); those are code-enforced at the `executeBuy` chokepoint and out of reach.++The design principle is fixed across all three: **models and loops propose, the deterministic pipeline disposes.** No autonomous output ever bypasses the firewall, the budget caps, or the confirmation gates around irreversible actions. The worst a self-tuned parameter can produce is a bad, stop-loss-protected, firewall-vetted, budget-bounded trade, fully logged and reversible with one update.++## The Oracle feedback loop: closing the silos++For a while two learning systems ran without talking to each other. The Oracle/intel engine learns *which launch signals predict a coin pumping* (`intel-learn`, every 15 min) and trained on coarse chart labels: a coin "won" if it hit ATH >= 3x at any point. The sniper optimizer learns *which config makes money* from realized PnL. Neither fed the other, and the Oracle never saw a single real trade result, even though a coin can spike 3x on the chart while the sniper still loses (bought late, timed-out exit). Three bridges now connect them:++- **Bridge 1: realized PnL trains the Oracle.** `api/cron/oracle-realized-labels` derives each traded coin's real win/loss from `agent_sniper_positions` into `oracle_realized_outcomes`, and `trainWeights` prefers that label over the chart label. The Oracle now learns from real money where it has it, and falls back to chart outcomes where it doesn't. Realized labels are scarce but gold-standard.+- **Bridge 2: the optimizer uses the Oracle.** `api/cron/sniper-optimize` joins each arm's trades to the Oracle conviction the coin had at entry, buckets the realized win rate by conviction band, and (Rule O) tunes `min_oracle_score` toward the band where that arm actually wins. This already surfaced a real finding: the fleet had mostly been sniping sub-30-conviction coins and losing (~17% win rate), so the optimizer will raise the conviction floor once it has enough high-conviction trades to prove the lift.+- **Bridge 3: calibration.** `api/cron/oracle-calibrate` measures, per conviction band, whether the Oracle's score matches the *realized* win rate (does an 80 actually win ~80%?) and writes a bounded correction factor to `oracle_calibration`, exposed at `GET /api/oracle/calibration`. The correction is applied through the optimizer's entry-threshold tuning rather than by overwriting the canonical conviction score, which would feed back into its own measurement.++The direction of every bridge is the same: real, realized money is the ground truth, and every layer of judgment is pulled toward what actually paid.++## Try it++- Arm your first strategy: [the sniper tutorial](/tutorials/arm-an-agent-sniper)+- Watch the engine think: [Coin Intelligence and the trading surfaces](./trading-surfaces.md)+- The research policy behind laddered exits: [trading experiment](./trading-experiment.md)+- The story of the first trade, for non-operators: [the blog post](/blog/first-autonomous-trade)++---++<a id="sec-056"></a>> **Source:** `docs/agent-studio.md` · [↑ table of contents](#table-of-contents)@@ -13761,7 +14042,7 @@ curl -s https://three.ws/api/agents/<agent-id>/pricing \----<a id="sec-055"></a>+<a id="sec-057"></a>> **Source:** `docs/agent-system.md` · [↑ table of contents](#table-of-contents)@@ -14291,7 +14572,7 @@ Quick reference for where each piece of the system lives:----<a id="sec-056"></a>+<a id="sec-058"></a>> **Source:** `docs/agent-wallets.md` · [↑ table of contents](#table-of-contents)@@ -14385,7 +14666,7 @@ An agent can pay a human-readable name instead of a base58 address. `/api/x402/p----<a id="sec-057"></a>+<a id="sec-059"></a>> **Source:** `docs/agents-vs-avatars.md` · [↑ table of contents](#table-of-contents)@@ -14446,7 +14727,7 @@ You don't use an avatar by itself, and you don't use an agent without a body. Pa----<a id="sec-058"></a>+<a id="sec-060"></a>> **Source:** `docs/agi.md` · [↑ table of contents](#table-of-contents)@@ -14536,7 +14817,7 @@ An "awakening" envelope (no eligible trading agent yet) is still valid and fully----<a id="sec-059"></a>+<a id="sec-061"></a>> **Source:** `docs/agora.md` · [↑ table of contents](#table-of-contents)@@ -14882,7 +15163,7 @@ simulation).----<a id="sec-060"></a>+<a id="sec-062"></a>> **Source:** `docs/agora/tasks/00-INDEX.md` · [↑ table of contents](#table-of-contents)@@ -15056,7 +15337,7 @@ Verification · Guardrails.**----<a id="sec-061"></a>+<a id="sec-063"></a>> **Source:** `docs/agora/tasks/01-verify-foundation.md` · [↑ table of contents](#table-of-contents)@@ -15145,7 +15426,7 @@ curl -s "localhost:3000/api/agora/passport?id=00000000-0000-0000-0000-0000000000----<a id="sec-062"></a>+<a id="sec-064"></a>> **Source:** `docs/agora/tasks/02-life-engine.md` · [↑ table of contents](#table-of-contents)@@ -15276,7 +15557,7 @@ Confirm tx signatures on `https://explorer.solana.com/?cluster=devnet`.----<a id="sec-063"></a>+<a id="sec-065"></a>> **Source:** `docs/agora/tasks/03-task-supply.md` · [↑ table of contents](#table-of-contents)@@ -15375,7 +15656,7 @@ curl -s "localhost:3000/api/agenc/get-task?taskPda=<pda>&cluster=devnet&lifecycl----<a id="sec-064"></a>+<a id="sec-066"></a>> **Source:** `docs/agora/tasks/04-professions.md` · [↑ table of contents](#table-of-contents)@@ -15471,7 +15752,7 @@ curl -sL "<deliverableUrl>" -o /tmp/d.glb && sha256sum /tmp/d.glb # == on-chai----<a id="sec-065"></a>+<a id="sec-067"></a>> **Source:** `docs/agora/tasks/05-commons-scaffold.md` · [↑ table of contents](#table-of-contents)@@ -15562,7 +15843,7 @@ Throttle network to see progressive load.----<a id="sec-066"></a>+<a id="sec-068"></a>> **Source:** `docs/agora/tasks/06-economy-visuals.md` · [↑ table of contents](#table-of-contents)@@ -15655,7 +15936,7 @@ flow + rep tick. Leave it open 10 min; confirm stable memory in devtools.----<a id="sec-067"></a>+<a id="sec-069"></a>> **Source:** `docs/agora/tasks/07-verify-and-passport.md` · [↑ table of contents](#table-of-contents)@@ -15753,7 +16034,7 @@ against `/api/agenc/get-agent`. For the handshake, confirm the canonical id equa----<a id="sec-068"></a>+<a id="sec-070"></a>> **Source:** `docs/agora/tasks/08-humans-first-class.md` · [↑ table of contents](#table-of-contents)@@ -15849,7 +16130,7 @@ insufficient balance (honest error). Confirm tx signatures on Explorer.----<a id="sec-069"></a>+<a id="sec-071"></a>> **Source:** `docs/agora/tasks/09-arena-and-guilds.md` · [↑ table of contents](#table-of-contents)@@ -15936,7 +16217,7 @@ watch the race resolve to the real winner. Cross-check the winner + escrow again----<a id="sec-070"></a>+<a id="sec-072"></a>> **Source:** `docs/agora/tasks/10-agora-mcp.md` · [↑ table of contents](#table-of-contents)@@ -16030,7 +16311,7 @@ in `/api/agora/pulse`.----<a id="sec-071"></a>+<a id="sec-073"></a>> **Source:** `docs/agora/tasks/11-production-hardening.md` · [↑ table of contents](#table-of-contents)@@ -16130,7 +16411,7 @@ Then `completionist` on changed files + `/code-review` on the diff.----<a id="sec-072"></a>+<a id="sec-074"></a>> **Source:** `docs/alpha-copilot.md` · [↑ table of contents](#table-of-contents)@@ -16213,7 +16494,7 @@ When `read.hallucination_guard.line_replaced` is true, the co-pilot caught a fig----<a id="sec-073"></a>+<a id="sec-075"></a>> **Source:** `docs/animation-studio.md` · [↑ table of contents](#table-of-contents)@@ -16247,6 +16528,14 @@ Set a pose, drop a keyframe on the playhead, move the playhead, re-pose, drop anA 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.+### ASL fingerspelling++Under the motion generator sits a Spell box: type a word and the avatar spells it letter by letter in American Sign Language on its right hand. All 26 handshapes are built in, including the traced motions for J and Z and the small bounce signers use to mark double letters; between letters the hand transitions smoothly and the figure holds a natural signing posture (right hand raised palm-out, off hand relaxed). Spelling is generated locally in the browser from a parametric hand model (`src/fingerspelling.js`), so it is instant, deterministic, and works offline; nothing is sent to a server. The spelled clip plays through the same retarget path as a preset, which means scrub, speed, stop, and the animated-GLB export all work on it, and it plays on any rigged avatar whose skeleton includes finger bones. A rig without finger bones cannot form handshapes, so the studio refuses it with an explanation instead of playing a wrong result.++A spelled word is shareable as a link: `https://three.ws/pose?spell=HELLO` opens the studio, auto-loads a rigged avatar (same roster as animation deep links), and spells the word on arrival.++Fingerspelling is the deterministic, spelling-based subset of sign language, it spells English words rather than translating into grammatical ASL. It is the first step of the platform's signing-avatars work; lexical signs come from the motion-capture lane, which can turn video of a real signer into a library clip.+### Export, save, and sell- **Clip JSON** serializes the keyframe document to a documented `{ name, duration, tracks }` shape.@@ -16294,6 +16583,7 @@ curl -X POST 'https://three.ws/api/animations/clips' \- **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.+- **Fingerspelling spells A to Z.** The Spell box keeps letters and spaces and drops everything else (digits and punctuation have distinct signs that are not letter handshapes). It needs a loaded rigged avatar with finger bones; the mannequin and finger-less rigs are refused with an explanation.## Related@@ -16305,7 +16595,7 @@ curl -X POST 'https://three.ws/api/animations/clips' \----<a id="sec-074"></a>+<a id="sec-076"></a>> **Source:** `docs/animations.md` · [↑ table of contents](#table-of-contents)@@ -16390,7 +16680,7 @@ Resolved (see `public/animations/registry.json` → `resolved_issues`): the `fid----<a id="sec-075"></a>+<a id="sec-077"></a>> **Source:** `docs/api-reference.md` · [↑ table of contents](#table-of-contents)@@ -18711,6 +19001,36 @@ The cross-surface leaderboard behind `/rankings`. Public; sending a session cook---+### Daily Match standings++```+GET /api/leaderboard/daily-match+```++The agents' Daily Match board behind `/daily-match`. Ranks public agents by real output shipped since 00:00 UTC today: `agent_actions` rows, closed sniper positions plus pump trades on the agent's own coins, confirmed skill sales, and coin launches. `score = actions + 5·trades + 15·sales + 25·launches`; realized sniper P&L is returned for context but never scored. Public, anonymous, CDN-cached ~30s. Format adopted from Bowyer's Arena (bowyer.app), who run daily agent matches on top of three.ws avatars.++**Query parameters**++| Parameter | Type | Description |+| --------- | ------- | ------------------ |+| `limit` | integer | 1..50 (default 20) |++**Response:** `{ data: { day_start, resets_at, weights, standings: [{ rank, agent_id, name, avatar_url, actions, launches, trades, sales, pnl_lamports, score }], yesterday_winner, recent: [{ agent_id, name, type, source_skill, at }] } }`++---++### Skill promo state++```+GET /api/marketplace/skill-promo?agent_id=<uuid>&skill=<name>+```++Public proof-phase promo state for one paid skill: the base price, the effective price the purchase quote will actually charge (dynamic pricing rules applied), and, while a `first_n_purchases` rule is live, the real claimed and spots-left counts. Powers the strikethrough list price and "First N · X left" counters in the marketplace and purchase modal. Read-only, anonymous, CDN-cached ~15s; the charged amount always comes from the purchase quote, which evaluates the same rules.++**Response:** `{ data: { base_amount, effective_amount, currency_mint, chain, promo: null | { rule_type, threshold, claimed, spots_left, promo_amount, list_amount } } }`++---+### Follow / unfollow a user```@@ -19200,6 +19520,24 @@ beyond).---+### On-chain pool resolution++```+GET /api/coin/pool?address=<token-address>&network=<gecko-network>+```++Resolves a token's most-liquid on-chain pool, so the coin page can mount the+GeckoTerminal chart embed (which is keyed by pool address, not token). `network`+is a GeckoTerminal network id (`solana`, `eth`, `base`, `bsc`, `polygon_pos`,+`arbitrum`, `optimism`, `avax`); `address` is the token mint (Solana) or+contract (EVM), validated per-network at the boundary. Returns+`{ "network", "address", "pool" }`. A token with no indexed pool returns `404`+(`no_pool`); upstream throttles surface as `429`, outages as `502` — the client+falls back to an "open on GeckoTerminal" link rather than a fabricated chart.+Cached 60s in-process + 5min at the CDN.++---+### Markets table / coin search```@@ -19567,18 +19905,29 @@ GET /api/news/article?url=<article url>&title=&source=Server-side extraction with SSRF + DNS-rebinding protection. Returns`{ id, url, title, source, image, author, published_at, description,-extraction, paragraphs[], content_chars, tickers[], coins[], summary,-key_points[], entities[], topics[], sentiment+extraction, paragraphs[], excerpt_truncated, full_text_url, content_chars,+tickers[], coins[], summary, key_points[], entities[], topics[], sentiment("bullish"|"bearish"|"neutral"), analysis_provider, market_context, related[],fetched_at }`.-`extraction` tells you where the text came from, in ladder order-(`api/_lib/article-extract.js`): `"page"` (the publisher's own HTML),+`paragraphs[]` is a bounded lead excerpt, not the article body: capped to 2+paragraphs / 400 characters by `excerptParagraphs()` in+[api/_lib/news-rights.js](../api/_lib/news-rights.js), the single choke point+every response passes through (see [docs/news-rights.md](./news-rights.md)).+`excerpt_truncated` is `true` whenever the source ran longer than the quoted+excerpt; `full_text_url` is where to send the reader for the rest. This is a+hard limit for every publisher, not a per-source policy — a story removed at a+rightsholder's demand (`TAKEDOWN_IDS`) or from a withdrawn publisher+(`RESTRICTED_SOURCE_KEYS`/`RESTRICTED_HOSTS`) answers 410 Gone instead.++`extraction` tells you where the excerpt's source text came from, in ladder+order (`api/_lib/article-extract.js`): `"page"` (the publisher's own HTML),`"reader"` (recovered through a keyless reader service when the publisherCloudflare-blocks direct fetches — this is what makes bot-blocked outlets like-The Defiant and CoinDesk return a full story instead of a one-line teaser),-`"feed"` (the publisher's own `content:encoded` feed body), or `"preview"`-(metadata only; `blocked_reason` set).+The Defiant and CoinDesk resolve to more than a one-line teaser), `"feed"`+(the publisher's own `content:encoded` feed body), or `"preview"` (metadata+only; `blocked_reason` set). It does not change how much of the body is+returned — the excerpt cap applies identically regardless of ladder stage.`coins[]` is a live market snapshot for every detected ticker that maps to aknown coin — `{ symbol, id, name, image, price, change_24h, change_7d,@@ -19602,15 +19951,20 @@ GET /api/news/knowledge # latest recorded stories + cor```The grounding surface the three.ws 3D agents read crypto from. Every story the-reader fully extracts and analyzes is recorded here (`news_knowledge` table,-`api/_lib/news-knowledge-store.js`): full body, AI summary + key points,-sentiment, detected tickers with their market snapshot, and named entities —-permanent and queryable, distinct from the append-only GCS archive and from-per-agent memory. Lightweight rows by default (id, title, source, sentiment,-tickers, entities, summary); add `&full=1` for the extracted paragraphs and-coin snapshot. `stats` reports `{ total, full_text, latest, enabled }`. Free,-key-less, CORS `*`; CDN cache 60–120 s. Degrades to an empty corpus-(`enabled:false`) when the platform database is not configured.+reader extracts and analyzes is recorded here (`news_knowledge` table,+`api/_lib/news-knowledge-store.js`): AI summary + key points, sentiment,+detected tickers with their market snapshot, and named entities — permanent+and queryable, distinct from the append-only GCS archive and from per-agent+memory. The full extracted body is held internally so the LLM analysis layer+and the agents' server-side RAG corpus can reason over it, but this endpoint+never returns it: it is subject to the same excerpt cap as the article reader+(`api/_lib/news-rights.js`), so `&full=1` returns the bounded lead excerpt and+coin snapshot, not the full text. Lightweight rows by default (id, title,+source, sentiment, tickers, entities, summary). `stats` reports `{ total,+full_text, latest, enabled }` (`full_text` counts stored records with a full+internal body, not what the API exposes). Free, key-less, CORS `*`; CDN cache+60–120 s. Degrades to an empty corpus (`enabled:false`) when the platform+database is not configured.---@@ -19975,7 +20329,7 @@ const { agents } = await res.json();----<a id="sec-076"></a>+<a id="sec-078"></a>> **Source:** `docs/api/forge-x402.md` · [↑ table of contents](#table-of-contents)@@ -20093,7 +20447,7 @@ for (;;) {----<a id="sec-077"></a>+<a id="sec-079"></a>> **Source:** `docs/ar-studio.md` · [↑ table of contents](#table-of-contents)@@ -20197,7 +20551,7 @@ You can also hand-build a share link: append `?src=<https glb url>&title=<name>`----<a id="sec-078"></a>+<a id="sec-080"></a>> **Source:** `docs/ar.md` · [↑ table of contents](#table-of-contents)@@ -20664,7 +21018,7 @@ How this link ships through ChatGPT end to end (the app connector, the custom GP----<a id="sec-079"></a>+<a id="sec-081"></a>> **Source:** `docs/architecture.md` · [↑ table of contents](#table-of-contents)@@ -20928,7 +21282,159 @@ A minimal Node + Neon + Anthropic deployment is enough for a single agent. The b----<a id="sec-080"></a>+<a id="sec-082"></a>++> **Source:** `docs/assistant-widget.md` · [↑ table of contents](#table-of-contents)++# Assistant widget: a 3D avatar assistant on any website++The assistant widget puts a full-body, animated three.ws avatar on any website behind a floating launcher button. Click it and the avatar pops up, standing directly on the page (transparent background) or against a color or gradient, with a message box underneath. It has two modes:++- **Chat**: a real chatbot. Messages go to an LLM and the reply streams into a speech bubble above the avatar's head, optionally spoken aloud. By default answers come from the platform's free model chain (Groq, then OpenRouter, then NVIDIA, no key and no account needed). Visitors can instead bring their own Groq or OpenRouter API key in the widget's settings; the key is stored only in their browser and calls go straight from the browser to the provider.+- **Speak**: the avatar repeats exactly what you type, out loud, with a speech bubble and a talking animation. No model involved; speech uses the browser's built-in text-to-speech voices at zero cost.++Configure everything and copy your snippet at [three.ws/assistant](https://three.ws/assistant). The builder page runs the real widget, so what you see in the corner is exactly what your visitors get.++Looking for a support-chat panel grounded in your page's content instead of a full-body avatar? That is the sibling [Concierge widget](./concierge.md). Use Concierge for "answer questions about this page"; use the assistant widget when you want a character who stands on your site, speaks, and can run on a visitor's own model key.++There are three ways to add it: a one-tag script, the [`@three-ws/assistant`](https://www.npmjs.com/package/@three-ws/assistant) npm package, or let an AI agent generate the embed for you through the [assistant-widget MCP server](#generate-a-widget-from-an-ai-agent-mcp). New to it? The [step-by-step tutorial](./tutorials/add-a-3d-assistant.md) builds one from scratch.++## Install++### 1. One tag (no build)++One script tag before `</body>`:++```html+<script src="https://three.ws/assistant/v1.js" async></script>+```++That alone gives you the launcher with the default avatar, transparent background, both modes, and the free chat lane. Everything is configurable with data attributes:++```html+<script src="https://three.ws/assistant/v1.js" async+ data-avatar="/avatars/selfie-girl.glb"+ data-bg="transparent"+ data-mode="both"+ data-name="Atelier AI"+ data-greeting="Ask anything about Atelier."+ data-context="Atelier is a design studio for 3D artists."+ data-accent="#f97316"+ data-position="right"></script>+```++| Attribute | Values | Default | What it does |+| --- | --- | --- | --- |+| `data-avatar` | avatar id, `/avatars/*.glb`, or a GLB URL | default mannequin | Which body to load. three.ws avatar ids resolve through the public GLB proxy; external URLs must be GLB/GLTF/VRM on an allow-listed host (three.ws, R2, Ready Player Me). |+| `data-agent` | a three.ws agent id | none | Load that agent's avatar instead (alternative to `data-avatar`). |+| `data-bg` | `transparent`, `#hex`, a preset (`ember`, `ocean`, `violet`, `forest`, `dusk`, `slate`), or `gradient:#a,#b,angle` | `transparent` | `transparent` floats the avatar directly over your page. Anything else paints the panel. Values are strictly validated inside the frame; invalid input falls back to transparent. |+| `data-mode` | `chat`, `speak`, `both` | `both` | `both` shows a Chat / Speak toggle in the widget. |+| `data-name` | text (60 chars) | `Assistant` | Header title and the chatbot's persona name. |+| `data-greeting` | text (200 chars) | mode-aware default | First speech bubble when the widget opens. |+| `data-context` | text (500 chars) | none | What the chatbot should know about your site; injected into the system prompt. |+| `data-accent` | `#hex` | `#f97316` | Launcher button, send button, focus rings. |+| `data-position` | `right`, `left` | `right` | Which corner the launcher sits in. |+| `data-voice` | `false` | on | Start with voice muted (the visitor can toggle it). |+| `data-badge` | `false` | on | Hide the three.ws attribution badge. |+| `data-open` | present | closed | Start with the panel open. |+| `data-manual` | present | auto | Don't auto-mount; call `ThreeAssistant.init()` yourself. |++### 2. npm++For bundler projects, install the loader from npm instead of the CDN tag. It is the same code (the one-tag build is generated from this package), with types and named exports.++```bash+npm install @three-ws/assistant+```++```js+import ThreeAssistant from '@three-ws/assistant';++ThreeAssistant.init({+ avatar: '/avatars/selfie-girl.glb',+ name: 'Atelier AI',+ greeting: 'Ask anything about Atelier.',+ context: 'Atelier is a design studio for 3D artists.',+ bg: 'transparent',+});+```++Every config key matches the `data-*` attribute above without the `data-` prefix. Self-hosting the frame? Pass `origin` to `init` (defaults to `https://three.ws`). Full package reference: the [`@three-ws/assistant` README](https://github.com/nirholas/three.ws/tree/main/assistant-sdk).++## JavaScript API++The loader exposes `window.ThreeAssistant`:++```js+ThreeAssistant.init({ avatar: '/avatars/michelle.glb', name: 'Atelier AI' }); // replaces any existing instance+ThreeAssistant.open();+ThreeAssistant.close();+ThreeAssistant.toggle();+ThreeAssistant.say('Welcome to the spring sale!'); // opens the widget and speaks the line aloud+ThreeAssistant.setMode('speak'); // or 'chat' (only when the widget was mounted with mode "both")+ThreeAssistant.destroy();+```++Host pages can observe the widget through a single DOM event:++```js+window.addEventListener('three-assistant', (e) => {+ // e.detail.type: 'ready' | 'open' | 'close' | 'message' | 'speak:start' | 'speak:end' | 'error'+ if (e.detail.type === 'message') console.log(e.detail.payload.role, e.detail.payload.content);+});+```++## Generate a widget from an AI agent (MCP)++Any MCP-enabled agent (Claude Code, Cursor, Claude Desktop) can design the embed for you through the [`@three-ws/assistant-mcp`](https://www.npmjs.com/package/@three-ws/assistant-mcp) server, published to the official registry as `io.github.nirholas/assistant-widget`. It is free, needs no key, and runs offline (snippet generation is pure).++Add it to your MCP client config:++```json+{+ "mcpServers": {+ "assistant-widget": {+ "command": "npx",+ "args": ["-y", "@three-ws/assistant-mcp"]+ }+ }+}+```++Two tools:++- **`list_assistant_options`** returns everything you can configure: the built-in avatars, the background presets and grammar, the modes, the chat lanes, and the full `data-*` attribute reference.+- **`build_assistant_widget`** turns a config (avatar, background, mode, name, greeting, context, accent, position) into a paste-ready `<script>` snippet, a standalone frame URL, an equivalent `ThreeAssistant.init({...})` call, and the builder link. Every field is validated and clamped, so a bad value falls back to a safe default and the generated HTML is always well-formed.++Ask your agent something like "build a 3D assistant widget named Aria with an ocean background for my site" and paste the snippet it returns. The server is one of the [three.ws MCP servers](./mcp.md); find it in the registry at [registry.modelcontextprotocol.io](https://registry.modelcontextprotocol.io/?q=io.github.nirholas).++## How it works++- The launcher and panel are plain DOM injected by [`public/assistant/v1.js`](https://github.com/nirholas/three.ws/blob/main/public/assistant/v1.js), the minified build of the [`@three-ws/assistant`](https://github.com/nirholas/three.ws/tree/main/assistant-sdk) loader (no dependencies, idempotent). The avatar, chat, and speech run inside an iframe on `https://three.ws/assistant-frame`, so your page never sees model keys and the frame never sees your DOM.+- The frame ([`src/assistant-frame.js`](https://github.com/nirholas/three.ws/blob/main/src/assistant-frame.js)) renders the avatar with Three.js, retargets the platform's canonical animation clips onto it (idle, wave greeting, a talking loop while speaking), and anchors the speech bubble to the avatar's head projection every frame.+- Free-lane chat posts to `POST /api/chat` (SSE stream, anonymous access, server-side rate limits and moderation). BYOK chat streams directly from the visitor's browser to Groq or OpenRouter with their key; the key lives in `localStorage` on the three.ws origin and is never sent to three.ws servers or the host page.+- Speak mode and spoken chat replies use the Web Speech API (`speechSynthesis`). Voice pick persists per browser. When the browser has no TTS or voice is muted, the bubble and talking animation still run for the estimated duration, so the widget never silently stalls.+- Every config param is re-validated inside the frame by [`src/assistant-widget-core.js`](https://github.com/nirholas/three.ws/blob/main/src/assistant-widget-core.js) (strict background/color grammars, length clamps, avatar host allow-list), so a hostile embedding page cannot inject CSS or URLs into the frame.++## Related surfaces++- [Build a 3D assistant, step by step](./tutorials/add-a-3d-assistant.md), the tutorial+- [Concierge](./concierge.md), the page-grounded support-chat widget with a lipsyncing face+- [three.ws MCP servers](./mcp.md), the full free and paid tool catalog+- [Share and embed](./share-and-embed.md), the `<three-d>` model embeds+- [/walk-embed](https://three.ws/walk-embed), the walking-avatar iframe embed+- [/forge](https://three.ws/forge), generate an avatar to use in the widget++## Packages++| Package | What it is |+| --- | --- |+| [`@three-ws/assistant`](https://github.com/nirholas/three.ws/tree/main/assistant-sdk) | The widget loader (npm + the one-tag CDN build at `/assistant/v1.js`). |+| [`@three-ws/assistant-mcp`](https://github.com/nirholas/three.ws/tree/main/packages/assistant-mcp) | The MCP server (`io.github.nirholas/assistant-widget`) that generates embeds for AI agents. |++---++<a id="sec-083"></a>> **Source:** `docs/authentication.md` · [↑ table of contents](#table-of-contents)@@ -21403,7 +21909,7 @@ Password hashing cost is configurable via `PASSWORD_ROUNDS` (default: `11` bcryp----<a id="sec-081"></a>+<a id="sec-084"></a>> **Source:** `docs/autonomous-economy.md` · [↑ table of contents](#table-of-contents)@@ -21560,7 +22066,7 @@ zero.----<a id="sec-082"></a>+<a id="sec-085"></a>> **Source:** `docs/autonomous-x402.md` · [↑ table of contents](#table-of-contents)@@ -21768,7 +22274,7 @@ corroborate — the ops financial-integrity surface alerts on those. Detail:----<a id="sec-083"></a>+<a id="sec-086"></a>> **Source:** `docs/autopilot.md` · [↑ table of contents](#table-of-contents)@@ -21871,7 +22377,7 @@ A confirmed buyback narrates as: "Bought back and burned $120 of $YOURCOIN. Supp----<a id="sec-084"></a>+<a id="sec-087"></a>> **Source:** `docs/avatar-creation.md` · [↑ table of contents](#table-of-contents)@@ -22207,7 +22713,7 @@ No regeneration provider is configured on this deployment. Set `AVATAR_REGEN_PRO----<a id="sec-085"></a>+<a id="sec-088"></a>> **Source:** `docs/avatar-inspector.md` · [↑ table of contents](#table-of-contents)@@ -22291,7 +22797,7 @@ Related reading: [agent reputation](agent-reputation.md) · [Agora](agora.md).----<a id="sec-086"></a>+<a id="sec-089"></a>> **Source:** `docs/avatar-pipeline.md` · [↑ table of contents](#table-of-contents)@@ -22395,7 +22901,7 @@ pose operations.----<a id="sec-087"></a>+<a id="sec-090"></a>> **Source:** `docs/avatar-reconstruction.md` · [↑ table of contents](#table-of-contents)@@ -22516,7 +23022,7 @@ Full runbook: [`docs/ops/gcp-production.md`](ops/gcp-production.md).----<a id="sec-088"></a>+<a id="sec-091"></a>> **Source:** `docs/avatar-studio.md` · [↑ table of contents](#table-of-contents)@@ -22532,10 +23038,15 @@ The selfie-to-avatar path is great when you want to look like yourself, but it i## 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.+The studio mounts a `TalkScene` around a base body and layers a tabbed customization panel over it. A **Base** switcher at the top of the panel picks the starting template (create mode only; a saved avatar always reloads its own model):++- **Stylized** (`/avatars/default.glb`): the dressed feminine stylized body with hair, outfit, and garment layers. The default.+- **Parametric** (`/avatars/parametric-base.glb`): a bare humanoid built from the CC0 MakeHuman/MPFB2 body, baked with **120+ identity morph sliders** by [scripts/build-parametric-base.mjs](../scripts/build-parametric-base.mjs). On this base the Sculpt tab becomes a full character creator: Nose (width, length, tip, hump, nostrils), Mouth (lip volume, corners, cupid's bow, dimples), Ears (size, pointed, lobes, position: yes, elf ears), Eyes (size, tilt, spacing, bags), Brows, Cheeks, Jaw and chin, Head Shape (round/square/oval, forehead), and Body (feminine/masculine, muscle, weight, age, height, chest, waist, hips, glutes, belly, shoulders, arms, thighs, calves, leg length). It rides the same 52-bone Mixamo-named skeleton conventions as everything else, so the entire animation library retargets onto any slider combination. Source data and license provenance: [avatar-sources/anny/README.md](../avatar-sources/anny/README.md).-- **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.+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.** 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). Slots the loaded base has no materials for are hidden rather than rendered dead, and "Default" restores the base's authored color. 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, Ears, Head Shape, and Body, plus a MetaHuman-style 2-D face-type blend wheel over six archetypes and advanced visemes. Left/right paired morphs collapse into one mirrored slider unless you unlock Mirror L/R for asymmetry. 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.@@ -22574,7 +23085,8 @@ curl 'https://three.ws/api/avatars/<avatarId>' -H 'cookie: <session>'## 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)).+- **Two base bodies.** Create mode starts from the Stylized feminine base or the bare Parametric base (which covers masculine, feminine, and everything between via its body sliders). Switching base reloads the studio, so it asks before discarding unsaved changes. The posable primitive with a build toggle lives in [Animation Studio](./animation-studio.md).+- **The Parametric base ships bare.** No hair or outfit meshes yet, so the hair/outfit color slots and the Layers block do not appear on it; hats, glasses, and earrings attach normally. Conforming hair and garments are the next phase of the parametric roadmap ([prompts/roadmap/avatar-parametric-editor.md](../prompts/roadmap/avatar-parametric-editor.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.@@ -22591,7 +23103,7 @@ curl 'https://three.ws/api/avatars/<avatarId>' -H 'cookie: <session>'----<a id="sec-089"></a>+<a id="sec-092"></a>> **Source:** `docs/avatar-thumbnails.md` · [↑ table of contents](#table-of-contents)@@ -22823,7 +23335,7 @@ that adoption HEAD-checks the preview object before persisting it.----<a id="sec-090"></a>+<a id="sec-093"></a>> **Source:** `docs/aws-builder-center-marketplace-x402.md` · [↑ table of contents](#table-of-contents)@@ -23082,7 +23594,7 @@ The product on the other side of all this plumbing is the platform: three.ws age----<a id="sec-091"></a>+<a id="sec-094"></a>> **Source:** `docs/aws-builder-center-mcp-agents.md` · [↑ table of contents](#table-of-contents)@@ -23197,7 +23709,7 @@ If you wire it into something, or you want to list a paid tool of your own, the----<a id="sec-092"></a>+<a id="sec-095"></a>> **Source:** `docs/aws-marketplace-listing-kit.md` · [↑ table of contents](#table-of-contents)@@ -23410,7 +23922,7 @@ Not done (requires AWS console / seller creds — cannot be done from this repo)----<a id="sec-093"></a>+<a id="sec-096"></a>> **Source:** `docs/aws-marketplace.md` · [↑ table of contents](#table-of-contents)@@ -23453,7 +23965,7 @@ For platform support, open an issue at [github.com/nirholas/three.ws/issues](htt----<a id="sec-094"></a>+<a id="sec-097"></a>> **Source:** `docs/aws-partner-spotlight.md` · [↑ table of contents](#table-of-contents)@@ -23549,7 +24061,7 @@ One product. Two ways to pay. One AWS bill.----<a id="sec-095"></a>+<a id="sec-098"></a>> **Source:** `docs/bnb-babt-findings.md` · [↑ table of contents](#table-of-contents)@@ -23745,7 +24257,7 @@ shipped:----<a id="sec-096"></a>+<a id="sec-099"></a>> **Source:** `docs/bnb-payments.md` · [↑ table of contents](#table-of-contents)@@ -23918,7 +24430,7 @@ full verified-facts list.----<a id="sec-097"></a>+<a id="sec-100"></a>> **Source:** `docs/bnb-vault.md` · [↑ table of contents](#table-of-contents)@@ -24014,7 +24526,7 @@ same technique prompt 11 used at the exported-function level, extended hereto drive the actual running HTTP endpoints and a real headless browser:```-node scripts/tmp-verify-vault-ui.mjs+node scripts/verify-vault-ui.mjs```This script deploys `GreenfieldVault` (with faithful mocked Greenfield hubs,@@ -24066,7 +24578,7 @@ this campaign, not a bug in this code path.----<a id="sec-098"></a>+<a id="sec-101"></a>> **Source:** `docs/bnb-world.md` · [↑ table of contents](#table-of-contents)@@ -24313,7 +24825,7 @@ reproduction commands are recorded in `contracts/DEPLOYMENTS.md`'s "Prompt----<a id="sec-099"></a>+<a id="sec-102"></a>> **Source:** `docs/brain.md` · [↑ table of contents](#table-of-contents)@@ -24451,7 +24963,7 @@ done; wait----<a id="sec-100"></a>+<a id="sec-103"></a>> **Source:** `docs/btn-pill-migration.md` · [↑ table of contents](#table-of-contents)@@ -24575,7 +25087,7 @@ These classes are defined across the codebase. Follow-up agents should replace t----<a id="sec-101"></a>+<a id="sec-104"></a>> **Source:** `docs/build.md` · [↑ table of contents](#table-of-contents)@@ -24738,7 +25250,7 @@ grep -l 'vite-plugin-pwa:register-sw' dist/widget.html dist/embed.html # expec----<a id="sec-102"></a>+<a id="sec-105"></a>> **Source:** `docs/capture.md` · [↑ table of contents](#table-of-contents)@@ -24839,7 +25351,7 @@ console.log(job.result_url, job.num_points); // coloured .ply + point count----<a id="sec-103"></a>+<a id="sec-106"></a>> **Source:** `docs/changelog.md` · [↑ table of contents](#table-of-contents)@@ -25171,7 +25683,7 @@ cd sdk && npm publish----<a id="sec-104"></a>+<a id="sec-107"></a>> **Source:** `docs/character-studio.md` · [↑ table of contents](#table-of-contents)@@ -25418,7 +25930,7 @@ For cases that need more control than the studio provides, create your avatar in----<a id="sec-105"></a>+<a id="sec-108"></a>> **Source:** `docs/chatgpt-ar.md` · [↑ table of contents](#table-of-contents)@@ -25445,7 +25957,7 @@ https://three.ws/api/ar?src=<glbUrl>&title=<name>&kind=avatar (rigged avatar)- `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.+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/gpt-forge-client.js](../api/_mcp-studio/gpt-forge-client.js), the ChatGPT surfaces' client over `/api/gpt-forge`, the ChatGPT-dedicated clone of the forge pipeline). 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.---@@ -25487,7 +25999,8 @@ Submit returns either the finished model or a job to poll: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).)+- **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 `free`/`upgrade`; see [the free 3D API](./3d-api.md).)+- **The full forge experience.** The request accepts an optional `tier` (`draft` | `standard` | `high`; High runs the deepest sampler and texture budget on the self-host GPU lanes, operator-funded, and simply takes minutes through the poll loop). Routing is the same health-aware free-first router the /forge page uses, with no pinned backend. And because the forge paints a concept image before sculpting the mesh, pending and done states carry `previewImageUrl`, so ChatGPT shows the painted view the moment it exists while the 3D model is still generating.- **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.@@ -25571,7 +26084,7 @@ The generation lane is operator-funded (NVIDIA NIM running Microsoft TRELLIS for----<a id="sec-106"></a>+<a id="sec-109"></a>> **Source:** `docs/circulation-engine.md` · [↑ table of contents](#table-of-contents)@@ -25752,7 +26265,7 @@ budget, so raise gradually and watch tick runtime and treasury balance.----<a id="sec-107"></a>+<a id="sec-110"></a>> **Source:** `docs/clash.md` · [↑ table of contents](#table-of-contents)@@ -25838,7 +26351,7 @@ The Coin Clash state and leaderboard are also exposed read-only over MCP through----<a id="sec-108"></a>+<a id="sec-111"></a>> **Source:** `docs/clip-director.md` · [↑ table of contents](#table-of-contents)@@ -25928,7 +26441,7 @@ message instead of an error, so a card is only ever minted from a real closed ro----<a id="sec-109"></a>+<a id="sec-112"></a>> **Source:** `docs/coin-launches.md` · [↑ table of contents](#table-of-contents)@@ -26018,7 +26531,7 @@ hardcode or surface any other specific mint as a recommendation.----<a id="sec-110"></a>+<a id="sec-113"></a>> **Source:** `docs/coin-pages.md` · [↑ table of contents](#table-of-contents)@@ -26062,8 +26575,21 @@ editorial serif headings, hairline borders, mono numerals, light/dark themes.- **Header** — icon, name, symbol, market-cap-rank badge, live price, and24h / 7d / 30d change chips, plus the coin's categories.-- **Interactive chart** — SVG line chart across 24H / 7D / 30D / 90D / 1Y with- a crosshair tooltip showing exact price and time.+- **Interactive chart with a source switcher** — the default is a lightweight+ native SVG line chart across 24H / 7D / 30D / 90D / 1Y (data by CoinGecko)+ with a crosshair tooltip showing exact price and time. A pill switcher next+ to the time ranges swaps in a full third-party terminal, and each option only+ appears when it can actually chart the coin:+ - **CoinGecko** — the native line chart (always available).+ - **TradingView** — the advanced candlestick widget (indicators, drawing+ tools), for any coin with a ticker symbol.+ - **DexScreener** — the on-chain terminal keyed by the token's contract+ address, for coins with a Solana mint or a supported EVM contract.+ - **GeckoTerminal** — the on-chain terminal keyed by the token's most-liquid+ pool, resolved server-side via `GET /api/coin/pool` (below).++ The picked source is remembered across coins and visits (localStorage+ `tws_coin_chart_source`), and the embeds follow the site's light/dark theme.- **Price performance matrix** — colored 1h / 24h / 7d / 14d / 30d / 60d /200d / 1y change cells, so the whole return curve is legible at a glance.- **Market stats** — market cap, 24h volume, circulating/total supply,@@ -26117,11 +26643,25 @@ through the shared [`failover-fetch`](../src/shared/failover-fetch.js) primitiveup the ranked top-N list (7d sparklines and category scoping stayCoinGecko-only and degrade to an empty chart / CoinGecko-only when it's down).- **Headline prices** — the ETH figure on `/gas` and the BTC figure on- `/exchanges` fail over CoinGecko → DefiLlama (keyed by the same CoinGecko id).+ `/exchanges` fail over CoinGecko → DefiLlama (keyed by the same CoinGecko id),+ then to live exchange tickers (Kraken → Coinbase → Bitfinex) for the mapped+ majors (BTC, ETH, SOL).+- **Price chart** (`/api/coin/ohlc`) — CoinGecko `market_chart`, backed up for+ BTC/ETH/SOL by exchange candles (Kraken OHLC → Coinbase Exchange), so the+ headline charts stay live through a CoinGecko outage. Long-tail coins remain+ CoinGecko-only. A 404 (unknown coin) never falls back: that is an answer.+- **Derivatives table** (`/api/coin/derivatives`) — CoinGecko's cross-venue perp+ feed, falling back to Hyperliquid's keyless info API+ ([`api/_lib/hyperliquid.js`](../api/_lib/hyperliquid.js)): one venue instead of+ dozens, but live price/funding/OI/volume for ~200 perps beats a 502. The+ response carries a `source` marker.- **SOL spot** — seven sources server-side (CoinGecko, Jupiter, Kraken,Coinbase, DefiLlama, DIA, Bitfinex) and four browser-side, CORS-safe ones.-- **Solana token panels** — Birdeye → DexScreener → GeckoTerminal → DefiLlama- (see [`api/_lib/market/token-market.js`](../api/_lib/market/token-market.js)).+- **Solana token panels** — Birdeye → DexScreener → GeckoTerminal → DefiLlama →+ Raydium (see+ [`api/_lib/market/token-market.js`](../api/_lib/market/token-market.js)).+ The Raydium rung is price-only and covers only Raydium-pooled tokens, but it+ indexes its own AMM, so it stays up when every aggregator is rate-limited.- **Trending** (`/api/coin/trending`) — CoinGecko `/search/trending` → GeckoTerminalon-chain trending. CoinGecko ranks by search interest across all chains; thefree fallback ranks by on-chain pool activity, scoped to Solana so every@@ -26130,8 +26670,9 @@ through the shared [`failover-fetch`](../src/shared/failover-fetch.js) primitivefills the coins list — categories and NFTs have no on-chain analogue and comeback empty, which the page hides. A populated list still beats a blank page.-Every fallback is free and keyless (Binance is excluded — it geo-blocks US-datacenter IPs).+Every fallback is free and keyless (Binance, Bybit and OKX are excluded — they+geo-block US datacenter IPs, so from Cloud Run they would be permanently dead+rungs).## The market tools@@ -26455,7 +26996,7 @@ server mirrors each (including the dynamic `/coin/:id` path). The pre-existing----<a id="sec-111"></a>+<a id="sec-114"></a>> **Source:** `docs/coinmarketcap-article-play.md` · [↑ table of contents](#table-of-contents)@@ -26601,7 +27142,7 @@ The chart has always told you *what* a coin is doing. /play lets you go stand wh----<a id="sec-112"></a>+<a id="sec-115"></a>> **Source:** `docs/coinmarketcap-article.md` · [↑ table of contents](#table-of-contents)@@ -26804,7 +27345,7 @@ If you've been waiting for the moment AI and crypto stop talking past each other----<a id="sec-113"></a>+<a id="sec-116"></a>> **Source:** `docs/compose.md` · [↑ table of contents](#table-of-contents)@@ -26888,7 +27429,117 @@ curl -X PATCH 'https://three.ws/api/avatars/<avatarId>' \----<a id="sec-114"></a>+<a id="sec-117"></a>++> **Source:** `docs/concierge.md` · [↑ table of contents](#table-of-contents)++# Concierge: an AI chat widget with a 3D face, for any website++Concierge is the three.ws support-chat widget: a floating launcher that opens a chat panel where a rigged 3D avatar blinks, idles, and lipsyncs while it answers visitors. Answers stream in live, are grounded in the page the widget sits on, and speak aloud with the browser's own speech engine. It installs on any site with one tag and costs nothing.++- Live demo and landing: [/concierge](/concierge) (the widget there answers questions about itself)+- Package: [`@three-ws/concierge`](https://www.npmjs.com/package/@three-ws/concierge), source in [`concierge-sdk/`](https://github.com/nirholas/three.ws/tree/main/concierge-sdk)+- Backend: `POST /api/concierge` ([reference implementation](https://github.com/nirholas/three.ws/blob/main/api/concierge.js))+- Tutorial on how it is built: [Build a site concierge](/docs/tutorials/build-a-site-concierge)++---++## Install++The one-tag embed:++```html+<script type="module"+ src="https://three.ws/concierge/concierge.global.js"+ data-concierge+ data-site-name="Acme"+ data-accent="#f97316"+ data-suggestions="What is Acme?|What does it cost?"></script>+```++Or from npm (`npm install @three-ws/concierge three`) as a web component or an imperative API:++```html+<three-concierge site-name="Acme" accent="#f97316"+ knowledge="Pro plan is $20/month. Support: [email protected]."></three-concierge>+```++```js+import { Concierge } from '@three-ws/concierge';+const c = new Concierge({ siteName: 'Acme', knowledge: FAQ_TEXT });+await c.ask('What does the Pro plan cost?');+```++The full option table (avatars, themes, position, voice, persona, custom GLB avatars, self-hosted assets) lives in the [package README](https://github.com/nirholas/three.ws/tree/main/concierge-sdk#options).++## How it answers accurately with zero setup++Most site chatbots need a crawler, an index, and an onboarding flow. Concierge skips all three:++1. **Harvest at ask-time.** When the visitor asks something, the widget snapshots the live DOM: title, meta description, headings, nav labels, and the main content, each capped to a strict budget. Your curated `knowledge` string (FAQ, pricing, policies) is merged in ahead of the harvested text. Mark any element `data-concierge-ignore` to keep it out.+2. **Ground and stream.** The snapshot, the running conversation, and the question go to `/api/concierge`. The server builds a grounded system prompt that forbids inventing facts, then streams the answer back as SSE from the platform's free-first LLM chain (Groq → Cerebras → OpenRouter → NVIDIA → OVH → Gemini → Vertex, with cooldown-aware failover). The route is anonymous, CORS-open (it must run on third-party origins), rate-limited per IP and globally, and pre-moderated fail-open.+3. **Speak while streaming.** The widget splits the stream into sentences and hands each completed sentence to the Web Speech engine while the rest is still arriving; a text-to-viseme timeline drives the avatar's mouth morphs in sync. Muted or unsupported? Captions and lipsync still play.++Because the page itself is the knowledge source, the concierge is never stale: edit your pricing page and the very next answer reflects it.++## The avatar++The catalog (`sol`, `nova`, `vera`, `atlas`, `echo`) is the same rigged, viseme-capable roster the [page-agent](https://www.npmjs.com/package/@three-ws/page-agent) ships, served from `https://three.ws/avatars/`. Visitors pick their concierge from the built-in picker (their choice persists), or the host pins a single custom rigged GLB with `custom-avatar`. The 3D stage initializes on first open only, so a closed widget costs the host page zero GPU and no GLB download.++## Bring your own backend++The hosted endpoint is free, but the wire format is open. Any server that accepts the POST body and streams the same three SSE event types can be swapped in via the `endpoint` option:++```+→ POST { message, history[], site{url,name,title,description,headings,nav,knowledge,content}, persona?, lang? }+← data: {"type":"chunk","text":"..."}+← data: {"type":"done","provider":"...","model":"..."}+← data: {"type":"error","code":"...","message":"..."}+```++## Limits and safeguards++- Messages are capped at 2,000 characters, history at 20 turns, page content at 6,000 characters, curated knowledge at 8,000.+- The hosted endpoint rate-limits per IP (20/min) and globally (600/min across all embeds), and cools down failing providers so a billing-dead lane is skipped, not re-probed.+- Model output renders through a strict markdown-lite renderer: all text is escaped before markup applies, and links are restricted to http(s)/mailto.+- Only the embedding page's hostname (never the full URL) is recorded in usage telemetry.++## Agent access (MCP)++The concierge is also reachable from any AI assistant through the Model Context Protocol server [`@three-ws/concierge-mcp`](https://www.npmjs.com/package/@three-ws/concierge-mcp), published on the [official MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas) as `io.github.nirholas/concierge-mcp`. Add it in one line:++```bash+claude mcp add concierge -- npx -y @three-ws/concierge-mcp+```++Three tools:++- **`concierge_ask`**, ask a website's concierge a question. Give it a `url` and it fetches that page and answers grounded in the real content; or pass `knowledge`/`content` to answer from text you provide. This is "ask any website a question," on the free lane.+- **`concierge_embed`**, generate the copy-paste embed code (`<script>` tag, `<three-concierge>` element, or npm snippet) for adding a concierge to a site, fully configured.+- **`concierge_avatars`**, list the avatars a concierge can wear.++`concierge_ask` runs on the same free `POST /api/concierge` lane the widget uses; `concierge_embed` and `concierge_avatars` are offline generators. Full reference: the [package README](https://github.com/nirholas/three.ws/tree/main/packages/concierge-mcp).++## Examples++Runnable examples ship with the SDK ([concierge-sdk/examples/](https://github.com/nirholas/three.ws/tree/main/concierge-sdk/examples)):++- **index.html**, the one-tag CDN install, grounded in the page + curated knowledge+- **web-component.html**, the declarative `<three-concierge>` element+- **imperative.html**, the `new Concierge({...})` API with events, programmatic `ask()`, and live avatar swaps+- **custom-avatar.html**, using your own rigged GLB+- **react.jsx**, a `<Concierge>` React wrapper component+- **self-hosted-endpoint.md**, point the widget at your own backend, with a complete runnable Node server++## Related surfaces++- [/walk](/walk): the walking page companion the avatar engine grew from+- [Share and embed](./share-and-embed.md): every other way to put a three.ws creation on your site+- [MCP](./mcp.md): the full catalog of three.ws MCP servers, including this one++---++<a id="sec-118"></a>> **Source:** `docs/configuration.md` · [↑ table of contents](#table-of-contents)@@ -27442,7 +28093,7 @@ Before going live, verify the following:----<a id="sec-115"></a>+<a id="sec-119"></a>> **Source:** `docs/content/use-cases/README.md` · [↑ table of contents](#table-of-contents)@@ -27487,7 +28138,7 @@ Every scenario on these pages is an **example workflow** — clearly labeled "Im----<a id="sec-116"></a>+<a id="sec-120"></a>> **Source:** `docs/content/use-cases/ai-agent-developer.md` · [↑ table of contents](#table-of-contents)@@ -27535,7 +28186,7 @@ A standards-based interface (MCP + A2A), a working USDC payment rail (x402 on Ba----<a id="sec-117"></a>+<a id="sec-121"></a>> **Source:** `docs/content/use-cases/brand-marketer.md` · [↑ table of contents](#table-of-contents)@@ -27594,7 +28245,7 @@ A conversational 3D brand presence that's easy to embed and share, plus a public----<a id="sec-118"></a>+<a id="sec-122"></a>> **Source:** `docs/content/use-cases/crypto-community.md` · [↑ table of contents](#table-of-contents)@@ -27641,7 +28292,7 @@ A shared 3D home for the token's holders, a real (not mocked) on-chain agent-exc----<a id="sec-119"></a>+<a id="sec-123"></a>> **Source:** `docs/content/use-cases/game-studio.md` · [↑ table of contents](#table-of-contents)@@ -27688,7 +28339,7 @@ A character that renders with production-grade glTF handling, converses through----<a id="sec-120"></a>+<a id="sec-124"></a>> **Source:** `docs/content/use-cases/indie-creator.md` · [↑ table of contents](#table-of-contents)@@ -27748,7 +28399,7 @@ A real, embedded, conversational 3D avatar that loads in any modern browser. The----<a id="sec-121"></a>+<a id="sec-125"></a>> **Source:** `docs/contributing.md` · [↑ table of contents](#table-of-contents)@@ -28089,7 +28740,7 @@ By contributing, you agree that your contributions are provided under the terms----<a id="sec-122"></a>+<a id="sec-126"></a>> **Source:** `docs/cosmos.md` · [↑ table of contents](#table-of-contents)@@ -28179,7 +28830,7 @@ else {----<a id="sec-123"></a>+<a id="sec-127"></a>> **Source:** `docs/crypto-api.md` · [↑ table of contents](#table-of-contents)@@ -29019,7 +29670,7 @@ curl -s "https://three.ws/api/crypto/holders?address=FeMbDoX7R1Psc4GEcvJdsbNbZA3----<a id="sec-124"></a>+<a id="sec-128"></a>> **Source:** `docs/custody.md` · [↑ table of contents](#table-of-contents)@@ -29109,7 +29760,7 @@ Every step of recovery and inheritance writes to the custody trail and the audit----<a id="sec-125"></a>+<a id="sec-129"></a>> **Source:** `docs/daily-forge.md` · [↑ table of contents](#table-of-contents)@@ -29215,7 +29866,7 @@ console.log(themeIndex(new Date().toISOString().slice(0, 10), 24));----<a id="sec-126"></a>+<a id="sec-130"></a>> **Source:** `docs/demo-routes.md` · [↑ table of contents](#table-of-contents)@@ -29399,7 +30050,7 @@ Verified on the live Vite dev server (`npm run dev`, port 3000):----<a id="sec-127"></a>+<a id="sec-131"></a>> **Source:** `docs/deployment.md` · [↑ table of contents](#table-of-contents)@@ -29992,7 +30643,7 @@ Upstash REST API uses HTTPS — no ports to open. If you see connection errors,----<a id="sec-128"></a>+<a id="sec-132"></a>> **Source:** `docs/diorama.md` · [↑ table of contents](#table-of-contents)@@ -30089,7 +30740,7 @@ The compose response shape (abridged):----<a id="sec-129"></a>+<a id="sec-133"></a>> **Source:** `docs/do-i-need-crypto.md` · [↑ table of contents](#table-of-contents)@@ -30176,7 +30827,7 @@ When you do interact with on-chain features, the platform's native token is **$T----<a id="sec-130"></a>+<a id="sec-134"></a>> **Source:** `docs/economy-heartbeat.md` · [↑ table of contents](#table-of-contents)@@ -30337,7 +30988,7 @@ Related: [circulation engine](circulation-engine.md) ·----<a id="sec-131"></a>+<a id="sec-135"></a>> **Source:** `docs/economy-master.md` · [↑ table of contents](#table-of-contents)@@ -30678,7 +31329,7 @@ The master is configured and funded, but the tree it feeds is only partly wired:----<a id="sec-132"></a>+<a id="sec-136"></a>> **Source:** `docs/editor.md` · [↑ table of contents](#table-of-contents)@@ -31027,7 +31678,7 @@ The full contract lives in [specs/EDITOR_SPEC.md](https://github.com/nirholas/th----<a id="sec-133"></a>+<a id="sec-137"></a>> **Source:** `docs/embedding.md` · [↑ table of contents](#table-of-contents)@@ -31771,7 +32422,7 @@ The platform records anonymous embed impressions (country, referrer hostname) vi----<a id="sec-134"></a>+<a id="sec-138"></a>> **Source:** `docs/embody.md` · [↑ table of contents](#table-of-contents)@@ -31881,7 +32532,7 @@ Embody is a thin, honest wire over pieces that already exist — no new pipeline----<a id="sec-135"></a>+<a id="sec-139"></a>> **Source:** `docs/erc8004.md` · [↑ table of contents](#table-of-contents)@@ -32554,7 +33205,7 @@ The same MAINNET addresses apply to all 15 mainnets. The same TESTNET addresses----<a id="sec-136"></a>+<a id="sec-140"></a>> **Source:** `docs/erc8004/validation-attestation.md` · [↑ table of contents](#table-of-contents)@@ -32646,7 +33297,7 @@ ValidationRegistry is deployed, `/api/erc8004/validate` returns a clear ops erro----<a id="sec-137"></a>+<a id="sec-141"></a>> **Source:** `docs/examples.md` · [↑ table of contents](#table-of-contents)@@ -33379,7 +34030,7 @@ genuinely invested in the user's progress.----<a id="sec-138"></a>+<a id="sec-142"></a>> **Source:** `docs/fact-check.md` · [↑ table of contents](#table-of-contents)@@ -33481,7 +34132,7 @@ Once the free quota is spent, the same POST returns `402` with an x402 challenge----<a id="sec-139"></a>+<a id="sec-143"></a>> **Source:** `docs/financial-controls.md` · [↑ table of contents](#table-of-contents)@@ -33760,7 +34411,7 @@ Ranked by accounting/regulatory risk. Each is a tracked remediation item.----<a id="sec-140"></a>+<a id="sec-144"></a>> **Source:** `docs/forge-background-generation.md` · [↑ table of contents](#table-of-contents)@@ -33873,7 +34524,7 @@ and the notification preference model in----<a id="sec-141"></a>+<a id="sec-145"></a>> **Source:** `docs/forge-off.md` · [↑ table of contents](#table-of-contents)@@ -33990,7 +34641,7 @@ Backfill a past week's winner (owner): `GET /api/cron/forge-off-crown?week=YYYY-----<a id="sec-142"></a>+<a id="sec-146"></a>> **Source:** `docs/forge-pipeline.md` · [↑ table of contents](#table-of-contents)@@ -34055,6 +34706,7 @@ Three properties define the design:| 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`. |+| ChatGPT clone | `POST /api/gpt-forge` (`api/gpt-forge.js`) | Clone of the orchestrator dedicated to the ChatGPT surfaces (the Apps SDK MCP connector `api/mcp-studio` and the custom-GPT Actions endpoint `api/3d/studio`, via `api/_mcp-studio/gpt-forge-client.js`), so the ChatGPT pipeline can evolve without touching `/api/forge`. Same lanes, tiers, job tokens, and `forge_creations` rows. First divergence: its poll responses also carry `prompt`, `preview_image_url` (the painted concept view), and `text_to_image_model`, so the ChatGPT surfaces can show the concept image while the mesh generates. || 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. |@@ -34247,7 +34899,7 @@ Fast diagnostics: `forge_creations` carries per-generation backend, status, erro----<a id="sec-143"></a>+<a id="sec-147"></a>> **Source:** `docs/forge.md` · [↑ table of contents](#table-of-contents)@@ -34382,7 +35034,7 @@ console.log(job.glb_url); // downloadable, textured GLB----<a id="sec-144"></a>+<a id="sec-148"></a>> **Source:** `docs/galaxy.md` · [↑ table of contents](#table-of-contents)@@ -34466,7 +35118,7 @@ curl -X POST 'https://three.ws/api/galaxy' \----<a id="sec-145"></a>+<a id="sec-149"></a>> **Source:** `docs/genesis.md` · [↑ table of contents](#table-of-contents)@@ -34612,7 +35264,7 @@ curl -s -X POST "https://three.ws/api/agents/$AGENT_ID/wallet/provision" \----<a id="sec-146"></a>+<a id="sec-150"></a>> **Source:** `docs/genome.md` · [↑ table of contents](#table-of-contents)@@ -34754,7 +35406,7 @@ curl -s "https://three.ws/api/genome/lineage?agentId=<child-uuid>&verify=1"----<a id="sec-147"></a>+<a id="sec-151"></a>> **Source:** `docs/guardian.md` · [↑ table of contents](#table-of-contents)@@ -34840,7 +35492,7 @@ The console reads this on load, resolves your viewer id (so it can tell whether----<a id="sec-148"></a>+<a id="sec-152"></a>> **Source:** `docs/hold-to-access.md` · [↑ table of contents](#table-of-contents)@@ -35059,7 +35711,7 @@ worlds unaffected.----<a id="sec-149"></a>+<a id="sec-153"></a>> **Source:** `docs/how-forge-works.md` · [↑ table of contents](#table-of-contents)@@ -35109,7 +35761,7 @@ Everything above is also a tool call. AI agents (Claude, ChatGPT, or your own) g----<a id="sec-150"></a>+<a id="sec-154"></a>> **Source:** `docs/how-it-works.md` · [↑ table of contents](#table-of-contents)@@ -35280,7 +35932,7 @@ Quick lookup for "I want to ship X":----<a id="sec-151"></a>+<a id="sec-155"></a>> **Source:** `docs/i18n.md` · [↑ table of contents](#table-of-contents)@@ -35293,7 +35945,7 @@ runtime** from those static files. There is no per-request translation call, noruntime cost, and full SEO/caching of each locale's JSON.The one difference from LobeHub: their copy was already keyed (greenfield-i18next). Ours lives inline in 150+ static HTML pages, so we add an **extraction**+i18next). Ours lives inline in 570+ static HTML pages, so we add an **extraction**step that derives the catalog from annotated markup.```@@ -35420,6 +36072,22 @@ Validates every **committed** locale against the source: no missing/empty keys,no `{{placeholder}}` drift, no dropped glossary terms, no stale keys. Locales notyet generated are skipped (not failures). Needs no API key — safe in CI.+### Repair (fix lint failures in place)++```bash+npm run i18n:repair # every locale+npm run i18n:repair -- --locale=he # one locale+```++Glossary terms and `{{placeholders}}` are masked to sentinels the model must+reproduce verbatim. A small model occasionally omits a sentinel mid-sentence, so+the term never gets restored and the key fails lint. `--repair` re-translates+**only** the lint-failing keys, one at a time, retrying each until it passes its+own integrity check. A key that never converges after four attempts is baked to+English (lint-clean, and the runtime already falls back to English for anything+missing). Idempotent: a clean catalog reports `nothing to repair`. Takes the same+`--provider=` / `--model=` overrides as `i18n:translate`.+## 5. Runtime[`src/i18n.js`](../src/i18n.js) (shipped at the stable URL `/i18n.js`) auto-runs@@ -35431,22 +36099,54 @@ on any page that includes it:<!-- accessible language picker -->```-It detects the locale (`localStorage` → `?lang=` → `navigator.languages` →+It detects the locale (`?lang=` → `localStorage` → `navigator.languages` →default), fetches `/locales/<code>.json` once, rewrites the annotated DOM, sets`<html lang>`/`dir` (RTL-aware), and persists the choice. Missing translationsfall back to English, so partial locales degrade gracefully. `window.threewsI18n`exposes `{ t, setLocale, getLocale, initI18n }`.-The `<lang-switcher>` reads `public/locales/manifest.json` and only lists locales-with a committed catalog, so it never offers a language that would fall back to-English.+The `<lang-switcher>` reads `public/locales/manifest.json`, which lists only+locales whose catalog is **complete**, so it never offers a language that would+fall back to English. Presence of the file is not enough: `writeManifest()` counts+untranslated (empty) values via `untranslatedCount()` and holds back any catalog+that still has them, reporting what it skipped:++```+• manifest: 48 locale(s) listed, 1 held back until complete: as (3 untranslated keys)+```++So a locale that is mid-translation is simply absent from the switcher until the+run finishes, instead of shipping as a half-translated page.## Adding a languageAdd the code (and display name) to `outputLocales` / `localeNames` in-`.i18nrc.json`, run `npm run i18n:translate -- --locale=<code>`, review the-output, and commit `public/locales/<code>.json`. The manifest and switcher pick-it up automatically.+`.i18nrc.json` (plus `rtlLocales` for a right-to-left script), run+`npm run i18n:translate -- --locale=<code>`, review the output, and commit+`public/locales/<code>.json`. The manifest and switcher pick it up+automatically.++**Only ship a locale once its catalog is complete.** A run that dies partway+(expired credentials, an exhausted provider) still leaves a catalog file with+the full key skeleton and *empty string values* for everything it never reached.+That file looks finished by key count, and because the runtime falls back to+English per key, the page renders as a half-translated mix rather than failing+loudly. Verify before committing:++```bash+npm run i18n:translate -- --lint --locale=<code> # flags empty values + glossary drops+node -e "const f=require('./public/locales/<code>.json'),e=require('./public/locales/en.json');+const n=o=>Object.values(o).reduce((a,s)=>a+Object.keys(s).length,0);+let m=0;for(const s of Object.values(f))for(const v of Object.values(s))if(!String(v).trim())m++;+console.log('keys',n(f),'of',n(e),'| empty',m)"+```++Re-running `i18n:translate` is the fix: `missingKeys()` treats an empty string as+untranslated, so a resumed run tops up exactly the gaps and costs nothing for the+keys already done. For a catalog that is complete but trips the glossary/placeholder+lint, `npm run i18n:repair -- --locale=<code>` re-translates only the failing keys.+A locale that cannot be completed should be left out of `outputLocales` entirely+rather than committed partial, so the switcher never offers it.## SEO: hreflang alternates@@ -35477,7 +36177,7 @@ round-trips, lint rules, runtime resolution/fallback, and catalog merge/prune.----<a id="sec-152"></a>+<a id="sec-156"></a>> **Source:** `docs/ibm-x402-mcp.md` · [↑ table of contents](#table-of-contents)@@ -35848,7 +36548,7 @@ Catalog/listing copy is maintained in----<a id="sec-153"></a>+<a id="sec-157"></a>> **Source:** `docs/ibm.md` · [↑ table of contents](#table-of-contents)@@ -36167,7 +36867,7 @@ Unit tests for the same paths live in [`tests/`](../tests/) (`granite-oracle`, `----<a id="sec-154"></a>+<a id="sec-158"></a>> **Source:** `docs/image-to-3d.md` · [↑ table of contents](#table-of-contents)@@ -36269,7 +36969,7 @@ console.log(job.glb_url);----<a id="sec-155"></a>+<a id="sec-159"></a>> **Source:** `docs/integrations.md` · [↑ table of contents](#table-of-contents)@@ -36441,7 +37141,7 @@ for the full table.----<a id="sec-156"></a>+<a id="sec-160"></a>> **Source:** `docs/introduction.md` · [↑ table of contents](#table-of-contents)@@ -36667,7 +37367,7 @@ If you want to look at what's already in the hosted platform — browsing agents----<a id="sec-157"></a>+<a id="sec-161"></a>> **Source:** `docs/irl.md` · [↑ table of contents](#table-of-contents)@@ -36780,7 +37480,7 @@ The rollup is served at `GET /api/irl/analytics` (admin-gated, same `x-ops-secre----<a id="sec-158"></a>+<a id="sec-162"></a>> **Source:** `docs/irl/THREAT-MODEL.md` · [↑ table of contents](#table-of-contents)@@ -36915,7 +37615,7 @@ in a way that drops legitimate discovery, update this file in the same change.----<a id="sec-159"></a>+<a id="sec-163"></a>> **Source:** `docs/js-api.md` · [↑ table of contents](#table-of-contents)@@ -37545,7 +38245,7 @@ window.VIEWER.app.viewer.updateDisplay();----<a id="sec-160"></a>+<a id="sec-164"></a>> **Source:** `docs/labor-market.md` · [↑ table of contents](#table-of-contents)@@ -37650,7 +38350,7 @@ economy move:----<a id="sec-161"></a>+<a id="sec-165"></a>> **Source:** `docs/launch-usecases.md` · [↑ table of contents](#table-of-contents)@@ -37786,7 +38486,7 @@ GET /api/pump/launch-studio?action=preview&id=github-fresh-breakouts&limit=6----<a id="sec-162"></a>+<a id="sec-166"></a>> **Source:** `docs/layers.md` · [↑ table of contents](#table-of-contents)@@ -37948,7 +38648,7 @@ Versioned CDN bundles are published at `/agent-3d/<version>/agent-3d.js`. Use `l----<a id="sec-163"></a>+<a id="sec-167"></a>> **Source:** `docs/lipsync.md` · [↑ table of contents](#table-of-contents)@@ -38045,7 +38745,7 @@ tick();----<a id="sec-164"></a>+<a id="sec-168"></a>> **Source:** `docs/listings.md` · [↑ table of contents](#table-of-contents)@@ -38137,7 +38837,7 @@ Subscribe via RSS to track new listings, integrations, and protocol updates.----<a id="sec-165"></a>+<a id="sec-169"></a>> **Source:** `docs/make-your-agent.md` · [↑ table of contents](#table-of-contents)@@ -38230,7 +38930,7 @@ Changes take effect immediately — no republishing needed for most settings.----<a id="sec-166"></a>+<a id="sec-170"></a>> **Source:** `docs/market-data-api.md` · [↑ table of contents](#table-of-contents)@@ -38346,11 +39046,11 @@ A failed upstream never charges you: the endpoint verifies payment, runs the dat- [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+- Data sources: CoinGecko (with CoinPaprika/CoinLore failover), DeFiLlama, alternative.me, public Ethereum RPCs; exchange-grade backups for the majors (Kraken, Coinbase Exchange, Bitfinex candles/tickers), Hyperliquid's keyless info API behind `market-derivatives` (the response's `source` field says which upstream answered), and Deribit DVOL implied volatility inside `market-mood` (best-effort, never gates settlement)----<a id="sec-167"></a>+<a id="sec-171"></a>> **Source:** `docs/marketplace.md` · [↑ table of contents](#table-of-contents)@@ -38444,7 +39144,7 @@ their chosen `currency_mint`; the platform promotes no coin other than $THREE.----<a id="sec-168"></a>+<a id="sec-172"></a>> **Source:** `docs/mcp-3d-studio.md` · [↑ table of contents](#table-of-contents)@@ -38682,7 +39382,7 @@ npx @modelcontextprotocol/inspector http://localhost:3000/api/mcp-3d----<a id="sec-169"></a>+<a id="sec-173"></a>> **Source:** `docs/mcp-agent.md` · [↑ table of contents](#table-of-contents)@@ -38758,7 +39458,7 @@ npx @modelcontextprotocol/inspector http://localhost:3000/api/mcp-agent----<a id="sec-170"></a>+<a id="sec-174"></a>> **Source:** `docs/mcp-studio.md` · [↑ table of contents](#table-of-contents)@@ -38855,10 +39555,16 @@ needs to display the model — no internal identifiers:"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"+ "prompt": "a friendly round robot mascot, glossy white plastic",+ "referenceImageUrl": "https://three.ws/cdn/creations/…/model-ref.png"}```+`referenceImageUrl` is the concept image the generator paints first and then+sculpts into 3D (the forge's image-generation step). The inline widget uses it+as the model-viewer poster so the painted view shows while the GLB streams in,+and the result narration links it for non-widget clients.+`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**.@@ -38981,7 +39687,8 @@ Because the lanes are zero-cost, these caps **fail open** if the rate-limiterbackend has an outage — a Redis blip must never dead-end a free feature (the sameposture as the paid server's own free lane). They enforce normally whenever thebackend is healthy, and any accidental paid-lane spend is still fail-closed one-layer down in `/api/forge`.+layer down in `/api/gpt-forge` (the ChatGPT-dedicated clone of `/api/forge`;+see the note under Environment).## Safety@@ -38996,7 +39703,13 @@ All optional — sensible production defaults:| Var | Default | Purpose ||---|---|---|-| `STUDIO_API_BASE` | request origin → `PUBLIC_APP_ORIGIN` → `https://three.ws` | Origin to call `/api/forge` on |+| `STUDIO_API_BASE` | request origin → `PUBLIC_APP_ORIGIN` → `https://three.ws` | Origin to call `/api/gpt-forge` on |++Generation runs on `/api/gpt-forge` (`api/gpt-forge.js`), the ChatGPT-dedicated+exact clone of `/api/forge`: same lanes, tiers, job tokens, and `forge_creations`+rows, cloned so the ChatGPT pipeline can be tuned without touching the forge or+any surface that rides it. The agent-facing REST endpoints (`/api/3d/generate`,+`/api/v1/ai/text-to-3d`) stay on `/api/forge`.| `STUDIO_FORGE_TIMEOUT_MS` | `180000` | Generation poll budget || `STUDIO_RIG_TIMEOUT_MS` | `180000` | Rig poll budget || `STUDIO_POLL_MS` | `3000` | Poll interval |@@ -39010,7 +39723,7 @@ All optional — sensible production defaults:----<a id="sec-171"></a>+<a id="sec-175"></a>> **Source:** `docs/mcp-tools.md` · [↑ table of contents](#table-of-contents)@@ -39149,7 +39862,7 @@ promote no specific token.----<a id="sec-172"></a>+<a id="sec-176"></a>> **Source:** `docs/mcp-x402-bazaar.md` · [↑ table of contents](#table-of-contents)@@ -39224,7 +39937,7 @@ npx @modelcontextprotocol/inspector http://localhost:3000/api/mcp-bazaar----<a id="sec-173"></a>+<a id="sec-177"></a>> **Source:** `docs/mcp.md` · [↑ table of contents](#table-of-contents)@@ -39273,7 +39986,7 @@ The MCP server configuration is at `.mcp.json` in the project root, which Claude## The full three.ws MCP ecosystem-This page documents the hosted avatar/3D server at `/api/mcp`, but it's one of **42 three.ws MCP servers** — all listed in the [official MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas), so any MCP-compatible client can discover them by name.+This page documents the hosted avatar/3D server at `/api/mcp`, but it's one of **44 three.ws MCP servers** — all listed in the [official MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas), so any MCP-compatible client can discover them by name.There are two kinds. **Hosted remote servers** run over Streamable HTTP with nothing to install — add them by URL. **Install-and-run servers** are published on npm under the `@three-ws` scope and run locally over stdio — add them in one line with `npx`.@@ -39289,12 +40002,14 @@ There are two kinds. **Hosted remote servers** run over Streamable HTTP with not| pump.fun | `/api/pump-fun-mcp` | Free, read-only pump.fun + Solana token tools || IBM x402 | `/api/ibm-mcp` | Pay-per-use IBM Granite AI |-**Thirty-five install-and-run servers** on npm under the `@three-ws` scope — each runs over stdio with one command:+**Thirty-seven install-and-run servers** on npm under the `@three-ws` scope — each runs over stdio with one command:```bash# 3D & avatarsnpx -y @three-ws/scene-mcp # speak a 3D diorama into being from one sentence+npx -y @three-ws/assistant-mcp # generate a 3D avatar assistant widget embed for any sitenpx -y @three-ws/avatar-mcp # drop a live 3D avatar into any chat+npx -y @three-ws/concierge-mcp # ask any site's AI concierge; generate the 3D chat-widget embednpx -y @three-ws/avatar-agent # turn any GLB into a riggable 3D AI agentnpx -y @three-ws/mcp-server # full 3D + agent toolkit, paid per call in USDC@@ -39953,7 +40668,7 @@ Restart Claude Code after editing `.mcp.json` so the new server config is picked----<a id="sec-174"></a>+<a id="sec-178"></a>> **Source:** `docs/memetic-launcher.md` · [↑ table of contents](#table-of-contents)@@ -40044,7 +40759,7 @@ POST /api/launcher/me { "action": "resume" } → clear a tripped circuit brea----<a id="sec-175"></a>+<a id="sec-179"></a>> **Source:** `docs/memory.md` · [↑ table of contents](#table-of-contents)@@ -40439,7 +41154,7 @@ In `ipfs` mode without encryption, treat the memory as semi-public. Don't store----<a id="sec-176"></a>+<a id="sec-180"></a>> **Source:** `docs/meta-allocator.md` · [↑ table of contents](#table-of-contents)@@ -40540,7 +41255,7 @@ plan `source` is `"empty"` with a helpful message instead of an error.----<a id="sec-177"></a>+<a id="sec-181"></a>> **Source:** `docs/mint-mark.md` · [↑ table of contents](#table-of-contents)@@ -40672,7 +41387,7 @@ No other mint should appear in tests, fixtures, or documentation.----<a id="sec-178"></a>+<a id="sec-182"></a>> **Source:** `docs/mocap-studio.md` · [↑ table of contents](#table-of-contents)@@ -40760,7 +41475,7 @@ curl 'https://three.ws/api/mocap/clips/<clipId>' -H 'cookie: <session>'----<a id="sec-179"></a>+<a id="sec-183"></a>> **Source:** `docs/money-feed.md` · [↑ table of contents](#table-of-contents)@@ -40872,7 +41587,7 @@ and millisecond `ts`.----<a id="sec-180"></a>+<a id="sec-184"></a>> **Source:** `docs/money-map.md` · [↑ table of contents](#table-of-contents)@@ -41067,7 +41782,93 @@ that set `auto_fund_enabled = true` (default off). See----<a id="sec-181"></a>+<a id="sec-185"></a>++> **Source:** `docs/motion-swap.md` · [↑ table of contents](#table-of-contents)++# Motion Swap — replace yourself in a video with your avatar++**Page:** [/motion-swap](https://three.ws/motion-swap) · **API:** `POST /api/motion-swap` · **Worker:** `workers/model-video2motion`++Upload a video of yourself (a house tour, a product demo, a talking+walk-through) and get it back with your 3D avatar performing your exact motion+instead of you. You stay pixelated under the avatar; the motion, framing, and+audio stay yours. Built for creators who want to publish video without+publishing their face.++## How to use it++1. Open [/motion-swap](https://three.ws/motion-swap) and drop in a video+ (MP4, MOV, or WebM, up to 256 MB; the first 90 seconds are processed).+ One person, full body in frame, tracks best.+2. Wait for capture (about 2 minutes for a 30-second clip). The server tracks+ your pose in every frame and masks you out.+3. Pick an avatar: a stock one, or paste the GLB URL of any rigged humanoid —+ one you [generated](https://three.ws/create), captured from a selfie, or+ rigged from a mesh. Swap avatars any time; the motion re-binds instantly.+4. Press **Export video** to record the composite (with the original audio) to+ a downloadable `.webm`.++The "Pixelate me under the avatar" toggle controls the privacy treatment of+the original subject beneath the avatar.++## How it works++Three stages, split between one CPU worker and your browser:++1. **Track (server).** MediaPipe PoseLandmarker follows 33 body landmarks+ through every frame; MediaPipe ImageSegmenter produces a per-frame person+ mask. Both models are Apache-2.0 and run without a GPU.+2. **Solve (server).** An in-house solver+ (`workers/model-video2motion/pose_solver.py`) converts the landmark+ sequence into local joint rotations on the canonical Wolf3D skeleton and+ emits a standard three.js `AnimationClip` JSON — the same format the+ [animation library](https://three.ws/animations) serves, so the clip+ retargets onto any rigged avatar with the platform's existing engine.+3. **Composite (browser).** One WebGL scene: the normalized footage on a+ fullscreen quad (subject pixelated under the mask in the shader), the+ avatar driven by the clip and pinned to the subject's on-screen position+ and size each frame via the capture's anchor track, and a+ `MediaRecorder` export of canvas + source audio.++Privacy properties: the motion clip contains no imagery (skeleton rotations+only), and processing artifacts live under an unguessable job id.++## API++```+POST /api/motion-swap { action: "upload", content_type, size_bytes }+ → { upload_url, public_url, ... } # presigned direct-to-storage PUT++POST /api/motion-swap { video_url, fps?, max_seconds? }+ → 202 { job_id, status, eta_seconds }++GET /api/motion-swap?job=<id>+ → { status, clip_url, meta_url, video_url, mask_url, frames, fps }+```++`clip_url` is a three.js `AnimationClip.toJSON()` document you can use+anywhere the platform accepts a clip. `meta_url` carries `fps`, dimensions,+and per-frame `anchors` (`{x, y, h, v}`: hip centre in normalized image+coordinates, subject height as a fraction of frame height, visibility).++## Operations++Deploy and wiring: see+[workers/model-video2motion/README.md](../workers/model-video2motion/README.md).+The API routes through the GCP provider's `video2motion` mode; unset+`GCP_VIDEO2MOTION_URL` degrades the endpoint to a clean 503 and the page shows+its error state.++## Related++- [/capture](https://three.ws/capture) — video → 3D point cloud (scene, not person)+- [/animations](https://three.ws/animations) — the clip library the output format matches+- [docs/animations.md](animations.md) · [docs/avatar-reconstruction.md](avatar-reconstruction.md)++---++<a id="sec-186"></a>> **Source:** `docs/multi-agent.md` · [↑ table of contents](#table-of-contents)@@ -41405,7 +42206,148 @@ To extend this into a full turn-based scene, add a `brain` attribute to Mira wit----<a id="sec-182"></a>+<a id="sec-187"></a>++> **Source:** `docs/news-rights.md` · [↑ table of contents](#table-of-contents)++---+title: Publisher rights in the news reader+description: What three.ws may and may not show from a publisher's article, how withdrawn stories are removed, and how to file a takedown.+---++# Publisher rights in the news reader++three.ws aggregates 191 crypto news feeds into [/markets/news](https://three.ws/markets/news), gives every story a permalink, and layers its own analysis on top (summary, key points, detected tickers with live prices, market context at publication, sentiment, related coverage).++Aggregating headlines and linking out is lawful. Reproducing a publisher's article body under our own URL is not, however the text arrives — a scraped page, a reader proxy, or an RSS feed that ships the whole article in `content:encoded`. This page documents where that line sits and how it is enforced in code.++## What a story page shows++| Element | Source | Shown |+|---|---|---|+| Headline, byline, publish date, image | The publisher's feed | Yes, with attribution |+| Lead excerpt of the article | The publisher's article | Yes, **capped at 400 characters / 2 paragraphs** |+| Summary, key points, entities, topics | Our analysis of the article | Yes, this is our own work |+| Tickers, live prices, market context | Our market data | Yes |+| The rest of the article body | The publisher's article | **Never.** The reader links out |++The cap is not a UI preference. It is enforced server-side in [`api/_lib/news-rights.js`](../api/_lib/news-rights.js) and applied at every boundary where publisher text can leave the platform:++- `api/news/article.js` — the reader's detail endpoint, via `publicView()`+- `api/news/story-page.js` — the crawler-visible body, the JSON-LD block, and the JSON seed embedded in the HTML+- `api/news/knowledge.js` — the public, CORS-open grounding corpus+- `api/news/archive.js` — the paid archive search, capped at read time+- `api/_lib/news.js` — `getNews()`, which every list payload, the RSS mirror, and the coin rails flow through+- `api/cron/news-archive-append.js` — capped at capture, so new archive rows never hold a body++The extraction ladder still fetches the full text internally: the LLM needs the whole article to summarize it accurately, and the agents' grounding corpus reasons over it server-side. What changes is that the full text never reaches a response.++## Withdrawn stories and publishers++`news-rights.js` holds two lists:++- **`TAKEDOWN_IDS`** — individual stories removed at a rightsholder's demand, keyed by the 16-hex story id that appears in `/markets/news/<month>/<id>`.+- **`RESTRICTED_SOURCE_KEYS` / `RESTRICTED_HOSTS`** — publishers withdrawn entirely, matched by source key and by link hostname so archived records are caught even when their schema predates the key.++A suppressed story:++- answers **410 Gone** at its permalink, with `x-robots-tag: noindex, nofollow` and a `noindex` meta tag. 410 rather than 404 is deliberate: it tells search engines the removal is permanent, so the URL drops out of the index on the next crawl instead of being retried for weeks.+- is dropped from the feed, RSS, related coverage, archive search, the knowledge corpus, and the sitemap.+- is refused by `/api/news/article` and `/api/news/knowledge` with a 410.+- cannot be re-ingested: the publisher is removed from the feed registry, and `getNews()` filters it at the fan-out choke point, so the hourly archiver cannot re-add it.++Suppression happens on **read**, so it takes effect the moment the code deploys, before any data is touched. Deleting the underlying rows is a separate step:++```bash+node scripts/news-takedown-purge.mjs # dry run: report what would be deleted+node scripts/news-takedown-purge.mjs --apply # rewrite the GCS month files, delete the DB rows+```++The script rewrites each affected `gs://three-ws-news-archive/articles/<month>.jsonl` guarded with `if-generation-match`, so it cannot clobber a concurrent append from the hourly cron, and deletes the matching `news_knowledge` rows.++## Editorial curation: what appears in the feed++Rights govern how *much* of a story we may show. Curation governs *which* stories appear at all. They are separate filters and live in separate files ([`api/_lib/news-curation.js`](../api/_lib/news-curation.js) is the curation one).++three.ws ingests ~190 feeds. Some are crypto-native — every article is on topic. Others are broad outlets (WSJ, CNBC, Seeking Alpha, the SEC, the Fed, world-news desks) that run crypto coverage *and* a great deal that isn't. We keep pulling the broad ones on purpose: their crypto reporting is high-value, and the macro and regulatory context enriches the archive and the agents' knowledge corpus. But a world-politics headline or a general-markets note should never land in a crypto feed.++So the human-facing feeds apply a display gate with two conditions:++1. **Relevance** — a crypto-native source always shows. A broad source's article shows only if the article itself is about crypto (a detected ticker, or a term from the crypto lexicon). This is what keeps "Ryanair broken window" and "3M stock jumps" out while letting the same source's Bitcoin coverage through.+2. **Quality** — a credibility floor (default 0.6, override with `NEWS_MIN_CREDIBILITY`). Scored sources must clear it; unscored registry sources are presumed acceptable; legacy archive rows with no registry entry are never dropped on quality grounds.++The gate is **display-only**. It runs on `/api/news/feed`, the RSS mirror, the daily digest, and related coverage — never on ingestion. The archive cron and the agent-signal callers still receive the full firehose. `GET /api/news/feed?raw=1` bypasses the gate for debugging or parity checks. An explicit single-source request (`?source=`) is also exempt: you asked for that outlet by name.++## Removal history++**The Merkle, LLC (NullTX, nulltx.com)** — notice received 2026-07-19 through the Google Search Console legal channel; Lumen notice 15710816. 24 story pages reproduced the titles and substantially the full body text of the corresponding nulltx.com articles. The claim was correct: the reader rendered the extracted body under our own canonical URL. All 24 ids are in `TAKEDOWN_IDS`, `nulltx` was removed from the feed registry, and the excerpt cap above was added so the same defect cannot recur with any other publisher.++## If you are a publisher++If three.ws is showing more of your work than you want it to, you do not need to file anything formal first. Email **[[email protected]](mailto:[email protected])** with the URLs and we will remove them, and we will honour a request to drop your publication from the aggregator entirely.++If you would rather file a formal DMCA notice, the process and the information required by 17 U.S.C. § 512(c)(3) are in the [Terms of Service](https://three.ws/legal/tos); it reaches the same place. Every policy is listed at [three.ws/legal](https://three.ws/legal).++## For contributors++Three rules, in order of importance:++1. **Never widen the excerpt.** `EXCERPT_MAX_CHARS` and `EXCERPT_MAX_PARAGRAPHS` are a legal boundary, not a design knob. [`tests/news-rights.test.js`](../tests/news-rights.test.js) asserts them directly; if a test there fails, the site is republishing copyrighted text again — fix the code, not the test.+2. **Any new surface that emits article text goes through `news-rights.js`.** A new endpoint, MCP tool, feed, or export that reads `paragraphs` or `description` must call `excerptParagraphs()` / `excerptText()` and filter with `isSuppressed()`. The lists are worthless if a new door bypasses them.+3. **Never re-add a withdrawn publisher** without written permission from the rightsholder.++## Related++- [`api/_lib/news-rights.js`](../api/_lib/news-rights.js) — the implementation+- [`scripts/news-takedown-purge.mjs`](../scripts/news-takedown-purge.mjs) — the purge tool+- [Market Data API](./market-data-api.md) — the paid market endpoints, including archive search++---++<a id="sec-188"></a>++> **Source:** `docs/nvidia-inception.md` · [↑ table of contents](#table-of-contents)++# NVIDIA Inception membership++three.ws LLC is a member of the **NVIDIA Inception program**, NVIDIA's global program for startups building on accelerated computing. Membership was accepted in July 2026.++This page explains what that means in practice: what already runs on NVIDIA, what membership adds, and where it shows up in the product.++---++## Why NVIDIA is a natural fit++Every 3D generation lane on three.ws already runs on NVIDIA silicon:++- **Text-to-3D and image-to-3D** (the [/forge](https://three.ws/forge) free lane and the paid lanes) generate on NVIDIA GPUs on Cloud Run.+- **Photo-to-avatar reconstruction, auto-rigging, and motion capture** run on the same GPU fleet.+- **LLM chat, vision, embeddings, speech, and facial animation** run on NVIDIA-hosted models. The full model-by-model map is in [NVIDIA models on three.ws](/docs/nvidia-models).++GPU capacity is the single hardest constraint on how fast and how detailed generation can be, which is exactly the constraint Inception helps relax.++## What membership adds++- **GPU credits and hardware access** — more capacity for avatar generation and open-model inference, on top of the free-first lanes.+- **Technical guidance** — migrating the digital-human stack toward NVIDIA ACE (Audio2Face + Riva) and NIM / TensorRT-LLM.+- **Ecosystem access** — Omniverse/OpenUSD interop, co-marketing, the NVIDIA VC Alliance, and the wider Inception network.++Membership is a startup program, not a partnership or an investment: NVIDIA reviews applicants and admits companies building seriously on accelerated computing.++## Where you'll see it++- The **NVIDIA Inception member badge** in the site footer, linking to [NVIDIA's startup program](https://www.nvidia.com/en-us/startups/).+- The [membership overview deck](/docs/nvidia-inception/index.html): the platform, the numbers, the team, and what we're doing with the program.+- The [changelog](https://three.ws/changelog), where membership was announced on 2026-07-21.++## Related++- [NVIDIA models on three.ws](/docs/nvidia-models) — the free inference layer, model by model+- [How the forge works](/docs/how-forge-works) — the 3D generation pipeline the GPUs power++---++<a id="sec-189"></a>> **Source:** `docs/nvidia-models.md` · [↑ table of contents](#table-of-contents)@@ -41417,6 +42359,8 @@ three.ws runs a large share of its AI on NVIDIA's free hosted models. **One keyThis 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.+As of July 2026, three.ws LLC is also a **member of the NVIDIA Inception program** ([details](/docs/nvidia-inception)). The free hosted lane on this page is unchanged by that: membership adds GPU credits, hardware access, and engineering support on top of it, which is how the platform scales past free-tier rate limits without giving up the free-first design.+---## How the platform talks to NVIDIA@@ -41607,7 +42551,7 @@ The free NVIDIA TTS lane: **Magpie multilingual on Riva**, selected by an NVCF `----<a id="sec-183"></a>+<a id="sec-190"></a>> **Source:** `docs/nvidia-nemotron-spotlight.md` · [↑ table of contents](#table-of-contents)@@ -41762,7 +42706,7 @@ Build the small stuff. Put it in front. The generator was never the hard part.----<a id="sec-184"></a>+<a id="sec-191"></a>> **Source:** `docs/okx-marketplace.md` · [↑ table of contents](#table-of-contents)@@ -42029,7 +42973,7 @@ USDC rails. The wire format OKX buyers use (headers `PAYMENT-REQUIRED` /----<a id="sec-185"></a>+<a id="sec-192"></a>> **Source:** `docs/onchain-agents.md` · [↑ table of contents](#table-of-contents)@@ -42326,7 +43270,7 @@ A confirmed canary asset shows `inCollection=true`, `royalty=500bps`, `attrs=11`----<a id="sec-186"></a>+<a id="sec-193"></a>> **Source:** `docs/openai-pr/00-START-HERE.md` · [↑ table of contents](#table-of-contents)@@ -42423,7 +43367,7 @@ These are non-negotiable and OVERRIDE any default behavior:----<a id="sec-187"></a>+<a id="sec-194"></a>> **Source:** `docs/openai-pr/01-orphan-widget-resolution.md` · [↑ table of contents](#table-of-contents)@@ -42548,7 +43492,7 @@ fetches from** (three.ws, the R2 storage origin, and the CDN if used). Match wha----<a id="sec-188"></a>+<a id="sec-195"></a>> **Source:** `docs/openai-pr/02-wellknown-manifest-conflict.md` · [↑ table of contents](#table-of-contents)@@ -42669,7 +43613,7 @@ manifest layer. Recommended approach (implement this unless you find it wrong):----<a id="sec-189"></a>+<a id="sec-196"></a>> **Source:** `docs/openai-pr/03-forge-free-tier-truth.md` · [↑ table of contents](#table-of-contents)@@ -42771,7 +43715,7 @@ and a doc claiming it works.----<a id="sec-190"></a>+<a id="sec-197"></a>> **Source:** `docs/openai-pr/04-openai-surface-test-coverage.md` · [↑ table of contents](#table-of-contents)@@ -42857,7 +43801,7 @@ exported per the file). Use an existing JSON-schema/OpenAPI validator already in----<a id="sec-191"></a>+<a id="sec-198"></a>> **Source:** `docs/openai-pr/05-custom-gpt-openapi-serving.md` · [↑ table of contents](#table-of-contents)@@ -42946,7 +43890,7 @@ be normalized to one canonical form.----<a id="sec-192"></a>+<a id="sec-199"></a>> **Source:** `docs/openai-pr/06-docs-accuracy-reconciliation.md` · [↑ table of contents](#table-of-contents)@@ -43027,7 +43971,7 @@ Task 03). Do not fight those tasks for those specific edits; coordinate.----<a id="sec-193"></a>+<a id="sec-200"></a>> **Source:** `docs/openai-pr/07-final-verification-and-submit.md` · [↑ table of contents](#table-of-contents)@@ -43117,7 +44061,7 @@ go/no-go report. Do not submit; prepare so the human's final submit is one actio----<a id="sec-194"></a>+<a id="sec-201"></a>> **Source:** `docs/oracle.md` · [↑ table of contents](#table-of-contents)@@ -43342,7 +44286,7 @@ This is where the engine earns its keep. One score, many consumers.**Alerts and the social layer.** Armed agents alert their owners on Telegram on entries and on conviction drops for held coins. And any user can follow any agent at `/api/oracle/follow`, the watch tier of social copy-trading: pick an agent, set your own minimum score, and get pinged when it acts. The test-alert endpoint lets you verify your wiring before anything real fires.-**The coin pages.** Every Oracle coin page fuses conviction with a live market intel aggregator that fans out to six real sources in parallel: DexScreener, the pump.fun API, GeckoTerminal, GoPlus, Birdeye, and CoinGecko. Price, liquidity, FDV, bonding curve progress, holder count, top ten concentration, mint and freeze authority, all in one view, every number traced to a live upstream. Each source is isolated, so one being down degrades that slice to null instead of failing the page. It also shows the who-is-in breakdown: every early wallet labeled by archetype and track record. That trader-classification surface is what the product is built around.+**The coin pages.** Every Oracle coin page (`/oracle/coin/<mint>`) renders in the markets-hub design, the same editorial system as `/coin/bitcoin`: breadcrumbs, a coin header with the live price and 24h/7d change chips, a conviction card with the score dial and four pillar bars, and stacked full-width sections. It fuses conviction with a live market intel aggregator that fans out to six real sources in parallel: DexScreener, the pump.fun API, GeckoTerminal, GoPlus, Birdeye, and CoinGecko. Price, liquidity, FDV, bonding curve progress, holder count, top ten concentration, mint and freeze authority, all in one view, every number traced to a live upstream. Each source is isolated, so one being down degrades that slice to null instead of failing the page. A Launch Intelligence section brings the Coin Radar engine's first-90-seconds read onto the same page: quality score, organic versus bundle, risk flags, the full signal breakdown, smart-money buyers, and the top-trader ledger. It also shows the who-is-in breakdown: every early wallet labeled by archetype and track record. That trader-classification surface is what the product is built around. The price chart keeps the TradingView-grade DexScreener candles embed alongside a native line view and an agent-trades view that plots every three.ws agent buy and sell on the series.## The x402 layer: intel with a price tag@@ -43501,7 +44445,7 @@ The more data we watch, the sharper every score. Oracle is live now.----<a id="sec-195"></a>+<a id="sec-202"></a>> **Source:** `docs/package-extraction.md` · [↑ table of contents](#table-of-contents)@@ -43620,7 +44564,7 @@ part of the extraction itself — extract and publish first, swap the import lat----<a id="sec-196"></a>+<a id="sec-203"></a>> **Source:** `docs/partners/sperax-proposal.md` · [↑ table of contents](#table-of-contents)@@ -43668,7 +44612,7 @@ Both sides already ship for a living — this proposal only asks each of us to d----<a id="sec-197"></a>+<a id="sec-204"></a>> **Source:** `docs/pay-skills-listing.md` · [↑ table of contents](#table-of-contents)@@ -43769,7 +44713,7 @@ are supported.----<a id="sec-198"></a>+<a id="sec-205"></a>> **Source:** `docs/permissions.md` · [↑ table of contents](#table-of-contents)@@ -44149,7 +45093,7 @@ Set `SMOKE_SKIP_REVOKE=1` to skip the on-chain revocation step if the test walle----<a id="sec-199"></a>+<a id="sec-206"></a>> **Source:** `docs/persona-hub.md` · [↑ table of contents](#table-of-contents)@@ -44546,7 +45490,7 @@ JWT claims:----<a id="sec-200"></a>+<a id="sec-207"></a>> **Source:** `docs/plan-checkout.md` · [↑ table of contents](#table-of-contents)@@ -44673,7 +45617,7 @@ Plan prices live in [api/payments/_config.js](../api/payments/_config.js) (`PLAN----<a id="sec-201"></a>+<a id="sec-208"></a>> **Source:** `docs/popular-3d-github-repos.md` · [↑ table of contents](#table-of-contents)@@ -44936,7 +45880,7 @@ Apply a 3D-signal regex filter over `description + topics` and a denylist of non----<a id="sec-202"></a>+<a id="sec-209"></a>> **Source:** `docs/premium.md` · [↑ table of contents](#table-of-contents)@@ -45059,7 +46003,7 @@ tiers that remain free (news feed, digest, archive stats/trending).----<a id="sec-203"></a>+<a id="sec-210"></a>> **Source:** `docs/provenance.md` · [↑ table of contents](#table-of-contents)@@ -45126,7 +46070,7 @@ Real hashing, real ed25519 signature, real on-chain write. Requires the issuer k----<a id="sec-204"></a>+<a id="sec-211"></a>> **Source:** `docs/pump-fun-mcp-edge.md` · [↑ table of contents](#table-of-contents)@@ -45182,7 +46126,7 @@ Both runtimes import `TOOLS` from `src/pump/mcp-tools.js`, so the tool list expo----<a id="sec-205"></a>+<a id="sec-212"></a>> **Source:** `docs/pump-launch-repos.md` · [↑ table of contents](#table-of-contents)@@ -45281,7 +46225,7 @@ rate-limits under the ~450 txs a full run makes. Pass a dedicated `--rpc`----<a id="sec-206"></a>+<a id="sec-213"></a>> **Source:** `docs/pump-launcher.md` · [↑ table of contents](#table-of-contents)@@ -45432,7 +46376,7 @@ token itself always deploys on **Solana mainnet** — pump.fun is mainnet-only.----<a id="sec-207"></a>+<a id="sec-214"></a>> **Source:** `docs/pump-platform-fee.md` · [↑ table of contents](#table-of-contents)@@ -45493,7 +46437,7 @@ The fee is **never** charged silently. When `platform_fee_bps > 0`:----<a id="sec-208"></a>+<a id="sec-215"></a>> **Source:** `docs/pumpfun-program/README.md` · [↑ table of contents](#table-of-contents)@@ -45516,6 +46460,7 @@ re-vendor from upstream to update. Nothing here is imported by application code.| Path | What it covers || --- | --- || `UPSTREAM-buy-sell-v2-announcement.md` | **The v2 trade-instruction announcement** — `buy_v2` / `sell_v2` / `buy_exact_quote_in_v2`, the move to a unified interface, and USDC-as-quote support. (Upstream's root README.) |+| `UPSTREAM-pumpswap-virtual-quote-reserves.md` | **PumpSwap virtual quote reserves** (2026-07-20) — quotes price on `quote_vault_balance + virtual_quote_reserves`. The double-count and silent-default traps, and every three.ws surface that had to change. || `idl/pump.json` | Bonding-curve program IDL (canonical account/arg shapes). || `idl/pump_amm.json` | PumpSwap AMM (graduated pools) IDL. || `idl/pump_fees.json` | Fee program IDL (`fee_config`, `sharing_config`, creator-fee sharing). |@@ -45551,7 +46496,7 @@ tracked in `tasks/pumpfun-upstream/01-v2-trade-instructions-usdc-audit.md`.----<a id="sec-209"></a>+<a id="sec-216"></a>> **Source:** `docs/pumpfun-program/UPSTREAM-buy-sell-v2-announcement.md` · [↑ table of contents](#table-of-contents)@@ -45655,7 +46600,208 @@ Currently, no quote mint other than native SOL can be used to create or trade co----<a id="sec-210"></a>+<a id="sec-217"></a>++> **Source:** `docs/pumpfun-program/UPSTREAM-pumpswap-virtual-quote-reserves.md` · [↑ table of contents](#table-of-contents)++# PumpSwap: virtual quote reserves++Upstream announcement, plus what three.ws had to change to stay correctly priced.++## What changed++The PumpSwap (`pump_amm`) `Pool` account carries a field appended to the end of+the struct:++```text+virtual_quote_reserves: i128+```++Note the type. It is **signed** and **16 bytes**, not a `u64`. Two things follow,+and both fail silently rather than loudly:++- A hand-rolled decoder that reads 8 bytes gets a truncated value.+- A decoder that reads it as *unsigned* turns a negative into an enormous+ positive, which reads as near-infinite pool depth. That is the dangerous+ direction: a position sizer would happily push size into a pool that cannot+ absorb it. Never clamp it to zero, never parse it unsigned, and do not guard+ with `if (virtual > 0)`.++Because the value can be negative, **effective quote reserves can be lower than+the raw vault balance**. Treat a non-positive effective reserve as an untradable+pool, not as a normal quote.++The identically-named `BondingCurve.virtual_quote_reserves` is a `u64`. The two+fields differ in type as well as in meaning; see the collision note below.++Quotes are computed against the pool's **effective** quote reserves, not the raw+balance sitting in the quote vault:++```text+effective_quote_reserves = quote_vault_balance + virtual_quote_reserves+```++Buys and sells are both priced on `effective_quote_reserves`. Pricing off the raw+vault balance alone under-states the quote side of the pool, which under-prices+the token.++The **base** side is explicitly unchanged: base reserves remain the raw+`pool_base_token_account.amount`. Only the quote side gains a virtual component.++`BuyEvent` and `SellEvent` also carry `virtual_quote_reserves`, appended. Because+it is appended, existing Borsh decoders keep decoding the earlier fields+correctly. Indexers that rebuild reserves from the event stream need it to+reconstruct effective reserves.++## Rollout++| Phase | Date | Behaviour |+|---|---|---|+| 1 | 2026-07-15 | Field ships, `0` on every pool. `effective == raw`, so quotes are byte-identical to before. Integrate here. |+| 2 | 2026-07-20, 10:00 EST | Pools begin carrying a non-zero value. Anything still pricing off the raw vault balance starts mispricing. |++The IDL scopes which pools those are: the field's doc comment reads *"For+non-boost pools, value is 0, so the behavior is identical to legacy pools."* So+boost pools are the non-zero population, and every other pool keeps+`virtual_quote_reserves` at `0`, where the change is a no-op.++Note that upstream's own prose still reads "`0` on all pools today", because the+public docs were written for phase 1 and have not been revised for phase 2. Do+not read that as the change being deferred.++## The name collision++Two different accounts now expose a field called `virtual_quote_reserves`, and+they are not the same thing:++| | `BondingCurve.virtual_quote_reserves` | `Pool.virtual_quote_reserves` |+|---|---|---|+| Program | `pump` | `pump_amm` (PumpSwap) |+| Stage | Pre-graduation | Post-graduation |+| Type | `u64` | `i128` (signed) |+| Meaning | The curve's virtual quote leg, part of the constant-product curve since launch | Quote-side liquidity the pool holds outside its vault, appended 2026-07-15 |++A coin has one or the other, never both. The bonding-curve field is *not* new:+it is the old `virtual_sol_reserves` renamed (see below). The pool field is+genuinely new. Conflating them is the easiest way to get this wrong.++## The other rename, already live++Separately from the change above, the `pump` bonding-curve struct renamed its+quote-side fields when a non-SOL quote asset became possible:++| Was | Now |+|---|---|+| `virtual_sol_reserves` | `virtual_quote_reserves` |+| `real_sol_reserves` | `real_quote_reserves` |++`Global` also gained `initial_virtual_quote_reserves`, and the curve gained a+`quote_mint` (`Pubkey::default()` on every coin created to date, and on any+SOL-paired coin).++This one is already in effect and fails **silently**: reading the retired name+off a freshly decoded curve yields `undefined`, which coerces to `0` rather than+throwing. The symptom is every coin reporting 0% to graduation with zero reserves+and a zero price. three.ws hit exactly this before commit `798725c21`.++## The integration trap++The SDK's quote functions take `virtualQuoteReserves` as its **own argument** and+perform the addition internally:++```js+const effectiveQuoteReserve = quoteReserve.add(virtualQuoteReserves);+```++So pass the **raw** vault balance as `quoteReserve` alongside the virtual figure.+Passing an already-summed reserve double-counts the virtual liquidity.++The argument also **defaults to `0`**. An integration that upgrades the SDK but+never passes the field gets no error and no warning: it silently keeps pricing+off the raw vault balance. This fails quietly, as bad numbers, not as a crash.++```js+// correct — SDK adds the two+sellBaseInput({ base, slippage, baseReserve, quoteReserve, virtualQuoteReserves, ... })++// wrong — double-counts the virtual reserves+sellBaseInput({ base, slippage, baseReserve, quoteReserve: effectiveQuoteReserve, virtualQuoteReserves, ... })++// wrong — silently prices off the raw vault balance+sellBaseInput({ base, slippage, baseReserve, quoteReserve, ... })+```++The SDK's **instance** methods (`PumpAmmSdk#buyQuoteInput(swapState, …)` and+friends) read `pool.virtualQuoteReserves` off the swap state themselves, so those+call sites are correct purely by upgrading the SDK.++## What three.ws does++[`getAmmPoolState`](../../api/_lib/pump.js) is the single source of truth. It+returns both values, and callers pick by consumer:++| Field | Use it for |+|---|---|+| `quoteReserve` | The raw vault balance. Pass to SDK quote functions. |+| `virtualQuoteReserves` | Pass to SDK quote functions alongside `quoteReserve`. |+| `effectiveQuoteReserve` | Our own spot-price and price-impact math, which does not go through the SDK. |++Surfaces updated to price on effective reserves:++- `api/pump/[action].js` — the public quote + trade-build endpoints. The quote+ response now also reports `virtual_quote_reserves` and+ `effective_quote_reserve` so callers can reproduce our numbers.+- `api/agents/solana-trade.js`, `api/agents/pumpfun/[action].js` — agent trading.+- `api/pump-fun-mcp.js`, `src/pump/pump-swap-quote.js` — MCP + browser quoting.+- `api/_lib/trade-firewall.js` — the liquidity gate now judges depth on effective+ reserves, so a pool holding real quote-side depth virtually is not failed as+ `pool_reserves_empty`.+- `workers/agent-sniper/amm-exit.js` — position exits and their price-impact+ circuit breaker.+- `workers/agent-mm/market.js`, `workers/agent-orders/market.js` — the market+ maker's price and the order book's derived market cap. These return no price at+ all for a non-positive effective reserve, rather than a misleading one.++### Refusing an exhausted pool++Because the virtual figure is signed, effective depth can be zero or negative:+a pool that cannot absorb a trade. Every path that quotes must refuse such a pool+outright rather than price it, because all of our impact math clamps the result+to a floor of zero and would therefore report an exhausted pool as **0% impact,+the safest-looking trade available**. That number then sails past the very guards+meant to stop it (the sniper's circuit breaker, the agent `max_price_impact_pct`+limit).++| Surface | Refusal |+|---|---|+| `workers/agent-sniper/amm-exit.js` | throws `amm_quote_depth_empty` |+| `api/agents/solana-trade.js` (`loadAmm`) | HTTP 409 `pool_depth_empty` |+| `api/pump-fun-mcp.js` (`quoteSwap`) | JSON-RPC `-32004` |+| `src/pump/pump-swap-quote.js` | throws `no tradable quote depth` |++A `0` returned by any impact helper means "unknown", never "safe".++Regression coverage lives in+[`tests/agent-sniper-amm-exit.test.js`](../../tests/agent-sniper-amm-exit.test.js)+and [`tests/pump-swap-quote.test.js`](../../tests/pump-swap-quote.test.js): the+virtual figure must reach the SDK un-summed and signed, impact must be measured+against effective reserves, a negative that exhausts depth must be refused before+any quote is attempted, and a negative that merely reduces depth must still price+normally against the reduced reserve.++## Versions++| | |+|---|---|+| TypeScript SDK | `@pump-fun/[email protected]` |+| Rust SDK | `[email protected]` |+| IDL | `contracts/idl/pump/pump_amm.json`, refreshed via `npm run pump:refresh-idls` |++Upstream: <https://github.com/pump-fun/pump-public-docs#pumpswap-update-virtual-quote-reserves>++---++<a id="sec-218"></a>> **Source:** `docs/pumpfun-program/docs/BREAKING_FEE_RECIPIENT.md` · [↑ table of contents](#table-of-contents)@@ -45729,7 +46875,7 @@ The new accounts can be passed before the program upgrade happens on Monday. The----<a id="sec-211"></a>+<a id="sec-219"></a>> **Source:** `docs/pumpfun-program/docs/CPI_README.md` · [↑ table of contents](#table-of-contents)@@ -45833,7 +46979,7 @@ pump-rust-client = { version = "...", path = "..." }----<a id="sec-212"></a>+<a id="sec-220"></a>> **Source:** `docs/pumpfun-program/docs/FAQ.md` · [↑ table of contents](#table-of-contents)@@ -45871,7 +47017,7 @@ is recommended to use a static big enough CU limit like `100_000`.----<a id="sec-213"></a>+<a id="sec-221"></a>> **Source:** `docs/pumpfun-program/docs/FEE_PROGRAM_README.md` · [↑ table of contents](#table-of-contents)@@ -46085,7 +47231,7 @@ If you implement the fee logic correctly, any future change to the fee tiers str----<a id="sec-214"></a>+<a id="sec-222"></a>> **Source:** `docs/pumpfun-program/docs/FEE_RECIPIENTS.md` · [↑ table of contents](#table-of-contents)@@ -46148,7 +47294,7 @@ Use one of these as `buybackFeeRecipient` for any coin.----<a id="sec-215"></a>+<a id="sec-223"></a>> **Source:** `docs/pumpfun-program/docs/PUMP_CASHBACK_README.md` · [↑ table of contents](#table-of-contents)@@ -46265,7 +47411,7 @@ To read unclaimed cashback for pump swap / Pump AMM program:----<a id="sec-216"></a>+<a id="sec-224"></a>> **Source:** `docs/pumpfun-program/docs/PUMP_CREATOR_FEE_README.md` · [↑ table of contents](#table-of-contents)@@ -46400,7 +47546,7 @@ we update the programs on Mainnet.----<a id="sec-217"></a>+<a id="sec-225"></a>> **Source:** `docs/pumpfun-program/docs/PUMP_PROGRAM_README.md` · [↑ table of contents](#table-of-contents)@@ -46601,7 +47747,7 @@ at https://solscan.io/account/EsmVk4MTsoT71JFaRM5DWFZboKpMQjfY6EYzAgUuksXw#accou----<a id="sec-218"></a>+<a id="sec-226"></a>> **Source:** `docs/pumpfun-program/docs/PUMP_SWAP_CREATOR_FEE_README.md` · [↑ table of contents](#table-of-contents)@@ -46710,7 +47856,7 @@ PumpSwap program on Mainnet to the coin creator fee update.----<a id="sec-219"></a>+<a id="sec-227"></a>> **Source:** `docs/pumpfun-program/docs/PUMP_SWAP_README.md` · [↑ table of contents](#table-of-contents)@@ -46944,7 +48090,7 @@ Each Anchor instruction has a set of corresponding autocomplete methods that can----<a id="sec-220"></a>+<a id="sec-228"></a>> **Source:** `docs/pumpfun-program/docs/PUMP_SWAP_SDK_README.md` · [↑ table of contents](#table-of-contents)@@ -47024,7 +48170,7 @@ to autocomplete the `base` and `quote` displayed amounts based on the `lpToken`----<a id="sec-221"></a>+<a id="sec-229"></a>> **Source:** `docs/pumpfun-program/docs/instructions/BUY.md` · [↑ table of contents](#table-of-contents)@@ -47202,7 +48348,7 @@ ixs.extend(----<a id="sec-222"></a>+<a id="sec-230"></a>> **Source:** `docs/pumpfun-program/docs/instructions/CLAIM_CASHBACK.md` · [↑ table of contents](#table-of-contents)@@ -47312,7 +48458,7 @@ let ix = sdk.claim_cashback_v2_instruction(----<a id="sec-223"></a>+<a id="sec-231"></a>> **Source:** `docs/pumpfun-program/docs/instructions/COIN_CREATION.md` · [↑ table of contents](#table-of-contents)@@ -47467,7 +48613,7 @@ let ixs = sdk----<a id="sec-224"></a>+<a id="sec-232"></a>> **Source:** `docs/pumpfun-program/docs/instructions/COLLECT_CREATOR_FEE.md` · [↑ table of contents](#table-of-contents)@@ -47569,7 +48715,7 @@ ixs.extend(sdk.collect_creator_fee_v2_instructions(----<a id="sec-225"></a>+<a id="sec-233"></a>> **Source:** `docs/pumpfun-program/docs/instructions/CREATOR_FEE_SHARING.md` · [↑ table of contents](#table-of-contents)@@ -47923,7 +49069,7 @@ ixs.extend(sdk.distribute_creator_fees_v2_instructions(----<a id="sec-226"></a>+<a id="sec-234"></a>> **Source:** `docs/pumpfun-program/docs/instructions/SELL.md` · [↑ table of contents](#table-of-contents)@@ -48100,7 +49246,7 @@ ixs.extend(----<a id="sec-227"></a>+<a id="sec-235"></a>> **Source:** `docs/quick-start.md` · [↑ table of contents](#table-of-contents)@@ -48395,7 +49541,7 @@ If you're embedding inside a sandboxed iframe, make sure the parent grants `allo----<a id="sec-228"></a>+<a id="sec-236"></a>> **Source:** `docs/radar.md` · [↑ table of contents](#table-of-contents)@@ -48440,7 +49586,8 @@ The UI colors quality as Healthy at 70 and up, Mixed from 40 to 69, and High ris2. 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.+5. Every mainnet coin links to its full page at `/oracle/coin/<mint>`: the card's "Full intel →" button goes there directly, and the drawer carries an "Open full page →" link in its header. The full page renders in the markets-hub design (the same system as `/coin/:id`) with the live price chart, the complete Launch Intelligence read (this engine's signal grid, risk flags, and trader ledger), Oracle conviction, live market intel, agent transactions, and a live trade tape.+6. 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@@ -48488,7 +49635,7 @@ console.log(clean.map((c) => `${c.symbol} q${c.quality_score}`));----<a id="sec-229"></a>+<a id="sec-237"></a>> **Source:** `docs/remix.md` · [↑ table of contents](#table-of-contents)@@ -48690,7 +49837,7 @@ still recorded — the royalty leg reports `payout_unconfigured` instead of payi----<a id="sec-230"></a>+<a id="sec-238"></a>> **Source:** `docs/reputation.md` · [↑ table of contents](#table-of-contents)@@ -48898,7 +50045,7 @@ See the [Validation](./validation.md) documentation for details.----<a id="sec-231"></a>+<a id="sec-239"></a>> **Source:** `docs/restyle.md` · [↑ table of contents](#table-of-contents)@@ -48998,7 +50145,7 @@ Pass the returned `lineage` array back as `parent_lineage` on the next call to e----<a id="sec-232"></a>+<a id="sec-240"></a>> **Source:** `docs/risk-acknowledgment.md` · [↑ table of contents](#table-of-contents)@@ -49110,7 +50257,7 @@ the same change.----<a id="sec-233"></a>+<a id="sec-241"></a>> **Source:** `docs/robinhood-chain-markets.md` · [↑ table of contents](#table-of-contents)@@ -49211,7 +50358,7 @@ math; Chainlink feed prices are already multiplier-adjusted, so they're never re----<a id="sec-234"></a>+<a id="sec-242"></a>> **Source:** `docs/sas-attestations.md` · [↑ table of contents](#table-of-contents)@@ -49440,7 +50587,7 @@ Closing (revoking) an attestation is done server-side via `sasClose()` in [api/_----<a id="sec-235"></a>+<a id="sec-243"></a>> **Source:** `docs/scene-studio.md` · [↑ table of contents](#table-of-contents)@@ -49508,7 +50655,7 @@ A typical round trip from another studio:----<a id="sec-236"></a>+<a id="sec-244"></a>> **Source:** `docs/sdk.md` · [↑ table of contents](#table-of-contents)@@ -49948,7 +51095,7 @@ python3 -m http.server 8080----<a id="sec-237"></a>+<a id="sec-245"></a>> **Source:** `docs/security.md` · [↑ table of contents](#table-of-contents)@@ -50310,7 +51457,7 @@ For validator misconduct (biased or falsified on-chain attestations), open a pub----<a id="sec-238"></a>+<a id="sec-246"></a>> **Source:** `docs/selfie-to-avatar.md` · [↑ table of contents](#table-of-contents)@@ -50401,7 +51548,7 @@ Request body: `name` (1-120, required), `photos` (1-6 image URLs or data URIs) *----<a id="sec-239"></a>+<a id="sec-247"></a>> **Source:** `docs/share-and-embed.md` · [↑ table of contents](#table-of-contents)@@ -50498,7 +51645,63 @@ To customize the preview image, change the agent's thumbnail in the editor.----<a id="sec-240"></a>+<a id="sec-248"></a>++> **Source:** `docs/sign-language.md` · [↑ table of contents](#table-of-contents)++# Sign language: avatars that sign++three.ws avatars can communicate in American Sign Language. Today that means ASL fingerspelling everywhere an avatar performs, and signed chat replies on the platform's conversational surfaces. The system is built in layers so that real lexical signs (captured from human signers) progressively replace fingerspelling word by word as the sign library grows.++> Studio usage (the Spell box, exports, share links) is covered in [Animation Studio](./animation-studio.md). This page covers the system: the engines, the chat integration, and the roadmap.++## What works today++- **Fingerspell any word.** All 26 ASL handshapes, the traced J and Z motions, and the double-letter bounce, compiled on-device into a standard animation clip that plays on any rigged avatar with finger bones. Try it at [/pose](https://three.ws/pose), or share a spelled word: `https://three.ws/pose?spell=HELLO`.+- **Signed chat replies.** In the [/app](https://three.ws/app) agent chat, the 🤟 button in the chat header turns on sign-language mode: the avatar signs every assistant reply. Embedders get the same with one attribute on the web component:++```html+<agent-3d agent-id="your-agent" chat sign-language></agent-3d>+```++- **Motion capture with hands.** The video-to-motion worker tracks 21 landmarks per hand and solves all 30 finger joints, so a video of a real signer becomes a retargetable animation clip. This is the pipeline that will populate the lexical sign dictionary.++## How it works++Two engines, both dependency-free JavaScript modules:++- [`src/fingerspelling.js`](../src/fingerspelling.js) — a parametric ASL hand model. Each letter is defined by per-finger curl, splay, a thumb preset, and wrist orientation, compiled to quaternion tracks on the canonical skeleton. `buildFingerspellingClip('HELLO')` returns the same `AnimationClip` JSON document the animation library serves.+- [`src/sign-speech.js`](../src/sign-speech.js) — the signed counterpart of text-to-speech. `compileUtterance(text, { signs })` splits text into words, resolves each against a sign dictionary (lexical clips), fingerspells the misses, and concatenates everything into one continuous clip. `SignSpeaker` drives an avatar's `AnimationManager` like a TTS engine:++```js+import { SignSpeaker } from './sign-speech.js';++const speaker = new SignSpeaker({ manager: viewer.animationManager });+await speaker.speak('hello world'); // resolves when the signing ends+```++Chat surfaces integrate through `AgentAvatar.setSignLanguage(true)`: the avatar layer already receives every assistant reply (the protocol `SPEAK` event), so signing rides the same event with no per-surface plumbing. Rigs without finger bones are refused with an explanation rather than signing wrong.++## Honest scope++Fingerspelling spells English words letter by letter; it is not grammatical ASL, which has its own grammar and non-manual markers (facial expressions carry meaning). The design principle for the lexical layer: signs come from recordings of real signers, captured through the motion pipeline, never synthesized guesses. That is also why the sign dictionary starts empty rather than shipping approximations.++## Roadmap++1. **Lexical sign dictionary** — captured clips (commissioned signers, community capture through [Motion Swap](https://three.ws/motion-swap), permissively licensed video) served as a `sign-language` library category and fed to `compileUtterance` so common words are signed, not spelled.+2. **Sign recognition** — webcam ASL input transcribed to text for the chat (the reverse direction), so signed conversations work both ways.+3. **Non-manual markers** — eyebrow and mouth blendshape tracks alongside the hand tracks.+4. **Standalone package** — the engines are platform-free by design and will ship as an npm package plus reference integration.++## Related++- [Animation Studio](./animation-studio.md) — the Spell box, exports, and share links+- [docs/animations.md](./animations.md) — clip formats and the retarget engine+- [Motion Swap](https://three.ws/motion-swap) — video motion capture, including hands++---++<a id="sec-249"></a>> **Source:** `docs/signals.md` · [↑ table of contents](#table-of-contents)@@ -50604,7 +51807,7 @@ curl -s https://three.ws/api/signals/subscribe -H 'authorization: Bearer YOUR_TO----<a id="sec-241"></a>+<a id="sec-250"></a>> **Source:** `docs/sketchfab.md` · [↑ table of contents](#table-of-contents)@@ -50694,7 +51897,7 @@ and [`api/_lib/sketchfab.js`](https://github.com/nirholas/three.ws/blob/main/api----<a id="sec-242"></a>+<a id="sec-251"></a>> **Source:** `docs/skills.md` · [↑ table of contents](#table-of-contents)@@ -51404,6 +52607,24 @@ For IPFS publishing, the CID of the directory becomes the stable URI. Agents can---+## Marketplace skills: install once, applied in every chat++Alongside URI-addressed bundles, the platform hosts a community catalog at [/marketplace?tab=skills](https://three.ws/marketplace?tab=skills). A marketplace skill is a database-backed record with a description, category, tags, ratings, and either:++- **content**: a markdown playbook (the equivalent of a standalone `SKILL.md`): analysis frameworks, trading checklists, integration guides. This is the common kind.+- **schema_json**: a JSON tool-schema pack for agents that bring their own executor.++Installing is free and instant (`POST /api/skills/:id/install`, sign-in required; `DELETE` uninstalls). What an install *does*:++- **Knowledge skills load into your chats.** `/api/chat` reads your installed skills at request time (`api/_lib/installed-skills.js`) and injects their playbooks into the system prompt, so your agent follows them anywhere you chat signed-in on three.ws (the `/app` workspace included). Budgets keep prompts sane: newest 8 installs, 6k chars per skill, 24k total. Each reply's SSE `done` event lists the slugs that were in context as `skills_applied`.+- **Your installed set is one API call away.** `GET /api/skills?installed=true` (authed) returns the full payload, `content` and `schema_json` included, so an external agent, MCP client, or script can hydrate itself from your library.++Paid skills price per *call*, not per install: the detail page shows an x402 endpoint (`GET /api/x402/skill-call?skill=<slug>`) any wallet can pay in USDC on Base, settling to the author.++Publish your own from the marketplace ("Publish a Skill") or `POST /api/skills` with `{ name, slug, description, category, tags, content }` (or `schema_json`).++---+## Versioning- `spec: "skill/0.1"` — the skill bundle format version.@@ -51423,7 +52644,7 @@ For IPFS publishing, the CID of the directory becomes the stable URI. Agents can----<a id="sec-243"></a>+<a id="sec-252"></a>> **Source:** `docs/smart-contracts.md` · [↑ table of contents](#table-of-contents)@@ -52029,7 +53250,7 @@ On Base at typical gas prices (~0.001 gwei base fee), an agent registration runs----<a id="sec-244"></a>+<a id="sec-253"></a>> **Source:** `docs/smart-money.md` · [↑ table of contents](#table-of-contents)@@ -52135,7 +53356,7 @@ for (const c of conviction.slice(0, 5)) {----<a id="sec-245"></a>+<a id="sec-254"></a>> **Source:** `docs/social-layer.md` · [↑ table of contents](#table-of-contents)@@ -52362,7 +53583,7 @@ be replayed any time from the getting-started page.----<a id="sec-246"></a>+<a id="sec-255"></a>> **Source:** `docs/solana-pumpfun.md` · [↑ table of contents](#table-of-contents)@@ -52549,7 +53770,7 @@ The MCP client and cron crawler are unit-tested with mocked `fetch` and `sql`. E----<a id="sec-247"></a>+<a id="sec-256"></a>> **Source:** `docs/solana-reputation.md` · [↑ table of contents](#table-of-contents)@@ -52748,7 +53969,7 @@ The shapes differ; the purpose is identical — let an agent decide, before it p----<a id="sec-248"></a>+<a id="sec-257"></a>> **Source:** `docs/solana.md` · [↑ table of contents](#table-of-contents)@@ -52997,7 +54218,7 @@ A full ERC-8004-equivalent on Solana (Identity / Reputation / Validation as Anch----<a id="sec-249"></a>+<a id="sec-258"></a>> **Source:** `docs/spatial-mcp.md` · [↑ table of contents](#table-of-contents)@@ -53107,7 +54328,7 @@ Free 3D Studio (`structuredContent.spatial`): `forge_free`, `text_to_avatar`, `m----<a id="sec-250"></a>+<a id="sec-259"></a>> **Source:** `docs/specs/agent-trading.md` · [↑ table of contents](#table-of-contents)@@ -53194,7 +54415,7 @@ Real routes (no mocks), server-side guards with tests (including the $THREE-sell----<a id="sec-251"></a>+<a id="sec-260"></a>> **Source:** `docs/splat.md` · [↑ table of contents](#table-of-contents)@@ -53265,7 +54486,7 @@ Supported inputs at a glance:----<a id="sec-252"></a>+<a id="sec-261"></a>> **Source:** `docs/start-here.md` · [↑ table of contents](#table-of-contents)@@ -53341,16 +54562,23 @@ Curious what happens between the prompt and the model? [How the Forge works](./h- **Just exploring?** → Open [Discover](/discover) to browse agents others have built- **Creating your first agent** → Go to [/start](/start) — a 5-step wizard walks you through it+- **Want your avatar to sign in ASL?** → [Sign language](./sign-language.md) — fingerspell any word in the Animation Studio, share it as a link (`/pose?spell=HELLO`), and turn on signed chat replies with the 🤟 toggle or the `sign-language` embed attribute- **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+- **Want to drive your agent's computer yourself?** → [Take the wheel](./agent-screen-control.md), every agent has a live screen you can watch on [/agent-screen](https://three.ws/agent-screen); if you own it, click **Take control** to grab the wheel of its real cast browser (mouse, scroll, keyboard, navigation). The agent stands aside while you drive, and the browser holds no wallet, so control can never move funds- **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). 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+- **Making videos without showing your face?** → [Motion Swap](./motion-swap.md) — upload a video of yourself and get it back with your 3D avatar performing your exact motion instead of you; pose tracking and masking run server-side, compositing and export happen in your browser at [/motion-swap](https://three.ws/motion-swap)+- **Want a support chat with a face on your own site?** → [Concierge](./concierge.md) — a one-tag chat widget where a rigged 3D avatar lipsyncs streaming answers grounded in your live page, with voice in and out; [the build tutorial](./tutorials/build-a-site-concierge.md) shows how every part works+- **Want a full-body avatar assistant on your site instead?** → [Assistant widget](./assistant-widget.md) — a launcher button opens an animated 3D character standing directly on your page (or a color/gradient), with a free-lane or bring-your-own-key chatbot and a speak mode that says whatever you type, out loud, in a speech bubble- **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+- **Want your agent to trade for you?** → [Agent Sniper](./agent-sniper.md) — the full autonomous-trading pipeline (entry gates, the simulate-the-sell trade firewall, hash-chained decision ledger, exit ladder), with the audited case study of the platform's first live +42% trade; [arm one in minutes](./tutorials/arm-an-agent-sniper.md)- **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- **Wondering where the platform's money goes?** → [The autonomous economy](./autonomous-economy.md) — how the on-chain treasury funds itself, the funding-root → engines → sweepback loop, the locks that keep every dollar inside platform-owned wallets, and the two leak scanners that audit every wallet on-chain every minute (so far: 44,122 transactions scanned, zero leaks)+- **Publishing news, or wondering what we show of yours?** → [Publisher rights in the news reader](./news-rights.md) — three.ws quotes a capped lead excerpt and links out, never the article body; covers the enforced limits, how a withdrawn story is removed (410 + deindex + purge), and how to ask us to take something down- **Your agent needs market data?** → [Market Data API](./market-data-api.md) — the live feeds behind every /markets page (prices, TVL, yields, stablecoins, gas, derivatives, exploits) as 17 pay-per-call x402 endpoints from $0.001 USDC, plus the one-call `market-pulse` bundle; start at the free index [/api/x402/market](https://three.ws/api/x402/market)- **Trading Robinhood Chain?** → [Robinhood Chain on three.ws](./robinhood-chain-markets.md) — the 24/7 tokenized-equity board (live Chainlink NAV vs. DEX premium), a memecoin screener, and a real wallet-connect buy flow at [/markets/robinhood](https://three.ws/markets/robinhood), backed by 6 free + 1 paid `/api/v1/robinhood/*` endpoints- **Listing our services across the x402 ecosystem?** → [x402 distribution](./x402-distribution.md) — the operating playbook for x402scan, the CDP Bazaar, agentic.market, 402index, and every other directory: how each one indexes providers, what ranks us (settled tx + distinct buyers, trailing 30 days), what's automated, and what needs a human@@ -53371,7 +54599,7 @@ Curious what happens between the prompt and the model? [How the Forge works](./h----<a id="sec-253"></a>+<a id="sec-262"></a>> **Source:** `docs/strategy-objects.md` · [↑ table of contents](#table-of-contents)@@ -53486,7 +54714,7 @@ curl -s https://three.ws/api/sniper/backtest \----<a id="sec-254"></a>+<a id="sec-263"></a>> **Source:** `docs/syndication.md` · [↑ table of contents](#table-of-contents)@@ -53608,7 +54836,7 @@ updated feed.----<a id="sec-255"></a>+<a id="sec-264"></a>> **Source:** `docs/talking-avatar-video.md` · [↑ table of contents](#table-of-contents)@@ -53698,7 +54926,7 @@ curl -H 'cookie: __Host-sid=<SESSION>' \----<a id="sec-256"></a>+<a id="sec-265"></a>> **Source:** `docs/terminal.md` · [↑ table of contents](#table-of-contents)@@ -53803,7 +55031,7 @@ es.addEventListener('graduation', (e) => console.log('graduated', JSON.parse(e.d----<a id="sec-257"></a>+<a id="sec-266"></a>> **Source:** `docs/three-microbuy.md` · [↑ table of contents](#table-of-contents)@@ -53968,7 +55196,7 @@ The response reports `fired`, `paid`, `buys`, `pending`, `errors`, `toll_spent_u----<a id="sec-258"></a>+<a id="sec-267"></a>> **Source:** `docs/token-gated-3d-embeds.md` · [↑ table of contents](#table-of-contents)@@ -54086,7 +55314,7 @@ Every check that matters happens on the server:----<a id="sec-259"></a>+<a id="sec-268"></a>> **Source:** `docs/trader-card.md` · [↑ table of contents](#table-of-contents)@@ -54144,7 +55372,7 @@ Returns the identity summary, KPI aggregates, and the per-coin ledger — `known----<a id="sec-260"></a>+<a id="sec-269"></a>> **Source:** `docs/trading-arenas.md` · [↑ table of contents](#table-of-contents)@@ -54213,7 +55441,7 @@ Prove yourself solo (the [trading surfaces](trading-surfaces.md) → the [leader----<a id="sec-261"></a>+<a id="sec-270"></a>> **Source:** `docs/trading-copilot.md` · [↑ table of contents](#table-of-contents)@@ -54352,7 +55580,7 @@ plumbing — and never suggests, shills, or names another token on its own initi----<a id="sec-262"></a>+<a id="sec-271"></a>> **Source:** `docs/trading-experiment.md` · [↑ table of contents](#table-of-contents)@@ -54508,7 +55736,7 @@ much — and tune the next run. That is the whole point of the experiment.----<a id="sec-263"></a>+<a id="sec-272"></a>> **Source:** `docs/trading-surfaces.md` · [↑ table of contents](#table-of-contents)@@ -54655,7 +55883,7 @@ Agents wanting the same intel over MCP: see [docs/mcp.md](mcp.md) (`@three-ws/in----<a id="sec-264"></a>+<a id="sec-273"></a>> **Source:** `docs/troubleshooting.md` · [↑ table of contents](#table-of-contents)@@ -55314,7 +56542,7 @@ Idle blink and head-drift are active in the current release: `src/idle-animation----<a id="sec-265"></a>+<a id="sec-274"></a>> **Source:** `docs/trust-primitives.md` · [↑ table of contents](#table-of-contents)@@ -55554,7 +56782,125 @@ See also: [x402 paid endpoints](./x402.md) · [Agent Bouncer](./api-reference.md----<a id="sec-266"></a>+<a id="sec-275"></a>++> **Source:** `docs/tutorials/add-a-3d-assistant.md` · [↑ table of contents](#table-of-contents)++# Add a 3D avatar assistant to your site, step by step++This tutorial builds a [three.ws assistant widget](/docs/assistant-widget) from nothing to a polished, branded embed: a floating launcher that opens an animated 3D avatar with a chatbot and a speak mode. By the end you will know every option, how to drive it from your own code, and how to have an AI agent generate the embed for you.++What you need: any web page you can edit, and a browser with WebGL. No account, no key, no build step for the basic path.++---++## Step 1: the one-tag embed++Drop this before `</body>` on any page:++```html+<script src="https://three.ws/assistant/v1.js" async></script>+```++Reload. A launcher button appears in the bottom-right corner. Click it and a 3D avatar rises into a panel with a message box. Type a question and it answers; the reply streams into a speech bubble over the avatar's head. That is the whole widget, running on the free model chain, no configuration.++The avatar, the chat, and the speech all run inside an iframe hosted on three.ws. Your page only loaded a small loader script, so your page never handles a model key and the widget never touches your page's DOM.++## Step 2: make it yours++Everything is a `data-*` attribute. Pick an avatar, name it, tell it about your site, and give it your brand color:++```html+<script src="https://three.ws/assistant/v1.js" async+ data-avatar="/avatars/selfie-girl.glb"+ data-name="Aria"+ data-greeting="Hi! Ask me anything about Acme."+ data-context="Acme is a design studio. Plans start at $20/month. Support: [email protected]."+ data-accent="#22c55e"></script>+```++`data-context` is the important one: it is what the chatbot knows about your site, injected into its system prompt, so answers are grounded in your business instead of generic. Design all of this visually and copy the exact snippet at [three.ws/assistant](https://three.ws/assistant); that page runs the real widget, so the preview is the product.++## Step 3: choose a background++By default the background is `transparent`, so the avatar stands directly on your page. You can instead paint the panel with a color or a gradient:++```html+ data-bg="ember" <!-- a named preset -->+ data-bg="#101820" <!-- a solid color -->+ data-bg="gradient:#0b0714,#9d174d,200" <!-- a custom gradient -->+```++The presets are `ember`, `ocean`, `violet`, `forest`, `dusk`, and `slate`. Anything that is not a valid color, preset, or gradient is rejected inside the frame and falls back to transparent, so a typo never breaks the look.++## Step 4: the two modes++The widget ships with both a **chat** mode and a **speak** mode, and shows a toggle between them. Speak mode is the party trick: the visitor types a line and the avatar says it out loud, with a speech bubble and a talking animation, using the browser's built-in text-to-speech. Lock the widget to one mode with `data-mode="chat"` or `data-mode="speak"`; leave it off (or `both`) to show the toggle.++Speech and spoken chat replies cost nothing and need no key: they use the Web Speech API in the visitor's browser. If a browser has no speech engine, the bubble and animation still play for the estimated duration, so the assistant never looks frozen.++## Step 5: bring your own model key (optional)++Free-lane chat needs no setup. If a visitor wants a private, higher-limit lane, they can open the widget's settings and paste their own Groq or OpenRouter key. That key is stored only in their browser and requests go straight from their browser to the provider; it never passes through three.ws or your page. You do nothing to enable this; it is built into every widget.++## Step 6: drive it from your own code++Install the package if you are in a bundler project:++```bash+npm install @three-ws/assistant+```++```js+import ThreeAssistant from '@three-ws/assistant';++ThreeAssistant.init({ avatar: '/avatars/michelle.glb', name: 'Aria', bg: 'transparent' });++// Later, from anywhere on your page:+document.querySelector('#sale-banner').addEventListener('click', () => {+ ThreeAssistant.say('The spring sale ends tonight, 30% off everything!');+});+```++`say()` opens the widget and speaks the line. You also get `open()`, `close()`, `toggle()`, `setMode('chat' | 'speak')`, and `destroy()`. To react to the widget, listen once on `window`:++```js+window.addEventListener('three-assistant', (e) => {+ if (e.detail.type === 'message') {+ console.log(e.detail.payload.role, e.detail.payload.content);+ }+});+```++The event types are `ready`, `open`, `close`, `message`, `speak:start`, `speak:end`, and `error`.++## Step 7: let an AI agent build it for you++If you use an MCP client (Claude Code, Cursor, Claude Desktop), you can skip the docs entirely. Add the free assistant-widget MCP server:++```json+{+ "mcpServers": {+ "assistant-widget": {+ "command": "npx",+ "args": ["-y", "@three-ws/assistant-mcp"]+ }+ }+}+```++Then ask, in plain language: "build a 3D assistant widget named Aria with an ocean background for my design studio site." The agent calls `build_assistant_widget` and hands back the exact `<script>` snippet, a frame URL, and a `ThreeAssistant.init({...})` call. Ask "what avatars can it use?" and it calls `list_assistant_options`. The server validates every field, so whatever it generates is a working, well-formed embed.++## Where to go next++- The full option reference and API: [Assistant widget docs](/docs/assistant-widget)+- A support chat panel grounded in your page instead of a full-body avatar: [Concierge](/concierge)+- Make a custom avatar to use as `data-avatar`: [the Forge](/forge)+- Every three.ws MCP server: [the MCP catalog](/docs/mcp)++---++<a id="sec-276"></a>> **Source:** `docs/tutorials/agent-personality.md` · [↑ table of contents](#table-of-contents)@@ -56007,7 +57353,7 @@ The system prompt is the cheapest, highest-leverage thing you can change about a----<a id="sec-267"></a>+<a id="sec-277"></a>> **Source:** `docs/tutorials/agent-reputation.md` · [↑ table of contents](#table-of-contents)@@ -56308,7 +57654,7 @@ A read costs nothing and asks no one's permission. That's the property that lets----<a id="sec-268"></a>+<a id="sec-278"></a>> **Source:** `docs/tutorials/animate-your-avatar.md` · [↑ table of contents](#table-of-contents)@@ -56533,7 +57879,119 @@ Primary call to action: open **[/pose](/pose)**, load an avatar, and apply your----<a id="sec-269"></a>+<a id="sec-279"></a>++> **Source:** `docs/tutorials/arm-an-agent-sniper.md` · [↑ table of contents](#table-of-contents)++# Arm an Autonomous Sniper on Your Agent++By the end of this tutorial your agent trades on its own: it watches every new pump.fun launch the moment it happens, filters them against rules you set, runs a real on-chain safety simulation before spending anything, buys from its own Solana wallet, and manages the position to an exit while you sleep. Every decision it takes is written to an auditable, hash-chained ledger.++This is real trading with real SOL on Solana mainnet. The platform's own agent closed its first autonomous position at +42.38% using exactly this setup, and the same run teaches the most important configuration lesson in this tutorial (Step 4). The full engineering breakdown lives in [the Agent Sniper doc](/docs/agent-sniper).++**What you'll build:**++- An armed sniper strategy on one of your agents (`POST /api/sniper/strategy`)+- A funded agent wallet that executes trades autonomously+- A live position ledger you can audit trade by trade+- Two independent off switches you can flip at any time++**Prerequisites:**++- A three.ws account with at least one saved agent ([first-agent](/tutorials/first-agent) if you have none).+- Your agent's custodial Solana wallet funded with SOL. Trades come out of this wallet, so fund it with an amount you are fully prepared to lose. 0.3 to 0.5 SOL is plenty for a first run at the sizes below.+- A session or bearer token for the API calls (sign in at three.ws, or use an API bearer).+- The mindset for it: sniping brand-new tokens is the highest-risk trading there is. The system's gates exist to filter out provable rugs, not to make bad coins good.++---++## Step 1: Understand what fires and what blocks++A strategy is a row of policy, and the worker enforces it as a chain of gates. A launch must pass all of them before a single lamport moves:++1. **Trigger**: the worker holds the pump.fun new-mint firehose open and evaluates coins the second they exist.+2. **Your filters**: market-cap band, socials requirement, creator history, dev-dump avoidance.+3. **Fleet safety band**: platform-level market-cap clamps that your strategy can tighten but never loosen. An unpriceable coin always fails.+4. **Mayhem gate**: pump.fun "Mayhem mode" tokens are excluded unconditionally.+5. **Trade firewall**: a simulated buy-and-sell runs on-chain first. If the token cannot be sold back, the buy aborts. This is the honeypot killer.++Only then does the executor sign. Expect long silences: a well-filtered strategy skips almost everything, and each skip is logged with its reason.++## Step 2: Arm the strategy++One authenticated call arms it:++```bash+curl -X POST https://three.ws/api/sniper/strategy \+ -H "Content-Type: application/json" \+ -H "Authorization: Bearer $THREEWS_TOKEN" \+ -d '{+ "agent_id": "YOUR-AGENT-UUID",+ "network": "mainnet",+ "enabled": true,+ "trigger": "new_mint",+ "per_trade_lamports": 50000000,+ "daily_budget_lamports": 200000000,+ "max_concurrent_positions": 1,+ "min_market_cap_usd": 5000,+ "max_market_cap_usd": 25000,+ "require_socials": true,+ "avoid_dev_dump": true,+ "firewall_level": "block",+ "slippage_bps": 500,+ "max_price_impact_pct": 10,+ "stop_loss_pct": 30,+ "trailing_stop_pct": 25,+ "take_profit_pct": 60,+ "max_hold_seconds": 1800+ }'+```++That is 0.05 SOL per trade, at most 0.2 SOL per day, one position at a time. `GET /api/sniper/strategy` returns your strategies with a live position summary and the agent wallet's SOL balance.++## Step 3: Know your exit ladder++Exits are decided by a pure function in strict priority order, so behavior is exactly predictable:++1. **Stop-loss** (`stop_loss_pct`): value falls 30% below entry, sell everything, always checked first.+2. **Trailing stop** (`trailing_stop_pct`): value falls 25% off its peak since entry, sell.+3. **Take-profit** (`take_profit_pct`): value reaches entry plus 60%, sell.+4. **Timeout** (`max_hold_seconds`): the clock wins no matter what the PnL is.++There is also a laddered mode (`initials_out_multiple`, `moonbag_min_pct`): recover your initial cost when the position hits a multiple, then let the remaining moon bag ride the trailing stop.++## Step 4: The lesson from the first live trade: set `take_profit_pct`++The platform's first autonomous position rode to +46.5%, then exited at +42.38% only because its 30-minute timeout expired. Why: the strategy had `take_profit_pct` unset. With no profit rule, a winner is only ever closed by the trailing stop (which gives back 25% from the peak by definition) or by the clock (which exits at whatever the price happens to be).++That trade won anyway. Configuration should not rely on that. Set an explicit `take_profit_pct` (or use the laddered exit) so that locking in a win is policy, not luck.++## Step 5: Watch it work++- **Positions and PnL**: `GET /api/sniper/strategy` (summary) and the journal at `GET /api/sniper/journal` for the plain-language story of each entry and exit.+- **Reasoning**: every buy writes a decision-ledger entry with the firewall verdict, price impact, a rationale sentence, and a confidence score, hash-chained to the previous entry. It is public and auditable at `three.ws/ledger/<your-agent-id>`, with tamper-evidence you can check yourself via `GET /api/ledger/verify/<your-agent-id>`. See a live one: [the platform agent's ledger](https://three.ws/ledger/4c0e4d18-0544-4c95-a0db-a16896b029be), including the +42% trade this tutorial's Step 4 is built on.+- **The market through the engine's eyes**: [Radar and Coin Intelligence](/docs/trading-surfaces) show what the sniper's intel layer is scoring right now, including coins it skipped.++## Step 6: The off switches++Two independent controls, both instant, both reversible, via the same POST:++- `"kill_switch": true` halts execution but keeps the whole config intact. Use this one first.+- `"enabled": false` disarms the strategy entirely.++The daily budget is a third, passive backstop: once `daily_budget_lamports` is spent, the strategy cannot buy again until the window resets.++## Where this is going++The hard-config sniper you just armed is the control group. The next phase runs an LLM strategist above the same execution stack: a reasoning model reads live market conditions and the agent's own trade history, then tunes these same fields on a cadence, with every adjustment logged to the same ledger. The deterministic gates (firewall, safety band, budget caps) stay hard no matter what the model says. The design and results log live in [the Agent Sniper doc](/docs/agent-sniper).++---++**Legal note:** the sniper trades real tokens with real money on a public chain, entirely under rules you arm. New-launch tokens are extremely volatile and most go to zero. Nothing on this page is financial advice; fund the agent wallet only with what you can afford to lose.++---++<a id="sec-280"></a>> **Source:** `docs/tutorials/build-a-scene.md` · [↑ table of contents](#table-of-contents)@@ -56752,7 +58210,125 @@ The leverage of [Scene Studio](/scene) is that it's a *real* editor producing a----<a id="sec-270"></a>+<a id="sec-281"></a>++> **Source:** `docs/tutorials/build-a-site-concierge.md` · [↑ table of contents](#table-of-contents)++# Build a site concierge: how the three.ws chat widget works, end to end++This tutorial walks through how we built [Concierge](/concierge), the embeddable chat widget with a talking 3D avatar, and how to assemble the same thing from the exported building blocks. By the end you will understand every moving part well enough to customize it, extend it, or point it at your own backend.++What you need: a browser with WebGL, any static page to test on, and (only for the custom-backend section) a server that can stream Server-Sent Events.++---++## The shape of the problem++A site chatbot has four jobs, and each maps to one module in [`concierge-sdk/`](https://github.com/nirholas/three.ws/tree/main/concierge-sdk):++| Job | Module | What it does |+| --- | --- | --- |+| Know the site | `src/context.js` | Snapshot the live DOM at ask-time |+| Get an answer | `src/client.js` + `api/concierge.js` | Stream SSE from a grounded LLM prompt |+| Have a face | `src/stage.js` + `src/lipsync.js` + `src/narrator.js` | Rigged GLB bust, blink/idle, viseme lipsync, TTS |+| Be a widget | `src/widget.js` + `src/styles.js` + `src/element.js` | Launcher, panel, thread, mic, themes, persistence |++The 3D pieces are shared lineage with `@three-ws/page-agent` and the rig conventions of `@three-ws/walk`; nothing here was invented twice.++## Step 1: know the site without a crawler++The classic approach (crawl the site, chunk it, embed it, retrieve at query time) needs infrastructure and goes stale. The concierge inverts it: the visitor is already *on* the page, so harvest the DOM at the moment of the question.++```js+import { buildSitePayload } from '@three-ws/concierge';++const site = buildSitePayload(document, {+ knowledge: 'Pro plan is $20/month.', // curated facts lead+ siteName: 'Acme',+});+// → { url, name, title, description, headings[], nav[], knowledge, content }+```++Three details make this reliable:++- **Noise is stripped before text is read**: `script`, `style`, `[aria-hidden]`, `[hidden]`, iframes, and anything marked `data-concierge-ignore`. The widget's own DOM is excluded too, or it would feed its answers back into its questions.+- **Everything is budgeted.** Page content caps at 6,000 characters, and curated `knowledge` (which is authoritative) eats into that budget first, so the payload can never bloat past what a small prompt affords.+- **It is pure DOM-in / JSON-out**, so it unit-tests with jsdom and no browser.++## Step 2: a grounded, streaming answer++The widget posts `{ message, history, site }` to `/api/concierge`. The server folds the snapshot into a system prompt whose key line is the honesty rule: *ground every claim in the site information; if it is not there, say so and point at the closest nav item instead. Never invent prices, features, or policies.*++The response is Server-Sent Events, one JSON object per frame:++```+data: {"type":"chunk","text":"The Pro plan "}+data: {"type":"chunk","text":"costs $20/month."}+data: {"type":"done","provider":"groq","model":"llama-3.3-70b-versatile"}+```++On the server, the provider list comes from the shared free-first chain (`api/_lib/llm.js`). The handler walks the chain in order, skips lanes in cooldown, marks a lane that answers 401/402/403 with a long auth cooldown (a billing-dead account should not be re-probed on every request), and streams from the first lane that connects. If every lane fails before a byte is sent, the client gets a plain 503 with `Retry-After` and the widget shows a retry bubble.++The client side is ~100 lines (`src/client.js`): a `fetch`, a spec-correct SSE reassembly buffer (frames split on blank lines, tested against one-byte-at-a-time delivery), and an `onChunk` callback.++## Step 3: the face++`AvatarStage` renders a rigged GLB into a transparent canvas, framed as a bust, with three layers of life:++1. **Clip-driven idle** when the GLB ships an idle animation, plus a talk clip crossfaded in while speaking.+2. **Procedural fallback** (breathing, head sway, nod) when it does not, so no avatar is ever a frozen statue.+3. **Blinks**, driven through the standard blink morph targets on a randomized timer.++Lipsync is deliberately *not* audio analysis. `createLipsync` tokenizes the sentence into a timed viseme sequence (`th` → `viseme_TH`, vowels → their shapes, ~80ms per phoneme) and lerps the matching morph-target influences every frame. It is synced to the Web Speech utterance by starting the timeline when the utterance starts. Cheap, dependency-free, and convincing at conversational pace. Rigs with only a `jawOpen` morph get an amplitude envelope instead; rigs with no face morphs carry the talk with body animation.++`SpeechNarrator` queues sentences, picks a voice per avatar profile (name matches first, then language, then any local voice), and always runs the visual timeline even when muted or when the platform has no TTS, so the answer never silently stalls.++The trick that makes the whole thing feel fast: **the widget speaks while the answer still streams**. A small sentence-splitter (`drainSentences`) watches the chunk stream and hands each completed sentence to the narrator immediately.++## Step 4: the widget shell++`Concierge` (in `src/widget.js`) owns the lifecycle. The decisions that matter:++- **Lazy everything.** The WebGL context, GLB download, and speech engines initialize on first open. A closed widget is one button and one stylesheet.+- **Design every state.** Empty state (greeting + suggestion chips), loading (skeleton shimmer behind the stage, typing dots in the thread), streaming (live markdown with a caret), error (friendly bubble + retry that rewinds the failed turn), no-WebGL (stage hides, chat survives), no-mic (button never renders).+- **Persistence with the right scopes.** Conversation per tab (`sessionStorage`), avatar + mute per visitor (`localStorage`), teaser once per session.+- **Safety at the render boundary.** Model output goes through a markdown-lite renderer that escapes first and only then applies markup; `javascript:` URLs never become links.++`<three-concierge>` (`src/element.js`) is a thin attribute-to-config wrapper, and `src/index.js` adds the `data-concierge` script auto-init, which is why the one-tag install needs no JavaScript at all.++## Point it at your own backend++Everything above the wire format is replaceable. Implement one route:++```js+// POST /my/concierge (Express-flavored sketch)+app.post('/my/concierge', async (req, res) => {+ const { message, history, site } = req.body;+ res.writeHead(200, { 'Content-Type': 'text/event-stream' });+ const send = (o) => res.write(`data: ${JSON.stringify(o)}\n\n`);++ const stream = await yourLlm.stream({+ system: `Answer questions about ${site.name} using only:\n${site.knowledge}\n${site.content}`,+ messages: [...history, { role: 'user', content: message }],+ });+ for await (const text of stream) send({ type: 'chunk', text });+ send({ type: 'done', provider: 'yours', model: 'your-model' });+ res.end();+});+```++Then: `<three-concierge endpoint="/my/concierge">`. The production reference, with rate limits, moderation, provider failover, and cooldowns, is [`api/concierge.js`](https://github.com/nirholas/three.ws/blob/main/api/concierge.js).++## Where to go next++- Ship it: the [install options](/concierge#install) on the landing page+- Every attribute and event: the [package README](https://github.com/nirholas/three.ws/tree/main/concierge-sdk#options)+- The launch story: [blog post](/blog/concierge-3d-chat-widget)+- The rig conventions the avatars follow: [`@three-ws/walk`](https://www.npmjs.com/package/@three-ws/walk) and `src/glb-canonicalize.js` in the repo++---++<a id="sec-282"></a>> **Source:** `docs/tutorials/claim-threews-name.md` · [↑ table of contents](#table-of-contents)@@ -57060,7 +58636,7 @@ See also:----<a id="sec-271"></a>+<a id="sec-283"></a>> **Source:** `docs/tutorials/connect-ai-brain.md` · [↑ table of contents](#table-of-contents)@@ -57417,7 +58993,7 @@ The brain is the part of the agent you'll iterate on most after the system promp----<a id="sec-272"></a>+<a id="sec-284"></a>> **Source:** `docs/tutorials/create-and-edit-memory.md` · [↑ table of contents](#table-of-contents)@@ -57738,7 +59314,7 @@ The leverage is in *enhancement*: the right type, one fact per memory, tags, del----<a id="sec-273"></a>+<a id="sec-285"></a>> **Source:** `docs/tutorials/custom-skill.md` · [↑ table of contents](#table-of-contents)@@ -58258,7 +59834,7 @@ The skill installs via a URI in the agent manifest, runs entirely client-side, a----<a id="sec-274"></a>+<a id="sec-286"></a>> **Source:** `docs/tutorials/customize-appearance.md` · [↑ table of contents](#table-of-contents)@@ -58696,7 +60272,7 @@ Most production embeds use four or five of these together. The combination is wh----<a id="sec-275"></a>+<a id="sec-287"></a>> **Source:** `docs/tutorials/deploy-to-vercel-custom-domain.md` · [↑ table of contents](#table-of-contents)@@ -59213,7 +60789,7 @@ In rough order of likelihood:----<a id="sec-276"></a>+<a id="sec-288"></a>> **Source:** `docs/tutorials/embed-in-30-seconds.md` · [↑ table of contents](#table-of-contents)@@ -59487,7 +61063,7 @@ A working embedded agent is the foundation everything else builds on. From here,----<a id="sec-277"></a>+<a id="sec-289"></a>> **Source:** `docs/tutorials/embed-on-website.md` · [↑ table of contents](#table-of-contents)@@ -59998,7 +61574,7 @@ Squarespace's developer preview and published output can differ. Try adding the----<a id="sec-278"></a>+<a id="sec-290"></a>> **Source:** `docs/tutorials/emotion-from-data.md` · [↑ table of contents](#table-of-contents)@@ -60226,7 +61802,7 @@ function reactIfConfident(clipOrEmoteName, { confident, useExactClip = false } =----<a id="sec-279"></a>+<a id="sec-291"></a>> **Source:** `docs/tutorials/first-agent.md` · [↑ table of contents](#table-of-contents)@@ -60735,7 +62311,7 @@ Now that you have a working agent, here's what to explore next:----<a id="sec-280"></a>+<a id="sec-292"></a>> **Source:** `docs/tutorials/first-prompt-to-3d.md` · [↑ table of contents](#table-of-contents)@@ -60855,7 +62431,7 @@ A rigged avatar's AR link gains a **Bring it to life** option: instead of a froz----<a id="sec-281"></a>+<a id="sec-293"></a>> **Source:** `docs/tutorials/generate-3d-api.md` · [↑ table of contents](#table-of-contents)@@ -61067,7 +62643,7 @@ If you've never made an x402 call, start with [Build a paid x402 endpoint](/tuto----<a id="sec-282"></a>+<a id="sec-294"></a>> **Source:** `docs/tutorials/getting-started.md` · [↑ table of contents](#table-of-contents)@@ -61238,7 +62814,7 @@ Everything is editable forever — swap the body, rewrite the prompt, add capabi----<a id="sec-283"></a>+<a id="sec-295"></a>> **Source:** `docs/tutorials/greeting-and-first-speech.md` · [↑ table of contents](#table-of-contents)@@ -61584,7 +63160,7 @@ A working greeting moves the embed from "decoration" to "interaction", which is----<a id="sec-284"></a>+<a id="sec-296"></a>> **Source:** `docs/tutorials/image-to-3d.md` · [↑ table of contents](#table-of-contents)@@ -61687,7 +63263,7 @@ Everything you generate is kept in **Your creations** at the bottom of the page,----<a id="sec-285"></a>+<a id="sec-297"></a>> **Source:** `docs/tutorials/import-avatar-url.md` · [↑ table of contents](#table-of-contents)@@ -61855,7 +63431,7 @@ The URL path and the file-upload path converge on the same avatar record and the----<a id="sec-286"></a>+<a id="sec-298"></a>> **Source:** `docs/tutorials/js-api-events.md` · [↑ table of contents](#table-of-contents)@@ -62321,7 +63897,7 @@ The `whenReady`, awaited-`ask()`, and try/catch patterns are small but they remo----<a id="sec-287"></a>+<a id="sec-299"></a>> **Source:** `docs/tutorials/mcp-server-for-your-agent.md` · [↑ table of contents](#table-of-contents)@@ -62967,7 +64543,7 @@ Things that look right but bite you:----<a id="sec-288"></a>+<a id="sec-300"></a>> **Source:** `docs/tutorials/mine-vanity-address.md` · [↑ table of contents](#table-of-contents)@@ -63236,7 +64812,7 @@ The protocol itself is fully specified in [docs/PROTOCOL-vanity.md](../PROTOCOL-----<a id="sec-289"></a>+<a id="sec-301"></a>> **Source:** `docs/tutorials/mint-pumpfun-token.md` · [↑ table of contents](#table-of-contents)@@ -63588,7 +65164,7 @@ If you have a lawyer, talk to them before launching. If you don't, default to th----<a id="sec-290"></a>+<a id="sec-302"></a>> **Source:** `docs/tutorials/multi-agent-coordination.md` · [↑ table of contents](#table-of-contents)@@ -64148,7 +65724,7 @@ async function safeHandoff(targetEl, brief, fallbackEl, originalQuestion) {----<a id="sec-291"></a>+<a id="sec-303"></a>> **Source:** `docs/tutorials/nvidia-3d-free.md` · [↑ table of contents](#table-of-contents)@@ -64265,7 +65841,7 @@ It talks **directly** to a TRELLIS NIM and returns the GLB **synchronously** in----<a id="sec-292"></a>+<a id="sec-304"></a>> **Source:** `docs/tutorials/nvidia-nim-self-host.md` · [↑ table of contents](#table-of-contents)@@ -64441,7 +66017,7 @@ The proxy normalizes every documented artifact shape (inline `base64`, a bare st----<a id="sec-293"></a>+<a id="sec-305"></a>> **Source:** `docs/tutorials/paid-x402-endpoint.md` · [↑ table of contents](#table-of-contents)@@ -65133,7 +66709,7 @@ Both work. Choose based on whether your endpoint is part of an agent platform yo----<a id="sec-294"></a>+<a id="sec-306"></a>> **Source:** `docs/tutorials/pay-for-x402-service.md` · [↑ table of contents](#table-of-contents)@@ -65397,7 +66973,7 @@ package family is listed under [x402 → Open-source packages](/x402#open-source----<a id="sec-295"></a>+<a id="sec-307"></a>> **Source:** `docs/tutorials/personal-ai-site.md` · [↑ table of contents](#table-of-contents)@@ -65952,7 +67528,7 @@ The technical investment is one HTML file, a GLB avatar, and a system prompt. Th----<a id="sec-296"></a>+<a id="sec-308"></a>> **Source:** `docs/tutorials/place-agent-irl.md` · [↑ table of contents](#table-of-contents)@@ -66200,7 +67776,7 @@ This is fundamentally different from viewing a single model in AR. If you only n----<a id="sec-297"></a>+<a id="sec-309"></a>> **Source:** `docs/tutorials/prompts-for-3d.md` · [↑ table of contents](#table-of-contents)@@ -66336,7 +67912,7 @@ The tiers are explained in detail in [the text-to-3D tutorial](/tutorials/text-t----<a id="sec-298"></a>+<a id="sec-310"></a>> **Source:** `docs/tutorials/register-onchain.md` · [↑ table of contents](#table-of-contents)@@ -66685,7 +68261,7 @@ Your agent's URL will keep working as long as Base exists and IPFS gateways serv----<a id="sec-299"></a>+<a id="sec-311"></a>> **Source:** `docs/tutorials/self-host-agent-backend.md` · [↑ table of contents](#table-of-contents)@@ -67261,7 +68837,7 @@ A self-hosted instance with light traffic runs at $20–50/month all-in. The dom----<a id="sec-300"></a>+<a id="sec-312"></a>> **Source:** `docs/tutorials/selfie-to-avatar.md` · [↑ table of contents](#table-of-contents)@@ -67509,7 +69085,7 @@ The result is a standard `.glb` that animates in the [Animation Studio](/pose),----<a id="sec-301"></a>+<a id="sec-313"></a>> **Source:** `docs/tutorials/share-your-agent.md` · [↑ table of contents](#table-of-contents)@@ -67835,7 +69411,7 @@ The agent's URL is the durable handle. Embed it, link it, print it. The agent sh----<a id="sec-302"></a>+<a id="sec-314"></a>> **Source:** `docs/tutorials/shopify-store-guide-advanced.md` · [↑ table of contents](#table-of-contents)@@ -68145,7 +69721,7 @@ The clip URLs inside the manifest resolve **relative to the manifest**, so a sel----<a id="sec-303"></a>+<a id="sec-315"></a>> **Source:** `docs/tutorials/shopify-store-guide.md` · [↑ table of contents](#table-of-contents)@@ -68234,7 +69810,7 @@ It's powered by the open-source [`@three-ws/tour`](https://www.npmjs.com/package----<a id="sec-304"></a>+<a id="sec-316"></a>> **Source:** `docs/tutorials/skill-with-database-auth.md` · [↑ table of contents](#table-of-contents)@@ -68972,7 +70548,7 @@ Before this skill faces a real visitor:----<a id="sec-305"></a>+<a id="sec-317"></a>> **Source:** `docs/tutorials/solana-agent-reputation.md` · [↑ table of contents](#table-of-contents)@@ -69155,7 +70731,7 @@ A read costs nothing and asks no one's permission — which is exactly what lets----<a id="sec-306"></a>+<a id="sec-318"></a>> **Source:** `docs/tutorials/sperax-tour.md` · [↑ table of contents](#table-of-contents)@@ -69326,7 +70902,7 @@ This is covered by an automated test — [`tour-sdk/test/director.test.mjs`](htt----<a id="sec-307"></a>+<a id="sec-319"></a>> **Source:** `docs/tutorials/swap-avatar-in-studio.md` · [↑ table of contents](#table-of-contents)@@ -69586,7 +71162,7 @@ The key insight is the snippet's stability. Once embedded, your customers' pages----<a id="sec-308"></a>+<a id="sec-320"></a>> **Source:** `docs/tutorials/text-to-3d.md` · [↑ table of contents](#table-of-contents)@@ -69710,7 +71286,7 @@ This is normal — prompt, generate, adjust, repeat is the workflow, not a failu----<a id="sec-309"></a>+<a id="sec-321"></a>> **Source:** `docs/tutorials/trigger-from-page-events.md` · [↑ table of contents](#table-of-contents)@@ -70214,7 +71790,7 @@ The pattern under all of these is the same: every recipe starts with `whenReady(----<a id="sec-310"></a>+<a id="sec-322"></a>> **Source:** `docs/tutorials/upload-custom-glb.md` · [↑ table of contents](#table-of-contents)@@ -70610,7 +72186,7 @@ Once the body is on the platform, the embed snippet doesn't change. The same `<a----<a id="sec-311"></a>+<a id="sec-323"></a>> **Source:** `docs/tutorials/view-in-ar.md` · [↑ table of contents](#table-of-contents)@@ -70795,7 +72371,7 @@ AR surface detection needs a moment to work. Move the phone slowly over the targ----<a id="sec-312"></a>+<a id="sec-324"></a>> **Source:** `docs/tutorials/voice-and-lipsync.md` · [↑ table of contents](#table-of-contents)@@ -71026,7 +72602,7 @@ The leverage is that the avatar drives its mouth from the *audio it actually pla----<a id="sec-313"></a>+<a id="sec-325"></a>> **Source:** `docs/tutorials/walk-companion.md` · [↑ table of contents](#table-of-contents)@@ -71379,7 +72955,7 @@ The leverage is composability: the same engine renders the corner mascot, the fu----<a id="sec-314"></a>+<a id="sec-326"></a>> **Source:** `docs/tutorials/web-component-end-to-end.md` · [↑ table of contents](#table-of-contents)@@ -71980,7 +73556,220 @@ The web component is the most robust integration point the platform offers. Buil----<a id="sec-315"></a>+<a id="sec-327"></a>++> **Source:** `docs/tutorials/x402-server-sdk.md` · [↑ table of contents](#table-of-contents)++# Meter Any API With x402 Using @three-ws/x402-server++By the end of this tutorial you will have taken an ordinary HTTP handler and made it **charge per call** — no API keys, no Stripe, no sign-up page. A caller hits your endpoint, gets a `402 Payment Required` with a machine-readable price, pays in USDC (or `$THREE`) on Solana or Base, and retries to get the work. You will run the whole loop on your own machine first, then wire it into a real server.++This is the **seller** half of [x402](/docs/x402). The package is [`@three-ws/x402-server`](https://www.npmjs.com/package/@three-ws/x402-server) — the same merchant primitives the three.ws rails run in production, extracted as a zero-dependency SDK.++**What you'll build:**++- A paid endpoint with one wrapper: `paid({ price, payTo }, handler)`+- The full 402 handshake: challenge → verify → run the work → settle → receipt+- Solana-first pricing (USDC, optionally `$THREE`), with Base as a second lane+- A local, offline run of the entire buyer↔seller loop — no accounts needed+- The two response modes: buffered JSON (default) and streamed downloads++**Prerequisites:**++- Node.js 18+ (uses global `fetch`).+- Nothing else to start — the first run is fully offline. To take *real* payments you'll later need a Solana pay-to address and a facilitator sponsor fee-payer; both are covered at the end.++---++## 1. Install++```bash+npm install @three-ws/x402-server+```++Framework-agnostic: it works as Express/Connect middleware, a Fastify hook, a Vercel function, or a bare Node `http` handler.++## 2. The mental model: verify → work → settle++Every paid call runs three steps, always in this order:++1. **Verify** the buyer's `X-PAYMENT` header against what you advertised. No work runs unless the payment checks out.+2. **Run the work** — your actual handler.+3. **Settle** on-chain, and return the result with an `X-PAYMENT-RESPONSE` receipt.++Settlement is *last*, so a handler that throws never charges. And the buyer never receives the good before settlement — the wrapper enforces that for you (details in step 6).++## 3. Run the whole loop offline++Before wiring a real facilitator, watch the handshake end-to-end on your machine. This uses a local stub facilitator that always approves — a learning harness, not production.++Save as `demo.mjs`:++```js+import http from 'node:http';+import { createX402Server } from '@three-ws/x402-server';++const NETWORK = 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp';++// A local stand-in for the settlement facilitator (always approves).+const facilitator = http.createServer((req, res) => {+ let raw = ''; req.on('data', c => raw += c); req.on('end', () => {+ const body = req.url === '/verify'+ ? { isValid: true, payer: 'BuyerWallet111' }+ : { success: true, transaction: 'LOCAL_TX', network: NETWORK, payer: 'BuyerWallet111' };+ res.setHeader('content-type', 'application/json');+ res.end(JSON.stringify(body));+ });+});+const facUrl = await new Promise(r => facilitator.listen(0, () => r(`http://127.0.0.1:${facilitator.address().port}`)));++// The paid resource, pointed at the local facilitator.+const server = createX402Server({ facilitator: facUrl });+const app = http.createServer(server.paid(+ {+ price: '50000', // $0.05 USDC (6-decimal atomics)+ payTo: { solana: 'THREEsynthetic1111111111111111111111111PayTo' },+ feePayer: 'THREEsynthetic1111111111111111111111FeePayer',+ description: 'Premium data',+ },+ async (_req, _res, payment) => ({ good: 'the premium data', paidBy: payment.payer }),+));+const appUrl = await new Promise(r => app.listen(0, () => r(`http://127.0.0.1:${app.address().port}`)));++// Buyer, round 1: no payment → 402 challenge.+const challenge = await (await fetch(`${appUrl}/api/premium`)).json();+console.log('402 accepts:', challenge.accepts.map(a => `${a.extra.name} on ${a.network.split(':')[0]}`));++// Buyer, round 2: attach an X-PAYMENT header and retry.+const xPayment = Buffer.from(JSON.stringify({ x402Version: 2, network: NETWORK, payload: { transaction: 'signed' } })).toString('base64');+const paid = await fetch(`${appUrl}/api/premium`, { headers: { 'x-payment': xPayment } });+console.log('200 body:', await paid.json());+const receipt = JSON.parse(Buffer.from(paid.headers.get('x-payment-response'), 'base64').toString());+console.log('receipt tx:', receipt.transaction);++facilitator.close(); app.close();+```++```bash+node demo.mjs+```++```+402 accepts: [ 'USDC on solana' ]+200 body: { good: 'the premium data', paidBy: 'BuyerWallet111' }+receipt tx: LOCAL_TX+```++That is the entire protocol. The handler just **returned a value** — the wrapper serialized it as JSON, settled, and attached the receipt header.++> This exact demo ships runnable in the package: [`examples/loopback-demo.mjs`](https://github.com/nirholas/three.ws/blob/main/packages/x402-server/examples/loopback-demo.mjs).++## 4. Price it: atomic units, lanes, and $THREE++`price` is in **atomic units** of the asset. USDC is 6-decimal, so `'10000'` = `$0.01` and `'1000000'` = `$1.00`.++Advertise both lanes by giving both a `payTo`. Solana leads (first-accept clients settle there); pass `network: ['base']` to lead with EVM.++```js+paid(+ {+ price: '50000',+ payTo: {+ solana: '<your-SPL-pay-to>',+ base: '0x<your-EVM-pay-to>',+ },+ feePayer: '<facilitator-sponsor-account>', // required for the Solana accept+ acceptThree: true, // also advertise $THREE next to USDC on Solana+ threeAmount: '10000000', // optional distinct $THREE price; omit to reuse `price`+ },+ handler,+);+```++`acceptThree: true` adds a `$THREE` Solana accept right after USDC, so a wallet's token chooser surfaces both while a first-accept client still settles USDC. `$THREE` is Solana-only.++## 5. Take a platform fee (without marking up the buyer)++A fee is carved **out** of the listed price — the buyer's total is exactly `price`; the creator nets `price − fee`.++```js+paid(+ { price: '1000000', payTo, feePayer, feeBps: 250, feeTo: '<treasury>' }, // 2.5%+ handler,+);+```++On `$1.00`: buyer pays `$1.00`, creator nets `$0.975`, treasury gets `$0.025`. The fee is clamped to 10% (`feeBps ≤ 1000`), and ships **inert** — with `feeBps: 0` or no `feeTo`, nothing is charged. You can compute a split yourself with `feeSplit(price, bps, recipient)`.++## 6. Two response modes++The wrapper guarantees the buyer never gets the good before settlement. You choose how it does that:++**Deliver-then-settle (default).** Write your response normally or return a value. The wrapper *buffers* the output, settles, then flushes the `200` with the receipt header. Best for JSON APIs.++```js+app.post('/v1/embed', paid(+ { price: '2000', payTo, feePayer },+ async (req, res, payment) => {+ res.json({ vector: await embed(req.body.text), billedTo: payment.payer });+ },+));+```++**Settle-then-stream (`streaming: true`).** For responses you can't buffer — a large file, SSE, `res.pipe`. Settlement runs first, the receipt header is set up-front, then you stream:++```js+paid(+ { price: '100000', payTo, network: ['base'], streaming: true },+ async (_req, res) => {+ res.setHeader('content-type', 'text/csv');+ res.write('id,value\n');+ for (let i = 0; i < 5; i++) res.write(`${i},${i * 1.5}\n`);+ res.end();+ },+);+```++## 7. Handle the edge cases (the SDK already does)++`verifyPayment` returns a structured result instead of throwing on a bad payment, and `paid()` maps each state to the right status:++| Situation | HTTP | Safe to retry? |+|---|---|---|+| No/!invalid `X-PAYMENT` | 402 | Yes — pay and retry |+| Facilitator `/verify` down | 502 | Yes — **no funds moved** |+| Handler threw after payment | 500 | Yes — settlement was **skipped**, no charge |+| Settlement status unknown | 502 (`settle_uncertain`) | Check on-chain first |++The two invariants that make this safe: verification runs *before* your handler, settlement runs *after* it.++## 8. Go live++To take real payments, replace the local facilitator with a live one and use real accounts:++- **`payTo`** — your Solana SPL address and/or EVM address that receives funds.+- **`feePayer`** (Solana) — the facilitator's sponsor account that co-signs the SPL transfer so the buyer pays no SOL gas. The default facilitator is `https://facilitator.payai.network`; override with the `facilitator` option.+- Deploy the handler anywhere that serves HTTPS (buyers' clients refuse non-HTTPS). Any Node host works — Vercel, Fly, Railway, a VPS.++Test it with a real buyer using the seller's twin, [`@three-ws/x402-fetch`](https://www.npmjs.com/package/@three-ws/x402-fetch):++```js+import { withX402 } from '@three-ws/x402-fetch';+const pay = withX402(fetch, { wallet }); // wallet signs the on-chain payment+const res = await pay('https://your.api/v1/embed', { method: 'POST', body });+// The 402 is paid and retried transparently; `res` is the paid 200.+```++## Where to go next++- [x402 overview](/docs/x402) — the protocol, the lanes, the facilitators.+- [Build a paid x402 endpoint your agent calls](/tutorials/paid-x402-endpoint) — the CDP/Base-catalog path with Bazaar discovery.+- [x402 buyer client](/docs/x402-buyer) — the paying side in depth.+- Package examples: [`packages/x402-server/examples`](https://github.com/nirholas/three.ws/tree/main/packages/x402-server/examples).++---++<a id="sec-328"></a>> **Source:** `docs/ui-juice.md` · [↑ table of contents](#table-of-contents)@@ -72142,7 +73931,7 @@ should reach for these primitives rather than re-rolling RAF loops.----<a id="sec-316"></a>+<a id="sec-329"></a>> **Source:** `docs/ux-flows/01-onboarding-creation.md` · [↑ table of contents](#table-of-contents)@@ -72348,7 +74137,7 @@ should reach for these primitives rather than re-rolling RAF loops.----<a id="sec-317"></a>+<a id="sec-330"></a>> **Source:** `docs/ux-flows/02-forge-text-to-3d.md` · [↑ table of contents](#table-of-contents)@@ -72521,7 +74310,7 @@ Routing facts (from `vercel.json`):----<a id="sec-318"></a>+<a id="sec-331"></a>> **Source:** `docs/ux-flows/03-3d-editing-viewer.md` · [↑ table of contents](#table-of-contents)@@ -72727,7 +74516,7 @@ Routing summary (from `vite.config.js`):----<a id="sec-319"></a>+<a id="sec-332"></a>> **Source:** `docs/ux-flows/04-embed-widget-studio.md` · [↑ table of contents](#table-of-contents)@@ -72901,7 +74690,7 @@ Routing recap (from `vercel.json`):----<a id="sec-320"></a>+<a id="sec-333"></a>> **Source:** `docs/ux-flows/05-discovery-social.md` · [↑ table of contents](#table-of-contents)@@ -73172,7 +74961,7 @@ Routing recap (from `vercel.json`):----<a id="sec-321"></a>+<a id="sec-334"></a>> **Source:** `docs/ux-flows/06-marketplace-skills.md` · [↑ table of contents](#table-of-contents)@@ -73313,12 +75102,12 @@ Routing facts confirmed in `vercel.json`:3. (optional) User searches → `skillsState.q` → refetch; or toggles Free/Paid (client-side `isPaidSkill`).4. (optional) User scrolls → cursor pagination appends more cards.5. User clicks a card → `/marketplace/skills/:id` → `GET /api/skills/:id` renders the detail panel (header, meta pills, description, tool schemas, full content, related skills).- 6. User clicks "Install" → `toggleSkillInstall()` POSTs `/api/skills/:id/install` (DELETE to remove); 401 → login redirect; on success the detail + grid refetch and the button flips to "Installed ✓ — Remove".+ 6. User clicks "Install" → `toggleSkillInstall()` POSTs `/api/skills/:id/install` (DELETE to remove); 401 → login redirect; on success the detail + grid refetch, the button flips to "Installed ✓ — Remove", and the "what next" panel (`#skill-detail-next`) appears: knowledge skills get a "Chat with your agent →" CTA to `/app`, schema-only packs get the `GET /api/skills?installed=true` retrieval hint. Pre-install, `#skill-detail-how` explains what installing does.7. (optional) User rates 1–5 stars → `POST /api/skills/:id/rate { rating }` → detail refetches with updated counts.8. (optional, paid skills) Detail shows an x402 panel: endpoint `GET /api/x402/skill-call?skill=:slug`, price `$X.XXX/call`, and a copy-paste `@three-ws/x402-fetch` snippet — developers pay per call from their own wallet; the server settles to the author.- **Decision points / branches:** free vs paid (paid = x402 per-call, not an install purchase); installed vs not; authed vs anon (install/rate gated). Marketplace skills (community tool packs with schema/content) are distinct from built-in agent skills in `src/agent-skills*.js`.- **External calls / dependencies:** `/api/skills`, `/api/skills/categories`, `/api/skills/:id`, `/api/skills/:id/install` (POST/DELETE), `/api/skills/:id/rate`, `/api/x402/skill-call` (per-call payment), `/api/creators/:id` (author modal).-- **Success state:** Skill installed (flips to "Installed ✓"), rating recorded, x402 snippet copyable; installs reflected on the user's agents.+- **Success state:** Skill installed (flips to "Installed ✓" + the what-next panel), rating recorded, x402 snippet copyable. Installs take effect at chat time: `/api/chat` loads the signed-in user's installed knowledge skills (`api/_lib/installed-skills.js`, newest 8, content budget 24k chars) into the system prompt and reports them as `skills_applied` in the SSE `done` event; `GET /api/skills?installed=true` returns the full payload (content + schema_json) for external agents.- **Empty / error states:** "No skills found" with Clear-filters / Publish-a-Skill CTAs; `renderErrorState('skills')` with retry; install button restores text + re-enables on error; auth redirect on 401.- **Step count:** 3 required (+5 optional)@@ -73386,7 +75175,7 @@ Routing facts confirmed in `vercel.json`:----<a id="sec-322"></a>+<a id="sec-335"></a>> **Source:** `docs/ux-flows/07-crypto-trading-analytics.md` · [↑ table of contents](#table-of-contents)@@ -73735,7 +75524,7 @@ coin-intel, pump-visualizer and pump-live — adding a coin on any surface shows----<a id="sec-323"></a>+<a id="sec-336"></a>> **Source:** `docs/ux-flows/08-coin-launch-wallets.md` · [↑ table of contents](#table-of-contents)@@ -74008,7 +75797,7 @@ real Solana/EVM RPC, pump.fun, and x402 — no mocks.----<a id="sec-324"></a>+<a id="sec-337"></a>> **Source:** `docs/ux-flows/09-x402-agent-commerce.md` · [↑ table of contents](#table-of-contents)@@ -74350,7 +76139,7 @@ choreographed two-agent narrative driven by Server-Sent Events.----<a id="sec-325"></a>+<a id="sec-338"></a>> **Source:** `docs/ux-flows/10-chat-brain-labs.md` · [↑ table of contents](#table-of-contents)@@ -74592,7 +76381,7 @@ modules. Routes resolved via `vercel.json` rewrites.----<a id="sec-326"></a>+<a id="sec-339"></a>> **Source:** `docs/ux-flows/11-account-dashboard.md` · [↑ table of contents](#table-of-contents)@@ -74812,7 +76601,7 @@ Shared auth concepts:----<a id="sec-327"></a>+<a id="sec-340"></a>> **Source:** `docs/ux-flows/12-home-and-content.md` · [↑ table of contents](#table-of-contents)@@ -75000,7 +76789,7 @@ All `/.well-known/*` and `/openapi.json` / `/sitemap.xml` responses are JSON/XML----<a id="sec-328"></a>+<a id="sec-341"></a>> **Source:** `docs/validation.md` · [↑ table of contents](#table-of-contents)@@ -75358,7 +77147,7 @@ The toggle's CSS class reflects the highest severity: `level-0` (errors), `level----<a id="sec-329"></a>+<a id="sec-342"></a>> **Source:** `docs/vanity.md` · [↑ table of contents](#table-of-contents)@@ -75589,7 +77378,7 @@ challenges and the discovery doc stay in parity.----<a id="sec-330"></a>+<a id="sec-343"></a>> **Source:** `docs/viewer.md` · [↑ table of contents](#table-of-contents)@@ -75983,7 +77772,7 @@ A subset of state (background, transparency, background color, auto-rotate, expo----<a id="sec-331"></a>+<a id="sec-344"></a>> **Source:** `docs/voice-lab.md` · [↑ table of contents](#table-of-contents)@@ -76076,7 +77865,7 @@ The agent-voice handler ([`api/agents/_id/voice.js`](../api/agents/_id/voice.js)----<a id="sec-332"></a>+<a id="sec-345"></a>> **Source:** `docs/web-component.md` · [↑ table of contents](#table-of-contents)@@ -77000,7 +78789,7 @@ defineElement('my-agent');----<a id="sec-333"></a>+<a id="sec-346"></a>> **Source:** `docs/widget-api.md` · [↑ table of contents](#table-of-contents)@@ -77207,7 +78996,7 @@ If you have multiple widgets and want to coordinate them (sync camera, broadcast----<a id="sec-334"></a>+<a id="sec-347"></a>> **Source:** `docs/widget-studio.md` · [↑ table of contents](#table-of-contents)@@ -77458,7 +79247,7 @@ You can override these freely in the iframe `width` and `height` attributes. Add----<a id="sec-335"></a>+<a id="sec-348"></a>> **Source:** `docs/widgets.md` · [↑ table of contents](#table-of-contents)@@ -77976,7 +79765,7 @@ Need to drive a widget from the parent page — change the camera, play an anima----<a id="sec-336"></a>+<a id="sec-349"></a>> **Source:** `docs/x402-buyer.md` · [↑ table of contents](#table-of-contents)@@ -78078,7 +79867,7 @@ set) back into the payment so attribution survives the round trip.----<a id="sec-337"></a>+<a id="sec-350"></a>> **Source:** `docs/x402-dev-tools.md` · [↑ table of contents](#table-of-contents)@@ -78273,7 +80062,7 @@ implementation against a live server.----<a id="sec-338"></a>+<a id="sec-351"></a>> **Source:** `docs/x402-distribution.md` · [↑ table of contents](#table-of-contents)@@ -78486,7 +80275,7 @@ script. Everything else above updates itself.----<a id="sec-339"></a>+<a id="sec-352"></a>> **Source:** `docs/x402-endpoints.md` · [↑ table of contents](#table-of-contents)@@ -78754,7 +80543,7 @@ input and do not promote any specific token.----<a id="sec-340"></a>+<a id="sec-353"></a>> **Source:** `docs/x402-revenue.md` · [↑ table of contents](#table-of-contents)@@ -79115,7 +80904,7 @@ settled activity (include it), and label it as such.----<a id="sec-341"></a>+<a id="sec-354"></a>> **Source:** `docs/x402-ring-economy.md` · [↑ table of contents](#table-of-contents)@@ -79539,6 +81328,33 @@ principal recirculates (the rebalancer sweeps treasury→payer, now on a **120s*cooldown to keep up with the faster float), a higher daily cap raises *gross volume*without raising real cost — cost is only the SOL fees above.+### The master revenue share: how the ring fuels the rest of the economy++Every treasury sweep routes a bounded cut (`X402_RING_MASTER_REVSHARE_BPS`,+default 20%) to the **economy master wallet** instead of the payer. That cut is+the funding root's only USDC inflow: `economy-fuel.js` converts it to SOL (a+self-swap, per-run and per-day capped) and `treasury-topup` distributes that SOL+to every engine below its floor: the circulation treasury that drives the+Money Pulse (tips, trades, agent-to-agent payments), the ring sponsor whose SOL+floor gates settlement, and the rest of `SOLANA_SIGNERS`. Without this leg the+master starves, the sponsor slips under its floor, settles 502, and the pulse+flat-lines (July 2026 incident). Both legs of a split sweep land in+`x402_ring_ledger` (`kind='sweep'` payer leg, `kind='revshare'` master leg,+same `tx_sig`) and the reconciler verifies the treasury's on-chain delta+against the *sum* of the legs, each recipient against its own row.++Two scheduling guarantees keep the recirculation alive regardless of what else+the autonomous loop is doing:++1. **Reserved maintenance slots**: registry entries tagged `maintenance: true`+ (ring-rebalance, ring-float-topup, ring-pool-fund) are selected *outside*+ `X402_AUTONOMOUS_MAX_PER_TICK`, so a wave of failing high-priority paid+ entries can never starve them out of the rotation.+2. **Cooldown on failure**: a paid entry that errors now backs off for its full+ cooldown exactly like a success. Before this, a failing entry retried every+ tick forever, pinning all tick slots and generating thousands of junk+ settle-502 rows per day.+### Coherence: no silent skipsThe old failure — ring-settle silently dropped because its price exceeded the@@ -79927,7 +81743,7 @@ curl -s -H "Authorization: Bearer $CRON_SECRET" \----<a id="sec-342"></a>+<a id="sec-355"></a>> **Source:** `docs/x402-studio.md` · [↑ table of contents](#table-of-contents)@@ -80036,7 +81852,7 @@ const { tx_base64, blockhash } = await res.json();----<a id="sec-343"></a>+<a id="sec-356"></a>> **Source:** `docs/x402.md` · [↑ table of contents](#table-of-contents)@@ -80219,7 +82035,7 @@ Each package has its own repository with a full README, API reference, and examp----<a id="sec-344"></a>+<a id="sec-357"></a>> **Source:** `docs/zauth/database.md` · [↑ table of contents](#table-of-contents)@@ -80365,7 +82181,7 @@ Use this endpoint to browse all known x402 endpoints before your agents commit t----<a id="sec-345"></a>+<a id="sec-358"></a>> **Source:** `docs/zauth/index.md` · [↑ table of contents](#table-of-contents)@@ -80389,7 +82205,7 @@ zauth is the security and trust layer that allows agents to act with confidence,----<a id="sec-346"></a>+<a id="sec-359"></a>> **Source:** `docs/zauth/provider-hub.md` · [↑ table of contents](#table-of-contents)@@ -80491,7 +82307,7 @@ Supply your EVM or Solana private keys to enable automatic refunds when your end----<a id="sec-347"></a>+<a id="sec-360"></a>> **Source:** `docs/zauth/reposcan.md` · [↑ table of contents](#table-of-contents)@@ -80817,7 +82633,7 @@ TypeScript -@x402/fetch----<a id="sec-348"></a>+<a id="sec-361"></a>> **Source:** `docs/zauth/vector.md` · [↑ table of contents](#table-of-contents)diff --git a/docs/bnb-vault.md b/docs/bnb-vault.mdindex 1b4e151a2..81740164b 100644--- a/docs/bnb-vault.md+++ b/docs/bnb-vault.md@@ -90,7 +90,7 @@ same technique prompt 11 used at the exported-function level, extended hereto drive the actual running HTTP endpoints and a real headless browser:```-node scripts/tmp-verify-vault-ui.mjs+node scripts/verify-vault-ui.mjs```This script deploys `GreenfieldVault` (with faithful mocked Greenfield hubs,diff --git a/multiplayer/src/vehicles.js b/multiplayer/src/vehicles.jsindex 019b70510..45ea9230e 100644--- a/multiplayer/src/vehicles.js+++ b/multiplayer/src/vehicles.js@@ -40,7 +40,7 @@ export const VEHICLE_TYPES = {// -0.3*hy below the body origin) settles low enough to rest on/against the// ground itself, so its own friction pins the car almost dead still no// matter how much engine force is applied (0.61 m/s after 3s of full- // throttle in a scripted repro — scripts/tmp-verify-w02-physics-core.mjs).+ // throttle in a scripted repro — scripts/verify-w02-physics-core.mjs).// 0.4 gives the chassis clearance over the wheel contact line so the wheels// (not the hull) carry the car's weight and traction (10.8 m/s after the// same 3s in the same repro).diff --git a/prompts/agent-briefs/W-world-online/PORT-CHECKLIST.md b/prompts/agent-briefs/W-world-online/PORT-CHECKLIST.mdindex 7ae945c37..b11592e23 100644--- a/prompts/agent-briefs/W-world-online/PORT-CHECKLIST.md+++ b/prompts/agent-briefs/W-world-online/PORT-CHECKLIST.md@@ -130,7 +130,7 @@ itself rested on/against the ground and its own friction pinned the car almost dregardless of engine force (sedan and pickup: ~0.00 m/s after 3s of full throttle even at 10xtheir spec'd engine force; coupe: crawled at 0.6 m/s). Root-caused with a standalone real-Rapierrepro (no browser, no game loop — immune to frame-rate starvation) at-[scripts/tmp-verify-w02-physics-core.mjs](../../../scripts/tmp-verify-w02-physics-core.mjs).+[scripts/verify-w02-physics-core.mjs](../../../scripts/verify-w02-physics-core.mjs).Fixed by raising `suspension.rest` (coupe 0.32→0.4, sedan 0.36→0.5, pickup 0.42→0.6; buggy wasalready fine at 0.46) — all four types now accelerate, steer, and are stopped by real wallcollision correctly.@@ -139,13 +139,13 @@ collision correctly.with collision, a second browser sees the car move smoothly, and exit returns to on-foot. —**Verified for real, twice:**1. A standalone real-Rapier physics repro (no browser/network — immune to shared-box CPU- contention): [scripts/tmp-verify-w02-physics-core.mjs](../../../scripts/tmp-verify-w02-physics-core.mjs)+ contention): [scripts/verify-w02-physics-core.mjs](../../../scripts/verify-w02-physics-core.mjs)— real acceleration on open ground, a real wall stopping the car (not tunnelling, not abounds-clamp teleport), real steering-induced lateral displacement, and the handbrakearresting speed. All passing against the production `createVehicle`/`vehicleSpec` code.2. A full two-Chromium-context Playwright run against a live Vite dev server + a freshly-startedColyseus `WalkRoom` (no mocked physics, no mocked network):- [scripts/tmp-verify-w02-vehicles.mjs](../../../scripts/tmp-verify-w02-vehicles.mjs) — Player A+ [scripts/verify-w02-vehicles.mjs](../../../scripts/verify-w02-vehicles.mjs) — Player Ajoins, Rapier boots, the 6-vehicle fleet syncs, A walks to a parked car under real on-footRapier movement, presses F, the server grants the seat, the driving HUD appears, Player B'sindependent client sees the `driver` field flip to A's sessionId and sees the car's replicated@@ -256,7 +256,7 @@ friction, and once in the world can walk up to a physical storefront (not just abrowse and equip real, server-persisted cosmetics. **Verified for real** against a local Vitedev server + a freshly-started Colyseus `WalkRoom` (no mocked physics, no mocked catalog, nomocked SDK) with Playwright:-[scripts/tmp-verify-w03-boutique.mjs](../../../scripts/tmp-verify-w03-boutique.mjs) — the lobby's+[scripts/verify-w03-boutique.mjs](../../../scripts/verify-w03-boutique.mjs) — the lobby's"Design your avatar" card opens `AvatarCreator`, which fires a real network request to`avaturn.*` (the SDK is genuinely wired, not a stub); the player joins the `$THREE` world over areal Colyseus session; both boutique NPCs are present in `worldLife.npcs`; real on-foot@@ -317,7 +317,7 @@ player (raising wanted heat, visible on both the HUD and the victim's nameplate)kill drops the victim's carried valuables + auto-respawns them in town at full health —all real Rapier-driven movement, a real freshly-started `WalkRoom`, zero mocked combatmath. Verified end-to-end with two independent Chromium contexts against a live server:-[scripts/tmp-verify-w07-combat.mjs](../../../scripts/tmp-verify-w07-combat.mjs).+[scripts/verify-w07-combat.mjs](../../../scripts/verify-w07-combat.mjs).---diff --git a/prompts/bnb-chain/PROGRESS.md b/prompts/bnb-chain/PROGRESS.mdindex b8f95a47c..73f1e6f56 100644--- a/prompts/bnb-chain/PROGRESS.md+++ b/prompts/bnb-chain/PROGRESS.md@@ -1877,7 +1877,7 @@ edge cases, and `pollDelayMs` backoff bounds. Full BNB suite: `npx vitest run te`node --check`/`eslint` clean on every new/changed file (0 errors; a handful of expected`no-console` warnings in the throwaway proof script).-**REAL anvil-fork browser E2E proof** (`scripts/tmp-verify-vault-ui.mjs`, reproducible — see+**REAL anvil-fork browser E2E proof** (`scripts/verify-vault-ui.mjs`, reproducible — see`docs/bnb-vault.md`#4). Not a reimplementation: drives the actual `pages/vault.html`/`src/vault.js`in a real headless Chromium (Playwright) against the actual running `server/index.mjs` API server(booted in-process so it shares the in-memory KV index with the proof's setup step) and a realdiff --git a/scripts/scratch-verify-dictation-create-prompt.mjs b/scripts/scratch-verify-dictation-create-prompt.mjsdeleted file mode 100644index 70339da53..000000000--- a/scripts/scratch-verify-dictation-create-prompt.mjs+++ /dev/null@@ -1,30 +0,0 @@-// Throwaway verification: confirms the voice dictation mic mounts on-// /create/prompt (avatar-from-text) without breaking the existing composer.-import { chromium } from 'playwright';--const BASE = process.env.BASE_URL || 'http://localhost:3000';-const browser = await chromium.launch();-const page = await browser.newPage();-const errors = [];-page.on('pageerror', (e) => errors.push(String(e)));-page.on('console', (m) => {- if (m.type() === 'error' && !/WebSocket|favicon/i.test(m.text())) errors.push(m.text());-});--await page.goto(`${BASE}/create/prompt`, { waitUntil: 'networkidle' });-await page.waitForTimeout(600);--const micCount = await page.locator('#prompt-dictate-slot .pd-mic').count();-console.log(`mic mounted on /create/prompt: ${micCount > 0}`);--// The pre-existing composer still works: typing enables the Generate button's-// disabled state to flip (existing behavior, must survive the change).-await page.fill('#prompt', 'a friendly robot mascot, glossy white shell');-await page.waitForTimeout(200);-const disabled = await page.locator('#generate-btn').isDisabled();-console.log(`generate button enabled after typing (existing flow intact): ${!disabled}`);--console.log(`console errors: ${errors.length ? errors.join(' | ') : 'none'}`);--await browser.close();-if (micCount === 0 || disabled || errors.length) process.exit(1);diff --git a/scripts/scratch-verify-input-modalities.mjs b/scripts/scratch-verify-input-modalities.mjsdeleted file mode 100644index 8d72bb347..000000000--- a/scripts/scratch-verify-input-modalities.mjs+++ /dev/null@@ -1,105 +0,0 @@-// One-off Playwright verification for prompts/roadmap/07-new-input-modalities.md.-// Drives the real forge-studio page in a headless browser: draws on the new-// sketch canvas, uploads it as a reference view, checks the voice dictation-// mic renders and is wired, and confirms the sketch-pane draw button too.-// Not committed as a permanent test — throwaway verification script per-// CLAUDE.md repo hygiene (scripts/ or delete when done).-import { chromium } from 'playwright';--const BASE = process.env.BASE_URL || 'http://localhost:3000';-const results = [];--function log(name, ok, detail) {- results.push({ name, ok, detail });- console.log(`${ok ? 'PASS' : 'FAIL'} ${name}${detail ? ' — ' + detail : ''}`);-}--const browser = await chromium.launch();-const page = await browser.newPage({ viewport: { width: 1400, height: 1000 } });-const consoleErrors = [];-page.on('console', (msg) => {- if (msg.type() === 'error') consoleErrors.push(msg.text());-});-page.on('pageerror', (err) => consoleErrors.push(String(err)));--await page.goto(`${BASE}/forge-studio`, { waitUntil: 'networkidle' });--// Switch to the Image / multi-view tab.-await page.click('button[data-mode="image"]');-await page.waitForSelector('#image-pane:not(.is-hidden)');-log('image mode selectable', true);--// The new "Or draw it instead" CTA exists and is visible in the live Image pane.-const drawBtn = page.locator('#draw-view-btn');-await drawBtn.waitFor({ state: 'visible', timeout: 5000 });-log('draw CTA visible in image pane', await drawBtn.isVisible());--// Open the sketch canvas modal.-await drawBtn.click();-await page.waitForSelector('.sk-panel', { state: 'visible', timeout: 5000 });-log('sketch canvas modal opens', true);--// "Use sketch" starts disabled (empty canvas).-const useBtn = page.locator('[data-sk-done]');-const initiallyDisabled = await useBtn.isDisabled();-log('Use-sketch starts disabled on empty canvas', initiallyDisabled);--// Draw a simple freehand shape via real pointer events on the canvas.-const canvas = page.locator('.sk-canvas');-const box = await canvas.boundingBox();-const cx = box.x + box.width / 2;-const cy = box.y + box.height / 2;-await page.mouse.move(cx - 120, cy - 80);-await page.mouse.down();-for (let i = 0; i <= 20; i++) {- const t = i / 20;- await page.mouse.move(cx - 120 + t * 240, cy - 80 + Math.sin(t * Math.PI * 2) * 100);-}-await page.mouse.up();--const enabledAfterDraw = await useBtn.isEnabled();-log('Use-sketch enables after drawing a stroke', enabledAfterDraw);--// Undo should be enabled too now.-log('Undo enabled after a stroke', await page.locator('[data-sk-undo]').isEnabled());--// Commit the sketch — this uploads via /api/forge-upload and fills a view slot.-const uploadReq = page.waitForResponse((r) => r.url().includes('/api/forge-upload'), { timeout: 15000 });-await useBtn.click();-const uploadRes = await uploadReq;-log('sketch PNG presigned via /api/forge-upload', uploadRes.ok(), `status ${uploadRes.status()}`);-const uploadJson = await uploadRes.json().catch(() => ({}));--await page.waitForSelector('.view-slot[data-state="uploaded"]', { timeout: 20000 });-log('drawn sketch lands as an uploaded reference view', true);-if (uploadJson.public_url) {- console.log(`SKETCH_PUBLIC_URL=${uploadJson.public_url}`);-}--// Voice dictation mic: renders (browser SpeechRecognition or Riva probe present-// in this Chromium build) next to the text prompt.-await page.click('button[data-mode="text"]');-await page.waitForSelector('#text-pane:not(.is-hidden)');-await page.waitForTimeout(500); // let the async Riva probe settle if SR is absent-const micCount = await page.locator('#prompt-dictate-slot .pd-mic').count();-log('voice dictation mic mounts on the text prompt (browser SR or Riva probe)', micCount > 0 || true, `mic present: ${micCount > 0}`);--// No console errors from our new modules.-const relevantErrors = consoleErrors.filter((e) => !/favicon|ResizeObserver/i.test(e));-log('no console errors from the new modules', relevantErrors.length === 0, relevantErrors.slice(0, 5).join(' | '));--await page.screenshot({ path: 'prompts/roadmap/_generated/07/forge-studio-image-pane-with-drawn-sketch.png', fullPage: false });--// Sketch pane (TripoSG-gated tab) draw button — verify wiring even though the-// tab itself is hidden pending the TripoSG worker deploy (see gate report).-const sketchTabHidden = await page.locator('button[data-mode="sketch"]').isHidden();-log('dedicated Sketch tab hidden pending TripoSG worker (expected)', sketchTabHidden);--await browser.close();--const failed = results.filter((r) => !r.ok);-console.log(`\n${results.length - failed.length}/${results.length} checks passed.`);-if (failed.length) {- console.error('FAILED:', failed.map((f) => f.name).join(', '));- process.exit(1);-}diff --git a/scripts/tmp-audit-ledger.mjs b/scripts/tmp-audit-ledger.mjsdeleted file mode 100644index 954500e76..000000000--- a/scripts/tmp-audit-ledger.mjs+++ /dev/null@@ -1,9 +0,0 @@-import { neon } from '@neondatabase/serverless';-const sql = neon(process.env.DATABASE_URL);-const byErr = await sql`- select coalesce(last_error,'(none)') e, count(*)::int n, max(attempts) max_att- from avatar_thumbnail_backfill group by e order by n desc limit 10`;-console.table(byErr.map(r=>({error:r.e.slice(0,46), rows:r.n, max_attempts:r.max_att})));-const [tot] = await sql`select count(*)::int n from avatar_thumbnail_backfill`;-const [ret] = await sql`select count(*)::int n from avatar_thumbnail_backfill where attempts>=3`;-console.log('ledger rows:', tot.n, '| retired (attempts>=3):', ret.n);diff --git a/scripts/tmp-cover.mjs b/scripts/tmp-cover.mjsdeleted file mode 100644index fcb9c3a2b..000000000--- a/scripts/tmp-cover.mjs+++ /dev/null@@ -1,28 +0,0 @@-import { neon } from '@neondatabase/serverless';-const sql = neon(process.env.DATABASE_URL);-const MISSING = sql`thumbnail_key is null or thumbnail_key ~ '^https?://'`;-const [tot] = await sql`select count(*)::int n from avatars where visibility='public' and deleted_at is null and storage_key is not null and (thumbnail_key is null or thumbnail_key ~ '^https?://')`;-console.log('total missing:', tot.n);--const [fc] = await sql`- select count(*)::int n from avatars a- join forge_creations f on f.id = (a.source_meta->>'forge_creation_id')::uuid- where a.visibility='public' and a.deleted_at is null and a.storage_key is not null- and (a.thumbnail_key is null or a.thumbnail_key ~ '^https?://')- and f.preview_image_url is not null`;-console.log(' covered by forge_creations.preview_image_url:', fc.n);--const [cl] = await sql`- select count(*)::int n from avatars a- join avatars s on s.id = (a.source_meta->>'cloned_from')::uuid- where a.visibility='public' and a.deleted_at is null and a.storage_key is not null- and (a.thumbnail_key is null or a.thumbnail_key ~ '^https?://')- and s.thumbnail_key is not null and s.thumbnail_key !~ '^https?://'`;-console.log(' covered by cloned_from source thumbnail:', cl.n);--// what preview_image_url extensions look like-const ext = await sql`- select right(f.preview_image_url, 5) e, count(*)::int n from avatars a- join forge_creations f on f.id = (a.source_meta->>'forge_creation_id')::uuid- where f.preview_image_url is not null group by e order by n desc limit 6`;-console.log('\npreview_image_url suffixes:'); console.table(ext);diff --git a/scripts/tmp-debug-boot.mjs b/scripts/tmp-debug-boot.mjsdeleted file mode 100644index 89e26d22b..000000000--- a/scripts/tmp-debug-boot.mjs+++ /dev/null@@ -1,25 +0,0 @@-import { chromium } from 'playwright';-const BASE = 'http://localhost:3004';-const WS = 'ws://localhost:2578';-const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';-const URL = `${BASE}/play?coin=${THREE_MINT}&name=three.ws&symbol=three`;-const browser = await chromium.launch({ headless: true });-const page = await browser.newPage();-page.on('console', (m) => console.log('[console]', m.type(), m.text()));-page.on('pageerror', (e) => console.log('[pageerror]', e.message));-page.on('requestfailed', (r) => console.log('[reqfail]', r.url(), r.failure()?.errorText));-await page.addInitScript((ws) => { window.GAME_SERVER_URL = ws; }, WS);-console.log('navigating to', URL);-await page.goto(URL, { waitUntil: 'load', timeout: 60000 });-console.log('loaded, waiting 12s for boot...');-await page.waitForTimeout(12000);-const state = await page.evaluate(() => ({- hasCC: !!window.__CC__,- phase: window.__CC__?.phase,- sessionId: window.__CC__?.net?.sessionId,- physicsOk: window.__CC__?._physicsOk,- netStatus: window.__CC__?.net?.status,-}));-console.log('state:', JSON.stringify(state));-await page.screenshot({ path: '/tmp/claude-1000/-workspaces-three-ws/3af649c2-981d-4e27-bcc7-a1b386bdb681/scratchpad/debug-boot.png', fullPage: true });-await browser.close();diff --git a/scripts/tmp-debug-boot2.mjs b/scripts/tmp-debug-boot2.mjsdeleted file mode 100644index 7847977e1..000000000--- a/scripts/tmp-debug-boot2.mjs+++ /dev/null@@ -1,29 +0,0 @@-import { chromium } from 'playwright';-const BASE = 'http://localhost:3004';-const WS = 'ws://localhost:2578';-const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';-const URL = `${BASE}/play?coin=${THREE_MINT}&name=three.ws&symbol=three`;-const browser = await chromium.launch({ headless: true });-const page = await browser.newPage();-page.on('console', (m) => { if (m.type()==='error') console.log('[console]', m.type(), m.text()); });-page.on('requestfailed', (r) => console.log('[reqfail]', r.url(), r.failure()?.errorText));-await page.addInitScript((ws) => { window.GAME_SERVER_URL = ws; }, WS);-await page.goto(URL, { waitUntil: 'load', timeout: 60000 });-for (let i = 0; i < 12; i++) {- await page.waitForTimeout(5000);- const state = await page.evaluate(() => {- const cc = window.__CC__;- return {- phase: cc?.phase,- hasNet: !!cc?.net,- netStatus: cc?.net?.status,- sessionId: cc?.net?.sessionId,- playPass: cc?.playPass ? 'set' : 'empty',- playReadyPending: cc?._playReady ? 'promise-present' : 'none',- };- });- console.log(i, JSON.stringify(state));- if (state.phase === 'world') break;-}-await page.screenshot({ path: '/tmp/claude-1000/-workspaces-three-ws/3af649c2-981d-4e27-bcc7-a1b386bdb681/scratchpad/debug-boot2.png', fullPage: true });-await browser.close();diff --git a/scripts/tmp-debug-w08.mjs b/scripts/tmp-debug-w08.mjsdeleted file mode 100644index aabfbe41d..000000000--- a/scripts/tmp-debug-w08.mjs+++ /dev/null@@ -1,73 +0,0 @@-import { chromium } from 'playwright';-import { spawn } from 'node:child_process';-import net from 'node:net';--const VITE_PORT = 3034;-const WS_PORT = 2599;-const BASE = `http://localhost:${VITE_PORT}`;-const WS = `ws://localhost:${WS_PORT}`;-const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';-const URL = `${BASE}/play?coin=${THREE_MINT}&name=three.ws&symbol=three`;--function waitForPort(port, timeout = 60000) {- return new Promise((resolve, reject) => {- const start = Date.now();- (function attempt() {- const sock = net.createConnection({ port, host: '127.0.0.1' });- sock.once('connect', () => { sock.end(); resolve(); });- sock.once('error', () => {- sock.destroy();- if (Date.now() - start > timeout) reject(new Error(`port ${port} never opened`));- else setTimeout(attempt, 400);- });- })();- });-}--async function main() {- const room = spawn('node', ['src/index.js'], {- cwd: '/workspaces/three.ws/multiplayer',- env: { ...process.env, PORT: String(WS_PORT), ALLOWED_ORIGINS: BASE },- stdio: ['ignore', 'pipe', 'pipe'],- });- room.stdout.on('data', (d) => process.stdout.write(`[room] ${d}`));- room.stderr.on('data', (d) => process.stderr.write(`[room:err] ${d}`));- await waitForPort(WS_PORT, 30000);- console.log('room up');-- const vite = spawn('/workspaces/three.ws/node_modules/.bin/vite', ['--port', String(VITE_PORT), '--strictPort'], {- cwd: '/workspaces/three.ws',- stdio: ['ignore', 'pipe', 'pipe'],- });- vite.stdout.on('data', (d) => process.stdout.write(`[vite] ${d}`));- vite.stderr.on('data', (d) => process.stderr.write(`[vite:err] ${d}`));- await waitForPort(VITE_PORT, 60000);- console.log('vite up');-- const browser = await chromium.launch({ headless: true, args: ['--disable-dev-shm-usage'] });- const page = await browser.newPage();- page.on('console', (msg) => console.log(`[console:${msg.type()}]`, msg.text()));- page.on('pageerror', (err) => console.log('[pageerror]', err.message, err.stack));- page.on('requestfailed', (req) => console.log('[requestfailed]', req.url(), req.failure()?.errorText));- await page.addInitScript((ws) => { window.GAME_SERVER_URL = ws; }, WS);-- await page.goto(URL, { waitUntil: 'domcontentloaded' });- const start = Date.now();- while (Date.now() - start < 90000) {- const phase = await page.evaluate(() => window.__CC__?.phase).catch(() => null);- if (phase === 'world') break;- await page.waitForTimeout(1000);- }- await page.waitForTimeout(3000);-- const npcs = await page.evaluate(() => (window.__CC__?.worldLife?.npcs || []).map((n) => n.id)).catch((e) => `EVAL ERROR: ${e.message}`);- console.log('NPC IDS:', JSON.stringify(npcs));-- const phase = await page.evaluate(() => window.__CC__?.phase).catch(() => 'n/a');- console.log('phase:', phase);-- await browser.close();- room.kill('SIGKILL');- vite.kill('SIGKILL');-}-main().catch((e) => { console.error('FATAL', e); process.exit(1); });diff --git a/scripts/tmp-debug-w08b.mjs b/scripts/tmp-debug-w08b.mjsdeleted file mode 100644index 9022f406e..000000000--- a/scripts/tmp-debug-w08b.mjs+++ /dev/null@@ -1,145 +0,0 @@-import { chromium } from 'playwright';-import { spawn } from 'node:child_process';-import net from 'node:net';--const VITE_PORT = 3035;-const WS_PORT = 2600;-const BASE = `http://localhost:${VITE_PORT}`;-const WS = `ws://localhost:${WS_PORT}`;-const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';-const URL = `${BASE}/play?coin=${THREE_MINT}&name=three.ws&symbol=three`;--function waitForPort(port, timeout = 60000) {- return new Promise((resolve, reject) => {- const start = Date.now();- (function attempt() {- const sock = net.createConnection({ port, host: '127.0.0.1' });- sock.once('connect', () => { sock.end(); resolve(); });- sock.once('error', () => {- sock.destroy();- if (Date.now() - start > timeout) reject(new Error(`port ${port} never opened`));- else setTimeout(attempt, 400);- });- })();- });-}--async function main() {- const room = spawn('node', ['src/index.js'], {- cwd: '/workspaces/three.ws/multiplayer',- env: { ...process.env, PORT: String(WS_PORT), ALLOWED_ORIGINS: BASE },- stdio: ['ignore', 'pipe', 'pipe'],- });- room.stderr.on('data', (d) => process.stderr.write(`[room:err] ${d}`));- await waitForPort(WS_PORT, 30000);-- const vite = spawn('/workspaces/three.ws/node_modules/.bin/vite', ['--port', String(VITE_PORT), '--strictPort'], {- cwd: '/workspaces/three.ws',- stdio: ['ignore', 'pipe', 'pipe'],- });- await waitForPort(VITE_PORT, 60000);-- const browser = await chromium.launch({ headless: true, args: ['--disable-dev-shm-usage'] });- const page = await browser.newPage();- page.on('console', (msg) => { if (msg.type() === 'error') console.log(`[console:error]`, msg.text()); });- page.on('pageerror', (err) => console.log('[pageerror]', err.message));- await page.addInitScript((ws) => { window.GAME_SERVER_URL = ws; }, WS);-- await page.goto(URL, { waitUntil: 'domcontentloaded' });- const start = Date.now();- while (Date.now() - start < 90000) {- const phase = await page.evaluate(() => window.__CC__?.phase).catch(() => null);- if (phase === 'world') break;- await page.waitForTimeout(1000);- }- await page.waitForTimeout(2000);-- // Teleport the local player position right next to Foreman Dell (26,-6) AND- // call interact() in the SAME evaluate() round-trip — localPos is driven by- // the physics loop every animation frame, so a manual mutation made in one- // evaluate() call gets snapped back before a second, separate evaluate()- // call can read it. Doing both atomically avoids that race.- const result = await page.evaluate(() => {- const cc = window.__CC__;- const out = { hasWorldLife: !!cc.worldLife, hasNet: !!cc.net };- try {- cc.localPos.x = 27; cc.localPos.z = -6;- const npc = cc.worldLife._nearestNpc(cc.localPos);- out.nearestNpcId = npc ? npc.id : null;- const nearest = cc.worldLife._nearestInteractable(cc.localPos);- out.nearestInteractable = nearest ? nearest.kind + ':' + (nearest.npc ? nearest.npc.id : nearest.zone?.id) : null;- out.interactResult = cc.worldLife.interact();- out.posAfter = { x: cc.localPos.x, z: cc.localPos.z };- } catch (e) { out.error1 = e.message + '\n' + e.stack; }- return out;- });- console.log('ATOMIC RESULT:', JSON.stringify(result, null, 2));- await page.waitForTimeout(500);- const result2 = await page.evaluate(() => {- const cc = window.__CC__;- return { posNow: { x: cc.localPos.x, z: cc.localPos.z } };- });- console.log('POS 500ms LATER (physics loop check):', JSON.stringify(result2));-- await page.waitForTimeout(2000);- const panelPresent = await page.evaluate(() => !!document.querySelector('.ec-overlay .ec-title'));- const panelTitle = await page.evaluate(() => document.querySelector('.ec-overlay .ec-title')?.textContent);- console.log('panel present:', panelPresent, 'title:', panelTitle);-- const directCall = await page.evaluate(async () => {- const cc = window.__CC__;- try {- const mod = await import('/src/game/quests-ui.js');- return { importOk: true, hasOpenQuestsPanel: typeof mod.openQuestsPanel === 'function' };- } catch (e) { return { importOk: false, error: e.message + '\n' + (e.stack || '') }; }- });- console.log('DIRECT IMPORT TEST:', JSON.stringify(directCall, null, 2));-- const directToggle = await page.evaluate(async () => {- const cc = window.__CC__;- try {- await cc._toggleQuests('harbor-courier');- return { ok: true };- } catch (e) { return { ok: false, error: e.message + '\n' + (e.stack || '') }; }- });- console.log('DIRECT _toggleQuests TEST:', JSON.stringify(directToggle, null, 2));- await page.waitForTimeout(500);- const panelPresent2 = await page.evaluate(() => !!document.querySelector('.ec-overlay .ec-title'));- console.log('panel present after direct toggle:', panelPresent2);-- const manualOnInteract = await page.evaluate(() => {- const cc = window.__CC__;- const npc = cc.worldLife.npcs.find((n) => n.id === 'npc-quest-foreman');- if (!npc) return { found: false };- const out = { found: true, hasOnInteract: typeof npc.def.onInteract === 'function' };- try {- npc.def.onInteract({ npc, player: cc.localPos, ui: cc.ui, net: cc.net, world: cc.worldLife.world });- out.calledOk = true;- } catch (e) { out.calledOk = false; out.error = e.message + '\n' + (e.stack || ''); }- return out;- });- console.log('MANUAL onInteract CALL:', JSON.stringify(manualOnInteract, null, 2));- await page.waitForTimeout(500);- const panelPresent3 = await page.evaluate(() => !!document.querySelector('.ec-overlay .ec-title'));- console.log('panel present after manual onInteract:', panelPresent3);-- const wrapperCall = await page.evaluate(() => {- const cc = window.__CC__;- const npc = cc.worldLife.npcs.find((n) => n.id === 'npc-quest-foreman');- const out = {};- try {- npc.interact({ player: cc.localPos, ui: cc.ui, net: cc.net, world: cc.worldLife.world });- out.calledOk = true;- } catch (e) { out.calledOk = false; out.error = e.message + '\n' + (e.stack || ''); }- return out;- });- console.log('npc.interact() WRAPPER CALL:', JSON.stringify(wrapperCall, null, 2));- await page.waitForTimeout(500);- const panelPresent4 = await page.evaluate(() => !!document.querySelector('.ec-overlay .ec-title'));- console.log('panel present after npc.interact() wrapper call:', panelPresent4);-- await browser.close();- room.kill('SIGKILL');- vite.kill('SIGKILL');-}-main().catch((e) => { console.error('FATAL', e); process.exit(1); });diff --git a/scripts/tmp-fc.mjs b/scripts/tmp-fc.mjsdeleted file mode 100644index a6246e252..000000000--- a/scripts/tmp-fc.mjs+++ /dev/null@@ -1,15 +0,0 @@-import { neon } from '@neondatabase/serverless';-const sql = neon(process.env.DATABASE_URL);-const c = await sql`select column_name from information_schema.columns where table_name='forge_creations' order by ordinal_position`;-console.log('forge_creations cols:', c.map(x=>x.column_name).join(', '));-const [a] = await sql`select count(*)::int n from forge_creations where preview_key is not null`;-const [b] = await sql`select count(*)::int n from forge_creations where preview_image_url is not null`;-console.log('fc with preview_key:', a.n, '| with preview_image_url:', b.n);-const [cov] = await sql`- select count(*)::int n from avatars a- join forge_creations f on f.id=(a.source_meta->>'forge_creation_id')::uuid- where a.visibility='public' and a.deleted_at is null and a.thumbnail_key is null- and f.preview_key is not null`;-console.log('missing-thumb avatars adoptable via fc.preview_key:', cov.n);-const s = await sql`select preview_key, preview_image_url from forge_creations where preview_key is not null limit 2`;-s.forEach(r=>console.log(' key:', r.preview_key, '\n url:', r.preview_image_url));diff --git a/scripts/tmp-meta.mjs b/scripts/tmp-meta.mjsdeleted file mode 100644index 7a1035974..000000000--- a/scripts/tmp-meta.mjs+++ /dev/null@@ -1,9 +0,0 @@-import { neon } from '@neondatabase/serverless';-const sql = neon(process.env.DATABASE_URL);-for (const s of ['forge','studio']) {- const rows = await sql`select id, source_meta, storage_key from avatars where source=${s} and visibility='public' and deleted_at is null and thumbnail_key is null limit 3`;- console.log(`\n=== source=${s} ===`);- rows.forEach(r=>console.log(' meta:', JSON.stringify(r.source_meta), '\n storage_key:', r.storage_key));-}-const t = await sql`select table_name from information_schema.tables where table_name like '%forge%'`;-console.log('\nforge tables:', t.map(x=>x.table_name).join(', '));diff --git a/scripts/tmp-render-test.mjs b/scripts/tmp-render-test.mjsdeleted file mode 100644index 35e3a18b0..000000000--- a/scripts/tmp-render-test.mjs+++ /dev/null@@ -1,10 +0,0 @@-import { renderGlbToPng } from '../api/_lib/render-glb.js';-const t0 = Date.now();-try {- const png = await renderGlbToPng({- glbUrl: 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/c96c2caf-3c36-4077-93cc-0019320577f3.glb',- width: 768, height: 768, background: '#0a0a0a',- });- console.log('OK bytes=', png.length, 'ms=', Date.now()-t0, 'png?', png.subarray(0,4).toString('hex'));-} catch (e) { console.log('FAIL:', e.message); }-process.exit(0);diff --git a/scripts/tmp-schema.mjs b/scripts/tmp-schema.mjsdeleted file mode 100644index 357e7c7eb..000000000--- a/scripts/tmp-schema.mjs+++ /dev/null@@ -1,6 +0,0 @@-import { neon } from '@neondatabase/serverless';-const sql = neon(process.env.DATABASE_URL);-const cols = await sql`select column_name, data_type from information_schema.columns where table_name='avatars' order by ordinal_position`;-console.log('avatars cols:', cols.map(c=>c.column_name).join(', '));-const src = await sql`select source, count(*)::int n from avatars where visibility='public' and deleted_at is null and storage_key is not null and (thumbnail_key is null or thumbnail_key ~ '^https?://') group by source order by n desc`;-console.log('\nmissing-thumb avatars by source:'); console.table(src);diff --git a/scripts/tmp-verify-schema.mjs b/scripts/tmp-verify-schema.mjsdeleted file mode 100644index b83558bea..000000000--- a/scripts/tmp-verify-schema.mjs+++ /dev/null@@ -1,6 +0,0 @@-import { neon } from '@neondatabase/serverless';-const sql = neon(process.env.DATABASE_URL);-const t = await sql`select to_regclass('public.avatar_thumbnail_backfill') as t`;-console.log('table avatar_thumbnail_backfill:', t[0].t || 'MISSING');-const idx = await sql`select indexname from pg_indexes where tablename in ('avatar_thumbnail_backfill','avatars') and indexname like '%thumbnail%'`;-console.log('indexes:', idx.map(i=>i.indexname).join(', ') || 'none');diff --git a/scripts/tmp-verify-vault-ui.mjs b/scripts/verify-vault-ui.mjssimilarity index 98%rename from scripts/tmp-verify-vault-ui.mjsrename to scripts/verify-vault-ui.mjsindex f02a1c20f..15e2aaf28 100644--- a/scripts/tmp-verify-vault-ui.mjs+++ b/scripts/verify-vault-ui.mjs@@ -4,8 +4,8 @@// technique prompt 11 established, extended here to drive the REAL running// HTTP endpoints (api/vault/*) and a REAL headless browser (Playwright)// through the REAL page (pages/vault.html + src/vault.js), not a-// reimplementation of either. Throwaway verification script — not committed-// product code, deleted after use per CLAUDE.md repo-hygiene rules.+// reimplementation of either. Kept as the reproducible E2E proof referenced+// by docs/bnb-vault.md; re-run it after touching the vault stack.//// What this proves for real:// - GET /api/vault/list resolves a real on-chain Listed event to a card.@@ -159,7 +159,7 @@ async function main() {process.env.BNB_VAULT_RPC_OVERRIDE_TESTNET = ANVIL_RPC;process.env.GREENFIELD_VAULT_BUCKET_TESTNET = 'three-ws-vault-testnet';process.env.GREENFIELD_SP_OVERRIDE_TESTNET = `http://${SP_HOST}:${SP_PORT}`;- process.env.JWT_SECRET = process.env.JWT_SECRET || 'tmp-verify-vault-ui-secret-not-for-prod';+ process.env.JWT_SECRET = process.env.JWT_SECRET || 'verify-vault-ui-secret-not-for-prod';process.env.PORT = String(API_PORT);process.env.NODE_ENV = process.env.NODE_ENV || 'development';diff --git a/scripts/tmp-verify-w02-physics-core.mjs b/scripts/verify-w02-physics-core.mjssimilarity index 100%rename from scripts/tmp-verify-w02-physics-core.mjsrename to scripts/verify-w02-physics-core.mjsdiff --git a/scripts/tmp-verify-w02-vehicles.mjs b/scripts/verify-w02-vehicles.mjssimilarity index 100%rename from scripts/tmp-verify-w02-vehicles.mjsrename to scripts/verify-w02-vehicles.mjsdiff --git a/scripts/tmp-verify-w03-boutique.mjs b/scripts/verify-w03-boutique.mjssimilarity index 100%rename from scripts/tmp-verify-w03-boutique.mjsrename to scripts/verify-w03-boutique.mjsdiff --git a/scripts/tmp-verify-w04-boutique-setup.mjs b/scripts/verify-w04-boutique-setup.mjssimilarity index 100%rename from scripts/tmp-verify-w04-boutique-setup.mjsrename to scripts/verify-w04-boutique-setup.mjsdiff --git a/scripts/tmp-verify-w04-boutique.mjs b/scripts/verify-w04-boutique.mjssimilarity index 98%rename from scripts/tmp-verify-w04-boutique.mjsrename to scripts/verify-w04-boutique.mjsindex 161b44b96..2055e9a1d 100644--- a/scripts/tmp-verify-w04-boutique.mjs+++ b/scripts/verify-w04-boutique.mjs@@ -2,7 +2,7 @@// Chromium browser against a real Vite dev server, a real, freshly-started// Colyseus WalkRoom wired to real game-token.js settlement, and a real local// Solana validator (the actual SVM + SPL-token program + RPC — see-// scripts/tmp-verify-w04-boutique-setup.mjs for why local instead of the+// scripts/verify-w04-boutique-setup.mjs for why local instead of the// public devnet faucet). Nothing here is simulated: a real ed25519 signature// from a real Keypair, a real broadcast transaction, a real confirmed// transaction the server re-reads from RPC before granting anything.@@ -14,8 +14,8 @@// and exercise the production code paths verbatim (boutique-purchase.js,// WalkRoom._handleBoutiqueQuote/_handleBoutiqueSettle, game-token.js).//-// Usage: node scripts/tmp-verify-w04-boutique-setup.mjs (once, writes the fixture)-// node scripts/tmp-verify-w04-boutique.mjs+// Usage: node scripts/verify-w04-boutique-setup.mjs (once, writes the fixture)+// node scripts/verify-w04-boutique.mjsimport { chromium } from 'playwright';import { Connection, Keypair, Transaction, PublicKey } from '@solana/web3.js';diff --git a/scripts/tmp-verify-w04-economy.mjs b/scripts/verify-w04-economy.mjssimilarity index 99%rename from scripts/tmp-verify-w04-economy.mjsrename to scripts/verify-w04-economy.mjsindex 38475b9f5..29c7e60dd 100644--- a/scripts/tmp-verify-w04-economy.mjs+++ b/scripts/verify-w04-economy.mjs@@ -11,7 +11,7 @@// (CLAUDE.md "known traps" — load average routinely far exceeds core count),// which starves headless Chromium's frame rate well below a normal machine's;// every wall-clock budget below is widened accordingly (mirrors-// scripts/tmp-verify-w02-vehicles.mjs). That affects wall-clock only, never+// scripts/verify-w02-vehicles.mjs). That affects wall-clock only, never// the pass/fail economy assertions.import { chromium } from 'playwright';@@ -92,7 +92,7 @@ function isBenignSandboxNoise(text) {// x402-pay?feed=… is the site-wide live-payments ticker, unrelated to the// economy under test; this dev Vite instance has no x402-pay API proxy// target running, so it 500s/502s on every poll (same root cause noted in- // tmp-verify-w02-vehicles.mjs — "the local x402-pay API proxy target not+ // verify-w02-vehicles.mjs — "the local x402-pay API proxy target not// running in this dev session").return /favicon|WebGL.*SwiftShader|Autoplay|r2\.dev|\[vite\]|502 \(Bad Gateway\)|500 \(Internal Server Error\)|401 \(Unauthorized\)|402 \(Payment Required\)|GPU stall|GL Driver Message|app\.github\.dev|WebSocket closed without opened|deprecated parameters for the initialization function|AnimationManager.*failed to load|npc-zauth|429 \(Too Many Requests\)|ERR_CONNECTION_REFUSED|ERR_FAILED|agents\?limit|x402-pay/i.test(text);}diff --git a/scripts/tmp-verify-w07-combat.mjs b/scripts/verify-w07-combat.mjssimilarity index 99%rename from scripts/tmp-verify-w07-combat.mjsrename to scripts/verify-w07-combat.mjsindex d7eb9d789..98f1ec84c 100644--- a/scripts/tmp-verify-w07-combat.mjs+++ b/scripts/verify-w07-combat.mjs@@ -19,7 +19,7 @@// This box runs many concurrent agent build/dev/test processes (CLAUDE.md// "known traps" — load average routinely exceeds core count), which starves// headless Chromium's frame rate; wall-clock budgets below are widened-// accordingly, mirroring tmp-verify-w02-vehicles.mjs / tmp-verify-w04-economy.mjs.+// accordingly, mirroring verify-w02-vehicles.mjs / verify-w04-economy.mjs.// That affects wall-clock only, never the pass/fail combat assertions.import { chromium } from 'playwright';@@ -85,7 +85,7 @@ function attachConsole(page, issues, tag) {}// Real WASD-driven walk toward a world point, steering camYaw each beat —-// identical technique to tmp-verify-w04-economy.mjs's walkTo (keyboard hold+// identical technique to verify-w04-economy.mjs's walkTo (keyboard hold// under heavy sandbox load is more reliable than Playwright's own click/drag// actionability checks, and it's still the REAL movement + physics + netcode// path, just driven externally).diff --git a/scripts/tmp-verify-w08-quests.mjs b/scripts/verify-w08-quests.mjssimilarity index 99%rename from scripts/tmp-verify-w08-quests.mjsrename to scripts/verify-w08-quests.mjsindex 646aa7134..fe11c6f95 100644--- a/scripts/tmp-verify-w08-quests.mjs+++ b/scripts/verify-w08-quests.mjs@@ -10,7 +10,7 @@// client-claimed), and finishing the mission pays out a real cash reward with// a toast. This box runs many concurrent agent build/dev/test processes// (CLAUDE.md "known traps"), so wall-clock budgets below are generous, mirroring-// scripts/tmp-verify-w04-economy.mjs and tmp-verify-w02-vehicles.mjs.+// scripts/verify-w04-economy.mjs and verify-w02-vehicles.mjs.import { chromium } from 'playwright';import { spawn } from 'node:child_process';