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.

Sync workspace: pricing docs, RPC and wallet-monitor updates, page and locale regeneration

nirholas78f6bd64cf26
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b588cb90a..7a9a3f271 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Documentation overhaul: every directory now explains itself** — A full documentation pass across the repository. Previously undocumented areas now ship real READMEs: the five server-side platform agents (endpoint shopper, fact checker, tutor, unstoppable, x402 buildout), the site data files, the static page system, the blog pipeline, and the npm package index. A docs-wide link audit fixed every broken link, including roughly 317 in the combined docs file, whose generator now rebases links correctly. Orphaned reference docs (design tokens, use cases, the UX flow atlas, specs) are now reachable from the Start Here page. (`/docs/start-here`) `[docs]`
- **Fixed a wallet-balancing loop that was quietly burning swap fees** — The platform wallet that pays for agent-to-agent settlements holds both USDC (to pay other agents) and a little SOL (to pay Solana network fees). An automatic balancer kept each side topped up, but when the wallet was too small to satisfy both targets at once, the two rules fought: one swapped USDC into SOL, the next run swapped it straight back, over a hundred reversing swaps in an afternoon, each one paying exchange fees for nothing. The balancer now treats the SOL fee reserve as untouchable when topping up USDC, so the tug-of-war is structurally impossible, and the balancer itself keeps running even during database-storage pressure, since skipping it is what let the fee wallet run dry earlier today. `[fix, infra]`
- **More avatar rigs animate out of the box, including research-generated characters** — Avatars rigged with SMPL-style skeletons (the convention most research text-to-3D and mocap tools export, with bones named like left_hip, left_knee, left_elbow) previously uploaded fine but froze in a T-pose or slid around on stiff legs, because their bone names were not recognized. The bone matcher now understands these skeletons, correctly tells a collarbone apart from an upper arm when both share a name, and never gives two bones the same name (which could make animations grab the wrong joint). Full body animation, legs and arms included, now works for these characters the moment they are uploaded. `[improvement, fix]`
+- **Reliable .eth name lookups and a fixed docs link** — The free name-resolution API (/api/v1/resolve) kept timing out on .eth lookups because it leaned on rate-limited public Ethereum RPCs and gave up after five seconds. It now leads with the platform-configured mainnet RPC and dedicated keys, fails over across endpoints faster, and allows a more realistic time budget, so .eth names resolve as dependably as .sol names. Also, the old agent-3d docs address now lands on the web-component reference instead of an empty page. `[fix]`
- **Site quality sweep: sharing, search visibility, and accessibility fixes** — A full audit of the live site turned up a batch of quiet problems, now fixed. The Create pages were accidentally hidden from search engines by a leftover tag, so Google could not index the main way people start on three.ws; they are indexable again. Links to the Docs and Get Started pages now unfurl with a proper preview card when shared on X, Telegram, or Slack, and the AR Forge page got a complete share card too. For screen reader users: the Studio's preview-size buttons, the homepage minimap, and the AR QR code are now properly labeled, and footer sections are real headings you can navigate by. Legal pages got readable text contrast, copying the contract address now tells you if the copy was blocked instead of failing silently, and the homepage embed playground shows a helpful message with a way forward if a live avatar cannot load. `[improvement, fix]`
- **The agent economy now paces its spending to its fuel level, wallet by wallet** — The autonomous agent economy runs about a dozen paid pipelines that share a small set of platform wallets to pay Solana network fees. Until now each pipeline throttled only itself, so under scarcity they raced each other and could drain a shared wallet in hours, halting everything at once until someone topped it up. Every settlement now draws from a single daily fee budget per wallet, sized to that wallet's live balance: activity tapers smoothly as funds run low and speeds back up the moment the wallet is refueled, whichever pipeline is spending. External customers paying for three.ws services are never rate-limited by this; it governs only the platform's own wallets. `[infra, improvement]`
- **The agent economy now refills its own fuel tank instead of quietly running dry** — The live activity feed on /pulse had gone almost silent, and the cause turned out to be a plumbing problem rather than a lack of money. The platform funds its agents by sending them SOL to trade and launch with, but that path only ever ran one way. Agents kept what they were given plus whatever their trades returned, and the small shared wallet that pays the network fee on every agent-to-agent payment had no way to get any of it back. It eventually fell a fraction of a cent below the minimum it needs to sign a transaction, and every paid request across the platform started failing, even though the wider fleet was holding plenty. The funding cycle is now a full loop: when the fee wallet runs short, the platform automatically pulls idle SOL back from its own agent wallets to cover the gap. Agents that are actively trading keep their trading capital, agents holding an open position are left alone entirely, and wallets belonging to real users are never touched. We also added an audit tool that reports where every lamport in the fleet is sitting and where it has been moving. (`/pulse`) `[fix, infra]`
diff --git a/api/_lib/evm/rpc.js b/api/_lib/evm/rpc.js
index f2548a980..02b76fd78 100644
--- a/api/_lib/evm/rpc.js
+++ b/api/_lib/evm/rpc.js
@@ -38,9 +38,9 @@ const ALCHEMY_SUBDOMAIN = {
43113: 'avax-fuji',
};
-// Per-chain Alchemy key overrides — operators provision separate keys per app
-// (ALCHEMY_ETH_KEY, ALCHEMY_BASE_KEY, …); the shared ALCHEMY_API_KEY remains
-// the fallback for every chain.
+// Per-chain Alchemy key overrides: operators provision separate keys per app
+// (ALCHEMY_ETH_KEY, ALCHEMY_BASE_KEY, etc.); the shared ALCHEMY_API_KEY
+// remains the fallback for every chain.
const ALCHEMY_CHAIN_KEY = {
1: 'ALCHEMY_ETH_KEY',
10: 'ALCHEMY_OPT_KEY',
diff --git a/api/coin/README.md b/api/coin/README.md
new file mode 100644
index 000000000..8bc6a2b01
--- /dev/null
+++ b/api/coin/README.md
@@ -0,0 +1,63 @@
+# `api/coin/` - global crypto market data endpoints
+
+Read-only market-data endpoints behind the /coins section and the Markets tools. Each file is its own HTTP route (`api/coin/markets.js` serves `GET /api/coin/markets`, see [`api/README.md`](../README.md) for the routing rules). Most proxy CoinGecko through the shared helper [`../_lib/coingecko.js`](../_lib/coingecko.js), slim the multi-hundred-KB upstream payloads down to exactly what the page renders, and cache in-memory plus at the CDN.
+
+Why this layer exists instead of calling CoinGecko from the browser:
+
+- **Rate-limit survival.** CoinGecko's keyless/demo tiers cap at roughly 30 req/min. The proxy adds an in-memory cache with a stale buffer, a durable last-good copy in the shared cache, and CDN `s-maxage`, so a throttled upstream serves recent data instead of a blank page.
+- **Failover.** The load-bearing datapoints read through [`../_lib/market-fallbacks.js`](../_lib/market-fallbacks.js): CoinGecko first, then CoinPaprika and CoinLore for the stats bar and market table, and Kraken/Coinbase exchange candles for the headline OHLC charts. A single dead upstream no longer blanks /coins.
+- **Payload shaping.** Every handler returns only the fields its page renders, coerces non-finite numbers to `null` (never NaN in the UI), and sanitizes upstream HTML descriptions to plain text server-side.
+
+All endpoints are `GET`, CORS-open, and rate-limited per client IP via [`../_lib/rate-limit.js`](../_lib/rate-limit.js). Errors follow the platform shape from [`../_lib/http.js`](../_lib/http.js).
+
+## Endpoints
+
+| Route | Powers | Source |
+| --- | --- | --- |
+| `GET /api/coin/markets?page&per_page[&category][&q]` | /coins table, /category/:id table, coin search type-ahead | CoinGecko `/coins/markets` and `/search`, CoinLore fallback |
+| `GET /api/coin/global` | /coins stats bar (market cap, volume, dominance, Fear & Greed) | CoinGecko, CoinPaprika, CoinLore failover plus alternative.me |
+| `GET /api/coin/detail?id=<id>` or `?contract=<solana-mint>` | /coin/:id profile | CoinGecko `/coins/{id}` |
+| `GET /api/coin/ohlc?id=<id>&days=<1\|7\|30\|90\|365>` | /coin/:id price chart | CoinGecko `market_chart`, Kraken/Coinbase candle fallback |
+| `GET /api/coin/tickers?id=<id>&page=1` | /coin/:id exchange listings table | CoinGecko `/coins/{id}/tickers` |
+| `GET /api/coin/pool?address=<token>&network=<net>` | /coin/:id GeckoTerminal chart embed (pool resolution) | GeckoTerminal via [`../_lib/market/ohlcv.js`](../_lib/market/ohlcv.js) |
+| `GET /api/coin/news?q=<coin name>&limit=8` | /coin/:id related-news rail | Native aggregator [`../_lib/news.js`](../_lib/news.js) |
+| `GET /api/coin/trending` | /markets/trending | CoinGecko `/search/trending` |
+| `GET /api/coin/categories` | /categories leaderboard | CoinGecko `/coins/categories` |
+| `GET /api/coin/category?id=<slug>` | /category/:id detail | CoinGecko `/coins/categories` (one cached fetch serves all) |
+| `GET /api/coin/exchanges` | /exchanges table | CoinGecko `/exchanges`, volumes converted to USD |
+| `GET /api/coin/exchange?id=<slug>[&days][&view=chart]` | /exchange/:id detail (spot and derivatives venues) | CoinGecko `/exchanges/{id}` plus `volume_chart` |
+| `GET /api/coin/derivatives[?view=exchanges]` | /derivatives (perp contracts and venues) | CoinGecko `/derivatives` |
+| `GET /api/coin/fear-greed?limit=<1..365>` | /fear-greed index and history chart | alternative.me `/fng` |
+| `GET /api/coin/gas` | /gas Ethereum fee tiers with USD estimates | On-chain `eth_feeHistory` via public RPC, no gas API |
+| `GET /api/coin/rates` | /converter fiat rates | CoinGecko `/exchange_rates` |
+| `GET /api/coin/liquidations` | /coins liquidations pulse strip | [`services/liquidation-collector`](../../services/liquidation-collector/README.md) |
+| `GET /api/coin/:mint/cohorts[?cohort&…]` | Holder cohorts for one agent token (creator-gated export) | Platform DB, see [`[mint]/cohorts.js`](./%5Bmint%5D/cohorts.js) |
+
+Frontend consumers live in `src/`: `coins-index.js`, `coin-page.js`, `markets-page.js`, `markets-trending.js`, `categories.js`, `category-page.js`, `exchanges.js`, `exchange-page.js`, `derivatives.js`, `fear-greed.js`, `gas.js`, `converter.js`, plus the Markets tools `heatmap.js`, `screener.js`, and `compare.js`. The public pages are declared in [`data/pages.json`](../../data/pages.json) (/coins, /heatmap, /screener, /compare, /categories, /exchanges, /derivatives, /fear-greed, /gas, /converter, /markets/trending).
+
+## Shared internals
+
+- [`../_lib/coingecko.js`](../_lib/coingecko.js) exports `geckoFetch(path, { ttlMs, timeoutMs })`, the one CoinGecko fetch: base URL, optional `COINGECKO_API_KEY` (demo tier, works key-free), per-instance memory cache with a 30-minute stale buffer, a durable last-good copy in Upstash, and automatic key benching when an exhausted demo key starts rejecting requests. It throws with `.status` set on non-OK responses so callers can tell 404 (unknown coin, a real answer) from 429/5xx (upstream trouble, serve stale). Also exports `isPlausibleCoinId` and `htmlToText`.
+- [`../_lib/market-fallbacks.js`](../_lib/market-fallbacks.js) exports the failover reads: `fetchGlobalMarket()`, `fetchMarketsTable({ page, perPage, category })`, `fetchCoinPriceUsd(coingeckoId)`, and `fetchExchangeChart(id, days)`.
+- `markets.js` itself exports `searchCoins(q)`, reused by the paid Market Data API in [`../_lib/market-data/`](../_lib/market-data/) so the x402 market-coins endpoint shares the same id resolver.
+
+## Usage
+
+No install step: these deploy with the rest of `api/` and run locally under the dev server (`npm run dev`, port 3000, Vite proxies `/api`). They work with zero configuration; two env vars are optional:
+
+- `COINGECKO_API_KEY` (demo tier) lifts the public CoinGecko rate limit.
+- `LIQUIDATION_COLLECTOR_URL` points at the liquidation collector; unset, `/api/coin/liquidations` answers `503 { "error": "collector_offline" }` and the UI shows its designed offline state. No synthetic numbers, ever.
+
+Example, straight from the route contract at the top of [`markets.js`](./markets.js) (`GET /api/coin/markets?page=1&per_page=100` returns ranked market table rows):
+
+```sh
+curl -s 'https://three.ws/api/coin/markets?page=1&per_page=5' | head -c 600
+```
+
+Returns `{ "coins": [ { rows with rank, price, 24h change, market cap, downsampled 7d sparkline } ], "page": 1, "per_page": 5, "category": null }`. Add `?q=solana` for the search shape instead, or `&category=layer-1` to scope the table to one CoinGecko category.
+
+## Related
+
+- [`api/README.md`](../README.md), how routing, `_lib/`, and crons work across the whole API surface.
+- [`services/liquidation-collector/README.md`](../../services/liquidation-collector/README.md), why the liquidations feed is a standalone long-lived service.
+- [`STRUCTURE.md`](../../STRUCTURE.md), the map of every product surface.
diff --git a/api/v1/resolve.js b/api/v1/resolve.js
index 585de6384..3cdd31a7b 100644
--- a/api/v1/resolve.js
+++ b/api/v1/resolve.js
@@ -38,7 +38,7 @@ const HIT_CACHE_CONTROL = 'public, max-age=300, s-maxage=300, stale-while-revali
// costs on misses.
const ENS_TIMEOUT_MS = 8000;
-// Ethereum mainnet (chainId 1) — ENS is a mainnet-only registry. Pin the
+// Ethereum mainnet (chainId 1); ENS is a mainnet-only registry. Pin the
// operator's mainnet RPC first (same as api/agents/ens/[name].js) so prod
// never leads with a rate-limited public endpoint.
async function ensProvider() {
diff --git a/character-studio/README.md b/character-studio/README.md
index 5725da563..aff6c662a 100644
--- a/character-studio/README.md
+++ b/character-studio/README.md
@@ -1,7 +1,105 @@
-# Character Studio
+# Avatar Studio (Character Studio fork)
-This directory contains the Character Studio application.
+The trait-based 3D avatar builder behind the "three.ws Studio" option in the platform's avatar creator. A user picks a base character class, swaps and tints hair, clothing, and accessory traits with live 3D preview, and exports an optimized, animation-ready GLB or VRM. No modeling experience required.
-## Overview
+This directory is a rebranded fork of the MIT-licensed [M3-org/CharacterStudio](https://github.com/M3-org/CharacterStudio) (React 19 + Three.js + VRM). Upstream attribution lives in [LICENSE](LICENSE). The platform's separate from-scratch sculpting builder (the page at `three.ws/avatar-studio` and `/create/studio`) is a native implementation documented in [../docs/avatar-studio.md](../docs/avatar-studio.md); this fork is the trait-swapping builder that runs inside the Avatar Creator iframe. Product-level documentation for this fork: [../docs/character-studio.md](../docs/character-studio.md).
-...
+## Why it exists
+
+Every three.ws agent needs an avatar, and not every user wants to generate one from a prompt or a selfie. This app gives them a point-and-click builder whose output plugs straight into the rest of the platform: the exported GLB drives the animation library, the emotion system, AR viewing, and the `<agent-3d>` embed. It runs entirely in the browser against same-origin assets, so there is no third-party avatar SDK dependency.
+
+## Where it runs
+
+- **Embedded (primary):** the agent edit page opens it in a modal iframe via the Avatar Creator wrappers ([../src/avatar-creator.js](../src/avatar-creator.js) in-app, [../avatar-sdk/src/creator.js](../avatar-sdk/src/creator.js) in the published `@three-ws/avatar` SDK). The user clicks **Save Avatar** and the GLB is handed back to the host page.
+- **Standalone demo:** mounted on the Avatar OS demo page at [three.ws/demo/avatar-os](https://three.ws/demo/avatar-os).
+- **In production** the compiled app is served same-origin under the `/avatar-studio/` path prefix. The root build copies [build/](build) into `dist/avatar-studio` via [../scripts/copy-avatar-studio.mjs](../scripts/copy-avatar-studio.mjs); the Vite `base` is pinned to `/avatar-studio/` in [vite.config.js](vite.config.js) so every emitted asset URL matches.
+
+## Install and run
+
+```bash
+cd character-studio
+npm install
+npm run dev # Vite dev server on port 5173 (base path /avatar-studio/)
+```
+
+Open `http://localhost:5173/avatar-studio/` in a browser.
+
+Other scripts:
+
+```bash
+npm run build # production build to ./build
+npm run serve # preview the production build
+npm test # vitest (unit + integration, see tests/)
+npm run lint # eslint + prettier
+npm run get-assets # clone the upstream loot-assets trait library into public/
+```
+
+From the repo root, `npm run build:avatar-studio` runs the build here, and `npm run ensure:avatar-studio` builds only if `build/index.html` is missing.
+
+## Configuration
+
+Environment variables (see [.env.example](.env.example)):
+
+| Variable | Purpose |
+|---|---|
+| `VITE_ASSET_PATH` | Root the app fetches `manifest.json` and trait assets from. Empty means same-origin, i.e. the files in [public/](public). |
+| `VITE_OPENSEA_KEY` | OpenSea API key for the NFT trait-ownership checks. |
+| `VITE_HELIUS_KEY` | Helius RPC key for the Solana flows. |
+| `VITE_VALIDATION_SERVER_URL` | Mint validation server for the claim/mint pages. |
+
+Character classes and their trait slots are declared in [public/manifest.json](public/manifest.json). In production, trait assets are the upstream [loot-assets](https://github.com/m3-org/loot-assets) library mirrored same-origin through `GET /api/studio-assets/<path>` ([../api/studio-assets/\[...path\].js](../api/studio-assets/%5B...path%5D.js)) so the browser never hits a vendor CDN.
+
+## Architecture
+
+Entry chain: [index.html](index.html) loads [src/Main.jsx](src/Main.jsx) (context providers: account, scene, view, audio, language) which renders [src/App.jsx](src/App.jsx). `App.jsx` fetches the manifest and routes between the view-mode pages in [src/pages/](src/pages): `Landing`, `Create`, `Appearance` (the main builder), `Save`, `Load`, `Mint`, `Wallet`, `Claim`, `Optimizer`, `BatchDownload`, `BatchManifest`, and `Studio`.
+
+The engine lives in [src/library/](src/library) and has its own module index in [src/library/README.md](src/library/README.md). The load-bearing pieces:
+
+- `characterManager.js`: loads classes, swaps traits, owns `downloadGLB()` / `downloadVRM()`
+- `merge-geometry.js`, `cull-mesh.js`, `create-texture-atlas.js`: export-time optimization (mesh merge, hidden-face culling, texture atlasing, optional KTX2 compression)
+- `VRMExporter.js` / `VRMExporterv0.js`: VRM 1 and VRM 0 export
+- `animationManager.js`, `blinkManager.js`, `lookatManager.js`, `lipsync.js`: preview animation and face runtime
+
+## Public interface: the export contract
+
+This is an application, not an npm library; nothing here is imported by other code. Its one public API is the postMessage contract a host page relies on when the app is embedded in an iframe. When `window.self !== window.top`, the export menu ([src/components/ExportMenu.jsx](src/components/ExportMenu.jsx)) replaces the GLB/VRM download buttons with a single **Save Avatar** button that posts the finished avatar to the parent window:
+
+```js
+window.parent.postMessage(
+ { source: 'characterstudio', type: 'export', format: 'glb', glb: arrayBuffer },
+ '*',
+ [arrayBuffer], // transferred, not copied
+);
+```
+
+`glb` is the binary glTF as a transferable `ArrayBuffer`. Standalone (top-level window), the same menu offers direct **GLB**, **VRM 0**, and **VRM 1** downloads instead.
+
+## Example: receive an avatar from the embedded studio
+
+The published SDK wraps the contract above. This is the real consumer path (from [../avatar-sdk/src/creator.js](../avatar-sdk/src/creator.js), also shown in [../avatar-sdk/README.md](../avatar-sdk/README.md)):
+
+```js
+import { AvatarCreator } from '@three-ws/avatar/creator';
+
+const creator = new AvatarCreator({
+ onExport: (blob) => {
+ // blob is the finished avatar, type model/gltf-binary
+ console.log('avatar GLB:', blob.size, 'bytes');
+ },
+ onClose: () => console.log('closed without exporting'),
+});
+await creator.open();
+```
+
+`AvatarCreator` opens this app in a modal iframe (default URL `https://three.ws/avatar-studio/`, overridable with `studioUrl` for a local dev server), verifies the message origin against the iframe it opened, and resolves the `characterstudio` export payload into a `Blob` before closing the modal.
+
+## Tests
+
+`npm test` runs the vitest suite in [tests/](tests) (unit tests for the library modules plus integration tests, jsdom environment). The root repo's `npm test` gate does not include this suite; run it here when touching this directory.
+
+## Related surfaces
+
+- Row in the platform map: [../STRUCTURE.md](../STRUCTURE.md) ("Avatar builder (full app)")
+- Product docs: [../docs/character-studio.md](../docs/character-studio.md)
+- Native sculpting builder (separate app): [../docs/avatar-studio.md](../docs/avatar-studio.md)
+- Consumer SDK: [../avatar-sdk/](../avatar-sdk)
diff --git a/pages/agi.html b/pages/agi.html
index f14e9c9b6..4eea0de7d 100644
--- a/pages/agi.html
+++ b/pages/agi.html
@@ -52,7 +52,24 @@
<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
<main class="agi-shell" id="agi-root" aria-labelledby="agi-title">
- <!-- hydrated by /src/agi.js -->
+ <!-- Static fallback for crawlers, slow connections, and JS-off visitors.
+ /src/agi.js hydrates by replacing this root's innerHTML wholesale,
+ so everything below is swapped out the moment the app boots. -->
+ <section class="agi-hero">
+ <div class="agi-hero-copy">
+ <span class="agi-domain-tag"><i class="agi-dot"></i> memecoin trading · pump.fun</span>
+ <h1 class="agi-title" id="agi-title">The first AGI.<br /><span class="agi-em">Narrow by design.</span></h1>
+ <p class="agi-lede">A single autonomous agent that is genuinely superhuman at one thing: trading memecoins on pump.fun (Solana), and deliberately nothing else. Watch it think, trade, and be held to a chain-proven track record in real time.</p>
+ <noscript>
+ <p class="agi-thesis">The live stream of its decisions, its embodied 3D avatar, and its reconciled track record need JavaScript. Enable JavaScript and reload to watch it work.</p>
+ <div class="agi-hero-actions">
+ <a class="agi-btn agi-btn-primary" href="/">three.ws home</a>
+ <a class="agi-btn" href="/ledger">Browse the proof ledger</a>
+ <a class="agi-btn" href="/docs">Read the docs</a>
+ </div>
+ </noscript>
+ </div>
+ </section>
</main>
<script type="module" src="/src/agi.js"></script>
diff --git a/pages/home.html b/pages/home.html
index 1a57a85e5..5b1d5306a 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -589,6 +589,105 @@
}
.door-screenshot img { width: 100%; height: 100%; object-fit: cover; display: block; }
+ /* ── START PATH (lite entry: three steps under the hero) ─── */
+ .start-path { border-top: 1px solid var(--hairline); padding: 44px 0 48px; }
+ .start-path-head {
+ display: flex; align-items: baseline; justify-content: space-between;
+ gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
+ }
+ .start-path-eyebrow {
+ font-family: var(--font-mono); font-size: 11.5px;
+ letter-spacing: 0.2em; text-transform: uppercase;
+ color: var(--text-3); margin: 0;
+ }
+ .start-path-note { font-size: 13px; color: var(--text-3); margin: 0; }
+ .start-path-note a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
+ .start-path-note a:hover, .start-path-note a:focus-visible { color: var(--text); }
+ .start-steps {
+ display: grid; grid-template-columns: repeat(3, 1fr);
+ gap: 1px; background: var(--hairline);
+ border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden;
+ }
+ @media (max-width: 980px) { .start-steps { grid-template-columns: 1fr; } }
+ .start-step {
+ background: var(--surface-0); padding: 24px 26px 22px;
+ display: flex; flex-direction: column; gap: 9px;
+ transition: background 0.15s;
+ }
+ .start-step:hover { background: var(--surface-1); }
+ .start-step:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; background: var(--surface-1); }
+ .start-step-num {
+ font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.18em;
+ color: var(--text-3); display: flex; justify-content: space-between; align-items: baseline;
+ }
+ .start-step-num .time { letter-spacing: 0.06em; text-transform: none; }
+ .start-step h3 {
+ font-family: var(--font-display); font-size: 21px; font-weight: 600;
+ letter-spacing: -0.02em; line-height: 1.15; margin: 0;
+ display: flex; align-items: center; gap: 10px;
+ }
+ .start-step h3 .arrow { color: var(--text-3); transition: transform 0.18s, color 0.18s; }
+ .start-step:hover h3 .arrow { transform: translateX(4px); color: var(--text); }
+ .start-step p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
+
+ /* ── ADVANCED TIER (progressive disclosure) ────────────────
+ html.home-lite is applied pre-paint from localStorage; the gate
+ section (#advanced-gate) toggles it and persists the choice. */
+ html.home-lite [data-tier="advanced"] { display: none; }
+ .adv-gate { border-top: 1px solid var(--hairline); padding: 64px 0; }
+ .adv-gate-card {
+ border: 1px solid var(--hairline-strong); border-radius: 14px;
+ background: var(--surface-0); padding: 36px 38px;
+ display: flex; flex-wrap: wrap; align-items: center;
+ justify-content: space-between; gap: 28px;
+ transition: padding 0.2s;
+ }
+ @media (max-width: 720px) { .adv-gate-card { padding: 26px 24px; } }
+ .adv-gate-text { max-width: 680px; }
+ .adv-gate-eyebrow {
+ font-family: var(--font-mono); font-size: 11.5px;
+ letter-spacing: 0.2em; text-transform: uppercase;
+ color: var(--text-3); margin: 0 0 12px;
+ }
+ .adv-gate-h {
+ font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px);
+ line-height: 1.08; letter-spacing: -0.025em; font-weight: 600; margin: 0 0 12px;
+ }
+ .adv-gate-h em { font-style: normal; color: var(--text-3); font-weight: 500; }
+ .adv-gate-desc { margin: 0 0 18px; font-size: 14.5px; line-height: 1.55; color: var(--text-2); max-width: 560px; }
+ .adv-gate-topics { display: flex; flex-wrap: wrap; gap: 8px; }
+ .adv-topic {
+ font-family: var(--font-mono); font-size: 12px; color: var(--text-2);
+ padding: 6px 12px; border: 1px solid var(--hairline-strong); border-radius: 999px;
+ background: transparent; transition: color 0.15s, border-color 0.15s, background 0.15s;
+ }
+ .adv-topic:hover, .adv-topic:focus-visible { color: var(--text); border-color: var(--text); background: var(--surface-1); }
+ .adv-toggle {
+ flex-shrink: 0; cursor: pointer;
+ background: var(--text); color: var(--bg); border: 1px solid var(--text);
+ padding: 13px 22px; border-radius: 9px; font-size: 14px; font-weight: 600;
+ display: inline-flex; align-items: center; gap: 10px;
+ transition: opacity 0.15s, transform 0.15s;
+ }
+ .adv-toggle:hover { opacity: 0.88; }
+ .adv-toggle:active { transform: translateY(1px); }
+ .adv-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
+ .adv-toggle .adv-toggle-hide { display: none; }
+ /* Expanded state: the gate compacts into a slim divider with a collapse control. */
+ html:not(.home-lite) .adv-gate { padding: 36px 0; }
+ html:not(.home-lite) .adv-gate-card { padding: 20px 24px; }
+ html:not(.home-lite) .adv-gate-h,
+ html:not(.home-lite) .adv-gate-desc,
+ html:not(.home-lite) .adv-gate-topics { display: none; }
+ html:not(.home-lite) .adv-gate-eyebrow { margin: 0; }
+ html:not(.home-lite) .adv-toggle {
+ background: transparent; color: var(--text); border-color: var(--hairline-strong);
+ font-weight: 500; padding: 9px 16px; font-size: 13px;
+ }
+ html:not(.home-lite) .adv-toggle:hover { border-color: var(--text); opacity: 1; }
+ html:not(.home-lite) .adv-toggle .adv-toggle-show { display: none; }
+ html:not(.home-lite) .adv-toggle .adv-toggle-hide { display: inline; }
+
/* ── BENTO GRID ──────────────────────────────────────────── */
.bento {
display: grid;
@@ -2750,6 +2849,35 @@
</div>
</section>
+<!-- ── START PATH ─ the lite entry. First-time visitors get three named
+ steps (avatar → agent → publish) before any feature depth; the deep
+ platform sits behind #advanced-gate further down. -->
+<section class="start-path" aria-label="Start here: three steps">
+ <div class="wrap-1280">
+ <div class="start-path-head">
+ <p class="start-path-eyebrow" data-i18n="home.lite_start_here">Start here &middot; three steps, about five minutes</p>
+ <p class="start-path-note" data-i18n-html="home.lite_power_note">Power user? <a href="#advanced-gate">Skip to the advanced platform &darr;</a></p>
+ </div>
+ <div class="start-steps">
+ <a class="start-step" href="/create/prompt" data-cta="lite_create_avatar" data-cta-loc="start_path">
+ <span class="start-step-num"><span>01</span><span class="time" data-i18n="home.lite_time_1_min">~1 min</span></span>
+ <h3><span data-i18n="home.lite_create_avatar">Create a 3D avatar</span><span class="arrow" aria-hidden="true">&rarr;</span></h3>
+ <p data-i18n="home.lite_create_avatar_desc">Describe a character, or start from a selfie. You get a rigged, animated avatar you own.</p>
+ </a>
+ <a class="start-step" href="/create-agent" data-cta="lite_build_agent" data-cta-loc="start_path">
+ <span class="start-step-num"><span>02</span><span class="time" data-i18n="home.lite_time_3_min">~3 min</span></span>
+ <h3><span data-i18n="home.lite_build_agent">Build an AI agent</span><span class="arrow" aria-hidden="true">&rarr;</span></h3>
+ <p data-i18n="home.lite_build_agent_desc">Give your avatar a personality, a voice, and skills in the guided wizard.</p>
+ </a>
+ <a class="start-step" href="#embed" data-cta="lite_publish" data-cta-loc="start_path">
+ <span class="start-step-num"><span>03</span><span class="time" data-i18n="home.lite_time_1_min_more">~1 min</span></span>
+ <h3><span data-i18n="home.lite_publish">Publish anywhere</span><span class="arrow" aria-hidden="true">&rarr;</span></h3>
+ <p data-i18n="home.lite_publish_desc">Two lines of HTML put your agent on any site. Try the live embed below.</p>
+ </a>
+ </div>
+ </div>
+</section>
+
<section class="block" id="home-forge">
<div class="wrap-1280">
<div class="block-head reveal">
@@ -3189,6 +3317,70 @@
</div>
</section>
+<!-- ── ADVANCED PLATFORM GATE ─ progressive disclosure. Sections tagged
+ data-tier="advanced" collapse behind this band for the lite tier
+ (html.home-lite, applied pre-paint in <head> from localStorage
+ 'tws-home:tier'). Expanding persists; deep links into a gated section
+ auto-expand for that visit without persisting. -->
+<section class="adv-gate" id="advanced-gate" aria-label="Advanced platform">
+ <div class="wrap-1280">
+ <div class="adv-gate-card">
+ <div class="adv-gate-text">
+ <p class="adv-gate-eyebrow" data-i18n="home.lite_adv_eyebrow">For power users</p>
+ <h2 class="adv-gate-h" data-i18n-html="home.lite_adv_h">The full platform, <em>when you want it.</em></h2>
+ <p class="adv-gate-desc" data-i18n="home.lite_adv_desc">Everything above takes you from a prompt to a published agent. The deep end is one click away:</p>
+ <div class="adv-gate-topics">
+ <a class="adv-topic" href="#home-sniper" data-i18n="home.lite_topic_trading">Autonomous trading</a>
+ <a class="adv-topic" href="#home-capabilities" data-i18n="home.lite_topic_capabilities">Full capability grid</a>
+ <a class="adv-topic" href="#home-token-economy" data-i18n="home.lite_topic_token">Token economy</a>
+ <a class="adv-topic" href="#home-live-economy" data-i18n="home.lite_topic_live_economy">Live agent economy</a>
+ <a class="adv-topic" href="#home-oracle" data-i18n="home.lite_topic_oracle">Oracle scoring</a>
+ <a class="adv-topic" href="#home-x402" data-i18n="home.lite_topic_x402">Pay-per-call payments</a>
+ <a class="adv-topic" href="#home-dev-platform" data-i18n="home.lite_topic_dev">API, SDK &amp; MCP</a>
+ <a class="adv-topic" href="#home-stack" data-i18n="home.lite_topic_stack">The stack</a>
+ </div>
+ </div>
+ <button type="button" class="adv-toggle" id="adv-toggle" data-cta="advanced_toggle" data-cta-loc="advanced_gate"
+ aria-controls="home-sniper home-capabilities home-token-economy home-live-economy home-oracle home-x402 home-dev-platform home-stack">
+ <span class="adv-toggle-show" data-i18n="home.lite_show_advanced">Show the advanced platform</span>
+ <span class="adv-toggle-hide" data-i18n="home.lite_hide_advanced">Hide advanced sections</span>
+ </button>
+ </div>
+ </div>
+</section>
+<script>
+// Advanced-tier runtime: toggle + persistence + deep-link auto-expand.
+// The boot script in <head> already applied html.home-lite before paint.
+(function () {
+ var KEY = 'tws-home:tier';
+ var root = document.documentElement;
+ var btn = document.getElementById('adv-toggle');
+ function isLite() { return root.classList.contains('home-lite'); }
+ function setLite(lite, persist) {
+ root.classList.toggle('home-lite', lite);
+ if (btn) btn.setAttribute('aria-expanded', String(!lite));
+ if (persist) { try { localStorage.setItem(KEY, lite ? 'lite' : 'full'); } catch (e) {} }
+ }
+ if (btn) {
+ btn.setAttribute('aria-expanded', String(!isLite()));
+ btn.addEventListener('click', function () { setLite(!isLite(), true); });
+ }
+ // A hash pointing inside a gated section (nav links, shared URLs, the
+ // topic chips above) expands the tier for this visit and scrolls there.
+ function revealForHash() {
+ var hash = location.hash;
+ if (!hash || hash.length < 2 || !isLite()) return;
+ var el = null;
+ try { el = document.getElementById(decodeURIComponent(hash.slice(1))); } catch (e) { return; }
+ if (!el || !el.closest('[data-tier="advanced"]')) return;
+ setLite(false, false);
+ requestAnimationFrame(function () { el.scrollIntoView({ block: 'start' }); });
+ }
+ revealForHash();
+ window.addEventListener('hashchange', revealForHash);
+})();
+</script>
+
<!-- ── AUTONOMOUS SNIPING & TRADING ─────────────────────────────── -->
<style>
#home-sniper .snipe-lede-pill {
@@ -3390,7 +3582,7 @@
#home-sniper .snipe-kpi-val.loading { animation: none; }
}
</style>
-<section class="block" id="home-sniper">
+<section class="block" id="home-sniper" data-tier="advanced">
<div class="wrap-1280">
<div class="block-head reveal">
<p class="block-eyebrow" data-i18n-html="home.03autonomous_trading"><span class="num">03</span>Autonomous trading</p>
@@ -5046,7 +5238,7 @@
</script>
<!-- ── FEATURE BENTO ─────────────────────────────────────────────── -->
-<section class="block">
+<section class="block" id="home-capabilities" data-tier="advanced">
<div class="wrap-1280">
<div class="block-head reveal">
<p class="block-eyebrow" data-i18n-html="home.03capabilities"><span class="num">03</span>Capabilities</p>
@@ -5341,7 +5533,7 @@
</section>
<!-- ── PUMP.FUN INTEGRATION ───────────────────────────────────────── -->
-<section class="block">
+<section class="block" id="home-token-economy" data-tier="advanced">
<div class="wrap-1280">
<div class="block-head reveal">
<p class="block-eyebrow" data-i18n-html="home.04token_economy"><span class="num">04</span>Token economy</p>
@@ -5390,7 +5582,7 @@
</section>
<!-- ── LIVE ECONOMY ──────────────────────────────────────────────────── -->
-<section class="block">
+<section class="block" id="home-live-economy" data-tier="advanced">
<div class="wrap-1280">
<div class="block-head reveal">
<p class="block-eyebrow" data-i18n-html="home.05live_economy"><span class="num">05</span>Live economy</p>
@@ -5406,7 +5598,7 @@
</section>
<!-- ── ORACLE CONVICTION ─────────────────────────────────────────────── -->
-<section class="block">
+<section class="block" id="home-oracle" data-tier="advanced">
<div class="wrap-1280">
<div class="feat-split reveal">
<div class="feat-text">
@@ -5441,7 +5633,7 @@
</section>
<!-- ── PAY-PER-CALL EARN ──────────────────────────────────────────────────── -->
-<section class="block">
+<section class="block" id="home-x402" data-tier="advanced">
<div class="wrap-1280">
<div class="feat-split rev reveal">
<div class="feat-text">
@@ -5555,7 +5747,7 @@
</section>
<!-- ── DEVELOPER PLATFORM ─────────────────────────────────────────── -->
-<section class="block">
+<section class="block" id="home-dev-platform" data-tier="advanced">
<div class="wrap-1280">
<div class="block-head reveal">
<p class="block-eyebrow" data-i18n-html="home.06developer_platform"><span class="num">06</span>Developer platform</p>
@@ -5736,7 +5928,7 @@
</section>
<!-- ── 3D STACK ────────────────────────────────────────────────────── -->
-<section class="block">
+<section class="block" id="home-stack" data-tier="advanced">
<div class="wrap-1280">
<div class="block-head reveal">
<p class="block-eyebrow" data-i18n-html="home.08the_stack"><span class="num">08</span>The stack</p>
diff --git a/pages/oracle.html b/pages/oracle.html
index 0261bca4e..bed37dd3b 100644
--- a/pages/oracle.html
+++ b/pages/oracle.html
@@ -679,6 +679,18 @@
</div>
</header>
+ <noscript>
+ <div class="state" style="border:1px solid var(--line);border-radius:14px;margin-bottom:20px">
+ <b>Oracle needs JavaScript</b>
+ Oracle fuses who's buying, how they're buying, what the coin is, and how it's moving into one live conviction score for every pump.fun launch, and lets your 3D AI agent act on the highest-conviction plays. The live feed, scores, and charts stream in with JavaScript enabled, so turn it on and reload.
+ <div style="margin-top:14px;display:flex;gap:10px;justify-content:center;flex-wrap:wrap">
+ <a class="btn" href="/">three.ws home</a>
+ <a class="btn" href="/oracle/docs">How Oracle works</a>
+ <a class="btn" href="/agents">Browse agents</a>
+ </div>
+ </div>
+ </noscript>
+
<nav class="tabs" role="tablist">
<button class="tab on" data-view="feed" role="tab" data-i18n-html="oracle.live_conviction">Live conviction <span class="ct" id="ctFeed"></span></button>
<button class="tab" data-view="movers" role="tab" data-i18n="oracle.movers">Movers ↑</button>
diff --git a/public/changelog.json b/public/changelog.json
index 4ceeb236c..8c21d6e6a 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-28T21:45:22.034Z",
+ "generated_at": "2026-07-28T21:56:35.183Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -91,6 +91,16 @@
"fix"
]
},
+ {
+ "date": "2026-07-28",
+ "type": "update",
+ "title": "Reliable .eth name lookups and a fixed docs link",
+ "summary": "The free name-resolution API (/api/v1/resolve) kept timing out on .eth lookups because it leaned on rate-limited public Ethereum RPCs and gave up after five seconds. It now leads with the platform-configured mainnet RPC and dedicated keys, fails over across endpoints faster, and allows a more realistic time budget, so .eth names resolve as dependably as .sol names. Also, the old agent-3d docs address now lands on the web-component reference instead of an empty page.",
+ "link": null,
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-28",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 7f67229b8..bc430b9a3 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -70,6 +70,14 @@
<category>improvement</category>
<description>Avatars rigged with SMPL-style skeletons (the convention most research text-to-3D and mocap tools export, with bones named like left_hip, left_knee, left_elbow) previously uploaded fine but froze in a T-pose or slid around on stiff legs, because their bone names were not recognized. The bone matcher now understands these skeletons, correctly tells a collarbone apart from an upper arm when both share a name, and never gives two bones the same name (which could make animations grab the wrong joint). Full body animation, legs and arms included, now works for these characters the moment they are uploaded.</description>
</item>
+ <item>
+ <title>Reliable .eth name lookups and a fixed docs link</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-28:Reliable .eth name lookups and a fixed docs link</guid>
+ <pubDate>Tue, 28 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The free name-resolution API (/api/v1/resolve) kept timing out on .eth lookups because it leaned on rate-limited public Ethereum RPCs and gave up after five seconds. It now leads with the platform-configured mainnet RPC and dedicated keys, fails over across endpoints faster, and allows a more realistic time budget, so .eth names resolve as dependably as .sol names. Also, the old agent-3d docs address now lands on the web-component reference instead of an empty page.</description>
+ </item>
<item>
<title>Site quality sweep: sharing, search visibility, and accessibility fixes</title>
<link>https://three.ws/changelog</link>
diff --git a/public/features.json b/public/features.json
index 68bd787bf..f66591fe9 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-28T21:43:41.339Z",
+ "generated_at": "2026-07-28T21:56:35.175Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/locales/ps.json b/public/locales/ps.json
index 7b33a25d3..d5da75ca0 100644
--- a/public/locales/ps.json
+++ b/public/locales/ps.json
@@ -2230,7 +2230,7 @@
},
"bnb_latency": {
"a_chain_s_rpc_going_quiet_shows": "د یو چین RPC چې خاموش شي یوازې په هغه لین کې \"بیا نښلول\" ښیې؛ د ریس پاتې برخه روانه وي. ټول څلور په یوځل بندیدل د بیا هڅې سره یوه ډیزاین شوې تېروتنه ښیې، هیڅکله یوه خالي پاڼه نه.",
- "bnb_chain_three_ws": "<span class=\"dot\" aria-hidden=\"true\"></span><a href=\"/bnb\">BNB چین × [[4]]</a>",
+ "bnb_chain_three_ws": "<span class=\"dot\" aria-hidden=\"true\"></span><a href=\"/bnb\">BNB چین × three.ws</a>",
"each_card_samples_real_blocks_or_slots": "هر کارت د عامه RPC څخه ریښتیني بلاکونه (یا د Solana لپاره سلاټونه) نمونه کوي او اندازه شوی اوسط وقفه راپور ورکوي — سپارکلین وروستي 24 ژوندي لوستل دي، ترټولو لوړ بار = ترټولو چټکه اندازه کول.",
"every_chain_s_public_rpc_is_unreachable": "د هر چین عامه RPC اوس مهال د لاسرسي وړ نه دی — دا یوه ریښتینې ستونزه ده، نه بګ. بیا هڅه وکړئ، یا لږ وروسته بیا وګورئ.",
"every_number_comes_from_which_samples_real": "هر شمیره د <code>/api/bnb/latency</code> څخه راځي، کوم چې ریښتیني بلاکونه (BNB د <code>probeBlockTime</code> له لارې، هماغه فنکشن چې د <a href=\"/bnb\">/bnb hub</a> د ثبوت پټه ملاتړ کوي) د عامه RPCs څخه په هره سروې کې نمونه کوي — هیڅ شی مخکې محاسبه شوی یا هارډکوډ شوی نه دی.",
@@ -3894,7 +3894,7 @@
"attach_a_domain_owned_by_this_agent": "د دې ایجنټ والټ ملکیت یو <code>.sol</code> ډومین وصل کړئ ترڅو په نوم ورته اشاره وشي.",
"attempts": "هڅې",
"balance": "بیلانس",
- "base58_only_no_0_o_i_l": "یوازې Base58 (هیڅ <a href=\"https://github.com/nirholas/solana-wallet-toolkit\" target=\"_blank\" rel=\"noopener\" >0/O/I/l</a> نشته). د مختاړي + وروستاړي ګډ اوږدوالی: 3 توري ≈ سمدستي، 4 ≈ ثانیې، 5 ≈ دقیقې، 6+ ممکن وخت تیر کړي. د <a href=\"https://github.com/nirholas/solana-wallet-toolkit\" target=\"_blank\" rel=\"noopener\" >solana-wallet-toolkit</a> لخوا پرمخ وړل کیږي.",
+ "base58_only_no_0_o_i_l": "یوازې Base58 (۰/O/I/l نشته). د مختاړي او وروستاړي ګډ اوږدوالی: ۳ توري ≈ سمدستي، ۴ ≈ ثانیې، ۵ ≈ دقیقې، ۶+ ښايي وخت تېر شي. د <a href=\"https://github.com/nirholas/solana-wallet-toolkit\" target=\"_blank\" rel=\"noopener\" >solana-wallet-toolkit</a> لخوا پرمخ وړل کیږي.",
"bonfida_pricing_1y_1_char_750_2": "د Bonfida قیمت (1 کال): 1 توری $750 · 2 $700 · 3 $640 · 4 $160 · 5+ $20. په USDC کې تادیه کیږي.",
"buy": "واخلئ",
"buy_with_sol": "په SOL واخلئ",
@@ -7085,16 +7085,16 @@
"for_anyone_who_wants_to_experience_their": "<strong>د:</strong> هر هغه چا لپاره چې غواړي خپل اوتار په ریښتینې نړۍ کې تجربه کړي، یا په یوه پیښه کې یو ایجنټ وښيي.",
"for_anyone_who_wants_to_see_their": "<strong>د:</strong> هر هغه چا لپاره چې غواړي خپل 3D ایجنټ په ریښتیني نړۍ کې په میز، فرش، یا المارۍ کې وګوري.",
"for_builders_curious_about_autonomous_agent": "<strong>د:</strong> هغو جوړونکو لپاره چې د خپلواکو ایجنټ اقتصادونو په اړه لیواله دي، یا هر هغه څوک چې غواړي یو خدمت وړاندې کړي چې نور AI سیسټمونه یې تادیه کولی شي.",
- "for_builders_who_need_original_3d_characters": "<strong>د هغو جوړونکو لپاره چې ژر اصلي 3D کرکټرونو ته اړتیا لري، له بلینډر پرته.",
- "for_builders_who_want_their_agent_to": "<strong>د هغو جوړونکو لپاره چې غواړي د دوی ایجنټ د نورو AI سیسټمونو لخوا د لیږد وړ، انتقال وړ او موندلو وړ وي.",
- "for_creators_who_have_built_something_useful": "<strong>د هغو خالقینو لپاره چې یو ګټور شی یې جوړ کړی او غواړي چې د بلینګ زیربنا جوړولو پرته یې پیسې واخلي.",
- "for_creators_who_want_a_community_and": "<strong>د هغو خالقینو لپاره چې د خپل ایجنټ په شاوخوا کې یوه ټولنه او ژوندی بازار غواړي.",
- "for_creators_who_want_a_personal_avatar": "<strong>د هغو خالقینو لپاره چې غواړي شخصي اوتار ولري، پرته له دې چې 3D هنرمند استخدام کړي.",
- "for_crypto_enthusiasts_who_want_a_more": "<strong>د هغو کرپټو مینه والو لپاره چې غواړي بازار په مستقیمه او اغیزمنه لاره تعقیب کړي.",
+ "for_builders_who_need_original_3d_characters": "<strong>د هغو </strong> جوړوونکو لپاره چې ژر اصلي درې اړخیز کرکټرونه غواړي، پرته له بلینډر څخه.",
+ "for_builders_who_want_their_agent_to": "<strong>د </strong> جوړونکو لپاره: چې غواړي خپل ایجنټ د وړلو وړ، د لېږدولو وړ او د نورو AI سیسټمونو لخوا د موندلو وړ وي.",
+ "for_creators_who_have_built_something_useful": "<strong>د:</strong> هغو تخلیق کونکو لپاره چې ګټور څه یې جوړ کړي او غواړي یې وپلوري، پرته له دې چې د بیلینګ زیربنا جوړولو ته اړتیا ولري.",
+ "for_creators_who_want_a_community_and": "<strong> د </strong> تخلیق کونکو لپاره چې د خپل ایجنټ لپاره یوه ټولنه او ژوندی بازار غواړي.",
+ "for_creators_who_want_a_personal_avatar": "<strong>د: </strong> هغو تخلیق کونکو لپاره چې شخصي اوتار غواړي، د درې اړخیز هنرمند له استخدام پرته.",
+ "for_crypto_enthusiasts_who_want_a_more": "<strong>د:</strong> هغو کرپټو مینه والو لپاره چې غواړي بازار په ډیره حسي توګه تعقیب کړي.",
"for_developers": "د پراختیا کونکو لپاره",
- "for_developers_and_creators_who_want_a": "<strong>د هغو پراختیا کونکو او خالقینو لپاره چې غواړي یو خبرې کوونکی AI ولري چې ریښتینی بصري شتون ولري.",
- "for_enterprise_teams_evaluating_ibm_watsonx": "<strong>د هغو تصدۍ ټیمونو لپاره چې IBM watsonx ارزوي، یا پراختیا کونکي چې غواړي وګوري چې Granite ماډلونه په ژوندي 3D چاپیریال کې څه کولی شي.",
- "for_site_owners_who_want_a_3d": "<strong>د هغو سایټ مالکینو لپاره چې غواړي په خپله پاڼه کې یو 3D AI مرستیال ولري، پرته له دې چې د بیکینډ کوډ ته لاس ورکړي.",
+ "for_developers_and_creators_who_want_a": "<strong>د:</strong> پراختیا کونکو او تخلیق کونکو لپاره، چې د ریښتیني بصري شتون لرونکی خبرې کوونکی AI غواړي.",
+ "for_enterprise_teams_evaluating_ibm_watsonx": "<strong>د:</strong> هغو تصدۍ ټیمونو لپاره چې IBM watsonx ارزوي، یا د پراختیا کونکو لپاره چې غواړي په یوه ژوندي 3D چاپیریال کې د Granite ماډلونو وړتیاوې وویني.",
+ "for_site_owners_who_want_a_3d": "<strong>د هغو سایټ خاوندانو لپاره:</strong> چې غواړي په خپله پاڼه کې یو درې اړخیز (3D) مصنوعي ځيرکتیا (AI) مرستیال ولري، بې له دې چې د بېکېنډ کوډ ته لاس ورکړي.",
"free_to_start_no_credit_card_required": "پیل کول وړیا دي. کریډیټ کارت ته اړتیا نشته.",
"galaxy_3d_agent_map": "ګیلیکسي · 3D ایجنټ نقشه",
"generate_your_own_avatar": "خپل اوتار جوړ کړئ <span class=\"btn-arrow\">→</span>",
@@ -17176,7 +17176,7 @@
"avatar_artifact_avatar_artifact_standalone_t": "<a href=\"/avatar-artifact\"> <span class=\"sm-title\">اوتار آرټیفیکټ</span> <span class=\"sm-path\">/avatar-artifact</span> <span class=\"sm-desc\">د اوتار آرټیفیکټونو لپاره خپلواک Three.js لیدونکی — د هر ډول ریپر پاڼې پرته د ځای پرځای کولو او شریکولو وړ.</span> </a>",
"avatar_engines_atlas_avatar_engines_a_curate": "<a href=\"/avatar-engines\"> <span class=\"sm-title\">اوتار انجنونو اطلس</span> <span class=\"sm-path\">/avatar-engines</span> <span class=\"sm-desc\">د خلاصې سرچینې او سوداګریزو انجنونو یو ترتیب شوی، حقیقي اطلس چې لوړ کیفیت او فوتوریل 3D انساني اوتارونه جوړوي — ګاوسیان-سپلټ سرونه، د یو عکس انسانان، متن→اوتار جنراتورونه، او هغه ریګونه چې three.ws لا دمخه متحرک کوي. د هر یوه لپاره تخنیک، جواز، کمپیوټ، او ادغام حالت.</span> </a>",
"avatar_gallery_gallery_every_public_3d_avata": "<a href=\"/gallery\"> <span class=\"sm-title\">اوتار ګالري</span> <span class=\"sm-path\">/gallery</span> <span class=\"sm-desc\">په سیسټم کې هر عامه 3D اوتار، د گرډ په توګه د لیدلو وړ.</span> </a>",
- "avatar_sdk_avatar_sdk_the_three_ws": "<a href=\"/avatar-sdk\"> <span class=\"sm-title\">Avatar SDK</span> <span class=\"sm-path\">/avatar-sdk</span> <span class=\"sm-desc\">د <a href=\"/avatar-sdk\">/avatar پیکیج: د پلیټفارم 3D اوتارونه په هر سایټ کې یوازې د جاواسکریپټ په څو کرښو سره ځای پرځای کړئ.</span> </a>",
+ "avatar_sdk_avatar_sdk_the_three_ws": "<a href=\"/avatar-sdk\"> <span class=\"sm-title\">Avatar SDK</span> <span class=\"sm-path\">/avatar-sdk</span> <span class=\"sm-desc\">@three-ws/avatar پکیج: د پلیټفارم درې اړخیز اوتارونه په هره ویب پاڼه کې د جاواسکریپټ په څو کرښو سره ځای پر ځای کړئ.</span> </a>",
"avatar_studio_avatar_studio_build_a_custom": "<a href=\"/avatar-studio\"> <span class=\"sm-title\">Avatar Studio</span> <span class=\"sm-path\">/avatar-studio</span> <span class=\"sm-desc\">له پیل څخه یو ځانګړی 3D اوتار جوړ کړئ. د بدن ډول وټاکئ، مخ او بدن مجسم کړئ، جامې او لوازم اضافه کړئ. سیلفي ته اړتیا نشته.</span> </a>",
"avatar_wallet_avatar_wallet_chat_an_embeddab": "<a href=\"/avatar-wallet-chat\"> <span class=\"sm-title\">Avatar Wallet</span> <span class=\"sm-path\">/avatar-wallet-chat</span> <span class=\"sm-desc\">یو د ځای پرځای کولو وړ 3D AI اوتار چې د Solana والټ لري، خبرې کوي، او په خپلواکه توګه SOL لیږلی شي.</span> </a>",
"back_an_agent_vaults_vaults_copy_trade": "<a href=\"/vaults\"> <span class=\"sm-title\">Back-an-Agent Vaults</span> <span class=\"sm-path\">/vaults</span> <span class=\"sm-desc\">د تایید وړ آن-چین شهرت لرونکي 3D ایجنټ کاپي-ټریډ کړئ: په یو تایید شوي سوداګر کې پانګونه وکړئ، د هغې ریښتیني P&amp;L په تناسب شریک کړئ، او وګورئ چې دا ستاسو پانګه په ژوندۍ بڼه تجارت کوي — جلا ساتنه، د لګښت سخت محدودیتونه، او د وتلو سرکټ بریکر.</span> </a>",
@@ -19633,7 +19633,7 @@
"paid_calls": "تادیه شوي کالونه",
"pause_resume_live_feed_p_title": "ژوندۍ فیډ ودروئ / بیا پیل کړئ (p)",
"pause_the_live_feed_arialabel": "ژوندۍ فیډ ودروئ",
- "real_usdc_flowing_into_three_ws_s": "ریښتیني USDC د three.ws خپلو x402 تادیه شوي پای ټکو ته بهیږي — په هغه شیبه کې چې هره تصفیه په زنځیر کې راښکته کیږي. د <a href=\"/pulse\">Money Pulse</a> هنداره: هغه فیډ ښیې چې ایجنټان څه <em>مصرفوي</em>؛ دا ښیې چې پلیټ فارم څه <em>ترلاسه کوي</em>. هره کرښه ریښتینې او د سپړونکي لخوا د تایید وړ ده.",
+ "real_usdc_flowing_into_three_ws_s": "د three.ws خپل x402 تادیه شوي پای ټکو ته د رښتیني USDC بهیدل <strong></strong> – په هغه شېبه کې چې هره تصفیه پر بلاکچین راښکته شي. د <a href=\"/pulse\">پیسو نبض</a> انعکاس: هغه فیډ ښیې چې ایجنټان څه <em>مصرفوي</em>؛ دا ښیې چې پلیټفارم څه <em>ګټي</em>. هره کرښه رښتینې او د اکسپلورر لخوا د تایید وړ ده.",
"run_rate_hr": "د چلولو کچه · /ساعت",
"search_p_pause_s_sound_e_export": "<kbd>/</kbd> لټون · <kbd>p</kbd> ودرول · <kbd>s</kbd> غږ · <kbd>e</kbd> صادرول · <kbd>1–4</kbd> کړکۍ",
"settled_usdc": "تصفیه شوی USDC",
diff --git a/public/locales/rw.json b/public/locales/rw.json
index 5502dbc42..b1530ede4 100644
--- a/public/locales/rw.json
+++ b/public/locales/rw.json
@@ -19633,7 +19633,7 @@
"paid_calls": "guhamagara byishyuwe",
"pause_resume_live_feed_p_title": "Hagarika / komeza ikigega cy'amakuru (p)",
"pause_the_live_feed_arialabel": "Hagarika ikigega cy'amakuru",
- "real_usdc_flowing_into_three_ws_s": "USDC nyayo yinjira mu x402 endpoints zishyurwa za three.ws — ako kanya buri kwishyura bigeze kuri blockchain. Indorerwamo ya <a href=\"/pulse\">Money Pulse</a>: iyo soko yerekana ibyo abakozi <em>bakoresha</em>; iyi yerekana ibyo urubuga <em>rwinjiza</em>. Buri murongo ni ukuri kandi ushobora kugenzurwa na explorer.",
+ "real_usdc_flowing_into_three_ws_s": "USDC nyayo yinjira <strong>muri</strong> x402 za three.ws zishyurwa — ako kanya buri kwishyurana kigera kuri chain. Indorerwamo ya <a href=\"/pulse\">Money Pulse</a>: iyo feed yerekana ibyo agents <em>bakoresha</em>; iyi yo yerekana ibyo platform <em>yinjiza</em>. Buri murongo ni ukuri kandi ushobora kugenzurwa na explorer.",
"run_rate_hr": "igipimo cy'imikorere · /isaha",
"search_p_pause_s_sound_e_export": "<kbd>/</kbd> shakisha · <kbd>p</kbd> hagarika · <kbd>s</kbd> ijwi · <kbd>e</kbd> kohereza · <kbd>1–4</kbd> idirishya",
"settled_usdc": "USDC yishyurwe",
diff --git a/src/diorama/README.md b/src/diorama/README.md
index 95705521f..3f853ec39 100644
--- a/src/diorama/README.md
+++ b/src/diorama/README.md
@@ -102,7 +102,7 @@ settles.
import { createDioramaRenderer } from './renderer.js';
import { composeWorld } from './compose.js';
-const renderer = createDioramaRenderer(document.querySelector('#stage'), {});
+const renderer = createDioramaRenderer(document.querySelector('#diorama-stage'), {});
const diorama = await composeWorld('a cozy autumn campsite by a lake at dusk', {
// Called once the plan returns, before any mesh exists: the island, sky,
diff --git a/src/feature-tour/README.md b/src/feature-tour/README.md
index 45e870910..c4269ed91 100644
--- a/src/feature-tour/README.md
+++ b/src/feature-tour/README.md
@@ -82,7 +82,7 @@ window.__featureTour = tour;
tour.bootstrap();
```
-To see it run locally: `npm run dev`, then open `http://localhost:3000/?tour=start&track=quick` (the dev server serves `/feature-tour.js` from this directory and the boot plugin injects it because of the `?tour=start` param).
+To see it run locally: `npm run dev`, then open `http://localhost:3000/?tour=start&track=quick` (the dev server rewrites `/feature-tour.js` to the entry file [../feature-tour.js](../feature-tour.js) and the boot plugin injects it because of the `?tour=start` param).
## Tests
diff --git a/src/pump/wallet-monitor.js b/src/pump/wallet-monitor.js
index f08170afb..a96b42cc6 100644
--- a/src/pump/wallet-monitor.js
+++ b/src/pump/wallet-monitor.js
@@ -7,6 +7,8 @@
//
// Auto-reconnects with exponential backoff on disconnect.
+import { log } from '../shared/log.js';
+
const PUMP_PROGRAM = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P';
const PUMP_AMM_PROGRAM = 'pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA';
@@ -130,7 +132,15 @@ export class WalletMonitor extends EventTarget {
this.dispatchEvent(evt);
};
- ws.onerror = () => {};
+ ws.onerror = () => {
+ // The paired onclose handler owns reconnection/rotation; this is
+ // diagnostics only, so a dead endpoint is visible instead of silent.
+ log.warn(
+ '[wallet-monitor] websocket error on',
+ this._wsUrls[this._urlIdx % this._wsUrls.length],
+ subscribed ? '(subscribed; will back off and reconnect)' : '(unsubscribed; rotating endpoint)',
+ );
+ };
ws.onclose = () => {
this._ws = null;
diff --git a/tests/forge-failover.test.js b/tests/forge-failover.test.js
index b200aa673..2648ed2c2 100644
--- a/tests/forge-failover.test.js
+++ b/tests/forge-failover.test.js
@@ -6,7 +6,7 @@
// end-to-end against production; these tests pin the pure contracts the poll
// handler depends on.
-import { describe, it, expect, beforeEach, afterEach } from 'vitest';
+import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import {
bindJobSuccessor,
resolveLiveJob,
@@ -15,6 +15,31 @@ import {
submitFailoverJob,
MAX_FAILOVER_HOPS,
} from '../api/_lib/forge-failover.js';
+import { decodeJobToken } from '../api/_lib/forge-job-token.js';
+import { resolveTier } from '../api/_lib/forge-tiers.js';
+
+// encodeJobToken signs handles with JWT_SECRET (lazily, at call time); give the
+// suite a deterministic secret so handle-shape assertions can decode them.
+process.env.JWT_SECRET = process.env.JWT_SECRET || 'test-jwt-secret';
+
+// Mock the lane submission boundaries: submitFailoverJob dynamic-imports the
+// provider modules, so the mocks intercept exactly the network edge and the
+// handle-encoding logic under test stays real. laneHealthSnapshot is mocked so
+// pickRedispatchLane's telemetry-failure fallback is drivable without probes.
+const { gcpSubmit, replicateSubmit, laneHealth } = vi.hoisted(() => ({
+ gcpSubmit: vi.fn(),
+ replicateSubmit: vi.fn(),
+ laneHealth: vi.fn(),
+}));
+vi.mock('../api/_providers/gcp.js', () => ({
+ createRegenProvider: () => ({ submit: gcpSubmit }),
+}));
+vi.mock('../api/_providers/replicate.js', () => ({
+ createRegenProvider: () => ({ submit: replicateSubmit }),
+}));
+vi.mock('../api/_lib/forge-lane-health.js', () => ({
+ laneHealthSnapshot: (...args) => laneHealth(...args),
+}));
function fakeRedis() {
const store = new Map();
@@ -44,6 +69,10 @@ beforeEach(() => {
saved[k] = process.env[k];
delete process.env[k];
}
+ gcpSubmit.mockReset();
+ replicateSubmit.mockReset();
+ laneHealth.mockReset();
+ laneHealth.mockResolvedValue({ byId: {} });
});
afterEach(() => {
for (const k of LANE_ENV) {
@@ -94,6 +123,34 @@ describe('successor chain', () => {
};
expect(await bindJobSuccessor('job-a', { handle: 'job-b', backend: 'x', hop: 1 }, { redis })).toBe(false);
});
+
+ it('terminates on a cyclic successor chain (A -> B -> A) within the hop cap', async () => {
+ // bindJobSuccessor always rebinds the ORIGINAL id, so a healthy flow never
+ // writes a cycle; this pins the defensive loop bound against a corrupt or
+ // hand-written record. Without it a poll would spin on redis.get forever.
+ const backing = fakeRedis();
+ await bindJobSuccessor('job-a', { handle: 'job-b', backend: 'trellis_selfhost', hop: 1 }, { redis: backing });
+ await bindJobSuccessor('job-b', { handle: 'job-a', backend: 'hunyuan3d', hop: 2 }, { redis: backing });
+
+ let reads = 0;
+ const counting = {
+ async get(key) {
+ reads++;
+ if (reads > 50) throw new Error('resolveLiveJob did not terminate on a cyclic chain');
+ return backing.get(key);
+ },
+ async set(key, value) {
+ return backing.set(key, value);
+ },
+ };
+ const live = await resolveLiveJob('job-a', { redis: counting });
+ // The chase is bounded at one read past the bind cap and still returns a
+ // chaseable successor record rather than hanging or throwing.
+ expect(reads).toBeLessThanOrEqual(MAX_FAILOVER_HOPS + 1);
+ expect(live).not.toBeNull();
+ expect(typeof live.handle).toBe('string');
+ expect(['job-a', 'job-b']).toContain(live.handle);
+ });
});
describe('retryBackendSuggestions', () => {
@@ -131,6 +188,32 @@ describe('pickRedispatchLane', () => {
process.env.GCP_RECONSTRUCTION_KEY = 'k';
expect(await pickRedispatchLane({ attempted: ['trellis_selfhost'] })).toBeNull();
});
+
+ it('skips lanes the health snapshot marks down', async () => {
+ process.env.MODEL_TRELLIS_URL = 'https://model-trellis.example';
+ process.env.GCP_HUNYUAN3D_URL = 'https://hunyuan.example';
+ process.env.GCP_RECONSTRUCTION_KEY = 'k';
+ laneHealth.mockResolvedValue({ byId: { trellis_selfhost: { status: 'down' } } });
+ expect(await pickRedispatchLane({ attempted: [] })).toBe('hunyuan3d');
+
+ laneHealth.mockResolvedValue({
+ byId: { trellis_selfhost: { status: 'down' }, hunyuan3d: { status: 'down' } },
+ });
+ expect(await pickRedispatchLane({ attempted: [] })).toBeNull();
+ });
+
+ it('falls back to the first configured candidate when the health snapshot throws', async () => {
+ // No telemetry must never mean no failover: a bad pick just fails over
+ // again, but a null pick strands the job on a dead lane.
+ process.env.MODEL_TRELLIS_URL = 'https://model-trellis.example';
+ process.env.GCP_HUNYUAN3D_URL = 'https://hunyuan.example';
+ process.env.GCP_RECONSTRUCTION_KEY = 'k';
+ laneHealth.mockRejectedValue(new Error('telemetry down'));
+ expect(await pickRedispatchLane({ attempted: [] })).toBe('trellis_selfhost');
+ // The fallback respects the attempted filter: candidates[0] is the first
+ // UNATTEMPTED configured lane, not the first lane in the static order.
+ expect(await pickRedispatchLane({ attempted: ['trellis_selfhost'] })).toBe('hunyuan3d');
+ });
});
describe('submitFailoverJob guard rails', () => {
@@ -150,6 +233,73 @@ describe('submitFailoverJob guard rails', () => {
});
});
+describe('submitFailoverJob handle shapes', () => {
+ // The handle is what the poll handler routes on. GCP lanes MUST return a
+ // signed f1.* job token (provider gcp) and the Replicate lane MUST return the
+ // bare prediction id: a shape regression on either side makes clients poll a
+ // dead handle forever, so the exact encoding is pinned here.
+ const IMG = 'https://cdn.example/ref.png';
+
+ it('trellis_selfhost returns a gcp job token wrapping the worker task id', async () => {
+ gcpSubmit.mockResolvedValue({ extJobId: 'gcp-task-1' });
+ const out = await submitFailoverJob({ backend: 'trellis_selfhost', imageUrl: IMG, prompt: 'a knight' });
+
+ expect(out.extJobId).toBe('gcp-task-1');
+ expect(out.handle).toMatch(/^f1\./);
+ expect(decodeJobToken(out.handle)).toEqual({ provider: 'gcp', kind: null, taskId: 'gcp-task-1' });
+
+ // Submitted through the gcp provider in trellis mode with the stored inputs.
+ expect(gcpSubmit).toHaveBeenCalledTimes(1);
+ expect(gcpSubmit).toHaveBeenCalledWith({
+ mode: 'trellis',
+ sourceUrl: IMG,
+ params: { images: [IMG], prompt: 'a knight' },
+ });
+ expect(replicateSubmit).not.toHaveBeenCalled();
+ });
+
+ it('hunyuan3d returns a gcp job token and carries the tier polycount target', async () => {
+ gcpSubmit.mockResolvedValue({ extJobId: 'hy-task-9' });
+ const out = await submitFailoverJob({ backend: 'hunyuan3d', imageUrl: IMG, tierId: 'high' });
+
+ expect(out.extJobId).toBe('hy-task-9');
+ expect(out.handle).toMatch(/^f1\./);
+ expect(decodeJobToken(out.handle)).toEqual({ provider: 'gcp', kind: null, taskId: 'hy-task-9' });
+
+ expect(gcpSubmit).toHaveBeenCalledTimes(1);
+ const call = gcpSubmit.mock.calls[0][0];
+ // Hunyuan3D speaks the standard /infer task shape, not /reconstruct.
+ expect(call.mode).toBe('hunyuan');
+ expect(call.sourceUrl).toBe(IMG);
+ expect(call.params.images).toEqual([IMG]);
+ expect(call.params.prompt).toBeUndefined();
+ expect(call.params.target_polycount).toBe(resolveTier('high').polycount);
+ });
+
+ it('an unknown tier falls back to the default tier polycount', async () => {
+ gcpSubmit.mockResolvedValue({ extJobId: 'hy-task-10' });
+ await submitFailoverJob({ backend: 'hunyuan3d', imageUrl: IMG, tierId: 'no-such-tier' });
+ expect(gcpSubmit.mock.calls[0][0].params.target_polycount).toBe(resolveTier(undefined).polycount);
+ });
+
+ it('trellis (Replicate) returns the bare prediction id, never an f1 token', async () => {
+ replicateSubmit.mockResolvedValue({ extJobId: 'r8-pred-abc123' });
+ const out = await submitFailoverJob({ backend: 'trellis', imageUrl: IMG, prompt: 'a knight' });
+
+ expect(out).toEqual({ extJobId: 'r8-pred-abc123', handle: 'r8-pred-abc123' });
+ expect(out.handle.startsWith('f1.')).toBe(false);
+ expect(decodeJobToken(out.handle)).toBeNull();
+
+ expect(replicateSubmit).toHaveBeenCalledTimes(1);
+ expect(replicateSubmit).toHaveBeenCalledWith({
+ mode: 'reconstruct',
+ sourceUrl: IMG,
+ params: { images: [IMG], prompt: 'a knight' },
+ });
+ expect(gcpSubmit).not.toHaveBeenCalled();
+ });
+});
+
describe('failover budget', () => {
it('allows exactly one primary + three backup lanes', () => {
expect(MAX_FAILOVER_HOPS).toBe(3);
diff --git a/tests/glb-canonicalize.test.js b/tests/glb-canonicalize.test.js
index 2ab5068b5..f954eef79 100644
--- a/tests/glb-canonicalize.test.js
+++ b/tests/glb-canonicalize.test.js
@@ -464,6 +464,144 @@ describe('canonicalizeBoneName', () => {
expect(canonicalizeBoneName('mixamorig:LeftToe_End_059')).toBeNull();
expect(canonicalizeBoneName('Tail_01')).toBeNull();
});
+
+ // Daz/Genesis chains that had no direct coverage: the Genesis 3+ forearm
+ // Bend joint, the lShin/lCalf lower-leg spellings, and the derived right
+ // twins of the Shldr/Thigh/Bend family. A miss on any of these drops the
+ // joint and a Daz export animates with a rigid elbow or frozen legs.
+ it.each([
+ ['lForearmBend', 'LeftForeArm'],
+ ['rForearmBend', 'RightForeArm'],
+ ['lShin', 'LeftLeg'],
+ ['lCalf', 'LeftLeg'],
+ ['rShldr', 'RightArm'],
+ ['rShldrBend', 'RightArm'],
+ ['rThigh', 'RightUpLeg'],
+ ['rThighBend', 'RightUpLeg'],
+ ['lUpperArm', 'LeftArm'],
+ ['rUpperArm', 'RightArm'],
+ ['lLowerArm', 'LeftForeArm'],
+ ['rLowerLeg', 'RightLeg'],
+ ])('maps remaining Daz/Genesis chain bones: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ // Reallusion CC3/CC4 neck twists WITHOUT the CC_Base_ prefix (some export
+ // paths ship the bare joint names); either twist drives the head chain.
+ it.each([
+ ['neckTwist01', 'Neck'],
+ ['neckTwist02', 'Neck'],
+ ['neck_twist_01', 'Neck'], // separator variant collapses to the same key
+ ])('maps bare Reallusion neck twists: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ // Generic Meshy/Tripo side-prefix twins derived by the l→r rule, plus the
+ // separator/case variants the normaliser must collapse onto the same keys.
+ it.each([
+ ['R_UpLeg', 'RightUpLeg'],
+ ['R_Shoulder', 'RightShoulder'],
+ ['r_arm', 'RightArm'],
+ ['R_Leg', 'RightLeg'],
+ ])('maps derived R_ side-prefix twins: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ // MakeHuman / VRM 1.0 centre-torso spellings in separator form (the
+ // camelCase forms are asserted in the VRM 1.0 and alias-variant tables
+ // above; these pin that snake_case reaches the same keys).
+ it.each([
+ ['upper_chest', 'Spine2'],
+ ['chest_lower', 'Spine1'],
+ ['lower_neck', 'Neck'],
+ ])('maps separator variants of centre-torso bones: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ // The SIDED right-twin derivation has four branches. Each is pinned with
+ // spellings only that branch can produce, so a regression in one regex
+ // cannot hide behind another.
+ // Branch 1: a leading "left" word swaps to "right" (leftUpperArm → rightUpperArm).
+ it.each([
+ ['rightUpperArm', 'RightArm'],
+ ['rightUpperLeg', 'RightUpLeg'],
+ ['rightToes', 'RightToeBase'],
+ ['rightHip', 'RightUpLeg'],
+ ['rightThigh', 'RightUpLeg'],
+ ['rightShin', 'RightLeg'],
+ ['rightCalf', 'RightLeg'],
+ ['rightWrist', 'RightHand'],
+ ['rightClavicle', 'RightShoulder'],
+ ['rightCollar', 'RightShoulder'],
+ ])('derives right twins from the left- word branch: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ // Branch 2: a leading lowercase "l" before an uppercase letter becomes "r"
+ // (lShldr → rShldr, lToeBase → rToeBase).
+ it.each([
+ ['rLowerArm', 'RightForeArm'],
+ ['rUpperLeg', 'RightUpLeg'],
+ ['rToeBase', 'RightToeBase'],
+ ['rClavicle', 'RightShoulder'],
+ ['rCollar', 'RightShoulder'],
+ ])('derives right twins from the l-prefix branch: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ // Branch 3: a trailing "L" becomes "R" (shoulderL → shoulderR).
+ it.each([
+ ['shoulderR', 'RightArm'],
+ ['forearmR', 'RightForeArm'],
+ ['upperArmR', 'RightArm'],
+ ['wristR', 'RightHand'],
+ ['ankleR', 'RightFoot'],
+ ['shinR', 'RightLeg'],
+ ['toeR', 'RightToeBase'],
+ ['hipR', 'RightUpLeg'],
+ ])('derives right twins from the trailing-L branch: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ // Branch 4 (identity fallthrough): a SIDED entry with no recognisable side
+ // token derives rv === lv, and the first-spelling-wins put() means the
+ // derived Right canonical can never overwrite the left entry. The observable
+ // invariant: no left-side spelling ever resolves to a Right bone, and no
+ // derived right-side spelling ever resolves to a Left bone.
+ it('side derivation never crosses sides', () => {
+ const leftSpellings = [
+ 'leftUpperArm', 'lUpperArm', 'shoulderL', 'lShldr', 'lShldrBend',
+ 'leftLowerArm', 'elbowL', 'lForeArm', 'lForearmBend', 'forearmL',
+ 'upperArmL', 'wristL', 'lHand', 'lCollar', 'collarL', 'lClavicle',
+ 'leftUpperLeg', 'hipL', 'lThigh', 'lThighBend',
+ 'leftLowerLeg', 'kneeL', 'shinL', 'lShin', 'lCalf',
+ 'ankleL', 'lFoot', 'leftToes', 'toeL', 'lToe', 'lToeBase',
+ 'lArm', 'lShoulder', 'lLeg', 'lUpLeg',
+ 'leftHip', 'leftKnee', 'leftAnkle', 'leftElbow', 'leftWrist',
+ 'leftCollar', 'leftClavicle', 'leftToe',
+ ];
+ const rightSpellings = [
+ 'rightUpperArm', 'rUpperArm', 'shoulderR', 'rShldr', 'rShldrBend',
+ 'rightLowerArm', 'elbowR', 'rForeArm', 'rForearmBend', 'forearmR',
+ 'upperArmR', 'wristR', 'rHand', 'rCollar', 'collarR', 'rClavicle',
+ 'rightUpperLeg', 'hipR', 'rThigh', 'rThighBend',
+ 'rightLowerLeg', 'kneeR', 'shinR', 'rShin', 'rCalf',
+ 'ankleR', 'rFoot', 'rightToes', 'toeR', 'rToe', 'rToeBase',
+ 'rArm', 'rShoulder', 'rLeg', 'rUpLeg',
+ 'rightHip', 'rightKnee', 'rightAnkle', 'rightElbow', 'rightWrist',
+ 'rightCollar', 'rightClavicle', 'rightToe',
+ ];
+ for (const name of leftSpellings) {
+ const canonical = canonicalizeBoneName(name);
+ expect(canonical, name).not.toBeNull();
+ expect(canonical.startsWith('Right'), `${name} must not map to a Right bone`).toBe(false);
+ }
+ for (const name of rightSpellings) {
+ const canonical = canonicalizeBoneName(name);
+ expect(canonical, name).not.toBeNull();
+ expect(canonical.startsWith('Left'), `${name} must not map to a Left bone`).toBe(false);
+ }
+ });
});
describe('canonicalizeJointNodes (in-place rewrite)', () => {