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.

feat(tokens): add the free plan-dry-run proof lane and map the surface in STRUCTURE

nirholas32809d3b1c22
diff --git a/STRUCTURE.md b/STRUCTURE.md
index adeb00f65..48f2cc7d2 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -143,6 +143,7 @@ bottom.
| On-chain skill licenses | [contracts/skill-license/](contracts/skill-license) `→ /api/skills/license-onchain` | In-repo | Anchor program: each purchased skill = a 1/1 SPL NFT + `SkillLicense` PDA, a trustless alternative to DB-backed access checks. Backend: [api/_lib/skill-license-onchain.js](api/_lib/skill-license-onchain.js) |
| Tokenized 3D (mint an avatar as an NFT) | [api/_lib/tokenize-3d.js](api/_lib/tokenize-3d.js) + [api/_lib/tokenize-3d-metadata.js](api/_lib/tokenize-3d-metadata.js), MCP tools [api/_mcp/tools/tokenize.js](api/_mcp/tools/tokenize.js) (`mint_3d_asset`, `get_3d_asset_onchain`), signed ledger provenance [api/_lib/asset-provenance.js](api/_lib/asset-provenance.js), launch directory [api/v1/tokenized/launches.js](api/v1/tokenized/launches.js) `→ GET /api/v1/tokenized/launches`, public gallery [pages/minted.html](pages/minted.html) + [src/minted.js](src/minted.js) `→ /minted` | In-repo | Mint a generated/owned GLB as a Metaplex Core NFT whose media is a live 3D viewer (GLB under `animation_url`), with baked provenance + enforced capped royalties (10%), idempotent, devnet-default. Every generated avatar AND every mint also appends an ERC-191-signed record to the `agent_actions` ledger (verifiable via `@three-ws/provenance-mcp`'s `query_action`). A mint naming `parent_mint` (a remix) routes the parent creator's royalty out of the mint fee as a real on-chain USDC transfer (mainnet, x402-collected calls only) — [api/_lib/remix-royalty.js](api/_lib/remix-royalty.js) split math, [api/_lib/remix-settlement.js](api/_lib/remix-settlement.js) payout wallet. Premium/token-gated generation: the Forge High tier (200k poly + PBR) is $THREE hold-or-pay gated — [api/forge.js](api/forge.js) `requireFeatureAccess('forge.high')` + [api/_lib/three-tier.js](api/_lib/three-tier.js) tier ladder, x402 pay-per-use or credits fallback; Draft/Standard stay free and ungated. Launch record: [tokenized_3d_assets](api/_lib/migrations/20260707120000_tokenized_3d_assets.sql) + [remix-royalty columns](api/_lib/migrations/20260708130000_tokenized_3d_remix_royalty.sql). Public gallery: `/minted` renders the launch directory live (model-viewer thumbnails, network toggle, royalty + remix badges) — the NFT counterpart of `/launches`. Docs: [docs/mcp.md](docs/mcp.md#mint_3d_asset). E2E: [scripts/tokenize-3d-devnet-e2e.mjs](scripts/tokenize-3d-devnet-e2e.mjs). Tests: [tests/tokenize-3d.test.js](tests/tokenize-3d.test.js), [tests/tokenize-3d-remix-royalty.test.js](tests/tokenize-3d-remix-royalty.test.js), [tests/asset-provenance.test.js](tests/asset-provenance.test.js) |
| Token-gated 3D embeds (holder-only interactive scenes) | Gate config + on-chain verify [api/_lib/embed-gate.js](api/_lib/embed-gate.js), access tokens [api/_lib/embed-gate-token.js](api/_lib/embed-gate-token.js), endpoints [api/embed/gate-create.js](api/embed/gate-create.js) + [api/embed/gate-verify.js](api/embed/gate-verify.js), gate-aware resolver [api/embed/resolve.js](api/embed/resolve.js), MCP tool [api/_mcp/tools/embed.js](api/_mcp/tools/embed.js) (`create_gated_embed`), widget [public/embed/v1.js](public/embed/v1.js) (`<three-d>`) + standalone host [public/embed/v1/gated.html](public/embed/v1/gated.html) `→ /embed/v1/gated` | In-repo | `create_gated_embed(asset_id, gate)` turns an avatar or on-chain agent you own into a holder-only interactive `<three-d>` embed — visitors must prove a real, server-verified SPL balance (SIWS challenge → nonce → signature → Solana RPC read, never a client-reported number) before the live scene renders; below the bar they see a designed locked teaser + connect-wallet CTA. `mint` defaults to $THREE but is a runtime parameter (coin-agnostic plumbing). Anti-abuse: short-lived signed access tokens (auto re-verify on expiry) + per-IP/per-wallet rate limits. Storage: [embed_gates + embed_gate_nonces](api/_lib/migrations/20260708120000_embed_gates.sql). Spec: [specs/EMBED_SPEC.md](specs/EMBED_SPEC.md#token-gating). Docs: [docs/token-gated-3d-embeds.md](docs/token-gated-3d-embeds.md). Tests: [tests/embed-gate.test.js](tests/embed-gate.test.js) |
+| Agent token plans (the coin an agent will become) | Rules + storage [api/_lib/agent-token-plan.js](api/_lib/agent-token-plan.js) (migration [api/_lib/migrations/20260811130000_agent_token_plans.sql](api/_lib/migrations/20260811130000_agent_token_plans.sql)), API actions `plan` + `plan-dry-run` in [api/agents/tokens/[action].js](api/agents/tokens/%5Baction%5D.js) `→ /api/agents/tokens/{plan,plan-dry-run}`, profile panel [src/agent-token-plan.js](src/agent-token-plan.js) on `/agents/:id` | In-repo · Live | The launch configuration bound to the agent record: one saved, editable plan per (agent, network) carrying the coin's name, ticker, story, artwork, pairing, buyback share and dev buy, with a derived readiness verdict and SOL cost estimate. Saving costs nothing and mints nothing. `plan-dry-run` is the free proof lane: it builds the SAME pump.fun create instructions the real launch builds from the SAME plan, compiles them against a real blockhash and simulates them on the cluster (devnet by default), never signing and never broadcasting, and separates `funding_required` from a genuinely broken plan. Both launch paths (`/api/agents/tokens/launch-confirm` from the owner's wallet, `/api/pump/launch-agent` from the agent's custodial wallet) call `markPlanLaunched` and write a `pump_agent_mints` row, which is also what finally puts user-wallet launches into `/launches` and the profile's launch history. Docs: [docs/agent-tokens.md](docs/agent-tokens.md). Tests: [tests/agent-token-plan.test.js](tests/agent-token-plan.test.js), [tests/agent-token-plan-api.test.js](tests/agent-token-plan-api.test.js), [tests/agent-token-plan-render.test.js](tests/agent-token-plan-render.test.js) |
| Launch Studio (coin-launch use cases) | [api/_lib/launch/](api/_lib/launch) `→ /launch-studio`, [api/pump/launch-studio.js](api/pump/launch-studio.js), [public/launch-studio/launch-studio.js](public/launch-studio/launch-studio.js) | In-repo | Engine + catalog of 50 declarative launch recipes — reward coins for trending GitHub repos/creators ([github-trending.js](api/_lib/github-trending.js)) and coins riding live narratives ([launcher-trends.js](api/_lib/launcher-trends.js)). Live preview → `/launch` handoff. Docs: [docs/launch-usecases.md](docs/launch-usecases.md), [api/_lib/launch/README.md](api/_lib/launch/README.md) |
| Native launchpad (three.ws's own bonding curve) | Curve economics [api/_lib/native-launch/config.js](api/_lib/native-launch/config.js), curve wrapper [api/_lib/native-launch/dbc.js](api/_lib/native-launch/dbc.js), dispatcher [api/native-launch/[action].js](api/native-launch/%5Baction%5D.js) `→ /api/native-launch/{config,quote,pool,launch-prep,launch-confirm,launches}`, lane toggle in [public/studio/launch-panel.js](public/studio/launch-panel.js) | In-repo (devnet-verified; mainnet config not yet deployed) | The second launch lane beside pump.fun: a coin launch on a bonding curve three.ws configures and owns, so the platform earns a share of every trade instead of only creator fees. Runs on Meteora's audited Dynamic Bonding Curve program with three.ws as the on-chain partner — 1B supply, SOL-quoted, immutable metadata, 1% trading fee split 50/50 creator/platform, graduating at ~85 SOL raised into a DAMM v2 pool with **100% of LP permanently locked** (un-ruggable, both sides keep earning). Same custody model as the pump lane (server builds an unsigned tx, the launcher's wallet + mint keypair sign client-side, confirm verifies on-chain that the curve program actually ran before recording). The lane hides itself entirely until a partner config is pinned for that network (`NATIVE_LAUNCH_CONFIG_KEY[_DEVNET]`), so launches fall back to pump.fun rather than half-working. Not to be confused with `/api/launchpad/*` (Launchpad Studio, the page builder). Storage: [native_launches](api/_lib/migrations/20260726100000_native_launchpad.sql). Setup: [scripts/native-launchpad-create-config.mjs](scripts/native-launchpad-create-config.mjs). E2E: [scripts/native-launchpad-e2e-devnet.mjs](scripts/native-launchpad-e2e-devnet.mjs). Docs: [docs/native-launchpad.md](docs/native-launchpad.md). Tests: [tests/native-launch-curve.test.js](tests/native-launch-curve.test.js), [tests/native-launch-endpoint.test.js](tests/native-launch-endpoint.test.js) |
| Memetic Launcher (per-user autonomous coin launcher) | [pages/launcher.html](pages/launcher.html) `→ /launcher` + [src/user-launcher.js](src/user-launcher.js), API [api/launcher/me.js](api/launcher/me.js), engine [api/_lib/launcher-engine.js](api/_lib/launcher-engine.js) (cron [api/cron/launcher-tick.js](api/cron/launcher-tick.js)), trends [api/_lib/launcher-trends.js](api/_lib/launcher-trends.js) | In-repo | Every user designs their own autonomous pump.fun launcher: mode (trend/meme/hybrid/random), trend sources, cadence, network. Preview (default) records picks without moving SOL; **Live** mints for real, SELF-FUNDED - each launch paid by the user's own agent wallet (base ~0.022 SOL + dev buy), never master SOL, with typed go-live confirm, dev-buy + daily-SOL-cap clamps, unfunded-wallet skips (breaker-immune), and an agent-wallet funding panel with live balances. Docs: [docs/memetic-launcher.md](docs/memetic-launcher.md). Tests: [tests/user-launcher.test.js](tests/user-launcher.test.js), [tests/launcher-engine.test.js](tests/launcher-engine.test.js) |
diff --git a/api/_lib/agent-token-plan.js b/api/_lib/agent-token-plan.js
index 5206c560c..00b5255ea 100644
--- a/api/_lib/agent-token-plan.js
+++ b/api/_lib/agent-token-plan.js
@@ -1,4 +1,4 @@
-// Agent token plans — the launch configuration bound to an agent record.
+// Agent token plans: the launch configuration bound to an agent record.
//
// An agent token is the economic object an agent becomes: one coin, on Solana,
// whose identity belongs to the agent rather than to whichever form the owner
@@ -352,7 +352,7 @@ export async function recordDryRun({ agentId, network, result }) {
/**
* Bind a confirmed on-chain launch back to the plan it came from. Idempotent and
* safe to call when no plan exists (the launch paths accept a launch configured
- * inline, without a saved plan) — it simply writes nothing and returns null.
+ * inline, without a saved plan). It simply writes nothing and returns null.
*
* @param {{ agentId: string, network: string, mint: string }} o
* @returns {Promise<object|null>} the launched plan row, or null
diff --git a/api/_lib/migrations/20260811130000_agent_token_plans.sql b/api/_lib/migrations/20260811130000_agent_token_plans.sql
index 7f7ab777e..17b970d9a 100644
--- a/api/_lib/migrations/20260811130000_agent_token_plans.sql
+++ b/api/_lib/migrations/20260811130000_agent_token_plans.sql
@@ -1,4 +1,4 @@
--- Migration: agent_token_plans — the launch configuration bound to an agent record.
+-- Migration: agent_token_plans, the launch configuration bound to an agent record.
-- Apply: psql "$DATABASE_URL" -f api/_lib/migrations/20260811130000_agent_token_plans.sql
-- Idempotent.
--
diff --git a/pages/create-agent.html b/pages/create-agent.html
index cf0c0eeaf..0d79e1a66 100644
--- a/pages/create-agent.html
+++ b/pages/create-agent.html
@@ -1331,7 +1331,7 @@
<div class="wizard-body" id="wizard-body">
<!-- Step 1 — Basics -->
<section class="panel is-active" data-step="0" aria-label="Basic info">
- <p class="panel-eyebrow" data-i18n="create_agent.step_1_of_5">Step 1 of 5</p>
+ <p class="panel-eyebrow" data-i18n="create_agent.step_1_of_6">Step 1 of 6</p>
<h2 class="panel-title" data-i18n="create_agent.the_basics">The basics</h2>
<p class="panel-help" data-i18n="create_agent.describe_your_agent_in_a_sentence_and">
Describe your agent in a sentence and we'll fill in everything —
@@ -1441,7 +1441,7 @@
<!-- Step 2 — 3D Model -->
<section class="panel" data-step="1" aria-label="3D model">
- <p class="panel-eyebrow" data-i18n="create_agent.step_2_of_5">Step 2 of 5</p>
+ <p class="panel-eyebrow" data-i18n="create_agent.step_2_of_6">Step 2 of 6</p>
<h2 class="panel-title" data-i18n="create_agent.give_it_a_body">Give it a body</h2>
<p class="panel-help" data-i18n-html="create_agent.every_agent_gets_a_3d_avatar_pick">
Every agent gets a 3D avatar. Pick a ready-made character, upload
@@ -1586,7 +1586,7 @@
<!-- Step 3 — Skills -->
<section class="panel" data-step="2" aria-label="Skills">
- <p class="panel-eyebrow" data-i18n="create_agent.step_3_of_5">Step 3 of 5</p>
+ <p class="panel-eyebrow" data-i18n="create_agent.step_3_of_6">Step 3 of 6</p>
<h2 class="panel-title" data-i18n="create_agent.pick_its_skills">Pick its skills</h2>
<p class="panel-help" data-i18n="create_agent.every_agent_ships_with_a_core_set">
Every agent ships with a core set. Toggle on extra capabilities to
@@ -1599,9 +1599,9 @@
</section>
<!-- Step 4 — Personality & Voice -->
- <section class="panel" data-step="3" aria-label="Personality and voice">
- <p class="panel-eyebrow" data-i18n="create_agent.step_4_of_5">Step 4 of 5</p>
- <h2 class="panel-title" data-i18n="create_agent.personality_voice">Personality &amp; voice</h2>
+ <section class="panel" data-step="3" aria-label="Personality">
+ <p class="panel-eyebrow" data-i18n="create_agent.step_4_of_6">Step 4 of 6</p>
+ <h2 class="panel-title" data-i18n="create_agent.personality">Personality</h2>
<p class="panel-help" data-i18n="create_agent.shape_how_your_agent_talks_a_category">
Shape how your agent talks. A category and a profile prompt are what
publish it to the marketplace.
@@ -1654,8 +1654,19 @@
</p>
</div>
+ </section>
+
+
+ <!-- Step 5 - Voice -->
+ <section class="panel" data-step="4" aria-label="Voice">
+ <p class="panel-eyebrow" data-i18n="create_agent.step_5_of_6">Step 5 of 6</p>
+ <h2 class="panel-title" data-i18n="create_agent.give_it_a_voice">Give it a voice</h2>
+ <p class="panel-help" data-i18n="create_agent.every_agent_speaks_pick_the_built_in">
+ Every agent speaks. Pick the built-in voice, or record a short sample
+ and your agent talks in your own cloned voice everywhere on three.ws.
+ </p>
+
<div class="field">
- <label class="field-label" data-i18n-html="create_agent.voice"><span>Voice</span></label>
<div class="opt-grid cols-2">
<button
type="button"
@@ -1708,23 +1719,23 @@
<line x1="12" y1="19" x2="12" y2="23" />
</svg>
</div>
- <span class="opt-name" data-i18n="create_agent.custom_voice">Custom voice</span>
+ <span class="opt-name" data-i18n="create_agent.clone_your_voice">Clone your voice</span>
<span class="opt-desc"
- data-i18n="create_agent.pick_or_clone_a_premium_voice_in">Pick or clone a premium voice in the editor after
- creating.</span
+ data-i18n="create_agent.record_thirty_seconds_and_your_agent_speaks">Record 30 seconds (or upload a clip) and your agent
+ speaks in your voice.</span
>
</button>
</div>
- <p class="field-hint" data-i18n="create_agent.starts_on_the_built_in_voice_you">
- Starts on the built-in voice — you can upgrade to a premium or
- cloned voice anytime.
- </p>
+ </div>
+
+ <div class="field" id="voice-clone-field" hidden>
+ <div id="voice-setup-host"></div>
</div>
</section>
- <!-- Step 5 — Review -->
- <section class="panel" data-step="4" aria-label="Review and create">
- <p class="panel-eyebrow" data-i18n="create_agent.step_5_of_5">Step 5 of 5</p>
+ <!-- Step 6 — Review -->
+ <section class="panel" data-step="5" aria-label="Review and create">
+ <p class="panel-eyebrow" data-i18n="create_agent.step_6_of_6">Step 6 of 6</p>
<h2 class="panel-title" data-i18n="create_agent.review_create">Review &amp; create</h2>
<p class="panel-help" data-i18n="create_agent.here_s_the_agent_you_re_about">
Here's the agent you're about to ship. Edit any step, then create
diff --git a/public/settings/index.html b/public/settings/index.html
index 67fe3b471..e27af614a 100644
--- a/public/settings/index.html
+++ b/public/settings/index.html
@@ -299,6 +299,53 @@
margin-top: 16px; padding: 14px 16px;
background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
}
+ .consent-list {
+ margin: 10px 0 0; padding: 0; list-style: none;
+ max-height: 340px; overflow-y: auto;
+ border: 1px solid var(--border); border-radius: 8px;
+ }
+ .consent-item {
+ display: flex; align-items: flex-start; gap: 10px;
+ padding: 10px 12px; border-bottom: 1px solid var(--border);
+ transition: background 0.15s ease;
+ }
+ .consent-item:last-child { border-bottom: none; }
+ .consent-item:hover { background: rgba(255,255,255,0.03); }
+ .consent-item input[type="checkbox"] { margin-top: 3px; width: auto; flex-shrink: 0; accent-color: #ddd; }
+ .consent-item .ci-body { flex: 1 1 auto; min-width: 0; }
+ .consent-item .ci-title {
+ font-size: 13px; color: #ddd; display: flex; align-items: center; gap: 8px;
+ flex-wrap: wrap;
+ }
+ .consent-item .ci-title a { color: inherit; text-decoration: none; border-bottom: 1px solid #333; }
+ .consent-item .ci-title a:hover { border-bottom-color: #888; }
+ .consent-item .ci-meta {
+ font-size: 12px; color: #777; margin-top: 3px;
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+ }
+ .consent-readme {
+ display: inline-flex; align-items: center; gap: 5px;
+ font-size: 11px; color: #888; cursor: pointer; flex-shrink: 0;
+ padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px;
+ transition: border-color 0.15s ease, color 0.15s ease;
+ }
+ .consent-readme:hover { border-color: #555; color: #bbb; }
+ .consent-readme input[disabled] + span { opacity: 0.45; }
+ .consent-readme:has(input[disabled]) { cursor: not-allowed; opacity: 0.55; }
+ .consent-summary {
+ margin-top: 10px; font-size: 12px; color: #888;
+ display: flex; align-items: center; justify-content: space-between; gap: 12px;
+ flex-wrap: wrap;
+ }
+ .consent-skeleton {
+ height: 44px; margin-bottom: 1px; border-radius: 6px;
+ background: linear-gradient(90deg, #161616 25%, #1e1e1e 50%, #161616 75%);
+ background-size: 200% 100%; animation: consent-shimmer 1.3s ease-in-out infinite;
+ }
+ @keyframes consent-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
+ @media (prefers-reduced-motion: reduce) { .consent-skeleton { animation: none; } }
+ .seed-facts { margin: 0; padding-left: 18px; color: #ccc; font-size: 13px; }
+ .seed-facts li { margin-bottom: 5px; }
@media (max-width: 768px) {
.layout { grid-template-columns: 1fr; }
aside {
@@ -528,11 +575,21 @@
<div class="agent-seed-area" id="seed-area" style="display:none">
<h3 style="font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:0.07em;color:#666;margin:0 0 10px" data-i18n="settings_index.seed_agent_memory">Seed Agent Memory</h3>
- <p class="muted" style="font-size:13px;margin:0 0 12px" data-i18n="settings_index.fetch_your_github_activity_and_distill_it">Fetch your GitHub activity and distill it into agent memory facts (once per 24 hours per agent).</p>
- <label for="inp-seed-agent-id" style="display:block;font-size:12px;color:#888;margin-bottom:6px" data-i18n="settings_index.agent_id">Agent ID</label>
- <input id="inp-seed-agent-id" type="text" placeholder="Paste agent UUID…" style="max-width:360px" />
- <div class="row" style="margin-top:8px">
- <button class="btn" id="seed-btn" data-i18n="settings_index.seed_memory">Seed memory</button>
+ <p class="muted" style="font-size:13px;margin:0 0 12px" data-i18n="settings_index.pick_exactly_what_your_agent_reads">Pick exactly what your agent reads. Only the items you tick below are fetched and stored, and you can delete every seeded memory at any time.</p>
+
+ <label for="sel-seed-agent" style="display:block;font-size:12px;color:#888;margin-bottom:6px" data-i18n="settings_index.agent">Agent</label>
+ <select id="sel-seed-agent" style="max-width:360px"></select>
+ <div id="seed-agent-fallback" style="display:none;margin-top:8px">
+ <label for="inp-seed-agent-id" style="display:block;font-size:12px;color:#888;margin-bottom:6px" data-i18n="settings_index.agent_id">Agent ID</label>
+ <input id="inp-seed-agent-id" type="text" placeholder="Paste agent UUID…" style="max-width:360px" />
+ <button class="btn sec" id="seed-load-btn" style="font-size:12px;padding:5px 14px;margin-top:8px" data-i18n="settings_index.load">Load</button>
+ </div>
+
+ <div id="seed-catalog" style="margin-top:14px" aria-live="polite"></div>
+
+ <div class="row" style="margin-top:12px">
+ <button class="btn" id="seed-btn" disabled data-i18n="settings_index.seed_memory">Seed memory</button>
+ <button class="btn sec" id="seed-revoke-btn" style="display:none" data-i18n="settings_index.delete_seeded_memories">Delete seeded memories</button>
<span class="inline-msg" id="seed-msg" style="display:none"></span>
</div>
<div id="seed-results" style="display:none;margin-top:12px"></div>
diff --git a/src/agent-token-plan.js b/src/agent-token-plan.js
index 4299f152b..e83c658db 100644
--- a/src/agent-token-plan.js
+++ b/src/agent-token-plan.js
@@ -1,5 +1,5 @@
/**
- * Agent token plan panel — the agent's coin before the coin exists.
+ * Agent token plan panel: the agent's coin before the coin exists.
*
* An agent token is the economic object an agent becomes. Until it mints, that
* object had nowhere to live: the launch form collected a name and a ticker,
diff --git a/tests/fixtures/mcp-golden-tools.json b/tests/fixtures/mcp-golden-tools.json
index c91adab50..04e67836b 100644
--- a/tests/fixtures/mcp-golden-tools.json
+++ b/tests/fixtures/mcp-golden-tools.json
@@ -762,7 +762,7 @@
"name": "pose_model",
"title": "Resolve a text prompt to a pose-studio seed + joint rotations",
"descHead": "Map a natural-language pose description to a deterministic pose-studio s",
- "descHash": "f90f437e72b1",
+ "descHash": "c6138b729e0e",
"annotations": {
"readOnlyHint": true,
"destructiveHint": false,