Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

chore(ops): sync docs, press page entries, and small cross-cutting fixes

nirholasc87881a45246
diff --git a/STRUCTURE.md b/STRUCTURE.md
index 84470cfa4..8120a4bee 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -81,13 +81,17 @@ bottom.
| 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). Play mode also has an opt-in **"Record on-chain (BNB testnet)"** toggle (OFF by default) that gaslessly commits your moves to the `WorldMoves` contract every ~block via MegaFuel (self-pay fallback) and renders other on-chain players as lightweight ghost markers read back from real `Moved` events: [src/agora/onchain-presence.js](src/agora/onchain-presence.js), sender [src/bnb/move-sender.js](src/bnb/move-sender.js), event reader [src/bnb/world-presence-reader.js](src/bnb/world-presence-reader.js), pure ghost interpolation [src/bnb/onchain-ghosts.js](src/bnb/onchain-ghosts.js), server relay lib [api/_lib/bnb/world-moves.js](api/_lib/bnb/world-moves.js), config endpoint [api/bnb/world-config.js](api/bnb/world-config.js). WorldMoves contract: [contracts/src/WorldMoves.sol](contracts/src/WorldMoves.sol) (code-complete + anvil-fork-proven; public BSC testnet deploy pending a funded deployer key — see `contracts/DEPLOYMENTS.md`). **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) |
| `/play` in-game economy (cash, bank/ATM, vendors, $THREE boutique) | Client: [src/game/coincommunities.js](src/game/coincommunities.js) `→ /play`, general-store/bank NPCs [src/game/npc/economy-npcs.js](src/game/npc/economy-npcs.js), store/bank UI [src/game/economy-ui.js](src/game/economy-ui.js), on-chain purchase flow [src/game/boutique-purchase.js](src/game/boutique-purchase.js), wardrobe [src/game/play-systems.js](src/game/play-systems.js). Server: [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) (store/bank/boutique handlers), price tables [multiplayer/src/shop.js](multiplayer/src/shop.js), purse/bank model [multiplayer/src/economy.js](multiplayer/src/economy.js), on-chain settlement [multiplayer/src/game-token.js](multiplayer/src/game-token.js) | In-repo | The GTA-style open world's real economy (W04 of the World Online program, program brief retired to git history). Walk up to a General Store clerk (E) to buy tools/consumables or sell gathered goods for cash, server-priced and validated every time; walk up to the Bank Teller to deposit cash into a protected balance (survives a death drop) or withdraw it. Premium wardrobe cosmetics unlock with a real on-chain `$THREE` payment from the player's connected Solana wallet; the server only grants the item after re-verifying the confirmed transaction on RPC. Distinct from the separate USDC/x402 avatar-shop rail ([api/x402/cosmetic-purchase.js](api/x402/cosmetic-purchase.js)), which sells a different catalog for the standalone character creator. Published publicly at [pages/play/economy.html](pages/play/economy.html) `→ /play/economy` ([src/play-economy.js](src/play-economy.js)), fed by [api/play/economy.js](api/play/economy.js) `→ /api/play/economy`, which serializes the SAME shop/economy/spin-wheel modules the server prices trades with rather than restating them, so the public reference cannot drift from the game. Docs: [docs/in-game-economy.md](docs/in-game-economy.md), tutorial [docs/tutorials/earn-and-spend-in-play.md](docs/tutorials/earn-and-spend-in-play.md). Tests: [tests/api/play-economy.test.js](tests/api/play-economy.test.js) |
| `/play` character & avatar customization (avatar creator, selfie→3D, wardrobe boutique) | Lobby creator flow [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js) `_openCreate()`, selfie SDK wrapper [src/avatar-creator.js](src/avatar-creator.js), shop [src/game/cosmetics-shop.js](src/game/cosmetics-shop.js), wardrobe [src/game/cosmetics-wardrobe.js](src/game/cosmetics-wardrobe.js), boutique NPCs [src/game/npc/npc-catalog.js](src/game/npc/npc-catalog.js) (`npc-tailor`, `npc-fitting-room`), boutique spawn points [src/game/world-zones.js](src/game/world-zones.js) (`type: 'boutique'`), in-world avatar switcher [src/game/avatar-switcher.js](src/game/avatar-switcher.js) (HUD Avatar button / `V`, swap applied in [src/game/coincommunities.js](src/game/coincommunities.js) `_applyAvatarSwap()`) | In-repo | W03 of the World Online program (program brief retired to git history). Before dropping into `/play`, design an avatar from scratch or a selfie (real Avaturn SDK), upload a `.glb`, or sculpt in the full Avatar Studio; no sign-in required. Once in the world, press `V` (or the HUD Avatar button) to change avatars without leaving: saved three.ws avatars, quick picks, gallery, paste-a-URL, upload, and the creator, rebuilt live on your rig and broadcast to peers over the room's `avatar` message. The cosmetics shop/wardrobe (real x402-settled catalog, server-persisted equip) also has a physical home: walk up to Roux · Tailor to browse/buy, or Nell's Fitting Room to equip anything you own. Doc: [docs/character-studio.md](docs/character-studio.md#character-customization-in-play-world-online). Tests: [tests/play-avatar-switcher.test.js](tests/play-avatar-switcher.test.js), [tests/walkroom-avatar-swap.test.js](tests/walkroom-avatar-swap.test.js). |
+| `/play` forge-in-world (prompt or photo to a live prop) | Lane client [src/game/forge-prop.js](src/game/forge-prop.js), palette form + `/forge` chat command [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js) (`_buildForgeRow()`, `_submitForge()`), placement handler [src/game/coincommunities.js](src/game/coincommunities.js) (`_forgeProp()`), styles [src/game/coincommunities.css](src/game/coincommunities.css), rendering [src/game/world-objects.js](src/game/world-objects.js) (`registerUploadedProp`), server gate [multiplayer/src/build-limits.js](multiplayer/src/build-limits.js) (`normalizePropAssetUrl`) | In-repo | Describe an item in the build palette's Forge form (or type `/forge a glowing campfire` in world chat, or attach a reference photo) and the free draft forge lane generates a real textured GLB in about half a minute. The finished model is registered as a placeable prop and armed, so the next click drops it into the shared world through the SAME `obj:spawn` channel player uploads use: the URL travels on the object, every connected player renders it, and the room persists it like any other build. No new server surface was needed because the durable forge URL (`S3_PUBLIC_DOMAIN`, an `*.r2.dev` host) already satisfies the world asset allow-list; an off-list host is refused with `obj:reject`/`asset_url`. Generation is one-at-a-time per player, and every failure (rate limit, refused prompt, dead upload, timeout) reports a recovery line in the palette's status strip. Docs: [docs/play-forge-in-world.md](docs/play-forge-in-world.md). Tests: [tests/forge-prop.test.js](tests/forge-prop.test.js) |
| `/play` combat & weapons (server-authoritative, danger zones, wanted, tombstones) | Client: [src/game/combat-system.js](src/game/combat-system.js) `→ /play` (vitals HUD wiring, danger-zone ground, tombstone loot, hit feedback, the `window.twsCombat` bridge into W08's `MobSystem`), HUD [src/game/hud/world-hud.js](src/game/hud/world-hud.js). Server: [multiplayer/src/combat-handlers.js](multiplayer/src/combat-handlers.js) (mob AI, attack/loot intents, death + respawn), pure math [multiplayer/src/combat.js](multiplayer/src/combat.js), weapon/mob/loot tables [multiplayer/src/items.js](multiplayer/src/items.js), zone geometry [multiplayer/src/world-features.js](multiplayer/src/world-features.js), handlers wired in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W07 of the World Online program (program brief retired to git history). Equip a sword/bat/pistol/bow from the hotbar and press `X` (or tap the touch Attack button) to fight; but only inside one of three named danger zones (Southern Wilds, Northern Wilds, Eastern Marches); town stays lawful by construction. PvE mobs chase and swing back through the same server-side damage path a player's attack uses; a kill (mob or PvP) spills a lootable tombstone, PvP raises the attacker's wanted/heat stars (visible on `WorldHud` and a downed peer's nameplate), and death drops carried cash/pack before an automatic respawn in town. |
| `/play` NPCs & world life (traffic, vendors, quest-givers, mobs) | Manager [src/game/npc/world-life.js](src/game/npc/world-life.js), nav graph [src/game/npc/nav-graph.js](src/game/npc/nav-graph.js), ambient crowd/traffic [src/game/npc/ambient-life.js](src/game/npc/ambient-life.js), quest-giver NPCs [src/game/npc/quest-npcs.js](src/game/npc/quest-npcs.js), quest-zone waypoints [src/game/npc/quest-markers.js](src/game/npc/quest-markers.js), Jobs Board UI [src/game/quests-ui.js](src/game/quests-ui.js), W07-gated mobs [src/game/npc/mobs.js](src/game/npc/mobs.js). Server: quest engine [multiplayer/src/quests.js](multiplayer/src/quests.js), quest zones [multiplayer/src/quest-zones.js](multiplayer/src/quest-zones.js), handlers in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W08 of the World Online program (program brief retired to git history). A deterministic nav graph drives client-side ambient pedestrians + ring-road traffic that read identically for every player without a single packet; real gameplay stays server-authoritative. Five quest-giver NPCs (Dockmaster Reyes, Warden Okoro, Cook Mara, Foreman Dell, The Fixer) front the jobs board the quest engine (W05) already ran server-side but no client ever reached; pressing E opens the real board, accepting a job drops a waypoint at its objective (goto zones auto-complete by walking there, interact zones get their own "press E"), and finishing pays real cash server-side. Hostile mobs are live: W07's `CombatSystem` ([src/game/combat-system.js](src/game/combat-system.js)) installs the `window.twsCombat` contract this module's mobs were built against, so `MobSystem` renders real server-authoritative PvE hostiles with zero changes here. Two jobs; `cross-town-delivery` (North↔South) and `east-west-express` (East↔West); are real driving missions: each `goto` leg is flagged `vehicle: true` and only completes off the authoritative vehicle-driver map ([multiplayer/src/vehicles.js](multiplayer/src/vehicles.js)), so walking through a depot never counts, only driving through it does. Depots sit on the avenue vehicle spawns, so a car is always parked at the start. Tests: [tests/quests-vehicle-delivery.test.js](tests/quests-vehicle-delivery.test.js). |
| Frame governor & power saver (`/play`, `/club`, `/walk`) | [src/shared/frame-governor.js](src/shared/frame-governor.js), wired in [src/game/coincommunities.js](src/game/coincommunities.js), [src/club.js](src/club.js), [src/club-entrance.js](src/club-entrance.js), [src/walk.js](src/walk.js); toggle UI in [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js) | Live | Shared frame-rate governor for the heavy 3D surfaces: 60fps while active, 30fps when idle or unfocused, plus a user-facing Power-saver mode (30fps + lighter rendering, "for a cooler, quieter machine") persisted in localStorage `tws-power-saver` and shared across surfaces (`getPowerSaver`/`setPowerSaver`/`onPowerSaverChange`, `trackWindowFocus`). Tests: [tests/frame-governor.test.js](tests/frame-governor.test.js) |
+| `/play` safety & lifecycle invariants | Doc [docs/play-hardening.md](docs/play-hardening.md) `→ /docs/play-hardening`. Guards: `cssBgImage()` + `clampParam()` + `isPlausibleMint()` in [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js) / [src/game/coincommunities.js](src/game/coincommunities.js), avatar template cache + `releaseAvatar()` in [src/game/avatar-rig.js](src/game/avatar-rig.js), reconnect pruning (`_markRemotesStale`/`_pruneStaleRemotes`) and `_disposeObject3D()` in [src/game/coincommunities.js](src/game/coincommunities.js). Harnesses: [scripts/play-desktop-audit.mjs](scripts/play-desktop-audit.mjs), [scripts/play-mobile-repro.mjs](scripts/play-mobile-repro.mjs) | Live | The rules that keep the platform's largest interactive surface safe, honest and phone-survivable, each written against a failure that actually shipped: untrusted display names and coin metadata never become markup or CSS (a tombstone owner's name once ran as HTML for everyone who walked past it; a crafted coin `image_uri` could paint a full-screen overlay across the lobby), a malformed `?coin=` is refused instead of building a convincing world nobody else can join, a reconnect retires the peers who left rather than accumulating frozen ghosts and a tripled headcount, and everything the world loads (crowd/NPC GLBs, the sun's 2048² shadow map, totem, jumbotron, dance floor, district, environment) is genuinely freed on the way out instead of held until the tab is killed. Tests: [tests/play-deeplink-safety.test.js](tests/play-deeplink-safety.test.js) |
| Cinematic rendering (shared 3D quality bar) | [src/shared/cinematic-render.js](src/shared/cinematic-render.js) — `applyCinematicDefaults()`, `loadEnvironment()`, `detectQualityTier()`, `updateGroundContactShadow()`; curated HDRIs in [public/hdri/](public/hdri) (CC0, Poly Haven) | Live, wired into every three.js viewer on the platform (`/irl`, talk mode, `/play`, `/club`, `/ar`, `/xr`, `/walk`, `/coin3d`, marketplace lobby, demo pages, the `<agent-3d>`/`<page-agent>` embeds, and more) | One module every WebGLRenderer-based viewer calls into instead of re-deriving ACES tone mapping, sRGB output color space, HDRI image-based lighting, and soft VSM shadows per file. `detectQualityTier()` picks high/medium/mobile from real device signals and caps pixel ratio + disables shadows/HDRI accordingly; `loadEnvironment()` fetches a real photographic HDRI (`studio`/`outdoor`/`sunset`) and falls back to a procedural room environment on mobile tier or fetch failure (including cross-origin embed contexts where the absolute `/hdri/*.hdr` URL can't resolve). `/walk` keeps its own richer per-biome HDR system ([src/walk-environments.js](src/walk-environments.js)); surfaces already running a postprocessing tone-mapping pass (`/oracle-graph`, `/club-entrance`) only take the sRGB/HDRI half to avoid double-applying the curve. |
| `/play` Wheel of Fortune (Fortune's Folly; free/paid $THREE spins) | Client: [src/game/wheel-station.js](src/game/wheel-station.js) (the plaza landmark, proximity prompt, `E` to spin; lazy-imports the actual UI on first interact), spin UI [src/game/spin-wheel-ui.js](src/game/spin-wheel-ui.js) (20-segment wheel, free/paid flow, wallet signing). Server: [multiplayer/src/spin-wheel.js](multiplayer/src/spin-wheel.js) (paytable, RNG, level/cooldown/pack gates, handlers), split-payment settlement [multiplayer/src/game-token.js](multiplayer/src/game-token.js) (`buildSpinPayment`/`verifySpinPayment`; the same primitives the $THREE boutique uses), wheel location [multiplayer/src/world-features.js](multiplayer/src/world-features.js) `WHEEL`, persisted cooldown field in [multiplayer/src/economy.js](multiplayer/src/economy.js), handlers wired in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W09 of the World Online program (program brief retired to git history). Walk up to the wheel in the plaza and press `E`: one free spin every 12h (a real persisted cooldown; survives a disconnect, unlike the ephemeral per-action cooldowns everything else on this row's neighbors use), or pay $3 in `$THREE`; split 50% to the holder-rewards pool / 50% to the treasury, verified on-chain before any prize is granted, mirroring the boutique's proven settlement pattern exactly. Gated behind an average skill level of 3 (a light anti-farm floor, not a grind) and never lets a won prize get lost to a full pack; room for at least one possible item prize is checked before a spin is even offered, paid or free. All 20 wedges are equal-odds by design, matching the client's fixed-angle wheel rendering exactly (see the header note in `spin-wheel.js` on why that must never drift). Tests: [tests/spin-wheel.test.js](tests/spin-wheel.test.js). |
-| `/play` event countdown (lobby banner + in-world pill) | Self-attaching module [src/game/event-countdown.js](src/game/event-countdown.js) loaded by [pages/play.html](pages/play.html); config [public/event.json](public/event.json) (single source of the event window; the file is the edit surface for scheduling an event). Campaign pack: [prompts/event/](prompts/event/) | In-repo | While `public/event.json` describes an upcoming or live event, the lobby shows a banner (name, tagline, local-time start, ticking countdown, CTA into the event world) and the in-world view gets a dismissible top-center pill (dismissal persisted per event in localStorage). Three explicit states: upcoming, live (pulsing marker, CTA suppressed when already standing in the event world), and over (everything unmounts, the interval stops). Zero edits to `coincommunities*.js` by design (the ambient-crowd pattern): it waits for the lobby DOM and mounts nothing when the config is missing, malformed, or expired. |
+| `/play` Coin Wars portal (in-world war door, league board, spectator screen) | Client: [src/game/war-portal.js](src/game/war-portal.js) + [src/game/war-portal.css](src/game/war-portal.css) (plaza landmark, canvas league board, queue panel, results echo), wired in [src/game/coincommunities.js](src/game/coincommunities.js); arena page [pages/play/war.html](pages/play/war.html) `→ /play/war` → [src/play/war.js](src/play/war.js) + [src/play/war-world.js](src/play/war-world.js) + [src/play/war.css](src/play/war.css). API: [api/wars.js](api/wars.js) `→ /api/wars` over [api/_lib/wars-store.js](api/_lib/wars-store.js) (ledger + queue + live registry) and [api/_lib/war-ticket.js](api/_lib/war-ticket.js) (signs a pairing). Server: [multiplayer/src/rooms/ClashRoom.js](multiplayer/src/rooms/ClashRoom.js) `clash_arena`, pairing math [multiplayer/src/war-matchmaking.js](multiplayer/src/war-matchmaking.js), ticket verify [multiplayer/src/war-ticket.js](multiplayer/src/war-ticket.js), spectator snapshots [multiplayer/src/war-live.js](multiplayer/src/war-live.js), league math [multiplayer/src/war-standings.js](multiplayer/src/war-standings.js), portal location [multiplayer/src/world-features.js](multiplayer/src/world-features.js) `WAR_PORTAL` | In-repo | F18. Coin Wars ran full community-vs-community battles with an Elo league behind it and no door into it from any world. The portal is that door: a plaza landmark whose board shows this coin's real league standing, its last battles, and any war running right now (read from `/api/wars`, folded through the arena's own standings module, never a second implementation). Press `E` to run the coin's holder gate and queue the community; the matchmaker pairs it with another waiting community, seals both sides into an HMAC war ticket, and hands the player to `/play/war` with a return link carrying the full coin identity, so walking back lands in the same world with the result already echoing on the board. While a war is live the board becomes a spectator screen (score, round clock, kill feed) off a cheap poll, and a win takes the board over for a few seconds. Costs nothing when nobody is near it: no poll fires outside `WAR_PORTAL_BOARD_REACH`. Docs: [docs/coin-wars.md](docs/coin-wars.md). Tests: [tests/war-matchmaking.test.js](tests/war-matchmaking.test.js), [tests/clash-match.test.js](tests/clash-match.test.js) |
+| `/play` event countdown (lobby banner + in-world pill) | Self-attaching module [src/game/event-countdown.js](src/game/event-countdown.js) loaded by [pages/play.html](pages/play.html); config [public/event.json](public/event.json) (single source of the event window; the file is the edit surface for scheduling an event), read through the shared parser + state machine in [src/shared/event-config.js](src/shared/event-config.js). Verified end to end in a real browser by `npm run verify:event` ([scripts/verify-event-countdown.mjs](scripts/verify-event-countdown.mjs)). Campaign pack: [prompts/event/](prompts/event/) | In-repo | While `public/event.json` describes an upcoming or live event, the lobby shows a banner (name, tagline, local-time start, ticking countdown, CTA into the event world) and the in-world view gets a dismissible top-center pill (dismissal persisted per event in localStorage). Three explicit states: upcoming, live (pulsing marker, CTA suppressed when already standing in the event world), and over (everything unmounts, the interval stops). Zero edits to `coincommunities*.js` by design (the ambient-crowd pattern): it waits for the lobby DOM and mounts nothing when the config is missing, malformed, or expired. |
| The event landing page (`/event`) | [pages/event.html](pages/event.html) `→ /event`, page module [src/event-page.js](src/event-page.js); config [public/event.json](public/event.json) (the SAME file the `/play` countdown reads, never a second copy of the times); live population [api/play/population.js](api/play/population.js) `→ /api/play/population`, backed by the multiplayer server's public `/population` aggregate in [multiplayer/src/index.js](multiplayer/src/index.js) | Live | The one link the community shares before and during an event, written for someone with zero context. Hero countdown ticking off `public/event.json`, a single large CTA into the event world, a plain-language "what to expect" built only from what `/play` actually does, and the run of show rendered in the visitor's own timezone with an "Add to calendar" button that builds a real RFC 5545 `.ics` in the browser (no third-party calendar service, so the guest list never leaves the device). Four designed states: upcoming (days/hours/minutes/seconds), live (LIVE marker plus the real number of people standing in the world), ended (says it happened, relabels the agenda to "What happened", and still routes people into `/play`), and no-config (an honest "no event scheduled" with the same door). The live number is real or absent: when the multiplayer server is unreachable the panel keeps the live state and drops the count instead of inventing one. Doc: [docs/api-reference.md](docs/api-reference.md#play-population-api). |
+| Home page event strip (`/`) | Self-attaching module [src/home-event-banner.js](src/home-event-banner.js) loaded by [pages/home.html](pages/home.html); same config [public/event.json](public/event.json) through [src/shared/event-config.js](src/shared/event-config.js) | Live | Puts the live event in front of everyone who lands on three.ws, not just the people who already opened `/play`. A slim announcement bar between the nav and the hero: event name, start time in the visitor's own timezone, a countdown ticking to the second, and one CTA into the $THREE world (suppressed when the visitor is already there). Same three states as the `/play` surfaces and the same auto-unmount at `endsAt`, flipping upcoming to live without a reload. Dismissal shares the `/play` pill's `cc-event-dismissed:<startsAt>` key, so waving the reminder away on the home page also clears it in-world; the `/play` lobby banner stays, because it is lobby content rather than an overlay. Styled from the home page's own tokens (mono kicker, hairline pill CTA) and light-theme aware. Verified with `npm run verify:event`. |
| `/play` friends, presence & verified profiles (drawer, cross-world DMs, in-world profile cards) | Client: [src/game/friends-panel.js](src/game/friends-panel.js) (shared with `/walk`), mounted in [src/game/coincommunities.js](src/game/coincommunities.js) `_openFriends()`/`_closeFriends()`, HUD button + unread badge in [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js), account-level state/polling in [src/friends.js](src/friends.js), profile card in the shared inspector [src/shared/avatar-inspector.js](src/shared/avatar-inspector.js) (`renderProfile`). Server: signed ticket verify + `socialHub` registration + verified `username` on the Player schema in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) + [multiplayer/src/schemas.js](multiplayer/src/schemas.js), ticket signer [api/_lib/presence-store.js](api/_lib/presence-store.js) / verifier [multiplayer/src/presence-token.js](multiplayer/src/presence-token.js), hub in [multiplayer/src/social-hub.js](multiplayer/src/social-hub.js) | In-repo | W09+W10 of the World Online program (program brief retired to git history). Press `J` or the HUD `Friends` button to open a right-docked drawer showing your account's friend graph; live online/offline presence per coin world, requests, and DM threads; the same graph and threads `/walk` and the standalone `/friends` page already share. `community-net.js` carries a signed presence ticket into every `walk_world` join and forwards the server's `social` push onto its own event bus, which is what makes a `/play` player visible to friends and able to receive a live DM. W10 makes the platform identity first-class in-world: the ticket also carries the account's username + display name (signed, so nobody can wear a handle they don't own), WalkRoom publishes the verified `username` on the Player schema, nameplates show the @handle, the signed-in lobby defaults to the account's display name with an @handle chip, and clicking any verified player (or `I`) opens their real three.ws profile card in the shared avatar inspector: bio, follower counts, follow/unfollow (`/api/users/:username/follow`), the right friends verb (Message → the in-world DM drawer when already friends, Add friend / Accept otherwise), their latest creations, and a link to `/u/<username>`. Works identically in `/walk` (same room, same inspector). Tests: [tests/play-friends-presence.test.js](tests/play-friends-presence.test.js), [tests/play-profile-identity.test.js](tests/play-profile-identity.test.js). |
| Crew HQ (crews, tags, 3D presence room) | Page [pages/crews.html](pages/crews.html) + [src/crews-page.js](src/crews-page.js) + [src/crews.css](src/crews.css) `→ /crews` and `/crews/<TAG>`, data layer [api/_lib/crews-store.js](api/_lib/crews-store.js), endpoints [api/crews/](api/crews) (`index.js`, `[tag].js`, `search.js`, `directory.js`), presence [api/_lib/presence-store.js](api/_lib/presence-store.js), schema `api/_lib/migrations/2026-06-05-crews.sql` | Live | The group half of the social system: a crew is a set of accounts flying one 2-6 character tag, with one owner, one crew per account, and a public headquarters. The HQ renders the roster as a room rather than a list, each member standing as their own agent's 3D avatar (resolved by `standeesFor()`, private models never emitted) and lit by the same Redis presence the friends drawer reads. Crew colour is an FNV-1a hash of the tag, so a crew looks like itself everywhere without stored art. Live `<agent-3d>` figures are capped and lazily mounted so a large crew cannot exhaust the browser's WebGL contexts. The backend shipped with W09 and had no UI at all until this page; the in-world friends drawer now links to it. Docs: [docs/crews.md](docs/crews.md). Tests: [tests/crews-shared.test.js](tests/crews-shared.test.js), [tests/crews-wiring.test.js](tests/crews-wiring.test.js) |
| `/play` Robinhood Chain worlds (NOXA + The Odyssey coins, live-trade animation) | Firehose worker [workers/robinhood-feed/](workers/robinhood-feed) (watches NOXA + Odyssey launchpads + their Uniswap v3 pools, normalizes to the pump-compatible event shape, serves SSE/WS/REST). API bridge: [api/robinhood/coin-trades.js](api/robinhood/coin-trades.js) (the in-world chart-screen's trade feed), [api/robinhood/play-worlds.js](api/robinhood/play-worlds.js) (the `/worlds` lobby's Robinhood Chain tab). Client: chain-flavored biome `hoodchain` in [src/game/world-env.js](src/game/world-env.js) (auto-pinned in [src/game/coincommunities.js](src/game/coincommunities.js) `isRobinhoodCoin()`), trade-feed endpoint routing in [src/game/chart-screen.js](src/game/chart-screen.js), lobby tab + EVM-address support in [src/worlds-lobby.js](src/worlds-lobby.js) (routes Robinhood coins to `/play`, unchanged pump.fun coins stay on `/temporary`) | In-repo | Every Robinhood Chain memecoin (chain 4663) gets the same treatment pump.fun coins already have: a deterministic 3D world seeded by its contract address, in a distinct dark ticker-tape palette, with real launchpad/Uniswap-v3 trades rippling the space live via `MarketReactor`. Multiplayer (`walk_world`, filtered by `coin`+`tier`) needed zero code changes — it already keys rooms by an opaque coin id string. `isValidToken()` in [api/_lib/coin-communities.js](api/_lib/coin-communities.js) was widened to accept EVM addresses (it previously 400'd every EVM-chain world's Town chat, even though the CHAINS list already declared ethereum/base/bsc support). Tests: [workers/robinhood-feed/tests/normalize.test.js](workers/robinhood-feed/tests/normalize.test.js) (against real captured on-chain logs). |
diff --git a/api/_lib/ops/subsystem-health.js b/api/_lib/ops/subsystem-health.js
index 3e678b5cf..f8cf4b73c 100644
--- a/api/_lib/ops/subsystem-health.js
+++ b/api/_lib/ops/subsystem-health.js
@@ -37,6 +37,7 @@ import { rateLimiterHealth } from '../rate-limit.js';
import { checkRingInvariants } from '../x402/ring-allowlist.js';
import { gatherX402SettleHealth } from './x402-settle-health.js';
import { gatherForgeHealth } from './forge-health-sensor.js';
+import { describeSolvency } from '../sniper-solvency.js';
const DB_PING_TIMEOUT_MS = 2_500;
const DB_SLOW_MS = 1_000;
@@ -377,6 +378,25 @@ export function classifySniperBeat(beat, now = Date.now()) {
if (ageMs > SNIPER_FRESH_MS) {
return { ...base, status: 'degraded', detail: `heartbeat ${Math.round(ageMs / 1000)}s old — worker slow or mid-restart` };
}
+ // Money before mechanics. A worker whose wallets cannot pay for an entry is
+ // not performing its function, however healthy its feed is. That combination
+ // (fresh heartbeat, live feed, empty wallets) reported 'ok' here for ten days
+ // while the fleet booked a thousand failed buys. Checked before the feed for
+ // the same reason it outranks it in /api/sniper/status: it is the more
+ // specific diagnosis and the one nothing else was watching.
+ const solvency = meta.solvency && typeof meta.solvency === 'object' ? meta.solvency : null;
+ if (solvency?.state === 'starved' || solvency?.state === 'degraded') {
+ const fullyStarved = solvency.state === 'starved';
+ return {
+ ...base,
+ status: fullyStarved ? 'down' : 'degraded',
+ detail: `worker alive but out of trading capital. ${describeSolvency(solvency)}`,
+ hint: solvency.masterCanCover === false
+ ? 'The funding master cannot cover the refills: move SOL to it, then the auto-funder tops the agent wallets up within 5 minutes.'
+ : 'The auto-funder should refill these wallets on its next 5-minute tick; if it does not, check SNIPER_AUTO_FUND caps and the master balance.',
+ };
+ }
+
const watchdogMs = Number(meta.feedWatchdogMs) || 180_000;
if (meta.feedConnected !== true || Number(meta.lastEventAgeMs) > watchdogMs) {
return {
diff --git a/data/pages.json b/data/pages.json
index 26f9488a6..63ab4a27b 100644
--- a/data/pages.json
+++ b/data/pages.json
@@ -832,7 +832,7 @@
{
"path": "/voice",
"title": "Voice Lab",
- "description": "Clone your voice from a short recording, then use it for TTS or give it to your agent. Side-by-side comparison of voice models.",
+ "description": "Browse about 850 voices across Microsoft Edge, Gemini, NVIDIA, OpenAI and ElevenLabs, preview any of them, or clone your own from a short recording, then give it to your agent.",
"priority": 0.7,
"changefreq": "weekly",
"added": "2026-06-05",
@@ -1453,6 +1453,14 @@
"changefreq": "daily",
"added": "2026-06-15"
},
+ {
+ "path": "/play/war",
+ "title": "Coin Wars arena: two communities, one battlefield",
+ "description": "The live Coin Wars arena. Enlist at your coin world's war portal, fight the rival community to the kill cap, and the result lands on the Elo ladder. You fight for the coin you hold.",
+ "priority": 0.7,
+ "changefreq": "daily",
+ "added": "2026-08-08"
+ },
{
"path": "/sniper/experiments",
"title": "Sniper Experiments: rules vs LLM judgment, scored live",
@@ -2374,6 +2382,14 @@
"changefreq": "weekly",
"added": "2026-08-04"
},
+ {
+ "path": "/docs/play-hardening",
+ "title": "Docs · How /play stays safe, honest, and light",
+ "description": "The invariants that keep the Play world safe: untrusted names never become markup, a coin image cannot escape its CSS, a broken world link says so, a reconnect retires the peers who left, and everything the world loads gets freed. Each rule names the failure it prevents.",
+ "priority": 0.5,
+ "changefreq": "monthly",
+ "added": "2026-08-08"
+ },
{
"path": "/docs/swarms",
"title": "Docs · Trading swarms",
@@ -2597,7 +2613,7 @@
{
"path": "/docs/voice-lab",
"title": "Docs · Voice Lab",
- "description": "Clone your voice from a short browser recording, play it in the TTS playground, and assign it to an agent.",
+ "description": "Pick a voice from any provider or clone your own from a short browser recording, play it in the TTS playground, and assign it to an agent.",
"priority": 0.7,
"changefreq": "monthly",
"added": "2026-07-18"
@@ -4973,7 +4989,7 @@
},
{
"path": "/blog/see-your-3d-in-ar",
- "title": "See Your 3D Avatar in the Real World - AR Lands on three.ws",
+ "title": "See Your 3D Avatar in the Real World: AR Lands on three.ws",
"description": "Every 3D model and avatar on three.ws now has a View in AR button. On mobile it places the model in your real space through the camera. On desktop, a QR code gets you there in one scan. No app, no download.",
"priority": 0.6,
"changefreq": "monthly",
@@ -4981,7 +4997,7 @@
},
{
"path": "/blog/text-to-3d-is-live",
- "title": "Text to 3D Is Live - Type a Prompt, Download a 3D Model",
+ "title": "Text to 3D Is Live: Type a Prompt, Download a 3D Model",
"description": "Forge is live on three.ws: type a description and get a textured, downloadable 3D model (GLB) in your browser. Image to 3D from photos works too. Free draft tier, no install.",
"priority": 0.6,
"changefreq": "monthly",
@@ -4999,7 +5015,7 @@
},
{
"path": "/blog/three-ws-dextools-social-boost-buyback",
- "title": "three.ws Wins DEXTools Social Boost - $5,543 $three Buyback",
+ "title": "three.ws Wins DEXTools Social Boost: $5,543 $three Buyback",
"description": "three.ws is DEXTools",
"priority": 0.6,
"changefreq": "monthly",
@@ -5009,7 +5025,7 @@
{
"path": "/blog/three-ws-featured-on-alibaba-cloud-marketplace-blog",
"title": "three.ws Featured on the Alibaba Cloud Marketplace Blog",
- "description": "Alibaba Cloud Marketplace published an editorial on three.ws - browser-native 3D AI agents you deploy with a single <agent-3d> tag, with a Claude-powered runtime, ERC-8004 identity, and an Apache 2.0 open-source stack.",
+ "description": "Alibaba Cloud Marketplace published an editorial on three.ws: browser-native 3D AI agents you deploy with a single <agent-3d> tag, with a Claude-powered runtime, ERC-8004 identity, and an Apache 2.0 open-source stack.",
"priority": 0.6,
"changefreq": "monthly",
"lastmod": "2026-06-08",
@@ -5044,7 +5060,7 @@
{
"path": "/blog/three-ws-on-aws-marketplace",
"title": "three.ws Launches on AWS Marketplace, Bringing On-Chain 3D AI Agents to Enterprise Procurement",
- "description": "three.ws is now live on AWS Marketplace as a SaaS subscription. AWS customers can subscribe directly, bill to their AWS invoice, spend AWS Activate credits, and count three.ws toward Enterprise Discount Program commitments - for the first fully on-chain 3D AI agent platform.",
+ "description": "three.ws is now live on AWS Marketplace as a SaaS subscription. AWS customers can subscribe directly, bill to their AWS invoice, spend AWS Activate credits, and count three.ws toward Enterprise Discount Program commitments: for the first fully on-chain 3D AI agent platform.",
"priority": 0.6,
"changefreq": "monthly",
"lastmod": "2026-05-27",
@@ -5052,7 +5068,7 @@
},
{
"path": "/blog/agent-3d-web-component",
- "title": "We Just Shipped the 3D Layer for the Internet - <agent-3d>",
+ "title": "We Just Shipped the 3D Layer for the Internet: <agent-3d>",
"description": "Drop one <agent-3d> web component on your site and give any page an AI with LLM brain, memory, emotions, DOM awareness, password field privacy, and an on-chain identity that lives forever.",
"priority": 0.6,
"changefreq": "monthly",
@@ -5062,7 +5078,7 @@
{
"path": "/blog/2500-new-animations",
"title": "2,500 New 3D Animations Coming to three.ws",
- "description": "three.ws is expanding its animation library with 2,500 new 3D animations - giving every agent vastly more expressive range across emotions, gestures, reactions, and activities.",
+ "description": "three.ws is expanding its animation library with 2,500 new 3D animations: giving every agent vastly more expressive range across emotions, gestures, reactions, and activities.",
"priority": 0.6,
"changefreq": "monthly",
"lastmod": "2026-05-22",
@@ -5071,7 +5087,7 @@
{
"path": "/blog/three-ws-x402-bazaar",
"title": "three.ws Listed on Coinbase x402 Bazaar and agentic.market",
- "description": "three.ws is now a verified service provider on the Coinbase x402 Bazaar and agentic.market - the app store and discovery layer for AI agents with 480k active agents and $50M in volume.",
+ "description": "three.ws is now a verified service provider on the Coinbase x402 Bazaar and agentic.market: the app store and discovery layer for AI agents with 480k active agents and $50M in volume.",
"priority": 0.6,
"changefreq": "monthly",
"lastmod": "2026-05-21",
@@ -5079,7 +5095,7 @@
},
{
"path": "/blog/real-time-voice-interaction",
- "title": "Real-Time Voice Interaction with 3D AI Agents - Preview",
+ "title": "Real-Time Voice Interaction with 3D AI Agents: Preview",
"description": "three.ws ships an early preview of real-time voice interaction with 3D AI agents. Agents listen, reason with memory and emotions, respond in voice, and support AR/VR.",
"priority": 0.6,
"changefreq": "monthly",
@@ -5116,7 +5132,7 @@
{
"path": "/blog/three-ws-on-coinmarketcap",
"title": "three.ws Is Now Live on CoinMarketCap",
- "description": "three.ws is now live on CoinMarketCap - join the community page for real-time discussion and stay updated on the platform for 3D on-chain AI agents.",
+ "description": "three.ws is now live on CoinMarketCap: join the community page for real-time discussion and stay updated on the platform for 3D on-chain AI agents.",
"priority": 0.6,
"changefreq": "monthly",
"lastmod": "2026-05-17",
@@ -5125,7 +5141,7 @@
{
"path": "/blog/how-to-embed-3d-onchain-agents",
"title": "How to Embed 3D On-Chain Agents on Your Site",
- "description": "A complete walkthrough for embedding a three.ws 3D on-chain agent on any website using the <agent-3d> web component - from setup to CORS configuration and page integration.",
+ "description": "A complete walkthrough for embedding a three.ws 3D on-chain agent on any website using the <agent-3d> web component: from setup to CORS configuration and page integration.",
"priority": 0.5,
"changefreq": "monthly",
"lastmod": "2026-05-15",
@@ -5142,8 +5158,8 @@
},
{
"path": "/blog/three-ws-speraxusd-integration",
- "title": "three.ws Ships Inside SperaxUSD - DeFi Gets a 3D Face",
- "description": "three.ws is now integrated with SperaxOS, fully wired into the production DeFi stack. Agents get a 3D body, memory, voice, and an on-chain identity - and they react to DeFi events in real time.",
+ "title": "three.ws Ships Inside SperaxUSD: DeFi Gets a 3D Face",
+ "description": "three.ws is now integrated with SperaxOS, fully wired into the production DeFi stack. Agents get a 3D body, memory, voice, and an on-chain identity: and they react to DeFi events in real time.",
"priority": 0.6,
"changefreq": "monthly",
"lastmod": "2026-05-11",
@@ -5151,7 +5167,7 @@
},
{
"path": "/blog/agent-builder-studio-launch",
- "title": "Agent Builder Live - Studio Redesign, LLM Chat Upgrade",
+ "title": "Agent Builder Live: Studio Redesign, LLM Chat Upgrade",
"description": "three.ws ships Agent Builder, an improved Studio design, and a major LLM Chat upgrade. Agents are now payable, tradeable, and discoverable.",
"priority": 0.6,
"changefreq": "monthly",
@@ -5160,7 +5176,7 @@
},
{
"path": "/blog/animation-emotion-control",
- "title": "Full Animation & Emotion Control - Plus Pump.fun Live Feed",
+ "title": "Full Animation & Emotion Control: Plus Pump.fun Live Feed",
"description": "three.ws now ships full animation and emotion control for 3D agents, with live Pump.fun feed integration. Your agents react to any API or data feed in real time.",
"priority": 0.6,
"changefreq": "monthly",
@@ -5178,7 +5194,7 @@
{
"path": "/blog/three-token-listings",
"title": "$THREE Listed on Coinbase, CoinGecko, Jupiter, and Investing.com",
- "description": "$THREE is now listed and verified across Coinbase, CoinGecko, Jupiter Exchange, and Investing.com - giving the three.ws community every major on-ramp and price discovery surface.",
+ "description": "$THREE is now listed and verified across Coinbase, CoinGecko, Jupiter Exchange, and Investing.com: giving the three.ws community every major on-ramp and price discovery surface.",
"priority": 0.6,
"changefreq": "monthly",
"lastmod": "2026-05-05",
@@ -5187,7 +5203,7 @@
{
"path": "/blog/solana-wallet-integration",
"title": "Solana Wallet Integration for Autonomous 3D Agents",
- "description": "three.ws 3D agents now have native Solana wallets. Your agent can hold and spend money autonomously - earning from skills, paying for inference, and executing on-chain transactions while you sleep.",
+ "description": "three.ws 3D agents now have native Solana wallets. Your agent can hold and spend money autonomously: earning from skills, paying for inference, and executing on-chain transactions while you sleep.",
"priority": 0.6,
"changefreq": "monthly",
"lastmod": "2026-04-30",
diff --git a/docs/api-reference.md b/docs/api-reference.md
index d83b698ae..329bf9dc2 100644
--- a/docs/api-reference.md
+++ b/docs/api-reference.md
@@ -640,7 +640,120 @@ Your original body is never mutated, and none of this changes the response shape
## TTS API
-### Text-to-speech
+### Voice catalog
+
+```
+GET /api/tts/catalog
+```
+
+Every voice the platform can synthesize, across every provider, in one shape.
+Auth is optional: anonymous callers see the keyless lanes (Microsoft Edge,
+Gemini, NVIDIA), a session adds the metered ones (OpenAI, ElevenLabs), and an
+`x-eleven-key` header adds that account's ElevenLabs voices.
+
+**Query**
+
+| Param | Meaning |
+| --- | --- |
+| `provider` | `edge`, `gemini`, `nvidia`, `openai`, `elevenlabs`. Omit for all. |
+| `q` | Substring match over name, id, locale, and labels. |
+| `language` | Primary subtag or full locale, e.g. `ja`, `en-GB`. |
+| `limit` | Max voices returned (default 400, max 2000). |
+
+**Response**
+
+```json
+{
+ "providers": [
+ {
+ "id": "edge",
+ "label": "Microsoft Edge",
+ "billing": "free",
+ "usdPer1k": 0,
+ "byok": false,
+ "clone": false,
+ "direction": false,
+ "available": true,
+ "reason": null,
+ "models": [],
+ "defaultVoice": "en-US-AriaNeural"
+ }
+ ],
+ "voices": [
+ {
+ "id": "en-GB-SoniaNeural",
+ "name": "Sonia",
+ "provider": "edge",
+ "gender": "female",
+ "locale": "en-GB",
+ "language": "en",
+ "labels": { "categories": ["News"], "personalities": ["Authentic"] },
+ "preview_url": null
+ }
+ ],
+ "counts": { "edge": 316 },
+ "total": 316,
+ "truncated": false
+}
+```
+
+`billing` is `free` (no vendor cost), `gcp` (platform Google credits, also free
+to you), or `credits` (metered per 1,000 characters at `usdPer1k`). A lane that
+cannot serve is still listed, with `available: false` and a `reason`.
+
+### Speak on any provider
+
+```
+POST /api/tts/synthesize
+```
+
+One endpoint for every lane. Pass the `provider` + `voiceId` pair from the
+catalog. The free lanes work without auth (rate-limited per IP); the metered
+lanes require a session or bearer token.
+
+**Request body**
+
+```json
+{
+ "provider": "gemini",
+ "voiceId": "Sulafat",
+ "text": "Your agent is live.",
+ "model": "gemini-2.5-flash-preview-tts",
+ "direction": "Warm and unhurried, like sharing good news",
+ "speed": 1.0
+}
+```
+
+`model` and `direction` apply only where the lane supports them (the catalog's
+`models` and `direction` fields say which). `speed` is clamped to 0.5 to 2.0.
+Max 1,000 characters. ElevenLabs additionally accepts `voice_settings`.
+
+**Response**
+
+Audio binary in the lane's container (`audio/mpeg` for Edge and ElevenLabs,
+`audio/wav` for Gemini and NVIDIA, caller-chosen for OpenAI). Response headers:
+`x-tts-provider`, `x-tts-voice`, `x-tts-model`, `x-tts-format`,
+`x-tts-cache` (`hit`/`miss`), `x-tts-billing` (`free` | `gcp` | `byok` |
+`credits` | `cached`), and `x-tts-charged-usd` when credits were spent. Every
+clip is cached in R2 for 30 days on a hash of the full request; cache hits are
+never charged. A short credit balance returns `402 insufficient_credits` with a
+`top_up_url`.
+
+### ElevenLabs Voice Library
+
+```
+GET /api/tts/eleven/library
+POST /api/tts/eleven/library
+```
+
+Search the public catalog ElevenLabs users share (`q`, `gender`, `accent`,
+`age`, `category`, `language`, `use_cases`, `page`, `page_size` up to 100), then
+`POST { publicUserId, voiceId, name }` to copy one into the account behind the
+request (yours with `x-eleven-key`, the platform's otherwise). The POST returns
+a normal `voice_id` usable with `/api/tts/synthesize`. Both require auth and an
+ElevenLabs key.
+
+### Text-to-speech (ElevenLabs, streaming)
```
POST /api/tts/eleven
diff --git a/docs/start-here.md b/docs/start-here.md
index ac694b6a1..412843150 100644
--- a/docs/start-here.md
+++ b/docs/start-here.md
@@ -76,6 +76,7 @@ Curious what happens between the prompt and the model? [How the Forge works](./h
- **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
+- **Changing anything in the `/play` world?** → [How `/play` stays safe, honest, and light](./play-hardening.md): the invariants that keep the largest interactive surface on the platform from breaking. Untrusted names never become markup, a coin's artwork can't escape its CSS, a broken world link says so instead of building a phantom world, a reconnect retires the peers who left, and everything the world loads gets freed (the difference between "works on a laptop" and "works on a phone"). Each rule names the failure it prevents, because each one shipped once
- **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)
diff --git a/pages/airdrops.html b/pages/airdrops.html
index bb0d13b48..556b407bf 100644
--- a/pages/airdrops.html
+++ b/pages/airdrops.html
@@ -17,7 +17,7 @@
property="og:description"
content="Scan any wallet's real on-chain activity and see which airdrops it qualifies for, what's missing, and what to do next."
/>
- <meta property="og:image" content="https://three.ws/api/page-og?s=crypto&amp;t=Airdrop+Checker&amp;d=Scan+any+Solana+or+Ethereum+wallet%27s+real+on-chain+activity+and+see+which+airdrops+it+qualifies+for%2C+what%27s+missing%2C+and+what+to+do+next.&amp;p=%2Fairdrops" />
+ <meta property="og:image" content="https://three.ws/api/page-og?s=crypto&amp;t=Airdrop+Checker&amp;d=Check+any+Solana+or+Ethereum+wallet+against+tracked+airdrop+criteria%3A+a+real+on-chain+activity+scan%2C+a+0-100+eligibility+score+per+program%2C+exactly+what+is&amp;p=%2Fairdrops" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
@@ -27,7 +27,7 @@
name="twitter:description"
content="Scan any wallet's real on-chain activity and see which airdrops it qualifies for, what's missing, and what to do next."
/>
- <meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&amp;t=Airdrop+Checker&amp;d=Scan+any+Solana+or+Ethereum+wallet%27s+real+on-chain+activity+and+see+which+airdrops+it+qualifies+for%2C+what%27s+missing%2C+and+what+to+do+next.&amp;p=%2Fairdrops" />
+ <meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&amp;t=Airdrop+Checker&amp;d=Check+any+Solana+or+Ethereum+wallet+against+tracked+airdrop+criteria%3A+a+real+on-chain+activity+scan%2C+a+0-100+eligibility+score+per+program%2C+exactly+what+is&amp;p=%2Fairdrops" />
<meta name="theme-color" content="#0a0a0a" />
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
diff --git a/src/game/ambient-crowd.js b/src/game/ambient-crowd.js
index 85358aecd..45778d8e9 100644
--- a/src/game/ambient-crowd.js
+++ b/src/game/ambient-crowd.js
@@ -24,6 +24,7 @@ import {
AVATAR_DEFAULT, CLIP_IDLE, CLIP_WALK,
} from './avatar-rig.js';
import { loadCitizenPool, isCitizen, openCitizenProfile } from './npc/citizens.js';
+import { log } from '../shared/log.js';
const WORLD_RADIUS = 54; // a touch inside the plaza edge
const AMBIENT_SPEED = 1.7; // gentle stroll, slower than the player
@@ -346,6 +347,10 @@ class AmbientCrowd {
}
}
+// How long the world must have been standing before the crowd starts spending
+// on itself. See SETTLE_MS's use below for why this exists at all.
+const SETTLE_MS = 2500;
+
// ---- bootstrap: wait for the scene, then run an independent update loop ----
async function attach(attempt = 0) {
const cc = window.__CC__;
@@ -355,18 +360,42 @@ async function attach(attempt = 0) {
if (attempt < 300) setTimeout(() => attach(attempt + 1), 300);
return;
}
- await Promise.all([loadManifest(), loadAvatarPool()]);
const crowd = new AmbientCrowd(cc);
let last = performance.now();
let realCount = -1;
+ // When the current world became playable. The crowd is scenery, and scenery
+ // must never compete with the thing it decorates: populating it the instant
+ // the world opened put a gallery fetch, several multi-megabyte GLB downloads,
+ // and a skeleton retarget per wanderer directly on top of world entry, which
+ // is already the busiest moment of the session (physics boot, district build,
+ // the player's own avatar, the room join). Everything below waits out
+ // SETTLE_MS of actual world time first, so the player's own world lands
+ // clean and the crowd fills in behind it.
+ let worldSince = 0;
+ // Started once, on the first settled world, and awaited before the first
+ // wanderer is built. The pool fetch used to run at module load, i.e. during
+ // the page's cold boot, for a crowd that could not be shown for seconds yet.
+ let assets = null;
const tick = () => {
requestAnimationFrame(tick);
const now = performance.now();
const dt = Math.min(0.05, (now - last) / 1000);
last = now;
if (cc.phase === 'world') {
+ if (!crowd.active) { crowd.active = true; realCount = -1; worldSince = now; }
+ if (now - worldSince < SETTLE_MS) return;
+ if (!assets) {
+ // A failed emote manifest costs the crowd its gestures, not its
+ // existence, and the citizen pool resolves to [] rather than throwing.
+ // Swallow so neither turns into an unhandled rejection.
+ assets = Promise.all([loadManifest(), loadAvatarPool()])
+ .catch((e) => log.warn('[ambient-crowd] asset load failed:', e?.message));
+ }
+ // The pool is what decides which models a wanderer may wear, so building
+ // one before it resolves would dress the whole crowd in the default
+ // avatar. Hold the population (not the update loop) until it lands.
+ if (!_avatars) return;
const rc = (cc.remotes?.size) | 0;
- if (!crowd.active) { crowd.active = true; realCount = -1; }
if (rc !== realCount) { realCount = rc; crowd.sync(rc); }
crowd.update(dt);
} else if (crowd.active) {
diff --git a/src/game/forge-prop.js b/src/game/forge-prop.js
index 973500bcb..2c3aafcae 100644
--- a/src/game/forge-prop.js
+++ b/src/game/forge-prop.js
@@ -44,7 +44,8 @@ function headers(extra = {}) {
// A short palette-friendly display name for the forged prop.
export function forgePropName(prompt, file) {
const base = String(prompt || '').trim() || String(file?.name || '').replace(/\.[a-z0-9]+$/i, '');
- return (base || 'Forged item').slice(0, 24);
+ // Trim after clamping so a cut mid-phrase does not leave a dangling space.
+ return ((base || 'Forged item').slice(0, 24).trim()) || 'Forged item';
}
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
diff --git a/src/home-sniper.js b/src/home-sniper.js
index 006ade5e2..87a485f32 100644
--- a/src/home-sniper.js
+++ b/src/home-sniper.js
@@ -209,7 +209,12 @@ function applyStatus(root, s) {
if (!s) return;
let cls = 'live', label = 'Engine live';
+ // 'starved' means the process is fine and the wallets are empty: nothing can
+ // fill. It reads as offline to a visitor because, for every purpose they care
+ // about, it is. The pill promising "Engine live" over a fleet that had not
+ // completed a trade in ten days is the failure this state exists to end.
if (s.state === 'down') { cls = 'down'; label = 'Engine offline'; }
+ else if (s.state === 'starved') { cls = 'down'; label = 'Engine out of SOL'; }
else if (s.state === 'degraded') { cls = 'degraded'; label = 'Feed degraded'; }
else if (s.state === 'unknown') { cls = 'degraded'; label = 'Engine idle'; }
else if (s.alive === false) { cls = 'down'; label = 'Engine offline'; }
@@ -219,6 +224,10 @@ function applyStatus(root, s) {
if (text) text.textContent = label;
if (sub) {
const parts = [];
+ // Lead with the blocker when there is one: "13 strategies armed" beside a
+ // dead engine is the reassuring half of a true sentence.
+ if (s.state === 'starved') parts.push('no wallet can fund a trade');
+ else if (s.solvency?.state === 'degraded') parts.push(`${s.solvency.tradeable}/${s.solvency.agents} wallets funded`);
if (Number.isFinite(s.strategies)) parts.push(`${s.strategies} ${s.strategies === 1 ? 'strategy' : 'strategies'} armed`);
if (Number.isFinite(s.openPositions)) parts.push(`${s.openPositions} open`);
sub.textContent = parts.join(' · ');
diff --git a/src/shared/cinematic-render.js b/src/shared/cinematic-render.js
index c92440b56..a12fe650d 100644
--- a/src/shared/cinematic-render.js
+++ b/src/shared/cinematic-render.js
@@ -84,8 +84,18 @@ const _envCache = new Map();
/**
* Load a curated HDRI as the scene's IBL environment, PMREM-prefiltered.
- * Falls back to the procedural RoomEnvironment (still correct, just not a
- * real photograph) on fetch failure or when `preset` is null/'mobile' tier.
+ *
+ * The procedural RoomEnvironment is installed FIRST, synchronously, every time.
+ * It is convolved from a handful of emissive boxes and costs a millisecond, so
+ * it lights the scene on its very first frame. The HDRI then replaces it when it
+ * arrives. This ordering matters because the curated HDRIs are 1-2 MB files: a
+ * scene that waited for one rendered its metals and roughness response unlit for
+ * as long as that download took (measured at ~8s into a cold /play boot), then
+ * popped to full lighting all at once. Now the pop is a refinement of an already
+ * correct image rather than the moment the world becomes lit.
+ *
+ * The room environment is also the permanent answer when `preset` is null (the
+ * 'mobile'/'low' tier opts out of HDRIs entirely) or when the fetch fails.
* @param {import('three').WebGLRenderer} renderer
* @param {import('three').Scene} scene
* @param {'studio'|'outdoor'|'sunset'|null} preset
@@ -93,8 +103,14 @@ const _envCache = new Map();
export async function loadEnvironment(renderer, scene, preset = 'studio') {
const pmrem = new PMREMGenerator(renderer);
pmrem.compileEquirectangularShader();
+ const roomTarget = pmrem.fromScene(new RoomEnvironment(), 0.04);
+ scene.environment = roomTarget.texture;
+ scene.environmentIntensity ??= 1;
if (!preset || !HDRI_PRESETS[preset]) {
- scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
+ // PMREMGenerator holds its own materials and LOD planes; the render target
+ // it just handed back stays valid after the generator is disposed, so this
+ // frees the scratch without touching the environment map itself.
+ pmrem.dispose();
return scene.environment;
}
try {
@@ -106,13 +122,21 @@ export async function loadEnvironment(renderer, scene, preset = 'studio') {
hdrTexture = await new HDRLoader().loadAsync(HDRI_PRESETS[preset]);
_envCache.set(preset, hdrTexture);
}
- const envMap = pmrem.fromEquirectangular(hdrTexture).texture;
- scene.environment = envMap;
- scene.environmentIntensity ??= 1;
- return envMap;
- } catch (err) {
- scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
+ const envTarget = pmrem.fromEquirectangular(hdrTexture);
+ // Another loadEnvironment call (a coin switch rebuilding the world, a stage
+ // swapping presets) may have re-pointed the environment while this HDRI was
+ // in flight. Losing that race means our map is stale: free it rather than
+ // stamp it over the newer one.
+ if (scene.environment === roomTarget.texture) scene.environment = envTarget.texture;
+ else envTarget.dispose();
+ roomTarget.dispose();
return scene.environment;
+ } catch {
+ // Fetch or decode failed. The room environment installed above stands, so
+ // the scene is still lit; there is nothing to recover.
+ return scene.environment;
+ } finally {
+ pmrem.dispose();
}
}
diff --git a/vercel.json b/vercel.json
index 0638d3c56..e4262d30d 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1350,6 +1350,10 @@
"src": "/play/arena/?",
"dest": "/play/arena.html"
},
+ {
+ "src": "/play/war/?",
+ "dest": "/play/war.html"
+ },
{
"src": "/play/economy/?",
"dest": "/play/economy.html"
diff --git a/vite.config.js b/vite.config.js
index d873f33a4..0578ebc8e 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -636,6 +636,7 @@ const appConfig = {
play: resolve(__dirname, 'pages/play.html'),
'play-agent-wallet': resolve(__dirname, 'pages/play/agent-wallet.html'),
'play-arena': resolve(__dirname, 'pages/play/arena.html'),
+ 'play-war': resolve(__dirname, 'pages/play/war.html'),
'play-ufo': resolve(__dirname, 'pages/play/ufo.html'),
event: resolve(__dirname, 'pages/event.html'),
'play-economy': resolve(__dirname, 'pages/play/economy.html'),
@@ -1303,6 +1304,8 @@ support: resolve(__dirname, 'pages/support.html'),
'/play/agent-wallet/': resolve(root, 'pages/play/agent-wallet.html'),
'/play/arena': resolve(root, 'pages/play/arena.html'),
'/play/arena/': resolve(root, 'pages/play/arena.html'),
+ '/play/war': resolve(root, 'pages/play/war.html'),
+ '/play/war/': resolve(root, 'pages/play/war.html'),
'/smart-money': resolve(root, 'pages/smart-money.html'),
'/smart-money/': resolve(root, 'pages/smart-money.html'),
'/guardian': resolve(root, 'pages/guardian.html'),