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
chore: land further in-progress platform work (concurrent session snapshot)
nirholas13c40fa51cb7
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 597e3aaaa..9faab5d1e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -40,6 +40,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Give your agent a 3D body in one call — the new Embodiment endpoint** — Any AI agent can now buy itself a real presence in a single USDC payment: POST a name plus a text description (or a reference photo) to the new Embodiment endpoint and get back a rigged, animated, talking 3D avatar, a durable persona id that reloads in any future session, and a one-tag embed snippet for any website. It's the same free generate-and-rig chain that powers the 3D Studio, packaged as one paid call — no separate rigging step, no account. Generation failures never settle, so a buyer is only ever charged for a finished body. (`/docs/embody`) `[feature]`- **Live block-speed race: watch BNB Chain confirm in ~0.45s** — A new /bnb-latency page races BNB Chain against Base, Ethereum, and Solana in real time, sampling real blocks off public RPCs every few seconds — never a hardcoded number. Each lane shows its live measured average and a rolling sparkline; a chain going quiet shows "reconnecting" instead of a frozen fake reading. (`/bnb-latency`) `[feature]`- **Markets goes deep — Screener, Categories, Exchanges, Derivatives, Converter, DeFi, Chains, Stablecoins** — Eight new tools join the Markets suite, all live data and all free. Screener filters the top 250 coins by market cap, volume, and 24h move. Categories ranks every crypto sector so you can see which narrative leads. Exchanges ranks venues by trust score and volume. Derivatives shows perpetual-futures funding, open interest, and volume. Converter turns any crypto into any major fiat at live rates. And a DeFi trio — DeFi TVL by protocol, Chains by total value locked, and Stablecoins with peg health — brings on-chain liquidity into view via DeFiLlama. Every one is cross-linked from the markets table. (`/screener`) `[feature]`+- **Minted 3D assets now carry a second, independently-signed provenance record — and remixing one pays the original creator on the spot** — Every 3D avatar generated on three.ws now gets a signed authorship record on the platform's append-only agent_actions ledger the moment it's created — the same cryptographically-verifiable trail @three-ws/provenance-mcp reads, now written automatically instead of only on request. Minting a generated GLB as a Solana NFT (mint_3d_asset) links its own signed ledger entry alongside the provenance already baked into the NFT metadata. And when a mint names another creator's asset as its parent (a remix), the original creator's royalty share now settles immediately as a real on-chain USDC transfer out of the mint fee — not just a royalty term for a future resale. Every minted 3D asset is also now listed in a public launch directory at GET /api/v1/tokenized/launches, the NFT counterpart to the existing coin-launch feed. (`/docs/mcp`) `[feature, improvement]`- **New free API: check if a wallet holds a Binance Account Bound Token (BABT)** — GET /api/bnb/babt-check?address=0x... tells you whether a BSC address holds a BABT — Binance's non-transferable, KYC-backed on-chain token. It's a real, live signal (1.16M+ holders on BSC mainnet) that developers can use as a free, no-signup uniqueness check for allowlists, anti-sybil gating, or airdrop targeting on BNB Chain. `[feature]`- **New guide: BNB Chain payments (MPP) and gasless sends** — A zero-context developer guide covering how to pay three.ws endpoints over MPP on BNB Chain, how our agents pay MPP endpoints, and how BNB Chain's block-level gas sponsorship (MegaFuel) lets a plain wallet send a transaction with zero gas — with an honest self-pay fallback for when sponsorship isn't available. Includes a wire-level bridge spec pinning how x402 and MPP map to each other. `[docs]`- **New shared DeFi utility library: one source of truth for chain and token constants across EVM and Solana** — Added @three-ws/defi-utils, a zero-dependency internal package with chain IDs, native-token symbols, common token addresses (including SPA and USDs on Arbitrum), and minimal ERC-20 ABI fragments for nine EVM chains, plus a Solana extension (SOL/USDC/$THREE mint resolution and base58 address validation). Also ships address and amount validators and USD/percent/token-amount formatters. It replaces ad hoc constant duplication across the codebase's API handlers and frontend modules going forward. `[sdk]`diff --git a/STRUCTURE.md b/STRUCTURE.mdindex e159ac9b5..3600af293 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -40,7 +40,7 @@ bottom.| Live Agents wall (mission control) | [pages/agents-live.html](pages/agents-live.html) + [src/agents-live.js](src/agents-live.js) `→ /agents-live` | In-repo · roster [api/agents/public.js](api/agents/public.js) (`sort=live`), per-agent SSE [api/agent-screen-stream.js](api/agent-screen-stream.js) | Real-time grid of every meaningful agent, ranked by most-recent on-chain/skill action (never-used placeholders suppressed). Each card streams a live caster feed when watched, else its real `agent_actions` as a terminal + an "active Nm ago" recency chip. Layers: showrunner spotlight ([src/showrunner.js](src/showrunner.js)), reputation arena ([src/agents-live-arena.js](src/agents-live-arena.js)), platform ticker ([src/theater-feed.js](src/theater-feed.js)) || X/Twitter automation toolkit | [nirholas/XActions](https://github.com/nirholas/XActions) (external repo, also on npm as `xactions`) | External | Formerly vendored in-repo; removed 2026-07-03 — install from npm or use the upstream repo || Agora — the Commons (living economy) | [pages/agora.html](pages/agora.html) + [src/agora/](src/agora) `→ /agora`, life engine [workers/agora-citizens/](workers/agora-citizens), read model [api/agora/[action].js](api/agora/[action].js) | In-repo · devnet AgenC | Watchable 3D world where agent + human citizens post, claim, work, prove and earn $THREE on-chain. **Play mode** ("Enter the Commons") makes it walkable GTA-style — your avatar walks the square among the working NPC citizens, other humans appear live over the `agora_world` Colyseus room, and walking up to a citizen (proximity → E) opens its passport: [src/agora/player-mode.js](src/agora/player-mode.js), pure math [src/agora/player-logic.js](src/agora/player-logic.js), room [multiplayer/src/rooms/AgoraRoom.js](multiplayer/src/rooms/AgoraRoom.js). **Arena** (Competitive tasks — citizens race, first valid proof wins the whole escrow) at [src/agora/arena.js](src/agora/arena.js); **Guilds** (Collaborative tasks — contributors split the reward) at [src/agora/guild.js](src/agora/guild.js), both live-driven by [api/agora/task](api/agora/[action].js). Spec: [docs/agora.md](docs/agora.md) |-| Premium vanity inventory (sell pre-ground addresses) | [public/vanity/premium/](public/vanity/premium/index.html) `→ /vanity/premium`, batch grinder [workers/vanity-grinder/](workers/vanity-grinder), store [api/_lib/vanity-inventory-store.js](api/_lib/vanity-inventory-store.js), sell [api/x402/vanity-premium.js](api/x402/vanity-premium.js) | In-repo · GCP spot CPU | Long (4–5+ char) brandable Solana addresses ground ahead of time on cheap spot CPU, sealed at rest (AES-256-GCM or GCP-KMS envelope, [api/_lib/vanity-vault.js](api/_lib/vanity-vault.js)), and sold from stock via x402 — priced by rarity ($1–$50), delivered exactly once, ciphertext destroyed on delivery. Free `vanity_premium` MCP browse tool. Runbook: [docs/gcp-credits.md](docs/gcp-credits.md) |+| Premium vanity inventory (sell pre-ground addresses) | [public/vanity/premium/](public/vanity/premium/index.html) `→ /vanity/premium`, batch grinder [workers/vanity-grinder/](workers/vanity-grinder), store [api/_lib/vanity-inventory-store.js](api/_lib/vanity-inventory-store.js), sell [api/x402/vanity-premium.js](api/x402/vanity-premium.js), replenish [api/cron/vanity-inventory-replenish.js](api/cron/vanity-inventory-replenish.js) | In-repo · GCP spot CPU | Long (4–5+ char) brandable Solana addresses ground ahead of time on cheap spot CPU, sealed at rest (AES-256-GCM or GCP-KMS envelope, [api/_lib/vanity-vault.js](api/_lib/vanity-vault.js)), and sold from stock via x402 — priced by rarity ($1–$50) on `vanity-premium`, or by fixed 4–5 char tiers ($2.50/$10) directly through [`/api/x402/vanity`](docs/vanity.md#tier-1--live-grinder) (instant delivery, `source:"inventory"`) and the [pump-launch vanity upsell](docs/pump-launcher.md) — delivered exactly once, ciphertext destroyed on delivery. An hourly cron watches stock and fires a fresh grind batch (Cloud Run Job) when low. Free `vanity_premium` MCP browse tool. Runbook: [docs/gcp-credits.md](docs/gcp-credits.md) || Embed examples | [examples/](examples) | In-repo | `embed-test.html`, `web-component.html`, `two-agents.html`, `minimal.html` || Animation pipeline | [public/animations/](public/animations) + [scripts/build-animations.mjs](scripts/build-animations.mjs) | In-repo | Mixamo source FBX + GLB retargeting pipeline · see [docs/3d-asset-pipeline.md](docs/3d-asset-pipeline.md) || Animation gallery | [pages/animations.html](pages/animations.html) + [src/animations-gallery.js](src/animations-gallery.js) | Live at `/animations` | 2,100+ clips with poster thumbnails ([scripts/build-animation-thumbnails.mjs](scripts/build-animation-thumbnails.mjs)), derived categories ([src/animation-categories.js](src/animation-categories.js)), shared live-preview engine ([src/animations-live-preview.js](src/animations-live-preview.js)) · see [docs/animations.md](docs/animations.md) |@@ -51,7 +51,7 @@ bottom.| Production server (Google Cloud Run) | [server/](server) + [Dockerfile](Dockerfile) | Live | Single Express container serving the static frontend, the vercel.json route table, and all `api/**` handlers with Vercel-parity routing; deploy via `npm run deploy:gcp` ([server/cloudbuild.yaml](server/cloudbuild.yaml)), crons via [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs) · see [server/README.md](server/README.md) || On-chain identity | [contracts/](contracts) | In-repo | Foundry-based on-chain agent identity, ERC-8004 || On-chain skill licenses | [contracts/skill-license/](contracts/skill-license) `→ /api/skills/license-onchain` | In-repo | Anchor program: each purchased skill = a 1/1 SPL NFT + `SkillLicense` PDA, a trustless alternative to DB-backed access checks. Backend: [api/_lib/skill-license-onchain.js](api/_lib/skill-license-onchain.js) |-| Tokenized 3D (mint an avatar as an NFT) | [api/_lib/tokenize-3d.js](api/_lib/tokenize-3d.js) + [api/_lib/tokenize-3d-metadata.js](api/_lib/tokenize-3d-metadata.js), MCP tools [api/_mcp/tools/tokenize.js](api/_mcp/tools/tokenize.js) (`mint_3d_asset`, `get_3d_asset_onchain`) | In-repo | Mint a generated/owned GLB as a Metaplex Core NFT whose media is a live 3D viewer (GLB under `animation_url`), with baked provenance + enforced capped royalties (10%), idempotent, devnet-default. Launch record: [tokenized_3d_assets](api/_lib/migrations/20260707120000_tokenized_3d_assets.sql). Docs: [docs/mcp.md](docs/mcp.md#mint_3d_asset). E2E: [scripts/tokenize-3d-devnet-e2e.mjs](scripts/tokenize-3d-devnet-e2e.mjs) |+| Tokenized 3D (mint an avatar as an NFT) | [api/_lib/tokenize-3d.js](api/_lib/tokenize-3d.js) + [api/_lib/tokenize-3d-metadata.js](api/_lib/tokenize-3d-metadata.js), MCP tools [api/_mcp/tools/tokenize.js](api/_mcp/tools/tokenize.js) (`mint_3d_asset`, `get_3d_asset_onchain`), signed ledger provenance [api/_lib/asset-provenance.js](api/_lib/asset-provenance.js), launch directory [api/v1/tokenized/launches.js](api/v1/tokenized/launches.js) `→ GET /api/v1/tokenized/launches` | In-repo | Mint a generated/owned GLB as a Metaplex Core NFT whose media is a live 3D viewer (GLB under `animation_url`), with baked provenance + enforced capped royalties (10%), idempotent, devnet-default. Every generated avatar AND every mint also appends an ERC-191-signed record to the `agent_actions` ledger (verifiable via `@three-ws/provenance-mcp`'s `query_action`). A mint naming `parent_mint` (a remix) routes the parent creator's royalty out of the mint fee as a real on-chain USDC transfer (mainnet, x402-collected calls only) — [api/_lib/remix-royalty.js](api/_lib/remix-royalty.js) split math, [api/_lib/remix-settlement.js](api/_lib/remix-settlement.js) payout wallet. Launch record: [tokenized_3d_assets](api/_lib/migrations/20260707120000_tokenized_3d_assets.sql) + [remix-royalty columns](api/_lib/migrations/20260708130000_tokenized_3d_remix_royalty.sql). Docs: [docs/mcp.md](docs/mcp.md#mint_3d_asset). E2E: [scripts/tokenize-3d-devnet-e2e.mjs](scripts/tokenize-3d-devnet-e2e.mjs). Tests: [tests/tokenize-3d.test.js](tests/tokenize-3d.test.js), [tests/tokenize-3d-remix-royalty.test.js](tests/tokenize-3d-remix-royalty.test.js), [tests/asset-provenance.test.js](tests/asset-provenance.test.js) || Token-gated 3D embeds (holder-only interactive scenes) | Gate config + on-chain verify [api/_lib/embed-gate.js](api/_lib/embed-gate.js), access tokens [api/_lib/embed-gate-token.js](api/_lib/embed-gate-token.js), endpoints [api/embed/gate-create.js](api/embed/gate-create.js) + [api/embed/gate-verify.js](api/embed/gate-verify.js), gate-aware resolver [api/embed/resolve.js](api/embed/resolve.js), MCP tool [api/_mcp/tools/embed.js](api/_mcp/tools/embed.js) (`create_gated_embed`), widget [public/embed/v1.js](public/embed/v1.js) (`<three-d>`) + standalone host [public/embed/v1/gated.html](public/embed/v1/gated.html) `→ /embed/v1/gated` | In-repo | `create_gated_embed(asset_id, gate)` turns an avatar or on-chain agent you own into a holder-only interactive `<three-d>` embed — visitors must prove a real, server-verified SPL balance (SIWS challenge → nonce → signature → Solana RPC read, never a client-reported number) before the live scene renders; below the bar they see a designed locked teaser + connect-wallet CTA. `mint` defaults to $THREE but is a runtime parameter (coin-agnostic plumbing). Anti-abuse: short-lived signed access tokens (auto re-verify on expiry) + per-IP/per-wallet rate limits. Storage: [embed_gates + embed_gate_nonces](api/_lib/migrations/20260708120000_embed_gates.sql). Spec: [specs/EMBED_SPEC.md](specs/EMBED_SPEC.md#token-gating). Docs: [docs/token-gated-3d-embeds.md](docs/token-gated-3d-embeds.md). Tests: [tests/embed-gate.test.js](tests/embed-gate.test.js) || Launch Studio (coin-launch use cases) | [api/_lib/launch/](api/_lib/launch) `→ /launch-studio`, [api/pump/launch-studio.js](api/pump/launch-studio.js), [public/launch-studio/launch-studio.js](public/launch-studio/launch-studio.js) | In-repo | Engine + catalog of 50 declarative launch recipes — reward coins for trending GitHub repos/creators ([github-trending.js](api/_lib/github-trending.js)) and coins riding live narratives ([launcher-trends.js](api/_lib/launcher-trends.js)). Live preview → `/launch` handoff. Docs: [docs/launch-usecases.md](docs/launch-usecases.md), [api/_lib/launch/README.md](api/_lib/launch/README.md) || Avatar Seeder control room | [pages/admin/seeder.html](pages/admin/seeder.html) + [src/admin-seeder.js](src/admin-seeder.js) `→ /admin/seeder`, backend [api/admin/seeder.js](api/admin/seeder.js) | In-repo (admin, noindex) | Arm/disarm the headless [Avaturn seed cron](api/cron/avaturn-seed-cron.js), watch live throughput + rig rate, and preview freshly-forged rigged avatars in 3D. Toggles the `avaturn_seed` runtime flag. Flags: [api/_lib/flags.js](api/_lib/flags.js) + [api/admin/flags.js](api/admin/flags.js). Docs: [docs/ops/runtime-flags.md](docs/ops/runtime-flags.md) |diff --git a/api/_lib/scene-graph-compose.js b/api/_lib/scene-graph-compose.jsindex 3c8d52e8c..0c3dd3d91 100644--- a/api/_lib/scene-graph-compose.js+++ b/api/_lib/scene-graph-compose.js@@ -109,7 +109,7 @@ export async function composeSceneGlb(dioramaInput) {};const scene = doc.createScene(diorama.title || 'Diorama');- doc.setDefaultScene(scene);+ root.setDefaultScene(scene);scene.addChild(buildGroundNode(doc, buffer, diorama));for (const light of buildLightNodes(doc, diorama)) scene.addChild(light);@@ -137,6 +137,14 @@ export async function composeSceneGlb(dioramaInput) {skipped.push({ id: obj.id, label: obj.label, reason: 'merge_failed' });continue;}+ // mergeDocuments copies every one of the source's own Scene entries into+ // the target root too. We only want its nodes (already re-parented into+ // `raw` below) — an empty leftover Scene fails glTF validation+ // (EMPTY_ENTITY) and is otherwise dead weight, so drop it right away.+ if (objScene) {+ const mergedScene = map.get(objScene);+ if (mergedScene) mergedScene.dispose();+ }const raw = doc.createNode(`${obj.label} (source)`);for (const n of mergedRoots) raw.addChild(n);diff --git a/contracts/DEPLOYMENTS.md b/contracts/DEPLOYMENTS.mdindex 90f941ae6..b79a83bd3 100644--- a/contracts/DEPLOYMENTS.md+++ b/contracts/DEPLOYMENTS.md@@ -205,18 +205,78 @@ upgradeability — `move()` never writes storage; `checkpoint()` is the onlyopt-in storage-writing call. Full design rationale in the contract NatSpec.**Status: built, compiled, and fully unit-tested locally (19/19 `forge test`-passing). NOT deployed to BSC testnet.** A `forge script ... -vvvv` dry-run-against the live BSC testnet RPC (`https://data-seed-prebsc-1-s1.bnbchain.org:8545`)-simulated successfully end-to-end (constructor executes, `COORD_MIN`/`COORD_MAX`-read back correctly, ~566k gas estimated for the deploy tx at 0.1 gwei ≈-0.0000566 BNB) — the RPC, script, and bytecode are all deploy-ready. The only-missing piece is a funded deployer key: neither `DEPLOYER_PK` nor-`BNB_TESTNET_DEPLOYER_KEY` is present in this environment (checked `.env`,-`.env.local`, and shell env; no secret values were read, only key presence).-Same funding blocker as campaign items 13 and 18 — owner-only to unblock (fund-a deployer EOA via the tBNB faucet, then run the broadcast command below).+passing). Public BSC testnet broadcast is BLOCKED on a funded deployer key**+(same root cause as campaign items 10/13/18 — no `DEPLOYER_PK` or+`BNB_TESTNET_DEPLOYER_KEY` in this environment; checked `.env`, `contracts/.env`,+`cast wallet list`, and shell env, no secret values read, only key presence;+the public tBNB faucet is reCAPTCHA-gated with no programmatic path). A+`forge script ... -vvvv` dry-run against the LIVE BSC testnet RPC+(`https://data-seed-prebsc-1-s1.bnbchain.org:8545`) simulated successfully+end-to-end 2026-07-08: constructor executes, `COORD_MIN`/`COORD_MAX` read back+correctly, 566,068 gas estimated for the deploy tx at 0.1 gwei ≈ 0.0000566068+BNB — the RPC, script, and bytecode are all deploy-ready.++**Real broadcast proof — anvil fork of LIVE BSC testnet state** (per+00-CONTEXT's decision-default table: "if every faucet fails, finish ALL code ++tests against a local `anvil --chain-id 97` fork" — the same workaround+prompts 02/03 used successfully). `anvil --chain-id 97 --fork-url+https://bsc-testnet.drpc.org` forked real BSC testnet at block `117848403`;+a fresh throwaway account (`0x5c04D686210421706E842A07e98B51396702e7AE`,+private key discarded after this run) was funded via `anvil_setBalance`, then+the REAL, unmodified `script/DeployWorldMoves.s.sol` was run with+`--broadcast` against the fork — same script, same bytecode that would run+against the public RPC, only the RPC endpoint differs:-Deploy (once funded):+```+$ forge script script/DeployWorldMoves.s.sol:DeployWorldMoves \+ --rpc-url http://127.0.0.1:8555 --private-key $THROWAWAY_PK --broadcast -vvvv+[353991] → new WorldMoves@0x71Ddcb9865632Ca3c4325dE0E4a92Cc0065c8aaE+ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.+```++- **Deploy tx:** `0x508db193ef6594c350751063657db3f9f831cb45ce590ea55f2c3759730b0710`,+ block `117848404`, status `success`.+- **Deployed address (fork-local):** `0x71Ddcb9865632Ca3c4325dE0E4a92Cc0065c8aaE`.+- **10 real `move()` transactions fired back-to-back** via `cast send`+ through the real deployed contract (not a reimplementation), each mined+ into its own block, receipts fetched independently and one full log decoded+ to confirm the exact `Moved` event shape:++ | # | tx hash | block | timestamp | gasUsed | status |+ |---|---|---|---|---|---|+ | 1 | `0xae6a706c…4a0` | 117848405 | 1783475882 | 26293 | success |+ | 2 | `0xd557c5d9…d9` | 117848406 | 1783475883 | 26293 | success |+ | 3 | `0x111b513d…a7` | 117848407 | 1783475884 | 26293 | success |+ | 4 | `0x9985f6e2…f8` | 117848408 | 1783475884 | 26293 | success |+ | 5 | `0x808f4586…f2` | 117848409 | 1783475885 | 26293 | success |+ | 6 | `0x39203f83…5d` | 117848410 | 1783475885 | 26293 | success |+ | 7 | `0x3a58b91b…d7` | 117848411 | 1783475885 | 26293 | success |+ | 8 | `0x878e042f…e8` | 117848412 | 1783475886 | 26305 | success |+ | 9 | `0xe7e9c934…be` | 117848413 | 1783475887 | 26305 | success |+ | 10 | `0x0b66bc4b…42` | 117848414 | 1783475888 | 26305 | success |++ One block minted per transaction (matches `move()`'s design goal of+ supporting one call per block); `gasUsed` is the full transaction-level+ cost (21,000 base intrinsic gas + calldata + 3-topic log), consistent with+ the `forge test` unit measurement below of ~4,800 gas of *internal+ execution* alone. Decoded log for tx `0xae6a706c…4a0` confirms the exact+ `Moved(worldId=1, player=0x5c04d686…702e7ae, x=10, y=-5, z=3, facing=36,+ blockNumber=117848405, timestamp=1783475882)` shape — every field matches+ the call args and block metadata exactly, byte-for-byte decoded from the+ real receipt, not asserted from memory.++ **Honesty note on block spacing:** these 10 blocks were mined by anvil's+ local auto-miner (one block per submitted tx, timestamps following the+ sandbox's real wall-clock as `cast send` calls executed sequentially) — this+ proves the `move()` call flow, gas cost, and event shape against real+ forked BSC-testnet EVM state, but it is NOT a measurement of BSC's live+ 0.45s block-production cadence (a local fork doesn't run BSC's validator+ set). The 0.45s claim itself is separately, already, live-proven by+ `probeBlockTime()` against the public RPC (prompt 01/19 entries above,+ reconfirmed `avgBlockTimeMs: 450` on 2026-07-08) — this WorldMoves proof and+ that block-time proof are complementary, not duplicative.++Deploy (once funded, real public broadcast):```forge script script/DeployWorldMoves.s.sol:DeployWorldMoves \--rpc-url https://data-seed-prebsc-1-s1.bnbchain.org:8545 \@@ -224,10 +284,9 @@ forge script script/DeployWorldMoves.s.sol:DeployWorldMoves \--broadcast```-After a real deploy, replace this status block with the address, deploy tx-hash, and a BscScan link, and paste ~10 real `move()` tx block numbers/-timestamps here as live proof of sub-second block spacing (per-`prompts/bnb-chain/14-world-moves-contract.md`'s definition of done).+Once a real public-testnet deploy tx exists, replace the fork-local address/tx+above with the BscScan-visible ones (same script, same bytecode — only the+`--rpc-url`/`--private-key` change).## GreenfieldVault (pay → PermissionHub grant, on-chain-gated 3D asset vault)diff --git a/data/changelog.json b/data/changelog.jsonindex 3b09aefc9..dd4ff7a8f 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,16 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-07-08",+ "title": "Minted 3D assets now carry a second, independently-signed provenance record — and remixing one pays the original creator on the spot",+ "summary": "Every 3D avatar generated on three.ws now gets a signed authorship record on the platform's append-only agent_actions ledger the moment it's created — the same cryptographically-verifiable trail @three-ws/provenance-mcp reads, now written automatically instead of only on request. Minting a generated GLB as a Solana NFT (mint_3d_asset) links its own signed ledger entry alongside the provenance already baked into the NFT metadata. And when a mint names another creator's asset as its parent (a remix), the original creator's royalty share now settles immediately as a real on-chain USDC transfer out of the mint fee — not just a royalty term for a future resale. Every minted 3D asset is also now listed in a public launch directory at GET /api/v1/tokenized/launches, the NFT counterpart to the existing coin-launch feed.",+ "tags": [+ "feature",+ "improvement"+ ],+ "link": "/docs/mcp"+ },{"date": "2026-07-08","title": "Fact Check's accuracy benchmark has a real published score, and the search+AI chain got more reliable",diff --git a/docs/mcp.md b/docs/mcp.mdindex 16acc5a61..4abc8bd38 100644--- a/docs/mcp.md+++ b/docs/mcp.md@@ -429,6 +429,10 @@ Mint a generated or owned GLB as a **Metaplex Core NFT on Solana whose media isThe call is **idempotent**: a row is claimed before any on-chain action, so a repeat call with the same arguments returns the same mint instead of minting twice. The royalty is capped at **10 %** (1000 bps) — a higher request is clamped.+**Signed provenance ledger.** Alongside the provenance baked into the NFT metadata, the mint appends an ERC-191-signed record to the platform's append-only `agent_actions` ledger — the same ledger [`@three-ws/provenance-mcp`](https://www.npmjs.com/package/@three-ws/provenance-mcp) reads and verifies (`list_agent_actions` / `query_action`). It requires the source avatar to have a provisioned agent; when it doesn't, the mint still succeeds and `provenance_ledger` in the response is `null` — never a blocking requirement. Every avatar generated through the platform (chat forge-to-avatar, direct upload, studio save) also gets this same signed ledger entry the moment its agent is provisioned, independent of ever being minted.++**Remix royalty settlement.** When `parent_mint` names another creator's tokenized asset (this mint is a derivative), the parent creator's royalty share — using the rate set on their own mint — is routed out of **this mint's fee** as a real on-chain USDC transfer, the moment the mint confirms. Mainnet only, and only when the mint fee was actually collected via x402 (an OAuth-bypassed call has nothing to split). Every outcome is reported honestly in `remix_royalty.reason` (`no_creator_wallet`, `below_dust_floor`, `payout_unconfigured`, `devnet_not_settled`, `no_fee_collected`, `parent_not_found`) rather than a fabricated payout.+**Pricing:** $0.25 USDC per mint via x402 (an OAuth bearer token bypasses payment). Supply either `avatar_id` (an avatar you own) or `glb_url`, and a recipient (`owner_wallet`, or your OAuth-linked Solana wallet).```json@@ -453,7 +457,7 @@ The call is **idempotent**: a row is claimed before any on-chain action, so a re}```-The `structuredContent` returns the `mint` address, `explorer_asset_url` + `explorer_tx_url` (Solscan), `viewer_url` (the live three.ws 3D viewer), `metadata_uri`, and the `royalty` terms (`basis_points`, `percent`, `recipient`, `cap_basis_points`, `capped`).+The `structuredContent` returns the `mint` address, `explorer_asset_url` + `explorer_tx_url` (Solscan), `viewer_url` (the live three.ws 3D viewer), `metadata_uri`, the `royalty` terms (`basis_points`, `percent`, `recipient`, `cap_basis_points`, `capped`), `provenance_ledger` (`action_id`, `signed`, `signer_address`, `digest` — or `null`), and `remix_royalty` (the settlement above — or `null` when there's no `parent_mint`).---@@ -473,7 +477,9 @@ Resolve a Solana mint address to its **live 3D asset**: current holder, the inte}```-Returns `holder`, `media` (`glb_url`, `image_url`, `viewer_url`, `viewer_live`), `provenance`, `royalty` (`basis_points`, `percent`, `recipient`, `enforced_onchain`, `cap_basis_points`), and, for platform mints, `minted_through_threews` + `tx_signature`.+Returns `holder`, `media` (`glb_url`, `image_url`, `viewer_url`, `viewer_live`), `provenance`, `provenance_ledger` (the mint's signed `agent_actions` entry, or `null`), `royalty` (`basis_points`, `percent`, `recipient`, `enforced_onchain`, `cap_basis_points`), `remix_royalty` (the settlement routed to the parent creator, or `null`), and, for platform mints, `minted_through_threews` + `tx_signature`.++**Browsing every mint:** `GET /api/v1/tokenized/launches?limit=24&offset=0&network=mainnet&agent_id=<uuid>` is the free, public, paginated directory of every 3D asset minted through three.ws — the NFT counterpart to `GET /api/v1/pump/launches`. No auth, no payment; 60 requests/min per IP.---diff --git a/page-agent-sdk/src/page-agent.js b/page-agent-sdk/src/page-agent.jsindex 10fc54cd6..fad9e82bd 100644--- a/page-agent-sdk/src/page-agent.js+++ b/page-agent-sdk/src/page-agent.js@@ -25,6 +25,7 @@ import { AvatarStage } from './stage.js';import { SpeechNarrator } from './narrator.js';import { AvatarPicker } from './picker.js';import { injectStyles } from './styles.js';+import { resolvePreset, sanitizeContext, buildSystemPrompt } from './presets.js';const ICONS = {play: '<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>',@@ -43,8 +44,17 @@ export class PageAgent {* mount?: HTMLElement, agent?: string, agents?: string[], assetBase?: string,* position?: 'bottom-right'|'bottom-left'|'top-right'|'top-left',* muted?: boolean, collapsed?: boolean, picker?: boolean, controls?: boolean,- * greeting?: string, autoNarrate?: boolean|string, persistAgent?: boolean+ * greeting?: string, autoNarrate?: boolean|string, persistAgent?: boolean,+ * preset?: string, context?: Record<string, unknown>,+ * suggestedPrompts?: (string|{prompt:string, response?:string, action?:'narrate'|'tour'})[],+ * tools?: string[]* }} [config]+ *+ * `preset` resolves a persona (greeting, systemRole, suggestedPrompts, tools) —+ * see `src/presets.js`. Explicit `greeting` / `suggestedPrompts` / `tools`+ * always win over the preset's defaults. `context` is sanitized host state+ * folded into `systemPrompt` (see `presets.js#buildSystemPrompt`) — this+ * package never sends it anywhere itself.*/constructor(config = {}) {if (typeof window === 'undefined') throw new Error('[page-agent] requires a browser environment');@@ -57,8 +67,16 @@ export class PageAgent {this._agent = null;this._narrationToken = 0;+ // ── Persona preset resolution (explicit config always wins) ────────────+ this._preset = resolvePreset(config.preset);+ this._context = sanitizeContext(config.context);+ this.tools = config.tools ?? this._preset?.tools ?? [];+ this.suggestedPrompts = normalizePrompts(config.suggestedPrompts ?? this._preset?.suggestedPrompts);+ this._effectiveGreeting = config.greeting ?? this._preset?.greeting;+injectStyles();this._buildDom();+ this._renderPrompts();this.stage = new AvatarStage(this._stageEl, { background: 'transparent' });this.narrator = new SpeechNarrator(this.stage, {@@ -92,8 +110,8 @@ export class PageAgent {if (config.autoNarrate) {const sel = typeof config.autoNarrate === 'string' ? config.autoNarrate : undefined;this.narratePage({ selector: sel, greet: true });- } else if (config.greeting) {- this.narrate(config.greeting);+ } else if (this._effectiveGreeting) {+ this.narrate(this._effectiveGreeting);}}).catch((e) => this._emit('error', e));}@@ -131,6 +149,13 @@ export class PageAgent {stage.append(name, caption);this._enableDrag(root, stage);+ // Suggested-prompt chips (from a persona preset, or explicit config)+ const prompts = document.createElement('div');+ prompts.className = 'tw-pa-prompts';+ prompts.setAttribute('role', 'group');+ prompts.setAttribute('aria-label', 'Suggested prompts');+ prompts.hidden = true;+// Control barconst bar = document.createElement('div');bar.className = 'tw-pa-bar';@@ -146,7 +171,7 @@ export class PageAgent {bar.append(this._playBtn, this._muteBtn, this._swapBtn, spacer, this._minBtn);- dock.append(stage, bar);+ dock.append(stage, prompts, bar);root.append(dock, launcher);document.body.appendChild(root);@@ -155,6 +180,30 @@ export class PageAgent {this._nameEl = name.querySelector('.tw-pa-name-text');this._captionEl = caption;this._launcher = launcher;+ this._promptsEl = prompts;+ }++ /** Render/refresh the suggested-prompt chip row from `this.suggestedPrompts`. */+ _renderPrompts() {+ const el = this._promptsEl;+ if (!el) return;+ el.innerHTML = '';+ if (!this.suggestedPrompts.length) {+ el.hidden = true;+ return;+ }+ el.hidden = false;+ for (const item of this.suggestedPrompts) {+ const btn = document.createElement('button');+ btn.type = 'button';+ btn.className = 'tw-pa-prompt';+ btn.textContent = item.prompt;+ btn.addEventListener('click', () => {+ if (item.action === 'tour') this.narratePage({ greet: false });+ else this.narrate(item.response, { interrupt: true });+ });+ el.appendChild(btn);+ }}_enableDrag(root, handle) {@@ -308,6 +357,23 @@ export class PageAgent {get currentAgent() { return this._agent; }+ /** The resolved persona preset (`undefined` if no `preset` was set/unknown). */+ get currentPreset() { return this._preset; }++ /** Sanitized host context (read-only copy) — see `presets.js#sanitizeContext`. */+ get context() { return { ...this._context }; }++ /**+ * `preset.systemRole` + sanitized `context`, composed into one plain-text+ * brief (see `presets.js#buildSystemPrompt`). `page-agent` never sends this+ * anywhere — it's for a host page (or a paired `<agent-3d chat>` on the same+ * page) to hand to a real LLM.+ */+ get systemPrompt() { return buildSystemPrompt(this._preset, this._context); }++ /** Update host context after load (e.g. once a wallet connects). Re-sanitized. */+ setContext(context) { this._context = sanitizeContext(context); }+// ── Internals ─────────────────────────────────────────────────────────────────_stateBase() { return this._collapsed ? 'collapsed' : 'idle'; }@@ -430,3 +496,30 @@ function pointer(e) {}function clamp(n, lo, hi) { return Math.max(lo, Math.min(hi, n)); }++/**+ * Normalize `suggestedPrompts` input (preset default or explicit config) into+ * a consistent `{ prompt, response, action }[]`. Accepts plain strings (an+ * attribute-only override with just questions) as well as full objects.+ * @param {(string|{prompt:string, response?:string, action?:'narrate'|'tour'})[]|undefined} list+ * @returns {{prompt:string, response:string, action:'narrate'|'tour'}[]}+ */+function normalizePrompts(list) {+ if (!Array.isArray(list)) return [];+ const out = [];+ for (const p of list) {+ if (typeof p === 'string') {+ const prompt = p.trim();+ if (prompt) out.push({ prompt, response: prompt, action: 'narrate' });+ continue;+ }+ if (p && typeof p === 'object' && typeof p.prompt === 'string' && p.prompt.trim()) {+ out.push({+ prompt: p.prompt.trim(),+ response: typeof p.response === 'string' && p.response.trim() ? p.response.trim() : p.prompt.trim(),+ action: p.action === 'tour' ? 'tour' : 'narrate',+ });+ }+ }+ return out;+}diff --git a/page-agent-sdk/src/presets.js b/page-agent-sdk/src/presets.jsnew file mode 100644index 000000000..51df95a31--- /dev/null+++ b/page-agent-sdk/src/presets.js@@ -0,0 +1,294 @@+/**+ * Persona presets — @three-ws/page-agent+ * =======================================+ *+ * A preset resolves one `preset="…"` attribute into a full persona: a spoken+ * `greeting`, a `systemRole` (the voice/behavior brief for this persona), a+ * set of `suggestedPrompts` rendered as tappable chips, and a `tools`+ * allowlist. It turns the embed from "configure five props" into "pick a+ * use case" — a one-liner per deployment, mirroring how the owner's SperaxOS+ * widget ships `WIDGET_PRESETS`.+ *+ * ── Reality this composes with ──────────────────────────────────────────+ * `page-agent` has no chat backend of its own: it is a client-side TTS+ * narrator (Web Speech API), not an LLM. There is no `fetch()` anywhere in+ * this package and no endpoint it calls (three.ws's LLM chat + tool-calling+ * backend, `api/chat.js`, powers the separate `<agent-3d chat>` component,+ * not this one). So a preset here does two real things and one documented,+ * forward-looking thing:+ *+ * - `greeting` / `suggestedPrompts` are genuinely functional: the greeting+ * is spoken via TTS on load, and each suggested prompt is a real chip+ * that narrates an authored response (or triggers a real method, e.g.+ * `narratePage()`, when `action: 'tour'`). No network round-trip is+ * faked — what you hear is static, owner-authored copy the widget+ * actually speaks, calibrated to never claim dynamic/live knowledge of+ * the host page it can't have.+ * - `systemRole` + the sanitized `context` attribute compose into+ * `buildSystemPrompt()`, a pure string the host page (or a paired+ * `<agent-3d chat>` on the same page) can read via `guide.systemPrompt`+ * to brief a *real* LLM. `page-agent` itself never sends it anywhere.+ * - `tools` is a documented allowlist of capability ids for that future+ * pairing. It is metadata only today — there is no live backend request+ * path in this package to enforce it against. Exposed on the element+ * (`guide.tools` / `currentPreset.tools`) so a host wiring up a real+ * chat backend has a ready-made scope per persona.+ */++/**+ * @typedef {Object} SuggestedPrompt+ * @property {string} prompt Chip label — what the visitor taps.+ * @property {string} response Spoken via `narrate()` when tapped.+ * @property {'narrate'|'tour'} [action]+ * 'narrate' (default) speaks `response`. 'tour' calls+ * `narratePage()` instead — for prompts that should *do* the+ * thing rather than describe it.+ */++/**+ * @typedef {Object} PagePersonaPreset+ * @property {string} id+ * @property {string} name+ * @property {string} description One line, shown in docs/tooling.+ * @property {string} greeting Spoken once on load (same slot as `greeting` config).+ * @property {string} systemRole Persona/behavior brief for a paired LLM backend.+ * @property {SuggestedPrompt[]} suggestedPrompts+ * @property {string[]} tools Capability allowlist — metadata, see file header.+ */++/** @type {Record<string, PagePersonaPreset>} */+export const PRESETS = {+ guide: {+ id: 'guide',+ name: 'Guide',+ description: "Narrates the host page end to end — today's default page-agent behavior, made explicit.",+ greeting: "Hi, I'm here to walk you through this page. Press play any time, or ask me where to start.",+ systemRole:+ 'You are a page guide. Narrate the host page in reading order, calling out what each section does ' ++ "and where to click next. Keep it warm, concise, and easy to follow — you're a good colleague " ++ 'pointing things out, not a script reader.',+ suggestedPrompts: [+ { prompt: 'Take me on a tour', response: "Let's go — I'll walk this page top to bottom.", action: 'tour' },+ {+ prompt: "What's on this page?",+ response: "I can give you the highlights — press play and I'll narrate it from the top, or ask me to change guides if you'd like someone else's voice.",+ },+ {+ prompt: 'Can I read instead of listening?',+ response: 'Yes — captions appear right below me as I talk, and you can mute me any time and just follow along.',+ },+ {+ prompt: 'Can I choose a different guide?',+ response: 'Definitely — tap change agent in the control bar and pick from the roster; your choice is remembered next time.',+ },+ ],+ tools: ['page-narration', 'page-navigation'],+ },++ 'shop-assistant': {+ id: 'shop-assistant',+ name: 'Shop Assistant',+ description: 'Product questions and purchase guidance — pairs with the tour/Shopify story.',+ greeting: "Hey, I'm your shopping guide — ask me about this product, sizing, or shipping, or I can just walk you through the page.",+ systemRole:+ 'You are a shop assistant embedded on a product or storefront page. Help visitors evaluate the ' ++ "product: what it is, who it's for, sizing/variants, shipping and returns, and how it compares to " ++ "alternatives on the page. Be honest about tradeoffs — never oversell. If you don't have the answer " ++ 'on this page, say so and point to support.',+ suggestedPrompts: [+ {+ prompt: 'What am I looking at?',+ response: "I can walk you through what's on this page — press play and I'll cover the product details, or ask me something specific like sizing or shipping.",+ },+ {+ prompt: 'Does this ship to me?',+ response: "Shipping details are usually listed further down this page — I'll highlight them if you press play, or check the shipping and returns section directly.",+ },+ {+ prompt: "What's the return policy?",+ response: "Look for the returns section on this page — most stores post their window and conditions there. I can read it out loud if you'd like the tour.",+ },+ {+ prompt: 'Is this the right fit for me?',+ response: "Check the size or variant guide on this page — if there's a chart or comparison, I can narrate it for you. Press play and I'll find it.",+ },+ ],+ tools: ['product-catalog', 'shipping-info', 'page-navigation'],+ },++ 'defi-advisor': {+ id: 'defi-advisor',+ name: 'DeFi Advisor',+ description: 'Explains yield, holdings, and risk on DeFi pages — the Sperax deployment.',+ greeting: "Hi, I'm your DeFi guide for this page — ask me what this protocol does, how yield is generated, or what the risks are.",+ systemRole:+ 'You are a DeFi advisor embedded on a protocol or dashboard page. Explain what the protocol does, ' ++ 'how yield or returns are generated, and what risk factors a visitor should understand — smart ' ++ 'contract risk, depeg risk, counterparty exposure — in plain language. Never give financial advice ' ++ 'or guarantee returns; explain mechanisms, not promises.',+ suggestedPrompts: [+ {+ prompt: 'What does this protocol do?',+ response: "This page explains the protocol's core mechanism — press play and I'll walk through what it does and how it fits together.",+ },+ {+ prompt: 'How is yield generated here?',+ response: "Yield sources are usually broken down on this page — lending, trading fees, or protocol incentives. Press play and I'll cover how it's generated here.",+ },+ {+ prompt: 'What are the risks I should know about?',+ response: "Every DeFi protocol carries smart contract risk, and some carry depeg or counterparty risk on top of that. I'll cover what's disclosed on this page if you press play — always worth reading the fine print yourself too.",+ },+ {+ prompt: 'How is this different from just holding a stablecoin?',+ response: "The difference usually comes down to what generates the extra yield and what risk you're taking on to get it. Press play and I'll walk through what this page says about that tradeoff.",+ },+ ],+ tools: ['protocol-analytics', 'portfolio-readonly', 'risk-disclosures'],+ },++ 'onboarding-coach': {+ id: 'onboarding-coach',+ name: 'Onboarding Coach',+ description: 'Walks new users through signup and first steps.',+ greeting: "Welcome — I'm here to get you set up. Want me to walk you through this, or jump to a specific step?",+ systemRole:+ 'You are an onboarding coach embedded on a signup or setup flow. Guide new users step by step: what ' ++ 'to enter, why it\'s needed, and what happens next. Anticipate the most common stumbling blocks ' ++ '(verification, permissions, connecting a wallet or account) and reassure without being condescending.',+ suggestedPrompts: [+ { prompt: 'Where do I start?', response: "Right at the top — let's go through it together.", action: 'tour' },+ {+ prompt: 'What information do I need?',+ response: "Most setups ask for just a few basics — I'll call out exactly what's needed as we go if you press play.",+ },+ {+ prompt: "I'm stuck on this step — what do I do?",+ response: "No worries — press play and I'll re-explain this step, or look for a help link near it if something isn't working as expected.",+ },+ {+ prompt: 'What happens after I finish?',+ response: "Once you're done here, you'll usually land somewhere that confirms you're set up — I'll flag it when we get there.",+ },+ ],+ tools: ['onboarding-flow', 'page-navigation'],+ },++ support: {+ id: 'support',+ name: 'Support',+ description: 'FAQ-style help with escalation phrasing.',+ greeting: "Hi, I'm here to help — ask me a question about this page, or I can point you to the team if I can't answer it.",+ systemRole:+ 'You are a support agent embedded on a help or FAQ page. Answer common questions directly and ' ++ "concisely using the content on this page. If a question is account-specific, sensitive, or outside " ++ 'what this page covers, say so plainly and direct the visitor to human support rather than guessing.',+ suggestedPrompts: [+ {+ prompt: 'I need help with something not listed here',+ response: 'If this page doesn\'t cover it, the best move is reaching out to the team directly — look for a contact or support link, and I can help you find it.',+ },+ {+ prompt: 'How do I contact a real person?',+ response: "Look for a contact, support, or chat link on this page — I'll call it out if you press play and I don't see one immediately.",+ },+ {+ prompt: 'Is there a status page for outages?',+ response: "Check for a status or system health link, often in the footer — if this page has one I'll surface it when you press play.",+ },+ {+ prompt: 'Where can I find documentation?',+ response: "Docs are usually linked from the header, footer, or a resources section — press play and I'll point you to it if it's on this page.",+ },+ ],+ tools: ['faq-search', 'escalation'],+ },+};++/** Stable, ordered list of preset ids — for docs/tooling/pickers. */+export const PRESET_IDS = Object.freeze(Object.keys(PRESETS));++/**+ * Resolve a preset id to its config, or `undefined` if unknown/unset.+ * @param {string} [id]+ * @returns {PagePersonaPreset|undefined}+ */+export function resolvePreset(id) {+ if (!id) return undefined;+ return PRESETS[id];+}++// ── Host-context sanitization ────────────────────────────────────────────++const CONTEXT_MAX_BYTES = 1024;+const CONTEXT_MAX_KEYS = 20;+const CONTEXT_MAX_VALUE_LEN = 200;+const CONTEXT_KEY_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;+const UNSAFE_KEYS = new Set(['__proto__', 'constructor', 'prototype']);++/**+ * Sanitize host-supplied context (the `context="{...}"` attribute, already+ * JSON-parsed) into a safe, flat string map:+ * - non-object / array input → `{}`+ * - non-string values are dropped (string values only)+ * - unsafe/malformed keys are dropped (`__proto__` etc., non `[a-zA-Z0-9_-]`)+ * - each value has backticks/newlines stripped (fence- and line-injection+ * safe) and is capped to 200 chars+ * - the whole map is capped at ~1KB and 20 keys; entries beyond the budget+ * are dropped, not truncated mid-value+ * @param {unknown} input+ * @returns {Record<string,string>}+ */+export function sanitizeContext(input) {+ if (!input || typeof input !== 'object' || Array.isArray(input)) return {};+ const out = {};+ let bytes = 0;+ let count = 0;+ for (const key of Object.keys(input)) {+ if (count >= CONTEXT_MAX_KEYS) break;+ if (UNSAFE_KEYS.has(key) || !CONTEXT_KEY_PATTERN.test(key)) continue;+ const raw = input[key];+ if (typeof raw !== 'string') continue;+ const clean = raw+ .replace(/`/g, "'")+ .replace(/[\r\n]+/g, ' ')+ .trim()+ .slice(0, CONTEXT_MAX_VALUE_LEN);+ if (!clean) continue;+ const entryBytes = byteLength(key) + byteLength(clean) + 4; // ~overhead for ": " + separators+ if (bytes + entryBytes > CONTEXT_MAX_BYTES) break;+ out[key] = clean;+ bytes += entryBytes;+ count++;+ }+ return out;+}++function byteLength(str) {+ return typeof TextEncoder !== 'undefined' ? new TextEncoder().encode(str).length : str.length;+}++/**+ * Compose a preset's `systemRole` with sanitized host context into one+ * plain-text brief — for a host page (or a paired `<agent-3d chat>` on the+ * same page) to hand to a real LLM. `page-agent` never sends this anywhere+ * itself; it's exposed via `guide.systemPrompt`.+ *+ * The context block is a fenced, clearly-delimited section so a consuming+ * LLM can't confuse host data for instructions — values are pre-sanitized+ * (no backticks/newlines) so they can't break out of the fence.+ *+ * @param {PagePersonaPreset|undefined} preset+ * @param {Record<string,string>|undefined} context Already-sanitized (see `sanitizeContext`).+ * @returns {string}+ */+export function buildSystemPrompt(preset, context) {+ const role = preset?.systemRole?.trim() || '';+ const sanitized = context && typeof context === 'object' ? context : {};+ const keys = Object.keys(sanitized);+ if (!keys.length) return role;++ const block = ['[Host page context]', ...keys.map((k) => `- ${k}: ${sanitized[k]}`)].join('\n');+ const fenced = '```\n' + block + '\n```';+ return role ? `${role}\n\n${fenced}` : fenced;+}diff --git a/prompts/roadmap/_generated/04/probe-viewer.mjs b/prompts/roadmap/_generated/04/probe-viewer.mjsindex c7a6048e9..73a25e113 100644--- a/prompts/roadmap/_generated/04/probe-viewer.mjs+++ b/prompts/roadmap/_generated/04/probe-viewer.mjs@@ -47,17 +47,13 @@ await withPage('three-ws-viewer harness', async (page) => {.catch(() => false);log('viewer element mounted:', loaded);- // Wait for the GLB `load` event (or error) to confirm real rendering.- const loadState = await page.evaluate(- () =>- new Promise((resolve) => {- const el = window.__viewerEl;- if (!el) return resolve('no-element');- el.addEventListener('load', () => resolve('load'), { once: true });- el.addEventListener('error', (e) => resolve('error:' + e.detail?.error?.message), { once: true });- setTimeout(() => resolve('timeout'), 12000);- }),- );+ // Confirm the GLB actually parsed and rendered — poll internal state rather+ // than a `load` listener attached after the fact (the default avatar loads+ // fast enough that a listener wired post-hoc can race the event).+ const loadState = await page+ .waitForFunction(() => !!window.__viewerEl?._model, { timeout: 15000 })+ .then(() => 'model-set')+ .catch(() => 'timeout-no-model');log('viewer GLB load result:', loadState);// AR button present + accessible name.@@ -77,6 +73,7 @@ await withPage('three-ws-viewer harness', async (page) => {: null;});log('canvas a11y:', JSON.stringify(canvasInfo));+ await page.screenshot({ path: `${OUT}/three-ws-viewer-harness.png` });// Keyboard orbit: focus canvas, press ArrowLeft, confirm camera moved.const before = await page.evaluate(() => {diff --git a/prompts/roadmap/_generated/05/scene-harbor-scene.glb b/prompts/roadmap/_generated/05/scene-harbor-scene.glbnew file mode 100644index 000000000..740a656c9Binary files /dev/null and b/prompts/roadmap/_generated/05/scene-harbor-scene.glb differdiff --git a/prompts/roadmap/_generated/05/scene-robot-parade.glb b/prompts/roadmap/_generated/05/scene-robot-parade.glbnew file mode 100644index 000000000..639923ce8Binary files /dev/null and b/prompts/roadmap/_generated/05/scene-robot-parade.glb differdiff --git a/prompts/roadmap/_generated/05/scene-zen-garden.glb b/prompts/roadmap/_generated/05/scene-zen-garden.glbnew file mode 100644index 000000000..db93fd990Binary files /dev/null and b/prompts/roadmap/_generated/05/scene-zen-garden.glb differdiff --git a/public/changelog.json b/public/changelog.jsonindex 506666676..929f46cec 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-08T01:51:28.549Z",+ "generated_at": "2026-07-08T01:57:47.376Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -355,6 +355,17 @@"feature"]},+ {+ "date": "2026-07-08",+ "type": "update",+ "title": "Minted 3D assets now carry a second, independently-signed provenance record — and remixing one pays the original creator on the spot",+ "summary": "Every 3D avatar generated on three.ws now gets a signed authorship record on the platform's append-only agent_actions ledger the moment it's created — the same cryptographically-verifiable trail @three-ws/provenance-mcp reads, now written automatically instead of only on request. Minting a generated GLB as a Solana NFT (mint_3d_asset) links its own signed ledger entry alongside the provenance already baked into the NFT metadata. And when a mint names another creator's asset as its parent (a remix), the original creator's royalty share now settles immediately as a real on-chain USDC transfer out of the mint fee — not just a royalty term for a future resale. Every minted 3D asset is also now listed in a public launch directory at GET /api/v1/tokenized/launches, the NFT counterpart to the existing coin-launch feed.",+ "link": "/docs/mcp",+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-07-08","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 7319296a0..e0aaa3f57 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -278,6 +278,14 @@<category>feature</category><description>Eight new tools join the Markets suite, all live data and all free. Screener filters the top 250 coins by market cap, volume, and 24h move. Categories ranks every crypto sector so you can see which narrative leads. Exchanges ranks venues by trust score and volume. Derivatives shows perpetual-futures funding, open interest, and volume. Converter turns any crypto into any major fiat at live rates. And a DeFi trio — DeFi TVL by protocol, Chains by total value locked, and Stablecoins with peg health — brings on-chain liquidity into view via DeFiLlama. Every one is cross-linked from the markets table.</description></item>+ <item>+ <title>Minted 3D assets now carry a second, independently-signed provenance record — and remixing one pays the original creator on the spot</title>+ <link>https://three.ws/docs/mcp</link>+ <guid isPermaLink="false">2026-07-08:Minted 3D assets now carry a second, independently-signed provenance record — and remixing one pays the original creator on the spot</guid>+ <pubDate>Wed, 08 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Every 3D avatar generated on three.ws now gets a signed authorship record on the platform's append-only agent_actions ledger the moment it's created — the same cryptographically-verifiable trail @three-ws/provenance-mcp reads, now written automatically instead of only on request. Minting a generated GLB as a Solana NFT (mint_3d_asset) links its own signed ledger entry alongside the provenance already baked into the NFT metadata. And when a mint names another creator's asset as its parent (a remix), the original creator's royalty share now settles immediately as a real on-chain USDC transfer out of the mint fee — not just a royalty term for a future resale. Every minted 3D asset is also now listed in a public launch directory at GET /api/v1/tokenized/launches, the NFT counterpart to the existing coin-launch feed.</description>+ </item><item><title>New free API: check if a wallet holds a Binance Account Bound Token (BABT)</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex c544d12b0..996c54fae 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-08T01:51:28.534Z",+ "generated_at": "2026-07-08T01:57:47.348Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/scene-studio/actions.js b/src/scene-studio/actions.jsindex b73ec033a..6309c4e90 100644--- a/src/scene-studio/actions.js+++ b/src/scene-studio/actions.js@@ -234,8 +234,11 @@ const CSS = `.tws-sa-menu button:hover, .tws-sa-menu button:focus-visible { background: rgba(255,255,255,0.08); outline: none; }.tws-sa-menu button span { display: block; margin-top: 2px; font-weight: 400; font-size: 11px; color: #9a9aa8; }@media (prefers-reduced-motion: reduce) { .tws-sa-btn { transition: none; } }+/* Narrow viewports: stay pinned top-right (never bottom — that corner is+ reserved for the site-wide "Getting started" launcher pill on every page,+ see public/getting-started.js) and shrink to fit under the vendor menubar. */@media (max-width: 640px) {- .tws-sa-bar { top: auto; bottom: 12px; left: 12px; right: 12px; justify-content: flex-end; }- .tws-sa-btn span, .tws-sa-btn { font-size: 11.5px; padding: 8px 10px; }+ .tws-sa-bar { flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 16px); }+ .tws-sa-btn { font-size: 11px; padding: 6px 8px; }}`;