Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat: enhance launch detail page with market metrics and trust checks
udvk18a8d8291a99
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.mdindex ef2b19f68..5662cd35f 100644--- a/ARCHITECTURE.md+++ b/ARCHITECTURE.md@@ -119,7 +119,7 @@ Every top-level directory in the monorepo, what it is, and where to look. File c| Directory | Files | Purpose ||-----------|-------|---------|-| `packages/` | ~636 | 54 published npm packages — feature SDKs + 30+ domain MCP servers. See [SDK Ecosystem](#sdk-ecosystem) & [MCP Layer](#mcp-layer). |+| `packages/` | ~636 | 67 published `@three-ws/*` npm packages total (30 `packages/*-mcp` + 23 non-MCP `packages/*` + 11 top-level SDK dirs + mcp-server/mcp-bridge/avatar-agent). See [SDK Ecosystem](#sdk-ecosystem) & [MCP Layer](#mcp-layer). || `sdk/` | ~41 | `@three-ws/sdk` — top-level agent kit (ERC-8004, chat, x402, SIWS, EAS). || `solana-agent-sdk/` | ~100 | `@three-ws/solana-agent` (TS) — keypair/browser/wallet-adapter providers, SPL, Jupiter, AgenC, x402-exact. || `agent-payments-sdk/` | ~76 | `@three-ws/agent-payments` (TS) — pump.fun agent payments, EVM/cross-chain clients, `pump_agent_payments` IDL. |@@ -726,6 +726,27 @@ Beyond the feature areas above, the `api/` tree exposes many more surfaces. Comp| `/api/pump-bounties/*` | `[id]`, `stats` | pump.fun GO bounty board + submission stats || `/api/trading/scan`, `/api/three-token/*`, `/api/three/*` | — | Candidate-trade scanner (RPC-budgeted) + $THREE tier/price surfaces |+#### Autonomous Trading, Vaults & Labor++| Endpoint Group | Files | Description |+|----------------|-------|-------------|+| `/api/oracle/*` (23) | `feed`, `stream` (SSE), `action-stream` (SSE), `trades` (SSE), `leaderboard`, `movers`, `wins`, `backtest`, `follow`, `watch`, `signal`, `agent-stats`, `categories`, `coin`, `wallet`, `og`, … | Full oracle product API: social follow/leaderboard, backtesting, watch arming, movers/wins |+| `/api/sniper/*` (11) | `radar`, `radar-stream` (SSE), `stream` (SSE), `compile`, `strategy`, `backtest`, `close`, `trader`, `leaderboard`, `history`, `status` | Autonomous sniping engine + strategy compiler + pre-launch radar (backed by `api/_lib/sniper/`) |+| `/api/vaults/*` (7) | `index`, `[id]`, `deposit`, `redeem`, `trade`, `claim-fees`, `ledger` | Tokenized agent vaults: deposit/redeem/Jupiter-trade (`api/_lib/vault-*.js` — 10 modules) |+| `/api/labor/*` (10) | `post`, `bid`, `award`, `deliver`, `settle`, `bounty`, `feed`, `agent`, `policy`, `tick` | Agent labor market: escrow/matching/settlement (`api/_lib/labor-{escrow,match,settle,economics,auth}.js`); tables `agent_jobs`/`agent_bids`/`agent_bounties`/`agent_labor_policies` |+| `/api/swarms/*`, `/api/signals/*` (6), `/api/copy/*` (5), `/api/mirror/*` | — | Multi-agent swarms (CRUD + SSE), signal marketplace (incl. SSE), copy/mirror trading |++#### Embeds, Walk, IRL, Users & Admin++| Endpoint Group | Files | Description |+|----------------|-------|-------------|+| `/api/widgets/*` (16) | `[id]/chat`, `[id]/knowledge`, `knowledge-process`, `transcripts`, `stats`, `duplicate`, `oembed`, `og`, `page`, `view`, `index` | Embeddable RAG chat-widget product with knowledge ingestion (`api/_lib/widget-types.js`) |+| `/api/walk/*` (6) | `pilot`, `session`, `control/[action]`, `metrics`, `analytics`, `leaderboard` | Walk Avatar browser-piloting: LLM "brain" pilots web pages from Chrome-extension DOM snapshots (`auth/extension-token.js`) |+| `/api/irl/*` (10) | `pins`, `drops`, `interactions`, `interactions-stream` (SSE), `presence-proofs`, `world-lines`, … | Geolocated agent presence/drops/pins; tables `irl_pins`/`irl_drops`/`irl_interactions`/`irl_presence_proofs`/`irl_world_lines` |+| `/api/users/*` (16) vs `/api/user/*` (5) | — | Two namespaces: `users/` = public profiles/follows/referrals/earnings; `user/` = account wallet/settings |+| `/api/admin/*` (11) | `[resource]`, `bulk-launch`, `register-agents`, `revenue`, `withdrawals/[id]`, `user/[id]`, `redis-health`, `pump-cron-health`, `rider-passes`, `news/[action]` | Admin/ops console backend (admin auth gate, `api/_lib/admin.js`) |+| `/api/rider/*`, `/api/play/*`, `/api/seed/*`, `/api/club/*` (incl. `tips-stream` SSE), `/api/tournaments/*`, `/api/clash/*` | — | Rider passes / play-pass / fixtures-seed / 3D-club tips / tournament + Coin Clash game surfaces |+> Internal MCP handler implementations live in `api/_mcp`, `api/_mcp3d`, `api/_mcpagent`, `api/_mcpbazaar`, `api/_mcpibm`, `api/_mcp-studio`, `api/_studio` — see [MCP Layer](#mcp-layer).---@@ -738,8 +759,8 @@ Beyond the feature areas above, the `api/` tree exposes many more surfaces. Compflowchart TDA["animation-sources/\n(Mixamo FBX source library, 120+ clips)"]B["scripts/build-animations.mjs\nreads: scripts/animations.config.json (121 entries)\nretargets: FBX/GLB → canonical Avaturn skeleton (cz.glb)\ntrims clips, applies uprightFix where configured\nemits: AnimationClip.toJSON() per clip"]- C["public/animations/clips/*.json\n(121 canonical JSON clips)"]- D["public/animations/manifest.json\n(clip catalog with metadata)"]+ C["public/animations/clips/*.json\n(~102 JSON files; 100 manifested)"]+ D["public/animations/manifest.json\n(clip catalog, ~100 entries)"]A --> B --> CB --> D```@@ -906,6 +927,8 @@ Standalone Three.js scenes not covered as page surfaces above: `/coin3d` (`src/cMove messages validated at 15 Hz with max-step/world-bounds/name/rate clamps; binary delta state (`schemas.js`: Player, Block, Vehicle, Mob, Tombstone, WorldObject). Auth/gates: `holder-pass.js`, `play-pass.js`, `guest-token.js`, `presence-token.js` (HMAC), `game-token.js` — boot fails in prod without `HOLDER_PASS_SECRET`. Durable per-world voxel builds + player state in Upstash Redis (`block-store.js`, `persistence.js`, `playerStore.js`); `@colyseus/redis-driver`/`-presence` for horizontal scale (>~200 players). Clients connect via `src/shared/colyseus-connect.js` + per-surface net wrappers (`src/walk-net.js`, `src/stage-net.js`, `src/game/community-net.js`). Deploy: `multiplayer/Dockerfile` + **Fly.io** (`fly.toml`, app `three-ws-multiplayer`, iad) and **Cloud Run** (`deploy-cloudrun.sh`); `@colyseus/monitor` at `/colyseus`, health at `/health`.+**Game systems** (`multiplayer/src/`): `stage-show.js` + `stage-schemas.js` + `stage-registry.js` + `social-hub.js` (live stage shows / social hub), and `clash.js`, `combat.js`, `quests.js`, `economy.js`, `shop.js`, `vehicles.js`, `war-report.js`. The 3D venues these load ship in **`public/club/`** — venue GLBs (`club-venue.glb`, `clubhouse.glb`, `alleyway.glb`, `space-smugglers-clubhouse.glb`, `tour.glb`), an HDRI (`club-hdri.hdr`), and props (`stage.glb`, `pole.glb`), each with per-asset `LICENSES.md`. Wearables live in **`public/accessories/`** (7 GLBs + `presets.json`).+### AR / WebXR Pipeline (`src/ar/`, `src/irl/`)Beyond animated-USDZ export, a full AR stack: `src/ar/webxr.js` (`immersive-ar` session + hit-test placement + opt-in half-body XR), `depth-occlusion.js` (real-world occlusion via WebXR depth-sensing), `anchor-lifecycle.js` (reticle / tracking-loss state machine), `quick-look.js` (iOS USDZ Quick Look), `scene-viewer.js` (Android ARCore Intent), `placement-capability.js`. `src/irl/` is a GPS/marker AR "world lines" subsystem (~25 modules: floor/room/marker anchors, sensor fusion, GPS lifecycle, geohash proximity, QR detect, privacy center, perf budget), backed by the IrlRoom. `src/irl/glasses/` integrates **Even Realities G1 smart glasses** over BLE (`protocol.js`, `transport.js`, `bridge.js`, `g1.js`, `frame.js`).@@ -928,6 +951,8 @@ three.ws exposes **~311 total MCP tools** across a multi-tier server architecturAll remote servers implement **MCP 2025-06-18 Streamable HTTP transport** (JSON-RPC 2.0). npm stdio servers use `@modelcontextprotocol/sdk` StdioServerTransport.+**Shared MCP infrastructure** (every remote server depends on it): `api/_lib/mcp-dispatch.js` (single source of the `PROTOCOL_VERSION = "2025-06-18"` constant), `mcp-batch-price.js` (JSON-RPC batch pricing + discovery-only detection), `mcp-getting-started.js` (the auto-injected `*_getting_started` free discovery tool), `mcp-error-sanitize.js`; three-mode auth in `api/_mcp/auth.js` + OAuth 2.1 issue/verify in `api/oauth/[action].js`. Each remote server is decomposed into a sibling `_mcp*/` dir (`catalog.js`, `dispatch.js`, `discovery.js`, `pricing.js`, `tools/`): `_mcp`, `_mcp3d`, `_mcpibm`, `_mcpagent`, `_mcpbazaar`, `_mcp-studio`.+### Remote MCP Servers (Vercel-hosted)| Server | Endpoint | Tools | Auth | Registry ID |@@ -947,7 +972,7 @@ All remote servers implement **MCP 2025-06-18 Streamable HTTP transport** (JSON-#### `/api/mcp-3d` — 3D Studio Tools (24 tools)-`text_to_3d` · `image_to_3d` · `generation_status` · `preview_3d` · `remove_background` · `remesh_model` · `stylize_model` · `segment_model` · `retexture_model` · `retexture_region` · `auto_rig_model` · `pose_model` · `direct_prompt` · `generate_material` · `save_avatar` · `create_agent_persona` · `inspect_model` · `optimize_model` · `list_animations` · `apply_animation` · `text_to_animation`+`text_to_3d` · `image_to_3d` · `generation_status` · `preview_3d` · `remove_background` · `remesh_model` · `stylize_model` · `segment_model` · `retexture_model` · `retexture_region` · `auto_rig_model` · `pose_model` · `direct_prompt` · `generate_material` · `save_avatar` · `create_agent_persona` · `get_agent_persona` · `persona_say` · `inspect_model` · `optimize_model` · `list_animations` · `apply_animation` · `text_to_animation` · `mcp_3d_getting_started` (18 from `_mcp3d/tools/studio.js`, 2 reused from `_mcp/tools/models.js`, 3 from `_mcp/tools/animations.js`, 1 discovery)#### `/api/mcp-studio` — Free Studio Tools (5 tools, no auth)@@ -965,6 +990,14 @@ All remote servers implement **MCP 2025-06-18 Streamable HTTP transport** (JSON-`setWireframe` · `setSkeleton` · `setGrid` · `setAutoRotate` · `setBgColor` · `setTransparentBg` · `setEnvironment` · `takeScreenshot` · `loadModel` · `runValidation` · `showMaterialEditor`+#### `/api/mcp-bazaar` — Bazaar Discovery (3 tools)++`search_services` · `browse_services` · `get_service` (`api/_mcpbazaar/tools.js`)++#### `/api/ibm-mcp` — IBM Granite via x402 (6 tools)++`ibm_granite_chat` · `ibm_granite_code` · `ibm_granite_embed` · `ibm_granite_analyze` · `ibm_granite_forecast` · `ibm_granite_getting_started`. The npm `@three-ws/ibm-watsonx-mcp` (direct IBM Cloud, non-x402) is a distinct toolset: `watsonx_chat` · `watsonx_generate` · `watsonx_embed` · `watsonx_tokenize` · `watsonx_forecast` · `watsonx_list_models`.+---### npm stdio MCP Servers@@ -1101,6 +1134,18 @@ Emits verifiable `SkillInvoked` on-chain events for agent-to-agent skill calls.Live pump.fun program (not deployed by three.ws). Handles agent token payments, distribution, and buyback. Wrapped by `PumpAgent`/`PumpAgentOffline` classes.+**PDA seeds** (used by the three.ws-authored programs): `skill_license` → `b"marketplace"` (singleton), `b"skill_license"`, `b"skill_mint"`; SkillLicense PDA = `(owner, agent_mint, sha256(skill_name))`. `agent_invocation` → `b"agent"` → `seeds=[b"agent", authority]`. Anchor **0.31.1** across both.++#### Bundled pump.fun program IDLs (`contracts/idl/pump/`)++Read-only IDLs for the upstream pump.fun programs the launch/trade tools target (not three.ws-deployed):++| Program | Program ID |+|---------|-----------|+| pump.fun core (bonding curve) | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` |+| pump.fun AMM (PumpSwap) | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` |+| pump.fun fees | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` |+---### EVM Contracts@@ -1111,10 +1156,12 @@ Deployed deterministically via CREATE2 at vanity-prefixed addresses.| Contract | Mainnet Address | Testnet Address | Chains ||----------|----------------|-----------------|--------|-| `IdentityRegistry.sol` | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` | `0x8004A818BFB912233c491871b3d84c89A494BD9e` | 12 mainnet, 7 testnet |-| `ReputationRegistry.sol` | `0x8004BAa17C55a88189AE136b182e5fdA19dE9b63` | `0x8004B663056A597Dffe9eCcC1965A193B7388713` | 12 mainnet |+| `IdentityRegistry.sol` | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` | `0x8004A818BFB912233c491871b3d84c89A494BD9e` | 15 configured / 12 live, 7 testnet |+| `ReputationRegistry.sol` | `0x8004BAa17C55a88189AE136b182e5fdA19dE9b63` | `0x8004B663056A597Dffe9eCcC1965A193B7388713` | 15 configured / 12 live || `ValidationRegistry.sol` | (not deployed on mainnet) | `0x8004Cb1BF31DAf7788923b405b754f57acEB4272` | testnet only |+**Chain count:** `src/erc8004/abi.js` `REGISTRY_DEPLOYMENTS` configures **15 mainnet** chain IDs (1, 10, 56, 100, 137, 250, 324, 1284, 5000, 8453, 42161, 42220, 43114, 59144, 534352) + **7 testnet** (97, 11155111, 84532, 421614, 11155420, 80002, 43113). As of the 2026-06-19 bytecode check, **12** mainnet are live — Fantom (250), zkSync Era (324), and Moonbeam (1284) are configured but **not yet deployed** (`eth_getCode` = `0x`, per `contracts/DEPLOYMENTS.md`). The platform validator key (`0x93Bc7EfB0059B784465619FC73C2db8D01b1CD04`, env `VALIDATOR_PRIVATE_KEY`) signs `recordValidation`. ERC-8004 registries compile with Foundry solc **0.8.24** (`foundry.toml`); the deployed ThreeWSFactory/ThreeWSPayments used solc **0.8.35** (`DEPLOYMENTS.md`).+**IdentityRegistry:** ERC-721 agent identity NFTs. EIP-712 wallet delegation, per-agent ETH deposit/spend/withdraw, key-value metadata, spend allowance for delegated server keys.**ReputationRegistry:** Signed reputation feedback [-100,100] + ETH-staked reviews. One review per address per agent. Aggregate `(avgX100, count)` stored on-chain.@@ -1880,6 +1927,10 @@ Representative coverage: agent custody/trade guards, A2A payment mandates, snipe| Audit | `audit-links.mjs`, `audit-console.mjs`, `audit-deploy-artifacts.mjs`, `audit-mcp-manifests.mjs`, `audit-page-index.mjs` | Automated hygiene checks (back the `prompts/` playbooks) || Mint / on-chain | `batch-mint-agents.mjs`, `agent-invocation-smoke.mjs` | Bulk agent minting, program smoke tests || Publish | `publish-packages.mjs` | Idempotent npm publish of `@three-ws/*` packages |+| Asset baking | `build:club-{props,venue,hdri,audio,entrance-venue,assets}`, `build:walk-environments`, `bake:mannequin`, `build:wasm`, `build:canonical-rest`, `convert:fbx`, `extract:animations` | Club venue/prop/HDRI GLBs, walk environments, mannequin/rest-pose bake, WASM grinder build |+| i18n & verify | `i18n`/`i18n:{extract,translate,lint}`, `verify:{solana,onchain,x402}`, `smoke:{onchain,agent-wallet,mcp}` | Localization pipeline + on-chain/x402 verification + smoke tests |++**`npm run gate`** is the de-facto pre-push composite check (no GitHub Actions runner exists): `test:gate && audit:mcp && audit:routes && audit:handlers && audit:pages && audit:hidden-guard`. `package.json` defines **118 scripts** total.---@@ -1896,8 +1947,12 @@ Authoritative format/protocol specs that the code implements:| `SKILL_SPEC.md` | Skill definition, pricing, licensing || `PERMISSIONS_SPEC.md` | ERC-7710 delegation & permission model || `ENS_AGENT_CLAIM.md` | ENS / SNS agent name claim flow |+| `STAGE_SPEC.md` | Stage/scene (live show) contract |+| `VALIDATORS.md` | Validator definitions (ERC-8004 ValidationRegistry) || `SECURITY.md` · `CLAUDE_ARTIFACT.md` | Security model + Claude artifact contract |+`specs/schema/` holds 6 canonical SQL DDL files defining spec-level table contracts (`agent_delegations`, `agent_subscriptions`, `dca_strategies`, `embed-policy`, `indexer_state`, `voice-cloning`) + a README. (Note: the x402 v2 spec lives in `docs/x402.md`, not `specs/`.)+---### Mobile, Embeds & Integrations@@ -1921,7 +1976,8 @@ Runnable reference implementations that exercise the live platform:- **`agents/`** — standalone agents: `endpoint-shopper` (x402 service shopper), `fact-checker`, `tutor`, `unstoppable`.- **`pump-fun-skills/`** — composable pump.fun skill modules: `create-coin`, `swap`, `coin-fees`, `reactive`, `tokenized-agents`.-- **`examples/`** — embed & integration demos: `coach-leo` (VR), `agenc-task-roundtrip`, `pump-fun-agent`, `metamask-agent-wallet`, plus `bare-avatar.html` / `minimal.html` / `web-component.html`.+- **`examples/`** — embed & integration demos: `coach-leo` (VR), `agenc-task-roundtrip`, `pump-fun-agent`, `metamask-agent-wallet`, `three-concierge` (concierge agent with `SKILL.md`/`agent-card.json`/`manifest.json`), plus runnable HTML: `bare-avatar`, `minimal`, `web-component`, `agent-presence`, `agent-wallet-embed`, `widget-rpc`, `two-agents`, `one-line-demo`, `embed-test`.+- **`examples/skills/`** — `pump-fun`, `pump-fun-compose`, `pump-fun-strategy`, `pump-fun-trade`, `solana-wallet`, `wave`.---@@ -2525,6 +2581,73 @@ The schema (`api/_lib/schema.sql` + **234 dated migration files**, 2026-04-29---+## GPU Worker Service Contracts++The Python/FastAPI workers in `workers/` run on Google Cloud Run (GPU). Each exposes a small, uniform HTTP contract — `POST` to submit a job, `GET /tasks/:id` to poll, `GET /health` for liveness. Job state lives in Firestore; outputs land in GCS, then are copied to Cloudflare R2. The Vercel `api/forge*` and `api/_lib/forge-tiers.js` layer selects a backend by $THREE tier and fronts these workers.++| Worker | Submit | Poll | Other | Function |+|--------|--------|------|-------|----------|+| `avatar-pipeline-controller` | `POST /reconstruct` | `GET /jobs/:id` | `GET /health` | Orchestrates image→3D→rig→blendshapes; routes to model backends then UniRig |+| `model-hunyuan3d` | `POST /infer` | `GET /tasks/:id` | `GET /health` | Image → 3D mesh (Hunyuan3D, CUDA) |+| `model-trellis` | `POST /infer` | `GET /tasks/:id` | `GET /health` | Text/image → 3D mesh (TRELLIS, CUDA) |+| `model-triposr` | `POST /infer` | `GET /tasks/:id` | `GET /health` | Image → 3D mesh (TripoSR) |+| `model-triposg` | `POST /infer` | `GET /tasks/:id` | `GET /health` | Image → 3D mesh (TripoSG) |+| `model-text2motion` | `POST /infer` | `GET /tasks/:id` | `GET /health` | Text → SMPL motion (MDM) → canonical AnimationClip JSON |+| `unirig` | `POST /rig` | `GET /tasks/:id` | `GET /health` | Skeleton + skinning + ARKit-52 blendshapes (UniRig, SIGGRAPH 2025) |+| `rembg` | `POST /remove` | `GET /tasks/:id` | `GET /health` | Background removal (BRIA RMBG-2.0, u2net, isnet) |+| `segment` | `POST /segment` | `GET /tasks/:id` | `GET /health` | Mesh part segmentation |+| `stylize` | `POST /process` | `GET /tasks/:id` | `GET /styles`, `GET /health` | Mesh/texture style transfer (style catalog) |+| `texture` | `POST /texture` | `GET /tasks/:id` | `POST /retexture_region`, `GET /health` | Full + regional re-texturing |+| `remesh` | `POST /infer` (Blender) | `GET /tasks/:id` | `GET /health` | Geometry remesh (Blender FBX pipeline) |+| `avatar-reconstruction` | `POST /reconstruct` | `GET /jobs/:id` | `GET /health` | Photo → avatar face reconstruction (`face_pipeline.py`) |++> Deploy via `workers/deploy/` (`deploy-all.sh`, `deploy-editing.sh`, `stage-weights.sh`) + per-worker `cloudbuild.yaml`. `workers/pump-fun-mcp/` is a Cloudflare Worker (`wrangler.toml`), not a GPU worker. `workers/longcat/` is an empty stub.++### Voice & Multimodal Endpoints (Vercel → NVIDIA)++| Endpoint | Files / Backend | Function |+|----------|-----------------|----------|+| `POST /api/tts/speak` | `api/tts/speak.js`, `voices.js`, `edge.js` | Text → speech (NVIDIA Magpie primary, OpenAI TTS backstop) |+| `POST /api/tts/eleven` · `eleven-clone` | `api/tts/eleven*.js` | ElevenLabs premium TTS + voice cloning |+| `POST /api/asr` | NVIDIA Riva (gRPC) | Free speech-to-text (voice in) |+| `POST /api/a2f` | NVIDIA Audio2Face-3D (gRPC) | Free audio → ARKit-52 facial animation |+| `POST /api/vision` | NVIDIA NIM VLM → OpenAI gpt-4o-mini | Public image understanding |+| `POST /api/cosmos` | NVIDIA Cosmos | Text → ~5s 1280×704@24fps world video (async MP4) |++gRPC protobufs are vendored under `api/_lib/riva-protos/` and `api/_lib/a2f-protos/`; these endpoints require the Node runtime (not Edge).++---++## Testing & Quality Assurance++There is **no external CI** (no `.github/workflows/`), so a large local test suite + the `gate`/`audit`/`smoke` scripts ARE the quality bar. **~591 test files.**++**Runners:**++| Script | Stack | Scope |+|--------|-------|-------|+| `test` | Vitest + Playwright | `vitest run && playwright test` — full suite |+| `test:core` | Vitest (1 worker) | Deterministic unit runs |+| `test:e2e` | Playwright | Browser end-to-end |+| `test:gate` | `test-gate.mjs` | Build-gate subset |+| `test:pages` | `test-pages.mjs` | Per-page smoke |+| `test:mcp` | `test-mcp-all.mjs` | All MCP remotes/stdio |++**Layout & coverage (by directory):**++| Dir | Count | Focus |+|-----|-------|-------|+| `tests/` (root) | ~334 | Cross-cutting unit/integration: agents, animation/retarget, ARKit blendshapes, sniper, wallet tabs, agora, IRL/AR, x402, guardian |+| `tests/api/` | ~207 | API handler tests across every feature area |+| `tests/src/` | ~38 | Frontend module tests |+| `tests/oracle/` | ~7 | Oracle scoring/conviction loops |+| `tests/three/`, `tests/runtime/`, `tests/sdk/`, `tests/public/` | ~5 | Three.js, runtime lipsync, SDK, public surfaces |+| `tests/_fixtures/`, `tests/_helpers/`, `tests/fixtures/`, `tests/helpers/`, `tests/e2e/` | — | Shared fixtures, helpers, Playwright specs |++**Heaviest-tested subsystems** (by filename prefix): `agent-*` (27), `irl-*` (20), `pump*` (20), `forge-*` (9), `three-*` (9), `vanity-*` (8), `mcp-*` (8), `wallet-*` (7), `solana-*` (6). Animation correctness is guarded by `animation-retarget`, `animation-upright-invariant`, `animation-state-machine`, `glb-canonicalize`, and `arkit-blendshapes` tests (the universal-rig contract from CLAUDE.md).++---+## Agent Discovery & Well-Known Manifeststhree.ws is built to be discovered and consumed by other agents, crawlers, and registries. It publishes a full suite of machine-readable manifests under `/.well-known/` — some static (`public/.well-known/`), some served dynamically (`api/wk.js`, `api/openapi-json.js`).diff --git a/docs/audit/2026-06-26-completion-audit.md b/docs/audit/2026-06-26-completion-audit.mdnew file mode 100644index 000000000..eaf42c0df--- /dev/null+++ b/docs/audit/2026-06-26-completion-audit.md@@ -0,0 +1,77 @@+# Completion Audit — 2026-06-26++**Question asked:** "Complete everything not yet complete."++**Finding:** There is no pile of abandoned, finishable code in this repo. The+work that *is* in flight is being completed and committed in real time by a+swarm of concurrent agents sharing this single worktree. The only genuinely+broken thing in production is ops/env configuration, not code.++This document records what was verified, so the next person doesn't re-run the+same investigation.++---++## What was checked (and the ground truth)++### 1. "Incomplete-work" markers are noise+A sweep of `src api workers sdk` for the patterns CLAUDE.md forbids:++| Pattern | Result |+| --- | --- |+| `sampleAgents`, `implement later`, `throw new Error("not implemented")` | **0 hits** |+| `TODO` | All in vendor three.js editor code (`src/scene-studio/vendor/`), the wasm vanity grinder, or a literal persona-prompt string (`circulation-personas.js`) that *says* "You never leave TODOs or stubs." None are real work. |+| `not implemented` | All intentional and documented: MPP deliberately unadvertised (`openapi-json.js`), web3-storage CAR note, and MCP dispatch returning a proper JSON-RPC `-32601` for unknown tools (correct behavior). |++No fake-data, stub, or placeholder violations to remediate.++### 2. The one real in-flight feature — verified, then it landed+**Token-launchpad deep-link prefill + Launch→Trade CTA flip** (5 files:+`public/p/render.js`, `public/launch/launch.js`, `public/studio/launch-panel.js`,+`src/editor/launchpad-studio.js`, `src/launchpad/landing.js`).++Verified end-to-end:+- Sender (`render.js`) writes query params `name/symbol/description/image/initialBuy`;+ receiver (`launch.js` → `launch-panel.js applyPrefill`) reads exactly those. Field-for-field match.+- Post-launch CTA opens `/launches/<mint>` — route exists (`vercel.json:695`, base58 matcher).+- `toSymbol` defined (`launch-panel.js:43`); image is pulled into a real `File` for IPFS pinning.+- **Tests: 29/29 pass** (`tests/studio-launch-panel.test.js`, `tests/studio-fees-panel.test.js`).+- Changelog entry present and valid (`npm run build:pages` passes).++**Status: committed during this session as `dce1f4d14`** by another agent. Done.++### 3. Production warnings are ops/env, not code+The "Production Warnings — Root Cause" panel named three issues:+- **`WALLET_ENCRYPTION_KEY` not set** → custodial wallet provisioning fails.+ This is **not a code bug** — `api/_lib/secret-box.js` already *fails closed*+ in production by design. The fix is setting the secret in the deployment.+- **Redis timing out / circuit breaker tripping** (`api/_lib/resilience.js`) — runtime/infra.+- **Audit-log DB timeout** (`api/audit-log.js`) — runtime/infra.++None of these are completable by editing source. They require deploy access and+the actual secret values.++---++## The real bottleneck++~24 agents (see FleetView) are editing and committing this **one shared+worktree** simultaneously. During this audit the tree gained, unprompted:+`dce1f4d14` (prefill feature), plus uncommitted edits to `ARCHITECTURE.md`,+`CHANGELOG.md`, `data/changelog.json`, `public/changelog.xml`,+`src/animation-retarget.js`, and an active redesign of `src/launchpad/landing.js`+(embedding the real launcher into the landing hero).++Piling more edits into the same tree creates collisions, not progress. The+correct way to add completion work here is one of:++1. **An isolated git worktree** for any new bounded surface — zero collision risk.+2. **Ops access** (Vercel project + which secrets are unset) to fix the one thing+ actually broken in production.+3. **A specific, single-owner surface** (one page / SDK / API route) assigned so+ no two agents touch the same files.++---++*Verified by inspection, tests, and `build:pages`. No source files were modified+by this audit; regenerated artifacts were restored to avoid worktree churn.*diff --git a/pages/launch-detail.html b/pages/launch-detail.htmlindex b9f48b67d..85aa4ea00 100644--- a/pages/launch-detail.html+++ b/pages/launch-detail.html@@ -54,6 +54,9 @@<!-- Hero / identity. Hydrated by src/launch-detail.js. --><section id="ld-hero" class="ld-hero" aria-label="Coin overview"></section>+ <!-- Market metrics — multi-timeframe price moves + on-chain safety. -->+ <section id="ld-metrics" class="ld-section ld-metrics" aria-label="Market metrics"></section>+<!-- Primary intelligence + market column, secondary sidebar. --><div class="ld-body"><div class="ld-main">diff --git a/src/launch-detail.css b/src/launch-detail.cssindex 3ac564ca1..ad5927b4d 100644--- a/src/launch-detail.css+++ b/src/launch-detail.css@@ -278,7 +278,7 @@ body {.ld-hero-stats {display: grid;- grid-template-columns: repeat(4, 1fr);+ grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));gap: var(--space-sm);margin: var(--space-lg) 0 0;}diff --git a/src/launch-detail.js b/src/launch-detail.jsindex 81b652053..4cca782d5 100644--- a/src/launch-detail.js+++ b/src/launch-detail.js@@ -406,6 +406,7 @@ function renderHero() {stat('Price', fmtPrice(price)),stat('Market cap', fmtMcap(mcap)),stat('24h volume', fmtMcap(Number(coin?.volume_24h ?? coin?.volume24h))),+ stat('Total supply', supply != null ? compact(supply) : '—'),stat('Launched', reg?.created_at || intel?.created_at ? relTime(reg?.created_at || intel?.created_at) : '—'),]);@@ -426,6 +427,179 @@ function renderHero() {target.classList.add('ld-revealed');}+// ════════════════════════════════════════════════════════════════════════════+// MARKET METRICS — multi-timeframe price moves + live on-chain safety read+// ════════════════════════════════════════════════════════════════════════════+//+// Two live reads, each real and independently degradable:+// · price moves — one 5m-candle pull (/api/pump/price-history), windowed in the+// client into 5m / 1h / 6h / 24h percentage moves. A window is shown only+// when the history actually spans (most of) it, so a young coin renders "—"+// for 24h rather than a misleading figure derived from two hours of data.+// · trust strip — the same pre-trade firewall verdict the autonomous sniper+// enforces (/api/pump/safety): a live SPL mint/freeze authority audit + a+// tradable-venue read, scored 0..100. Answers the on-chain trust questions a+// GMGN-style terminal leads with — can the dev mint more, freeze your tokens,+// is there a real venue — at a glance, every value traceable to chain state.++const TF_WINDOWS = [+ { key: '5m', label: '5m', sec: 300 },+ { key: '1h', label: '1h', sec: 3600 },+ { key: '6h', label: '6h', sec: 21600 },+ { key: '24h', label: '24h', sec: 86400 },+];++// Window a single ascending 5m-candle series into per-timeframe % moves. Returns+// null when there isn't enough data to compute even the shortest window.+function priceDeltas(pts) {+ const sorted = (pts || [])+ .filter((p) => Number.isFinite(p.c) && Number.isFinite(p.t) && p.c > 0)+ .sort((a, b) => a.t - b.t);+ if (sorted.length < 2) return null;+ const last = sorted[sorted.length - 1];+ const span = last.t - sorted[0].t;+ const deltas = TF_WINDOWS.map((w) => {+ // Require ≥60% of the window in history before quoting it — never fabricate+ // a long-horizon move from a short series.+ if (span < w.sec * 0.6) return { ...w, pct: null };+ const target = last.t - w.sec;+ let ref = sorted[0];+ for (const p of sorted) { if (p.t >= target) { ref = p; break; } }+ return { ...w, pct: ref.c ? ((last.c - ref.c) / ref.c) * 100 : null };+ });+ return { last: last.c, deltas };+}++function renderTimeframeStrip(host) {+ host.replaceChildren(el('div', { class: 'ld-skel ld-skel-strip' }));+ const to = Math.floor(Date.now() / 1000);+ const from = to - 30 * 3600;+ fetchJson(`/api/pump/price-history?mint=${encodeURIComponent(state.mint)}&interval=5m&from=${from}&to=${to}`)+ .then((body) => {+ const res = priceDeltas(body.data);+ if (!res || res.deltas.every((d) => d.pct == null)) {+ host.replaceChildren(el('p', { class: 'ld-mtf-empty', text: 'Not enough trade history yet for price moves.' }));+ return;+ }+ host.replaceChildren(+ el('div', { class: 'ld-mtf' }, res.deltas.map((d) =>+ el('div', { class: 'ld-mtf-cell' }, [+ el('span', { class: 'ld-mtf-label', text: d.label }),+ el('span', {+ class: `ld-mtf-val ${d.pct == null ? 'ld-muted' : pnlClass(d.pct)}`,+ text: d.pct == null ? '—' : fmtPct(d.pct, { sign: true }),+ }),+ ]),+ )),+ );+ })+ .catch(() => {+ host.replaceChildren(+ el('div', { class: 'ld-mtf-empty' }, [+ el('span', { text: 'Price moves unavailable right now.' }),+ el('button', { class: 'ld-btn ld-btn-ghost', type: 'button', text: 'Retry', onclick: () => renderTimeframeStrip(host) }),+ ]),+ );+ });+}++const TRUST_TONE = { pass: 'good', warn: 'warn', fail: 'danger', skip: 'muted' };+const VERDICT_META = {+ allow: { label: 'Tradable', tone: 'good' },+ warn: { label: 'Caution', tone: 'warn' },+ block: { label: 'High risk', tone: 'danger' },+};+const VENUE_LABEL = {+ live_amm_pool: 'AMM pool',+ live_bonding_curve: 'Bonding curve',+ no_tradable_venue: 'None',+ curve_reserves_empty: 'Drained',+ pool_reserves_empty: 'Drained',+};++function trustChip(label, value, tone, title) {+ return el('div', { class: 'ld-trust', title: title || null }, [+ el('span', { class: 'ld-trust-k', text: label }),+ el('span', { class: `ld-trust-v ld-${tone}`, text: value }),+ ]);+}++function renderTrustStrip(host) {+ host.replaceChildren(el('div', { class: 'ld-skel ld-skel-strip' }));+ fetchJson(`/api/pump/safety?mint=${encodeURIComponent(state.mint)}&network=${state.network}`)+ .then((s) => {+ const checks = Array.isArray(s.checks) ? s.checks : [];+ const byName = (n) => checks.find((c) => c.name === n);+ const auth = byName('mint_authority');+ const venue = byName('venue');+ const sell = byName('round_trip');++ const chips = [];+ // A null on-chain authority means it was renounced — the dev can no longer+ // inflate supply (mint) or freeze your account (the cleanest honeypot).+ if (auth) {+ const unread = auth.reason === 'authority_read_failed' || auth.reason === 'mint_not_found';+ const mintActive = auth.detail?.mint_authority != null;+ const freezeActive = auth.detail?.freeze_authority != null;+ chips.push(trustChip('Mint authority', unread ? 'Unknown' : mintActive ? 'Active' : 'Revoked',+ unread ? 'muted' : mintActive ? 'danger' : 'good',+ mintActive ? 'The creator can still mint new supply and dilute holders.' : 'Mint authority renounced — supply is fixed.'));+ chips.push(trustChip('Freeze authority', unread ? 'Unknown' : freezeActive ? 'Active' : 'Revoked',+ unread ? 'muted' : freezeActive ? 'danger' : 'good',+ freezeActive ? 'The creator can freeze your token account — you may be unable to sell.' : 'Freeze authority renounced — your tokens cannot be frozen.'));+ }+ if (venue) {+ chips.push(trustChip('Liquidity', VENUE_LABEL[venue.reason] || (venue.status === 'pass' ? 'Live' : '—'),+ TRUST_TONE[venue.status] || 'muted', 'Where this coin can actually be traded.'));+ }+ if (sell) {+ const label = sell.status === 'pass' ? 'Sellable' : sell.status === 'fail' ? 'Honeypot' : 'Untested';+ chips.push(trustChip('Sell test', label, TRUST_TONE[sell.status] || 'muted',+ sell.status === 'skip' ? 'A live buy→sell round-trip is simulated at trade time.' : 'Simulated buy→sell round-trip on-chain.'));+ }++ if (!chips.length) {+ host.replaceChildren(el('p', { class: 'ld-mtf-empty', text: 'Safety checks are unavailable for this coin.' }));+ return;+ }++ const v = VERDICT_META[s.verdict] || { label: 'Unscored', tone: 'muted' };+ const head = el('div', { class: 'ld-trust-head' }, [+ el('span', { class: `ld-verdict-pill ld-pill-${v.tone}`, text: v.label }),+ Number.isFinite(Number(s.score)) ? el('span', { class: 'ld-trust-score', text: `${Math.round(Number(s.score))}/100 safety` }) : null,+ ]);+ host.replaceChildren(head, el('div', { class: 'ld-trust-grid' }, chips));+ })+ .catch(() => {+ host.replaceChildren(+ el('div', { class: 'ld-mtf-empty' }, [+ el('span', { text: 'Safety check unavailable right now.' }),+ el('button', { class: 'ld-btn ld-btn-ghost', type: 'button', text: 'Retry', onclick: () => renderTrustStrip(host) }),+ ]),+ );+ });+}++function renderMetrics() {+ const target = $('ld-metrics');+ if (!target) return;+ if (state.network !== 'mainnet') {+ section(target, 'Market metrics', el('div', { class: 'ld-empty ld-empty-sm' }, [+ el('p', { text: 'Live price moves and on-chain safety checks are mainnet-only.' }),+ ]));+ return;+ }+ const tfHost = el('div', { class: 'ld-mtf-host' });+ const trustHost = el('div', { class: 'ld-trust-host' });+ const body = el('div', { class: 'ld-metrics-body' }, [+ el('div', { class: 'ld-metrics-block' }, [el('h3', { class: 'ld-metrics-h', text: 'Price moves' }), tfHost]),+ el('div', { class: 'ld-metrics-block' }, [el('h3', { class: 'ld-metrics-h', text: 'On-chain safety' }), trustHost]),+ ]);+ section(target, 'Market metrics', body, { tag: 'live' });+ renderTimeframeStrip(tfHost);+ renderTrustStrip(trustHost);+}+// ════════════════════════════════════════════════════════════════════════════// INTELLIGENCE VERDICT// ════════════════════════════════════════════════════════════════════════════@@ -1679,6 +1853,7 @@ async function boot() {// Paint everything. Each section owns its own empty/error state, so one// missing data source never blanks the page.renderHero();+ renderMetrics();renderVerdict();renderOracleConviction();renderSmartMoney();