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(pump): v2 USDC quote support + update-fee-shares; relocate HTML pages
nirholasebbd69f82963
diff --git a/api/_lib/pumpfun-ws-feed.js b/api/_lib/pumpfun-ws-feed.jsindex 993deffff..0f90ea5f6 100644--- a/api/_lib/pumpfun-ws-feed.js+++ b/api/_lib/pumpfun-ws-feed.js@@ -177,8 +177,30 @@ async function enrichMint(d) {return base;}+// USDC mint on Solana mainnet — used to flag USDC-paired pump.fun v2 coins+// when the upstream feed reports a non-WSOL quote_mint. We don't bother with a+// devnet branch here: PumpPortal only streams mainnet events.+const WSOL_MINT_STR = 'So11111111111111111111111111111111111111112';+const USDC_MINT_STR = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';++// Classify the quote mint reported by PumpPortal. PumpPortal exposes the+// quote_mint field on v2 coins (post-May-21-2026 USDC launch); for legacy+// SOL-paired coins the field is absent or echoes WSOL. Returning a stable+// symbol lets the UI label trades/cards without each consumer reimplementing+// the same comparison.+function classifyQuote(quoteMintStr) {+ if (!quoteMintStr || quoteMintStr === WSOL_MINT_STR) {+ return { quote_mint: WSOL_MINT_STR, quote_symbol: 'SOL', is_usdc_pair: false };+ }+ if (quoteMintStr === USDC_MINT_STR) {+ return { quote_mint: USDC_MINT_STR, quote_symbol: 'USDC', is_usdc_pair: true };+ }+ return { quote_mint: quoteMintStr, quote_symbol: 'OTHER', is_usdc_pair: false };+}+function normalizeMint(d, meta, solPrice) {const mcSol = d.marketCapSol ?? 0;+ const quote = classifyQuote(d.quoteMint || d.quote_mint);return {mint: d.mint,name: d.name,@@ -189,6 +211,14 @@ function normalizeMint(d, meta, solPrice) {market_cap_usd: solPrice > 0 ? mcSol * solPrice : null,initial_buy_sol: d.solAmount ?? null,initial_buy_usd: solPrice > 0 && d.solAmount ? d.solAmount * solPrice : null,+ // USDC-paired v2 coins report initial_buy in USDC base units (6-dec) on+ // the upstream `quoteAmount` / `usdcAmount` field. We surface both raw+ // quote in/out and a USD figure so downstream renderers can show "Y+ // USDC initial buy" without re-parsing the event.+ initial_buy_quote: d.quoteAmount ?? d.usdcAmount ?? null,+ initial_buy_usd_quote: quote.is_usdc_pair && (d.quoteAmount || d.usdcAmount)+ ? Number(d.quoteAmount ?? d.usdcAmount)+ : null,sol_price: solPrice,bonding_curve: d.bondingCurveKey,image_uri: d.uri,@@ -197,10 +227,12 @@ function normalizeMint(d, meta, solPrice) {telegram: meta?.telegram || null,website: meta?.website || null,created_at: Math.floor(Date.now() / 1000),+ ...quote,};}function normalizeGrad(d) {+ const quote = classifyQuote(d.quoteMint || d.quote_mint);return {tx_signature: d.signature,signature: d.signature,@@ -209,6 +241,7 @@ function normalizeGrad(d) {symbol: d.symbol,pool: d.pool,timestamp: Math.floor(Date.now() / 1000),+ ...quote,};}@@ -344,8 +377,16 @@ async function enrichGrad(d) {const raydiumPool = coin.raydium_pool || null;const pumpSwapPool = coin.pump_swap_pool || null;+ // Pump.fun's v3 frontend API surfaces `quote_mint` on coins launched after+ // the v2 / USDC rollout. When present it's the authoritative on-chain+ // quote — override what we guessed from the WS event so AMM-paired+ // USDC coins render correctly even if PumpPortal omits the field on the+ // migrate event.+ const coinQuote = classifyQuote(coin.quote_mint || coin.quoteMint || base.quote_mint);+return {...base,+ ...coinQuote,name: coin.name || base.name,symbol: coin.symbol || base.symbol,description: coin.description || null,diff --git a/api/pump/[action].js b/api/pump/[action].jsindex 424d28bea..a01c80b11 100644--- a/api/pump/[action].js+++ b/api/pump/[action].js@@ -28,9 +28,13 @@// strategy-run -> handleStrategyRun (SSE; bypasses wrap())// strategy-validate -> handleStrategyValidate// live-stream -> handleLiveStream (SSE; bypasses wrap())-// collect-creator-fee-prep -> handleCollectCreatorFeePrep-// distribute-creator-fees-prep -> handleDistributeCreatorFeesPrep-// create-fee-sharing-prep -> handleCreateFeeSharingPrep+// collect-creator-fee-prep -> handleCollectCreatorFeePrep+// distribute-creator-fees-prep -> handleDistributeCreatorFeesPrep+// (auto-prepends transfer_creator_fees_to_pump_v2+// for graduated coins; ATA-init for non-native+// quotes is handled internally by the SDK)+// create-fee-sharing-prep -> handleCreateFeeSharingPrep (step 1)+// update-fee-shares-prep -> handleUpdateFeeSharesPrep (step 2)import { z } from 'zod';import { Keypair, PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';@@ -116,6 +120,7 @@ const wrapped = wrap(async (req, res) => {case 'collect-creator-fee-prep': return handleCollectCreatorFeePrep(req, res);case 'distribute-creator-fees-prep': return handleDistributeCreatorFeesPrep(req, res);case 'create-fee-sharing-prep': return handleCreateFeeSharingPrep(req, res);+ case 'update-fee-shares-prep': return handleUpdateFeeSharesPrep(req, res);default:return error(res, 404, 'not_found', 'unknown pump action');}@@ -2699,13 +2704,23 @@ async function handleCollectCreatorFeePrep(req, res) {}// ── distribute-creator-fees-prep ──────────────────────────────────────────-// Builds the tx that distributes accumulated AMM creator fees to shareholders-// defined in the coin's fee-sharing config.+// Builds the tx that distributes accumulated creator fees to shareholders+// defined in the coin's fee-sharing config. For graduated coins the SDK+// automatically prepends a `transfer_creator_fees_to_pump_v2` instruction so+// AMM-side fees are consolidated into the bonding-curve vault first — no+// separate transfer call is needed at this layer.+//+// ATA initialization for non-native quotes (e.g. USDC) is handled internally+// by `buildDistributeCreatorFeesInstructions`: the SDK reads the coin's+// quote_mint and emits `initialize_ata: true` for the underlying+// `distribute_creator_fees_v2` instruction so each shareholder's USDC ATA is+// idempotently created before the program transfers their share.+//// Docs: https://github.com/pump-fun/pump-public-docs/blob/main/docs/instructions/CREATOR_FEE_SHARING.mdconst distributeCreatorFeesPrepSchema = z.object({mint: z.string().min(32).max(44),- wallet_address: z.string().min(32).max(44), // fee payer / signer+ wallet_address: z.string().min(32).max(44), // fee payer / signer (permissionless)network: z.enum(['mainnet', 'devnet']).default('mainnet'),});@@ -2728,15 +2743,16 @@ async function handleDistributeCreatorFeesPrep(req, res) {const { connection } = await getPumpSdk({ network: body.network });const { OnlinePumpSdk } = await import('@pump-fun/pump-sdk');const onlineSdk = new OnlinePumpSdk(connection);- const ixs = await onlineSdk.buildDistributeCreatorFeesInstructions(mintPk);+ const { instructions, isGraduated } = await onlineSdk.buildDistributeCreatorFeesInstructions(mintPk);const tx_base64 = await buildUnsignedTxBase64({network: body.network,payer: payerPk,- instructions: Array.isArray(ixs) ? ixs : [ixs],+ instructions,});return json(res, 201, {mint: body.mint,network: body.network,+ is_graduated: !!isGraduated,tx_base64,});} catch (e) {@@ -2744,6 +2760,93 @@ async function handleDistributeCreatorFeesPrep(req, res) {}}+// ── update-fee-shares-prep ────────────────────────────────────────────────+// Step 2 of the fee-sharing lifecycle. The current sharing_config admin+// finalises the shareholder list (1–10 entries, share_bps must sum to 10_000).+// This sweeps any pending AMM + bonding-curve fees, applies the new+// distribution, and (in version-1 configs) permanently revokes further+// updates — so for v1 callers should call it exactly once after+// create-fee-sharing-prep.+// Docs: https://github.com/pump-fun/pump-public-docs/blob/main/docs/instructions/CREATOR_FEE_SHARING.md++const updateFeeSharesSchema = z.object({+ mint: z.string().min(32).max(44),+ wallet_address: z.string().min(32).max(44), // sharing_config admin (signer + fee payer)+ network: z.enum(['mainnet', 'devnet']).default('mainnet'),+ // The set of shareholder addresses currently encoded in the on-chain+ // sharing_config. Right after create-fee-sharing-prep this is `[creator]`+ // at 10_000 bps; after a prior update it's whatever was last set. The SDK+ // uses these to derive the existing PDA accounts that must be passed in.+ current_shareholders: z.array(z.string().min(32).max(44)).min(1).max(10),+ new_shareholders: z+ .array(+ z.object({+ address: z.string().min(32).max(44),+ share_bps: z.number().int().min(1).max(10_000),+ }),+ )+ .min(1)+ .max(10)+ .refine(+ (arr) => arr.reduce((s, x) => s + x.share_bps, 0) === 10_000,+ { message: 'share_bps must sum to 10000' },+ )+ .refine(+ (arr) => new Set(arr.map((x) => x.address)).size === arr.length,+ { message: 'duplicate shareholder addresses' },+ ),+});++async function handleUpdateFeeSharesPrep(req, res) {+ if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;+ if (!method(req, res, ['POST'])) return;++ const user = await getSessionUser(req);+ if (!user) return error(res, 401, 'unauthorized', 'sign in required');++ const rl = await limits.authIp(clientIp(req));+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');++ const body = parse(updateFeeSharesSchema, await readJson(req));+ const mintPk = solanaPubkey(body.mint);+ const payerPk = solanaPubkey(body.wallet_address);+ if (!mintPk || !payerPk) return error(res, 400, 'validation_error', 'invalid pubkeys');++ const currentShareholders = body.current_shareholders.map((s) => {+ const pk = solanaPubkey(s);+ if (!pk) throw Object.assign(new Error(`invalid current shareholder ${s}`), { status: 400, code: 'validation_error' });+ return pk;+ });+ const newShareholders = body.new_shareholders.map((s) => {+ const addr = solanaPubkey(s.address);+ if (!addr) throw Object.assign(new Error(`invalid shareholder ${s.address}`), { status: 400, code: 'validation_error' });+ return { address: addr, shareBps: s.share_bps };+ });++ try {+ const { sdk } = await getPumpSdk({ network: body.network });+ const ix = await sdk.updateFeeShares({+ authority: payerPk,+ mint: mintPk,+ currentShareholders,+ newShareholders,+ });+ const tx_base64 = await buildUnsignedTxBase64({+ network: body.network,+ payer: payerPk,+ instructions: [ix],+ });+ return json(res, 201, {+ mint: body.mint,+ network: body.network,+ shareholder_count: newShareholders.length,+ tx_base64,+ });+ } catch (e) {+ return error(res, e.status || 502, e.code || 'pump_sdk_error', e.message || 'failed to build update-fee-shares tx');+ }+}+// ── create-fee-sharing-prep ────────────────────────────────────────────────// Builds the tx to create a fee-sharing config for a graduated coin, enabling// the coin creator to split AMM creator fees among multiple shareholders.diff --git a/package.json b/package.jsonindex d5885f59f..5b7b1abf5 100644--- a/package.json+++ b/package.json@@ -116,8 +116,8 @@"@pixiv/three-vrm": "^3.5.2","@pixiv/three-vrm-animation": "^3.5.2","@pump-fun/agent-payments-sdk": "^3.1.0",- "@pump-fun/pump-sdk": "^1.35.0",- "@pump-fun/pump-swap-sdk": "^1.15.0",+ "@pump-fun/pump-sdk": "^1.36.0",+ "@pump-fun/pump-swap-sdk": "^1.16.0","@pythnetwork/hermes-client": "^3.1.0","@recast-navigation/core": "^0.43.1","@recast-navigation/three": "^0.43.1",diff --git a/a-edit.html b/pages/a-edit.htmlsimilarity index 99%rename from a-edit.htmlrename to pages/a-edit.htmlindex 530c81ec6..c490d28d4 100644--- a/a-edit.html+++ b/pages/a-edit.html@@ -261,7 +261,7 @@</main><script type="module">- import { mountChainEdit } from './src/erc8004/chain-edit.js';+ import { mountChainEdit } from '/src/erc8004/chain-edit.js';// URL: /a/:chainId/:agentId/editconst parts = location.pathname.split('/').filter(Boolean);diff --git a/a-embed.html b/pages/a-embed.htmlsimilarity index 99%rename from a-embed.htmlrename to pages/a-embed.htmlindex b81723388..cc0c87554 100644--- a/a-embed.html+++ b/pages/a-embed.html@@ -147,7 +147,7 @@<div id="blocked"></div><script type="module">- import { Viewer } from './src/viewer.js';+ import { Viewer } from '/src/viewer.js';import {parseAgentRef,resolveOnchainAgent,@@ -155,7 +155,7 @@resolveUrlCandidates,isEmbedAllowed,toPublicUrl,- } from './src/erc8004/resolver.js';+ } from '/src/erc8004/resolver.js';const params = new URL(location.href).searchParams;const bg = params.get('bg') || 'transparent';diff --git a/agent-chat-widget.html b/pages/agent-chat-widget.htmlsimilarity index 98%rename from agent-chat-widget.htmlrename to pages/agent-chat-widget.htmlindex 7e9332613..4d8a13468 100644--- a/agent-chat-widget.html+++ b/pages/agent-chat-widget.html@@ -83,7 +83,7 @@</div><script type="module">- import { Viewer } from './src/viewer.js';+ import { Viewer } from '/src/viewer.js';const params = new URL(location.href).searchParams;const agentId = params.get('agentId') || 'default';diff --git a/agent-detail.html b/pages/agent-detail.htmlsimilarity index 100%rename from agent-detail.htmlrename to pages/agent-detail.htmldiff --git a/agent-edit.html b/pages/agent-edit.htmlsimilarity index 100%rename from agent-edit.htmlrename to pages/agent-edit.htmldiff --git a/agent-embed.html b/pages/agent-embed.htmlsimilarity index 99%rename from agent-embed.htmlrename to pages/agent-embed.htmlindex 5dd32abd2..d2171bd13 100644--- a/agent-embed.html+++ b/pages/agent-embed.html@@ -367,7 +367,7 @@if (bg === 'dark') {// Midnight-blue atmosphere with volumetric clouds.- const { Clouds, Cloud } = await import('./src/cloud.js');+ const { Clouds, Cloud } = await import('/src/cloud.js');if (viewer.scene.background?.set) viewer.scene.background.set('#070b18');const clouds = new Clouds({ limit: 350 });diff --git a/agent-home.html b/pages/agent-home.htmlsimilarity index 100%rename from agent-home.htmlrename to pages/agent-home.htmldiff --git a/app-demo.html b/pages/app-demo.htmlsimilarity index 99%rename from app-demo.htmlrename to pages/app-demo.htmlindex c340bbad4..85d9c04e3 100644--- a/app-demo.html+++ b/pages/app-demo.html@@ -46,7 +46,7 @@<meta name="robots" content="noindex" /><link rel="shortcut icon" href="/favicon.ico" /><link rel="apple-touch-icon" href="/pwa-192x192.png" />- <link rel="stylesheet" href="style.css" />+ <link rel="stylesheet" href="/style.css" /><link rel="stylesheet" href="/app-demo.css" /><link rel="stylesheet" href="/fonts/fonts.css" /><script defer type="module" src="/src/app.js"></script>diff --git a/app.html b/pages/app.htmlsimilarity index 99%rename from app.htmlrename to pages/app.htmlindex 276343c77..5834100fd 100644--- a/app.html+++ b/pages/app.html@@ -45,7 +45,7 @@<link rel="canonical" href="https://three.ws/app" /><link rel="shortcut icon" href="/favicon.ico" /><link rel="apple-touch-icon" href="/pwa-192x192.png" />- <link rel="stylesheet" href="style.css" />+ <link rel="stylesheet" href="/style.css" /><link rel="stylesheet" href="/fonts/fonts.css" /><link rel="stylesheet" href="/footer.css" /><script defer type="module" src="/src/app.js"></script>diff --git a/avatar-artifact.html b/pages/avatar-artifact.htmlsimilarity index 100%rename from avatar-artifact.htmlrename to pages/avatar-artifact.htmldiff --git a/avatar-edit.html b/pages/avatar-edit.htmlsimilarity index 100%rename from avatar-edit.htmlrename to pages/avatar-edit.htmldiff --git a/avatar-page.html b/pages/avatar-page.htmlsimilarity index 100%rename from avatar-page.htmlrename to pages/avatar-page.htmldiff --git a/community.html b/pages/community.htmlsimilarity index 100%rename from community.htmlrename to pages/community.htmldiff --git a/create-selfie.html b/pages/create-selfie.htmlsimilarity index 100%rename from create-selfie.htmlrename to pages/create-selfie.htmldiff --git a/create.html b/pages/create.htmlsimilarity index 100%rename from create.htmlrename to pages/create.htmldiff --git a/creating.html b/pages/creating.htmlsimilarity index 100%rename from creating.htmlrename to pages/creating.htmldiff --git a/embed-test.html b/pages/embed-test.htmlsimilarity index 100%rename from embed-test.htmlrename to pages/embed-test.htmldiff --git a/embed.html b/pages/embed.htmlsimilarity index 93%rename from embed.htmlrename to pages/embed.htmlindex 647e3a742..556e7ba7b 100644--- a/embed.html+++ b/pages/embed.html@@ -22,7 +22,7 @@<body><div id="root"></div><script type="module">- import { mountEmbedEditor } from './src/editor/embed-editor.js';+ import { mountEmbedEditor } from '/src/editor/embed-editor.js';const url = new URL(location.href);mountEmbedEditor(document.getElementById('root'), {widgetId: url.searchParams.get('id') || '',diff --git a/features.html b/pages/features.htmlsimilarity index 100%rename from features.htmlrename to pages/features.htmldiff --git a/home.html b/pages/home.htmlsimilarity index 100%rename from home.htmlrename to pages/home.htmldiff --git a/launchpad.html b/pages/launchpad.htmlsimilarity index 93%rename from launchpad.htmlrename to pages/launchpad.htmlindex 5a7aadc2a..d4a3a612a 100644--- a/launchpad.html+++ b/pages/launchpad.html@@ -26,7 +26,7 @@<body><div id="root"></div><script type="module">- import { mountLaunchpadStudio } from './src/editor/launchpad-studio.js';+ import { mountLaunchpadStudio } from '/src/editor/launchpad-studio.js';const url = new URL(location.href);mountLaunchpadStudio(document.getElementById('root'), {template: url.searchParams.get('template') || 'token-launchpad',diff --git a/marketplace.html b/pages/marketplace.htmlsimilarity index 99%rename from marketplace.htmlrename to pages/marketplace.htmlindex df8b2bac9..41d2287c6 100644--- a/marketplace.html+++ b/pages/marketplace.html@@ -11,11 +11,11 @@<meta name="theme-color" content="#000000" /><link rel="canonical" href="https://three.ws/marketplace" /><link rel="shortcut icon" href="/favicon.ico" />-<link rel="stylesheet" href="style.css" />- <link rel="stylesheet" href="footer.css" />- <link rel="stylesheet" href="marketplace.css" />- <link rel="stylesheet" href="marketplace-skills.css" />- <link rel="stylesheet" href="marketplace-v2.css" />+<link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/footer.css" />+ <link rel="stylesheet" href="/marketplace.css" />+ <link rel="stylesheet" href="/marketplace-skills.css" />+ <link rel="stylesheet" href="/marketplace-v2.css" /><link rel="stylesheet" href="/fonts/fonts.css" /><style>/* Author display rules on modal overlays override the UA stylesheet'sdiff --git a/playground.html b/pages/playground.htmlsimilarity index 100%rename from playground.htmlrename to pages/playground.htmldiff --git a/pricing.html b/pages/pricing.htmlsimilarity index 100%rename from pricing.htmlrename to pages/pricing.htmldiff --git a/profile.html b/pages/profile.htmlsimilarity index 99%rename from profile.htmlrename to pages/profile.htmlindex 9295a2842..2c6f48608 100644--- a/profile.html+++ b/pages/profile.html@@ -787,7 +787,7 @@</footer><script type="module">- import { mountUserProfile } from './src/erc8004/user-profile.js';+ import { mountUserProfile } from '/src/erc8004/user-profile.js';const esc = (s) =>String(s ?? '').replace(diff --git a/pump-3d-agent.html b/pages/pump-3d-agent.htmlsimilarity index 100%rename from pump-3d-agent.htmlrename to pages/pump-3d-agent.htmldiff --git a/pump-coin-page.html b/pages/pump-coin-page.htmlsimilarity index 100%rename from pump-coin-page.htmlrename to pages/pump-coin-page.htmldiff --git a/pump-dashboard.html b/pages/pump-dashboard.htmlsimilarity index 100%rename from pump-dashboard.htmlrename to pages/pump-dashboard.htmldiff --git a/pump-live.html b/pages/pump-live.htmlsimilarity index 100%rename from pump-live.htmlrename to pages/pump-live.htmldiff --git a/pump-visualizer.html b/pages/pump-visualizer.htmlsimilarity index 100%rename from pump-visualizer.htmlrename to pages/pump-visualizer.htmldiff --git a/pumpfun-buy.html b/pages/pumpfun-buy.htmlsimilarity index 100%rename from pumpfun-buy.htmlrename to pages/pumpfun-buy.htmldiff --git a/pumpfun-counter.html b/pages/pumpfun-counter.htmlsimilarity index 94%rename from pumpfun-counter.htmlrename to pages/pumpfun-counter.htmlindex 4f828ae68..d3e724c40 100644--- a/pumpfun-counter.html+++ b/pages/pumpfun-counter.html@@ -26,7 +26,7 @@<body><div id="counter">0</div><script type="module">- import pumpFunClient from './src/pumpfun-client.js';+ import pumpFunClient from '/src/pumpfun-client.js';let count = 0;const counterElement = document.getElementById('counter');diff --git a/pumpfun-search.html b/pages/pumpfun-search.htmlsimilarity index 100%rename from pumpfun-search.htmlrename to pages/pumpfun-search.htmldiff --git a/pumpfun-trending.html b/pages/pumpfun-trending.htmlsimilarity index 100%rename from pumpfun-trending.htmlrename to pages/pumpfun-trending.htmldiff --git a/pumpfun-widget.html b/pages/pumpfun-widget.htmlsimilarity index 100%rename from pumpfun-widget.htmlrename to pages/pumpfun-widget.htmldiff --git a/three-ws-launch-week.html b/pages/three-ws-launch-week.htmlsimilarity index 100%rename from three-ws-launch-week.htmlrename to pages/three-ws-launch-week.htmldiff --git a/tutorial.html b/pages/tutorial.htmlsimilarity index 100%rename from tutorial.htmlrename to pages/tutorial.htmldiff --git a/tutorials.html b/pages/tutorials.htmlsimilarity index 100%rename from tutorials.htmlrename to pages/tutorials.htmldiff --git a/walk.html b/pages/walk.htmlsimilarity index 100%rename from walk.htmlrename to pages/walk.htmldiff --git a/widget-studio.html b/pages/widget-studio.htmlsimilarity index 100%rename from widget-studio.htmlrename to pages/widget-studio.htmldiff --git a/widgets.html b/pages/widgets.htmlsimilarity index 100%rename from widgets.htmlrename to pages/widgets.htmldiff --git a/public/sitemap.xml b/public/sitemap.xmlindex 0762f28f4..4efcadc6b 100644--- a/public/sitemap.xml+++ b/public/sitemap.xml@@ -84,6 +84,48 @@<changefreq>weekly</changefreq><priority>0.7</priority></url>+ <url>+ <loc>https://three.ws/features</loc>+ <lastmod>2026-05-19</lastmod>+ <changefreq>weekly</changefreq>+ <priority>0.8</priority>+ </url>+ <url>+ <loc>https://three.ws/launchpad</loc>+ <lastmod>2026-05-19</lastmod>+ <changefreq>weekly</changefreq>+ <priority>0.7</priority>+ </url>+ <url>+ <loc>https://three.ws/walkaround</loc>+ <lastmod>2026-05-19</lastmod>+ <changefreq>weekly</changefreq>+ <priority>0.7</priority>+ </url>+ <url>+ <loc>https://three.ws/brain</loc>+ <lastmod>2026-05-19</lastmod>+ <changefreq>weekly</changefreq>+ <priority>0.7</priority>+ </url>+ <url>+ <loc>https://three.ws/lipsync</loc>+ <lastmod>2026-05-19</lastmod>+ <changefreq>weekly</changefreq>+ <priority>0.6</priority>+ </url>+ <url>+ <loc>https://three.ws/lipsync/mic</loc>+ <lastmod>2026-05-19</lastmod>+ <changefreq>weekly</changefreq>+ <priority>0.6</priority>+ </url>+ <url>+ <loc>https://three.ws/avatar-artifact</loc>+ <lastmod>2026-05-19</lastmod>+ <changefreq>monthly</changefreq>+ <priority>0.5</priority>+ </url><url><loc>https://three.ws/pay</loc><lastmod>2026-05-19</lastmod>@@ -126,6 +168,12 @@<changefreq>monthly</changefreq><priority>0.6</priority></url>+ <url>+ <loc>https://three.ws/pump-visualizer</loc>+ <lastmod>2026-05-19</lastmod>+ <changefreq>weekly</changefreq>+ <priority>0.7</priority>+ </url><url><loc>https://three.ws/chat</loc><lastmod>2026-05-19</lastmod>@@ -496,52 +544,4 @@<changefreq>yearly</changefreq><priority>0.6</priority></url>- <url>- <loc>https://three.ws/features</loc>- <lastmod>2026-05-19</lastmod>- <changefreq>monthly</changefreq>- <priority>0.8</priority>- </url>- <url>- <loc>https://three.ws/launchpad</loc>- <lastmod>2026-05-19</lastmod>- <changefreq>weekly</changefreq>- <priority>0.7</priority>- </url>- <url>- <loc>https://three.ws/walkaround</loc>- <lastmod>2026-05-19</lastmod>- <changefreq>weekly</changefreq>- <priority>0.7</priority>- </url>- <url>- <loc>https://three.ws/brain</loc>- <lastmod>2026-05-19</lastmod>- <changefreq>weekly</changefreq>- <priority>0.7</priority>- </url>- <url>- <loc>https://three.ws/lipsync</loc>- <lastmod>2026-05-19</lastmod>- <changefreq>weekly</changefreq>- <priority>0.6</priority>- </url>- <url>- <loc>https://three.ws/lipsync/mic</loc>- <lastmod>2026-05-19</lastmod>- <changefreq>weekly</changefreq>- <priority>0.6</priority>- </url>- <url>- <loc>https://three.ws/avatar-artifact</loc>- <lastmod>2026-05-19</lastmod>- <changefreq>monthly</changefreq>- <priority>0.5</priority>- </url>- <url>- <loc>https://three.ws/pump-visualizer</loc>- <lastmod>2026-05-19</lastmod>- <changefreq>daily</changefreq>- <priority>0.7</priority>- </url></urlset>diff --git a/public/studio/launch-panel.js b/public/studio/launch-panel.jsindex 54852a8a6..766a6769d 100644--- a/public/studio/launch-panel.js+++ b/public/studio/launch-panel.js@@ -71,6 +71,9 @@ function friendlyError(msg) {}const PUMP_BASE_COST = 0.022; // pump.fun fee + mint rent (estimate)+// USDC mainnet mint — pump.fun v2 quote when the user picks the USDC coin type.+// Pump.fun v2 launched USDC as a quote mint on 2026-05-21.+const USDC_MAINNET_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';// Absolute URL — @solana/web3.js's Connection constructor calls// `new URL(endpoint)` to derive a WebSocket URL, which throws on a// relative path. We don't use subscriptions, but constructor must not throw.@@ -926,7 +929,6 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewasync function launch() {if (!formValid() || s.phase !== 'idle') return;if (!av || av.id === DEMO_ID) return;- if (s.coinType === 'usdc') return; // gated — USDC denomination not yet liveif (s.walletSource === 'connected' && !s.walletAddr) return;if (s.walletSource === 'agent' && !s.agentWallet?.address) return;s.errorMsg = '';@@ -1021,6 +1023,12 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewconst payer = w.publicKey?.toBase58?.() || w.publicKey?.toString?.();if (!payer) throw new Error('Could not read wallet public key.');+ const isUsdc = s.coinType === 'usdc';+ const buyIn = Math.max(0, parseFloat(s.initialBuy) || 0);+ // Server schema treats 'usdc' as an unknown coin_type. Map it to 'agent'+ // (the buyback-bound variant) so the launch wires up an agent identity,+ // but flip the quote mint to USDC and route the initial buy through+ // usdc_buy_in so the backend builds createV2AndBuyV2Instructions.const pr = await fetch('/api/pump/launch-prep', {method: 'POST', credentials: 'include',headers: { 'content-type': 'application/json' },@@ -1028,9 +1036,11 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView...(av.agent_id ? { agent_id: av.agent_id } : { avatar_id: av.id }),wallet_address: payer,name: nameTrim, symbol: symTrim, uri: s._metaUrl,- coin_type: s.coinType,- buyback_bps: s.coinType === 'agent' ? s.buybackBps : 0,- sol_buy_in: Math.max(0, parseFloat(s.initialBuy) || 0),+ coin_type: isUsdc ? 'agent' : s.coinType,+ buyback_bps: (isUsdc || s.coinType === 'agent') ? s.buybackBps : 0,+ ...(isUsdc+ ? { usdc_buy_in: buyIn, quote_mint: USDC_MAINNET_MINT }+ : { sol_buy_in: buyIn }),network: 'mainnet',}),});@@ -1073,12 +1083,16 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewasync function launchViaAgentWallet(nameTrim, symTrim) {s.phase = 'signing'; s.phaseLabel = 'Agent wallet signing…'; render();+ const isUsdc = s.coinType === 'usdc';+ const buyIn = Math.max(0, parseFloat(s.initialBuy) || 0);const body = {...(av.agent_id ? { agent_id: av.agent_id } : { avatar_id: av.id }),name: nameTrim, symbol: symTrim, uri: s._metaUrl,- coin_type: s.coinType,- buyback_bps: s.coinType === 'agent' ? s.buybackBps : 0,- sol_buy_in: Math.max(0, parseFloat(s.initialBuy) || 0),+ coin_type: isUsdc ? 'agent' : s.coinType,+ buyback_bps: (isUsdc || s.coinType === 'agent') ? s.buybackBps : 0,+ ...(isUsdc+ ? { usdc_buy_in: buyIn, quote_mint: USDC_MAINNET_MINT }+ : { sol_buy_in: buyIn }),network: 'mainnet',};s.phase = 'confirming'; s.phaseLabel = 'Launching on-chain (may take ~10s)…'; render();@@ -1121,7 +1135,13 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView// ── Helpers ────────────────────────────────────────────────────────────- const estimatedCost = () => PUMP_BASE_COST + Math.max(0, parseFloat(s.initialBuy) || 0);+ // SOL out-of-pocket for the launch tx. For SOL-paired coins this is the+ // fixed mint/rent + the initial buy. For USDC-paired coins only the SOL+ // rent/fee applies — the buy itself is debited from the wallet's USDC ATA.+ const estimatedCost = () => {+ const buy = Math.max(0, parseFloat(s.initialBuy) || 0);+ return PUMP_BASE_COST + (s.coinType === 'usdc' ? 0 : buy);+ };const formValid = () => s.name.trim() && s.symbol.trim() && s.description.trim();// ── Render ─────────────────────────────────────────────────────────────@@ -1431,20 +1451,22 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView<button type="button" role="tab" data-coin="agent" class="agent ${ct === 'agent' ? 'on' : ''}" ${busy ? 'disabled' : ''}><span class="lp-coin-emoji">🤖</span>Agent<span class="lp-coin-sub">SOL buyback</span></button>- <button type="button" role="tab" data-coin="usdc" class="usdc ${ct === 'usdc' ? 'on' : ''}" ${busy ? 'disabled' : ''} title="USDC-denominated agent payments — coming soon">- <span class="lp-coin-emoji">💵</span>USDC<span class="lp-coin-sub">Soon</span>+ <button type="button" role="tab" data-coin="usdc" class="usdc ${ct === 'usdc' ? 'on' : ''}" ${busy ? 'disabled' : ''} title="USDC-paired agent coin — trades and pays out in USDC instead of SOL.">+ <span class="lp-coin-emoji">💵</span>USDC<span class="lp-coin-sub">Stablecoin pair</span></button></div>`;const coinNoteHtml = ct === 'mayhem'? `<div class="lp-coin-note mayhem">Mayhem coins launch on pump.fun's high-volatility mode. No agent buyback or payments — pure speculation.</div>`: ct === 'usdc'- ? `<div class="lp-coin-note usdc">USDC-denominated agent coins are coming soon. Powered by <a href="https://github.com/nirholas/agent-payments-sdk" target="_blank" rel="noopener" style="color:inherit;text-decoration:underline">agent-payments-sdk</a> — accept USDC payments, auto-buyback, x402 pay-gating.</div>`+ ? `<div class="lp-coin-note usdc">USDC-paired agent coin. Bonding curve quotes in USDC instead of SOL — your initial buy and all subsequent trades settle through the wallet's USDC ATA. Buyback share still applies, denominated in USDC.</div>`: ct === 'regular'? `<div class="lp-coin-note">Standard pump.fun launch — no on-chain buyback. Initial buy still funds bonding curve.</div>`: '';- const showBuyback = ct === 'agent';+ // USDC coins are agent-buyback-bound (same on-chain agent identity flow+ // as 'agent'), so surface the buyback slider for both variants.+ const showBuyback = ct === 'agent' || ct === 'usdc';let walletHtml;if (s.walletSource === 'agent') {@@ -1458,9 +1480,6 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewlet btnText, btnDis, btnAction = 'launch', btnTitle = '';if (busy) {btnText = s.phaseLabel || 'Working…'; btnDis = true;- } else if (ct === 'usdc') {- btnText = 'USDC coin — coming soon'; btnDis = true;- btnTitle = 'USDC-denominated agent coins are launching soon. Pick Regular, Mayhem, or Agent for now.';} else if (!signedIn) {btnText = 'Sign in to launch'; btnDis = false; btnAction = 'sign-in';btnTitle = 'You need an account to launch — click to sign in, then come right back.';@@ -1514,29 +1533,38 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView</div>${coinTypeHtml}${coinNoteHtml}- ${showBuyback ? `<div class="lp-2col">- <div>- <label for="lp-buy" title="Optional SOL spent on the bonding curve at launch. You receive the resulting coins. Leave at 0 for a launch-only mint.">Initial buy (SOL)</label>- <input class="lp-number" id="lp-buy" type="number" min="0" max="50" step="0.001"+ ${(() => {+ const isUsdcCoin = ct === 'usdc';+ const unit = isUsdcCoin ? 'USDC' : 'SOL';+ // pump.fun launch caps: 50 SOL or 1,000,000 USDC (matches server schema).+ const maxBuy = isUsdcCoin ? 1_000_000 : 50;+ const stepBuy = isUsdcCoin ? 1 : 0.001;+ const buyTitle = isUsdcCoin+ ? 'Optional USDC spent on the bonding curve at launch. Requires a USDC ATA on the signing wallet.'+ : 'Optional SOL spent on the bonding curve at launch. You receive the resulting coins. Leave at 0 for a launch-only mint.';+ const buybackUnit = isUsdcCoin ? 'USDC' : 'SOL';+ const buyField = `+ <label for="lp-buy" title="${esc(buyTitle)}">Initial buy (${unit})</label>+ <input class="lp-number" id="lp-buy" type="number" min="0" max="${maxBuy}" step="${stepBuy}"value="${esc(s.initialBuy)}" ${dis}- title="Optional SOL spent on the bonding curve at launch. You receive the resulting coins. Leave at 0 for a launch-only mint." />- </div>- <div>- <div class="lp-slider-head">- <label title="Share of your agent's paid-endpoint revenue (in SOL) that automatically buys back and burns this token on-chain.">Buyback share</label>- <span class="lp-bps-val" id="lp-bps-val">${(s.buybackBps / 100).toFixed(1)}%</span>- </div>- <input type="range" class="lp-slider" id="lp-bps"- min="0" max="5000" step="50" value="${s.buybackBps}" ${dis}- title="Share of agent revenue (in SOL) that buys back and burns this token on-chain. 0% means no buyback, 50% is the max." />- <div class="lp-slider-hint">Of agent revenue burned back</div>- </div>- </div>` : `<div>- <label for="lp-buy" title="Optional SOL spent on the bonding curve at launch. You receive the resulting coins. Leave at 0 for a launch-only mint.">Initial buy (SOL)</label>- <input class="lp-number" id="lp-buy" type="number" min="0" max="50" step="0.001"- value="${esc(s.initialBuy)}" ${dis}- title="Optional SOL spent on the bonding curve at launch. You receive the resulting coins. Leave at 0 for a launch-only mint." />- </div>`}+ title="${esc(buyTitle)}" />`;+ if (showBuyback) {+ return `<div class="lp-2col">+ <div>${buyField}</div>+ <div>+ <div class="lp-slider-head">+ <label title="Share of your agent's paid-endpoint revenue (in ${buybackUnit}) that automatically buys back and burns this token on-chain.">Buyback share</label>+ <span class="lp-bps-val" id="lp-bps-val">${(s.buybackBps / 100).toFixed(1)}%</span>+ </div>+ <input type="range" class="lp-slider" id="lp-bps"+ min="0" max="5000" step="50" value="${s.buybackBps}" ${dis}+ title="Share of agent revenue (in ${buybackUnit}) that buys back and burns this token on-chain. 0% means no buyback, 50% is the max." />+ <div class="lp-slider-hint">Of agent revenue burned back</div>+ </div>+ </div>`;+ }+ return `<div>${buyField}</div>`;+ })()}${sourceToggleHtml}${walletHtml}${s.phase === 'error' ? `<div class="lp-err">${esc(s.errorMsg)}<div class="lp-err-sub">Adjust the details above and try again — nothing has been minted yet.</div></div>` : ''}diff --git a/pump-fun-skills/coin-fees/package.json b/pump-fun-skills/coin-fees/package.jsonindex e02c7ecd9..2f0a21996 100644--- a/pump-fun-skills/coin-fees/package.json+++ b/pump-fun-skills/coin-fees/package.json@@ -15,8 +15,8 @@"fetch-distributable-info": "node scripts/fetch-distributable-info.mjs"},"dependencies": {- "@pump-fun/pump-sdk": "^1.33.0",- "@pump-fun/pump-swap-sdk": "^1.15.0",+ "@pump-fun/pump-sdk": "^1.36.0",+ "@pump-fun/pump-swap-sdk": "^1.16.0","@solana/spl-token": "^0.4.13","@solana/web3.js": "^1.98.2","bn.js": "^5.2.2"diff --git a/pump-fun-skills/create-coin/package.json b/pump-fun-skills/create-coin/package.jsonindex 30e8ed23c..306fb1ef4 100644--- a/pump-fun-skills/create-coin/package.json+++ b/pump-fun-skills/create-coin/package.json@@ -12,9 +12,9 @@"build-create-coin-tx": "node scripts/build-create-coin-tx.mjs"},"dependencies": {- "@pump-fun/agent-payments-sdk": "^3.0.3",- "@pump-fun/pump-sdk": "^1.33.0",- "@pump-fun/pump-swap-sdk": "^1.15.0",+ "@pump-fun/agent-payments-sdk": "^3.1.0",+ "@pump-fun/pump-sdk": "^1.36.0",+ "@pump-fun/pump-swap-sdk": "^1.16.0","@solana/spl-token": "^0.4.13","@solana/web3.js": "^1.98.2","bn.js": "^5.2.2"diff --git a/pump-fun-skills/swap/package.json b/pump-fun-skills/swap/package.jsonindex 271aae061..44e080164 100644--- a/pump-fun-skills/swap/package.json+++ b/pump-fun-skills/swap/package.json@@ -16,8 +16,8 @@"print-balances": "node scripts/print-balances.mjs"},"dependencies": {- "@pump-fun/pump-sdk": "^1.33.0",- "@pump-fun/pump-swap-sdk": "^1.15.0",+ "@pump-fun/pump-sdk": "^1.36.0",+ "@pump-fun/pump-swap-sdk": "^1.16.0","@solana/spl-token": "^0.4.13","@solana/web3.js": "^1.98.2","bn.js": "^5.2.2"diff --git a/scripts/add-nav-footer.mjs b/scripts/add-nav-footer.mjsindex 291bc591c..78d6158f7 100644--- a/scripts/add-nav-footer.mjs+++ b/scripts/add-nav-footer.mjs@@ -95,7 +95,7 @@ function injectBeforeBodyClose(html, snippet) {let changed = 0;for (const file of PAGES) {- const path = resolve(ROOT, file);+ const path = resolve(ROOT, 'pages', file);let html;try {html = readFileSync(path, 'utf8');diff --git a/scripts/pump-v2-smoke.mjs b/scripts/pump-v2-smoke.mjsnew file mode 100644index 000000000..0cb258972--- /dev/null+++ b/scripts/pump-v2-smoke.mjs@@ -0,0 +1,265 @@+// Live mainnet verification of every V2 / USDC code path our backend depends+// on. Reads real on-chain state (Global, BondingCurve) and builds real+// transactions — but never submits, so no funds move and no keys are needed.+//+// Why mainnet and not devnet: the May 21, 2026 USDC launch ships on mainnet+// first; the pump.fun program/state we ship against lives there. Devnet has+// stale program versions for parts of the v2 surface, so it's not a faithful+// smoke target.+//+// Env:+// SOLANA_RPC_URL — preferred (paid Helius/Triton/etc). Falls back to public+// mainnet-beta if unset (rate-limited but works for a few+// reads).+// PUMP_SMOKE_MINT — pump.fun mint to use as the read target. Defaults to a+// known live SOL-paired coin pulled from the v3 frontend+// API at write time; override with any current mint.+//+// Run: node scripts/pump-v2-smoke.mjs++import { Keypair, PublicKey, Connection } from '@solana/web3.js';+import BN from 'bn.js';+import {+ PumpSdk,+ OnlinePumpSdk,+ isLegacyQuoteMint,+ canonicalPumpPoolPda,+ canonicalPumpPoolPdaWithQuote,+ getBuyTokenAmountFromSolAmount,+} from '@pump-fun/pump-sdk';++const RPC = process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';+const USDC_MAINNET = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');+const WSOL = new PublicKey('So11111111111111111111111111111111111111112');++// A live mainnet pump.fun coin to exercise real bonding-curve reads against.+// Override with PUMP_SMOKE_MINT when this one graduates / 404s.+const TARGET_MINT_STR = process.env.PUMP_SMOKE_MINT+ || 'BD1Soa3PKTkcJkGtn14d7jLy4dUiztwo6tP2KkqJpump';++console.log(`RPC: ${RPC}`);+console.log(`Mint: ${TARGET_MINT_STR}`);+console.log('');++const connection = new Connection(RPC, 'confirmed');+const offline = new PumpSdk();+const online = new OnlinePumpSdk(connection);++const targetMint = new PublicKey(TARGET_MINT_STR);+const fakeUser = Keypair.generate().publicKey;+const creator = Keypair.generate().publicKey;+const wallet1 = Keypair.generate().publicKey;+const wallet2 = Keypair.generate().publicKey;++const results = [];+async function check(name, fn) {+ const started = Date.now();+ try {+ const v = await fn();+ results.push({ name, ok: true, detail: summarize(v), ms: Date.now() - started });+ } catch (err) {+ results.push({ name, ok: false, err: err?.message || String(err), ms: Date.now() - started });+ }+}+function summarize(v) {+ if (Array.isArray(v)) return `${v.length} instruction${v.length === 1 ? '' : 's'}`;+ if (v?.keys && Array.isArray(v.keys)) return `1 ix (${v.keys.length} accounts)`;+ if (v?.toBase58) return v.toBase58();+ if (typeof v === 'boolean') return String(v);+ if (v && typeof v === 'object' && 'mint' in v) return Object.keys(v).join(',');+ return typeof v;+}++// ── Offline helpers (no RPC) ────────────────────────────────────────────────++await check('isLegacyQuoteMint(WSOL) === true', () => {+ if (!isLegacyQuoteMint(WSOL)) throw new Error('expected WSOL to be legacy');+ return true;+});+await check('isLegacyQuoteMint(USDC) === false', () => {+ if (isLegacyQuoteMint(USDC_MAINNET)) throw new Error('expected USDC to be non-legacy');+ return true;+});+await check('canonicalPumpPoolPda(mint) — SOL', () => canonicalPumpPoolPda(targetMint));+await check('canonicalPumpPoolPdaWithQuote(mint, USDC)', () =>+ canonicalPumpPoolPdaWithQuote(targetMint, USDC_MAINNET),+);++// ── Live mainnet reads ──────────────────────────────────────────────────────++let global = null;+await check('OnlinePumpSdk.fetchGlobal() — mainnet', async () => {+ global = await online.fetchGlobal();+ if (!global) throw new Error('null global');+ return global;+});++let buyState = null;+await check(`OnlinePumpSdk.fetchBuyState(${TARGET_MINT_STR.slice(0, 6)}…)`, async () => {+ buyState = await online.fetchBuyState(targetMint, fakeUser);+ if (!buyState?.bondingCurve) throw new Error('no bonding curve returned');+ return buyState;+});++// ── Real V1 buy ix against fetched state (SOL-paired, current behaviour) ───++await check('buyInstructions (SOL, 0.01 SOL in)', async () => {+ if (!buyState || !global) throw new Error('prerequisite fetch missing');+ const solLamports = new BN(Math.floor(0.01 * 1_000_000_000));+ const expected = getBuyTokenAmountFromSolAmount({+ global,+ feeConfig: null,+ mintSupply: buyState.bondingCurve.tokenTotalSupply,+ bondingCurve: buyState.bondingCurve,+ amount: solLamports,+ });+ return offline.buyInstructions({+ global,+ bondingCurveAccountInfo: buyState.bondingCurveAccountInfo,+ bondingCurve: buyState.bondingCurve,+ associatedUserAccountInfo: buyState.associatedUserAccountInfo,+ mint: targetMint,+ user: fakeUser,+ amount: expected,+ solAmount: solLamports,+ slippage: 0.01,+ });+});++// ── Real V2 buy ix with USDC quote (post-launch path; pre-launch the program+// will reject on submit, but the SDK must still build the tx so our handler+// surface is provably correct the moment USDC flips live on Thursday.) ──++await check('buyV2Instructions (USDC quote, 1 USDC in)', async () => {+ if (!buyState || !global) throw new Error('prerequisite fetch missing');+ return offline.buyV2Instructions({+ global,+ bondingCurveAccountInfo: buyState.bondingCurveAccountInfo,+ bondingCurve: buyState.bondingCurve,+ associatedUserAccountInfo: buyState.associatedUserAccountInfo,+ mint: targetMint,+ user: fakeUser,+ amount: new BN(0),+ quoteAmount: new BN(1_000_000), // 1 USDC (6 dec)+ slippage: 0.01,+ quoteMint: USDC_MAINNET,+ });+});++// ── V2 sell ix with USDC quote ─────────────────────────────────────────────++await check('sellV2Instructions (USDC quote)', async () => {+ if (!buyState || !global) throw new Error('prerequisite fetch missing');+ // fetchSellState requires a real user ATA to exist on-chain. The seller+ // surface we exercise here is the offline ix builder, which only needs+ // the bonding-curve state — that's already in `buyState`. Skipping the+ // fetchSellState round-trip avoids needing a funded test holder.+ return offline.sellV2Instructions({+ global,+ bondingCurveAccountInfo: buyState.bondingCurveAccountInfo,+ bondingCurve: buyState.bondingCurve,+ mint: targetMint,+ user: fakeUser,+ amount: new BN(1_000_000_000),+ quoteAmount: new BN(0),+ slippage: 0.01,+ quoteMint: USDC_MAINNET,+ });+});++// ── createV2Instruction + USDC (launch path, no initial buy) ───────────────++const launchMint = Keypair.generate().publicKey;+await check('createV2Instruction (USDC launch, no buy)', () =>+ offline.createV2Instruction({+ mint: launchMint,+ name: 'SmokeTest',+ symbol: 'SMK',+ uri: 'https://example.com/m.json',+ creator,+ user: fakeUser,+ mayhemMode: false,+ quoteMint: USDC_MAINNET,+ }),+);++// ── createV2AndBuyV2Instructions + USDC (launch with USDC initial buy) ─────++await check('createV2AndBuyV2Instructions (USDC, 5 USDC initial buy)', async () => {+ if (!global) throw new Error('prerequisite fetch missing');+ const quoteAmount = new BN(5_000_000); // 5 USDC+ const tokenAmount = getBuyTokenAmountFromSolAmount({+ global,+ feeConfig: null,+ mintSupply: null,+ bondingCurve: null,+ amount: quoteAmount,+ });+ return offline.createV2AndBuyV2Instructions({+ global,+ mint: Keypair.generate().publicKey,+ name: 'SmokeTest',+ symbol: 'SMK',+ uri: 'https://example.com/m.json',+ creator,+ user: fakeUser,+ quoteAmount,+ amount: tokenAmount,+ mayhemMode: false,+ quoteMint: USDC_MAINNET,+ });+});++// ── Fee-sharing lifecycle on mainnet PDAs ──────────────────────────────────++await check('createFeeSharingConfig (USDC pool)', () =>+ offline.createFeeSharingConfig({+ creator,+ mint: targetMint,+ pool: canonicalPumpPoolPdaWithQuote(targetMint, USDC_MAINNET),+ }),+);+await check('updateFeeShares (2 shareholders, 60/40)', () =>+ offline.updateFeeShares({+ authority: creator,+ mint: targetMint,+ currentShareholders: [creator],+ newShareholders: [+ { address: wallet1, shareBps: 6_000 },+ { address: wallet2, shareBps: 4_000 },+ ],+ }),+);++// OnlinePumpSdk method presence — these need the right Solana program state to+// run end-to-end, but the constructor + method binding are what our handlers+// rely on, so a presence check is the right scope here.+await check('OnlinePumpSdk.collectCoinCreatorFeeInstructions exists', () => {+ if (typeof online.collectCoinCreatorFeeInstructions !== 'function')+ throw new Error('method missing');+ return true;+});+await check('OnlinePumpSdk.buildDistributeCreatorFeesInstructions exists', () => {+ if (typeof online.buildDistributeCreatorFeesInstructions !== 'function')+ throw new Error('method missing');+ return true;+});++// ── Report ──────────────────────────────────────────────────────────────────++const pad = (s, n) => String(s).padEnd(n);+let pass = 0, fail = 0;+console.log('Pump.fun V2 / USDC mainnet smoke results');+console.log('─'.repeat(80));+for (const r of results) {+ if (r.ok) {+ pass++;+ console.log(` PASS ${pad(r.name, 56)} ${pad(r.detail, 14)} ${r.ms}ms`);+ } else {+ fail++;+ console.log(` FAIL ${pad(r.name, 56)} ${r.err}`);+ }+}+console.log('─'.repeat(80));+console.log(` ${pass}/${pass + fail} passed${fail ? ` — ${fail} FAILED` : ''}`);+process.exit(fail ? 1 : 0);diff --git a/src/agent-skills-pumpfun.js b/src/agent-skills-pumpfun.jsindex 263de4535..d4faca8c0 100644--- a/src/agent-skills-pumpfun.js+++ b/src/agent-skills-pumpfun.js@@ -324,10 +324,16 @@ export function registerPumpFunSkills(skills) {});// ── pumpfun-buy ───────────────────────────────────────────────────────────+ // Bonding-curve buy. Supports both SOL-paired (legacy `buyInstructions`)+ // and USDC-paired v2 coins (`buyV2Instructions`). The route is auto-detected+ // from the on-chain bonding curve's `quoteMint` field — callers can pass+ // either `solAmount` (SOL coins) or `usdcAmount` (USDC coins); for legacy+ // agents that only know about `solAmount`, the server-flow path falls back+ // to inferring the correct field server-side.skills.register({name: 'pumpfun-buy',- description: 'Buy a pump.fun token with SOL on the bonding curve.',- instruction: 'Bonding-curve buy. Reverts if the token has graduated — use pumpfun-amm-buy.',+ description: 'Buy a pump.fun token on the bonding curve (SOL- or USDC-paired).',+ instruction: 'Bonding-curve buy. Reverts if the token has graduated — use pumpfun-amm-buy. For USDC-paired v2 coins, pass usdcAmount instead of solAmount.',animationHint: 'gesture',voicePattern: 'Buying {{solAmount}} SOL of {{mint}}…',mcpExposed: true,@@ -335,52 +341,64 @@ export function registerPumpFunSkills(skills) {type: 'object',properties: {mint: { type: 'string' },- solAmount: { type: 'number' },+ solAmount: { type: 'number', description: 'SOL to spend (SOL-paired coins).' },+ usdcAmount: { type: 'number', description: 'USDC to spend (USDC-paired v2 coins).' },+ quoteMint: { type: 'string', description: 'Optional explicit quote mint. Auto-detected from the on-chain bonding curve when omitted.' },slippageBps: { type: 'number' },network: { type: 'string', enum: ['mainnet', 'devnet'] },},- required: ['mint', 'solAmount'],+ required: ['mint'],},handler: async (args, _ctx) => {const network = args.network || DEFAULT_NETWORK;const slippageBps = args.slippageBps ?? DEFAULT_SLIPPAGE_BPS;+ const usdcAmount = typeof args.usdcAmount === 'number' ? args.usdcAmount : null;+ const solAmount = typeof args.solAmount === 'number' ? args.solAmount : null;+ if (usdcAmount == null && solAmount == null) {+ return { success: false, output: 'pumpfun-buy requires either solAmount or usdcAmount.', sentiment: -0.2 };+ }if (args.serverFlow) {const { pubkey: pk } = await requireWallet();+ const body = {+ mint: args.mint,+ network,+ slippage_bps: slippageBps,+ wallet_address: pk.toBase58(),+ ...(args.quoteMint ? { quote_mint: args.quoteMint } : {}),+ ...(usdcAmount != null ? { usdc_amount: usdcAmount } : { sol: solAmount }),+ };const r = await runServerFlow({prepPath: '/api/pump/buy-prep',- body: {- mint: args.mint,- network,- sol: args.solAmount,- slippage_bps: slippageBps,- wallet_address: pk.toBase58(),- },+ body,confirmPath: '/api/pump/buy-confirm',confirmExtra: (prep) => ({mint: args.mint,network,wallet_address: pk.toBase58(),- sol: args.solAmount,+ sol: solAmount ?? 0,slippage_bps: slippageBps,route: prep.route,}),});const route = r.prep.route;+ const denom = usdcAmount != null ? `${usdcAmount} USDC` : `${solAmount} SOL`;return {success: true,- output: `Bought ~${args.solAmount} SOL of ${args.mint.slice(0, 8)}… via ${route}.`,+ output: `Bought ~${denom} of ${args.mint.slice(0, 8)}… via ${route}.`,sentiment: 0.6,data: {signature: r.signature,route,mint: args.mint,+ quote_mint: r.prep.quote_mint || null,network,tracked: r.confirm?.tracked,},};}+ // In-browser path: build, sign, and send the instructions directly.const { pump, web3, BN } = await loadCore();const { wallet, pubkey } = await requireWallet();const connection = getConnection(web3, network);@@ -391,28 +409,58 @@ export function registerPumpFunSkills(skills) {const global = await onlineSdk.fetchGlobal();const state = await onlineSdk.fetchBuyState(mint, pubkey);- const solLamports = new BN(Math.floor(args.solAmount * web3.LAMPORTS_PER_SOL));- const expected = pump.getBuyTokenAmountFromSolAmount({- global,- feeConfig: null,- mintSupply: state.bondingCurve.tokenTotalSupply,- bondingCurve: state.bondingCurve,- amount: solLamports,- });- const buyIxs = await offline.buyInstructions({- global,- bondingCurveAccountInfo: state.bondingCurveAccountInfo,- bondingCurve: state.bondingCurve,- associatedUserAccountInfo: state.associatedUserAccountInfo,- mint,- user: pubkey,- amount: expected,- solAmount: solLamports,- slippage: slippageBps / 10_000,- tokenProgram:- web3.TOKEN_PROGRAM_ID || (await import('@solana/spl-token')).TOKEN_PROGRAM_ID,- });+ // Resolve quoteMint: explicit override > on-chain curve > WSOL fallback.+ const WSOL = new web3.PublicKey('So11111111111111111111111111111111111111112');+ const quoteMintPk = args.quoteMint+ ? new web3.PublicKey(args.quoteMint)+ : (state.bondingCurve?.quoteMint || WSOL);+ const isUsdcQuote = !pump.isLegacyQuoteMint(quoteMintPk);++ let buyIxs;+ if (isUsdcQuote) {+ if (usdcAmount == null) {+ return { success: false, output: 'USDC-paired coin: pass usdcAmount.', sentiment: -0.2 };+ }+ const quoteAtomics = new BN(Math.round(usdcAmount * 1_000_000));+ buyIxs = await offline.buyV2Instructions({+ global,+ bondingCurveAccountInfo: state.bondingCurveAccountInfo,+ bondingCurve: state.bondingCurve,+ associatedUserAccountInfo: state.associatedUserAccountInfo,+ mint,+ user: pubkey,+ amount: new BN(0),+ quoteAmount: quoteAtomics,+ slippage: slippageBps / 10_000,+ quoteMint: quoteMintPk,+ });+ } else {+ if (solAmount == null) {+ return { success: false, output: 'SOL-paired coin: pass solAmount.', sentiment: -0.2 };+ }+ const solLamports = new BN(Math.floor(solAmount * web3.LAMPORTS_PER_SOL));+ const expected = pump.getBuyTokenAmountFromSolAmount({+ global,+ feeConfig: null,+ mintSupply: state.bondingCurve.tokenTotalSupply,+ bondingCurve: state.bondingCurve,+ amount: solLamports,+ });+ buyIxs = await offline.buyInstructions({+ global,+ bondingCurveAccountInfo: state.bondingCurveAccountInfo,+ bondingCurve: state.bondingCurve,+ associatedUserAccountInfo: state.associatedUserAccountInfo,+ mint,+ user: pubkey,+ amount: expected,+ solAmount: solLamports,+ slippage: slippageBps / 10_000,+ tokenProgram:+ web3.TOKEN_PROGRAM_ID || (await import('@solana/spl-token')).TOKEN_PROGRAM_ID,+ });+ }const sig = await sendIxs({web3,@@ -421,20 +469,24 @@ export function registerPumpFunSkills(skills) {payer: pubkey,instructions: buyIxs,});+ const denom = isUsdcQuote ? `${usdcAmount} USDC` : `${solAmount} SOL`;return {success: true,- output: `Bought ~${expected.toString()} units of ${args.mint.slice(0, 8)}… for ${args.solAmount} SOL.`,+ output: `Bought ${args.mint.slice(0, 8)}… for ${denom}.`,sentiment: 0.6,- data: { signature: sig, mint: args.mint, solAmount: args.solAmount, network },+ data: { signature: sig, mint: args.mint, quote_mint: quoteMintPk.toBase58(), network },};},});// ── pumpfun-sell ──────────────────────────────────────────────────────────+ // Bonding-curve sell. Auto-detects the quote mint from the on-chain+ // bonding-curve state and routes through `sellV2Instructions` for USDC-paired+ // v2 coins or the legacy `sellInstructions` for SOL-paired coins.skills.register({name: 'pumpfun-sell',- description: 'Sell a pump.fun token back to the bonding curve for SOL.',- instruction: 'Bonding-curve sell. Reverts if graduated — use pumpfun-amm-sell.',+ description: 'Sell a pump.fun token back to the bonding curve (SOL- or USDC-paired).',+ instruction: 'Bonding-curve sell. Reverts if graduated — use pumpfun-amm-sell. Quote currency (SOL or USDC) is auto-detected from the coin.',animationHint: 'gesture',voicePattern: 'Selling {{tokenAmount}} of {{mint}}…',mcpExposed: true,@@ -443,6 +495,7 @@ export function registerPumpFunSkills(skills) {properties: {mint: { type: 'string' },tokenAmount: { type: 'string', description: 'Base-unit integer string' },+ quoteMint: { type: 'string', description: 'Optional explicit quote mint. Auto-detected from the on-chain bonding curve when omitted.' },slippageBps: { type: 'number' },network: { type: 'string', enum: ['mainnet', 'devnet'] },},@@ -462,6 +515,7 @@ export function registerPumpFunSkills(skills) {tokens: String(args.tokenAmount),slippage_bps: slippageBps,wallet_address: pk.toBase58(),+ ...(args.quoteMint ? { quote_mint: args.quoteMint } : {}),},confirmPath: '/api/pump/sell-confirm',confirmExtra: (prep) => ({@@ -507,18 +561,41 @@ export function registerPumpFunSkills(skills) {amount: tokenAmount,});- const sellIxs = await offline.sellInstructions({- global,- bondingCurveAccountInfo: state.bondingCurveAccountInfo,- bondingCurve: state.bondingCurve,- mint,- user: pubkey,- amount: tokenAmount,- solAmount: expectedSol,- slippage: slippageBps / 10_000,- tokenProgram: (await import('@solana/spl-token')).TOKEN_PROGRAM_ID,- mayhemMode: false,- });+ // Route based on the on-chain quote mint. USDC-paired v2 coins go+ // through sellV2Instructions; SOL-paired stays on the legacy path.+ const WSOL = new web3.PublicKey('So11111111111111111111111111111111111111112');+ const quoteMintPk = args.quoteMint+ ? new web3.PublicKey(args.quoteMint)+ : (state.bondingCurve?.quoteMint || WSOL);+ const isUsdcQuote = !pump.isLegacyQuoteMint(quoteMintPk);++ let sellIxs;+ if (isUsdcQuote) {+ sellIxs = await offline.sellV2Instructions({+ global,+ bondingCurveAccountInfo: state.bondingCurveAccountInfo,+ bondingCurve: state.bondingCurve,+ mint,+ user: pubkey,+ amount: tokenAmount,+ quoteAmount: new BN(0),+ slippage: slippageBps / 10_000,+ quoteMint: quoteMintPk,+ });+ } else {+ sellIxs = await offline.sellInstructions({+ global,+ bondingCurveAccountInfo: state.bondingCurveAccountInfo,+ bondingCurve: state.bondingCurve,+ mint,+ user: pubkey,+ amount: tokenAmount,+ solAmount: expectedSol,+ slippage: slippageBps / 10_000,+ tokenProgram: (await import('@solana/spl-token')).TOKEN_PROGRAM_ID,+ mayhemMode: false,+ });+ }const sig = await sendIxs({web3,@@ -531,7 +608,7 @@ export function registerPumpFunSkills(skills) {success: true,output: `Sold ${args.tokenAmount} of ${args.mint.slice(0, 8)}…`,sentiment: 0.4,- data: { signature: sig, mint: args.mint, network },+ data: { signature: sig, mint: args.mint, quote_mint: quoteMintPk.toBase58(), network },};},});diff --git a/src/pump/pump-modals.js b/src/pump/pump-modals.jsindex feb710a9a..20d13174c 100644--- a/src/pump/pump-modals.js+++ b/src/pump/pump-modals.js@@ -388,11 +388,13 @@ function openGovernance({ mint, currentBps }) {// ── Launch wizard ──────────────────────────────────────────────────────────// formData: { name, symbol, description, initialBuy, feeTier, image (File|null) }// Steps: 1 = token details (pre-filled) + metadata generation-// 2 = buyback share + initial buy+// 2 = quote pair (SOL/USDC) + buyback share + initial buy// 3 = review + signfunction openLaunch({ identity, agentId, avatarId, formData }) {const { inner, close } = openModal();let step = 1;+ // USDC mainnet mint — pump.fun v2 quote when the user picks USDC pair.+ const USDC_MAINNET = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';async function buildMetadata(name, symbol, description) {let imageDataUrl = null;diff --git a/tests/branding.test.js b/tests/branding.test.jsindex 0133b6dde..f15223672 100644--- a/tests/branding.test.js+++ b/tests/branding.test.js@@ -92,7 +92,7 @@ function* walk(absDir, match) {/*** Collect all in-scope files for the branding scan.* Scope (per spec):- * - *.html at repo root+ * - pages/**\/*.html (bundled top-level pages, formerly at repo root)* - public/**\/*.html* - docs/**\/*.md* - public/docs/**\/*.md@@ -104,14 +104,12 @@ function* walk(absDir, match) {function collectScopedFiles() {const files = [];- // 1. Repo-root HTML- for (const ent of readdirSync(REPO_ROOT, { withFileTypes: true })) {- if (ent.isFile() && ent.name.endsWith('.html')) {- files.push({- abs: join(REPO_ROOT, ent.name),- kind: 'html',- });- }+ // 1. pages/**/*.html — bundled top-level pages+ for (const abs of walk(+ join(REPO_ROOT, 'pages'),+ (_a, rel) => rel.endsWith('.html'),+ )) {+ files.push({ abs, kind: 'html' });}// 2. public/**/*.htmldiff --git a/tests/share-panel.test.js b/tests/share-panel.test.jsindex d56918a93..11235732e 100644--- a/tests/share-panel.test.js+++ b/tests/share-panel.test.js@@ -203,7 +203,7 @@ describe('agent-3d web component — attribute surface', () => {});describe('agent-embed.html — consolidated embed page', () => {- const html = readFileSync(p('agent-embed.html'), 'utf8');+ const html = readFileSync(p('pages/agent-embed.html'), 'utf8');it('defaults to a transparent background', () => {expect(html).toContain("const bg = params.get('bg') || 'transparent'");diff --git a/vite.config.js b/vite.config.jsindex 27c461796..a22040e16 100644--- a/vite.config.js+++ b/vite.config.js@@ -115,34 +115,34 @@ const appConfig = {},input: {'footer-bot': resolve(__dirname, 'src/footer-bot.js'),- app: resolve(__dirname, 'app.html'),- 'app-demo': resolve(__dirname, 'app-demo.html'),- home: resolve(__dirname, 'home.html'),- features: resolve(__dirname, 'features.html'),- tutorials: resolve(__dirname, 'tutorials.html'),- tutorial: resolve(__dirname, 'tutorial.html'),- playground: resolve(__dirname, 'playground.html'),- embed: resolve(__dirname, 'embed.html'),- launchpad: resolve(__dirname, 'launchpad.html'),- create: resolve(__dirname, 'create.html'),- 'create-selfie': resolve(__dirname, 'create-selfie.html'),- 'agent-home': resolve(__dirname, 'agent-home.html'),- marketplace: resolve(__dirname, 'marketplace.html'),- 'agent-edit': resolve(__dirname, 'agent-edit.html'),- 'agent-embed': resolve(__dirname, 'agent-embed.html'),- 'agent-detail': resolve(__dirname, 'agent-detail.html'),- 'a-embed': resolve(__dirname, 'a-embed.html'),- 'a-edit': resolve(__dirname, 'a-edit.html'),- 'pump-live': resolve(__dirname, 'pump-live.html'),- 'pump-dashboard': resolve(__dirname, 'pump-dashboard.html'),- 'pump-visualizer': resolve(__dirname, 'pump-visualizer.html'),- 'avatar-artifact': resolve(__dirname, 'avatar-artifact.html'),- 'launch-week': resolve(__dirname, 'three-ws-launch-week.html'),- community: resolve(__dirname, 'community.html'),- profile: resolve(__dirname, 'profile.html'),- 'avatar-page': resolve(__dirname, 'avatar-page.html'),- 'widget-studio': resolve(__dirname, 'widget-studio.html'),- walk: resolve(__dirname, 'walk.html'),+ app: resolve(__dirname, 'pages/app.html'),+ 'app-demo': resolve(__dirname, 'pages/app-demo.html'),+ home: resolve(__dirname, 'pages/home.html'),+ features: resolve(__dirname, 'pages/features.html'),+ tutorials: resolve(__dirname, 'pages/tutorials.html'),+ tutorial: resolve(__dirname, 'pages/tutorial.html'),+ playground: resolve(__dirname, 'pages/playground.html'),+ embed: resolve(__dirname, 'pages/embed.html'),+ launchpad: resolve(__dirname, 'pages/launchpad.html'),+ create: resolve(__dirname, 'pages/create.html'),+ 'create-selfie': resolve(__dirname, 'pages/create-selfie.html'),+ 'agent-home': resolve(__dirname, 'pages/agent-home.html'),+ marketplace: resolve(__dirname, 'pages/marketplace.html'),+ 'agent-edit': resolve(__dirname, 'pages/agent-edit.html'),+ 'agent-embed': resolve(__dirname, 'pages/agent-embed.html'),+ 'agent-detail': resolve(__dirname, 'pages/agent-detail.html'),+ 'a-embed': resolve(__dirname, 'pages/a-embed.html'),+ 'a-edit': resolve(__dirname, 'pages/a-edit.html'),+ 'pump-live': resolve(__dirname, 'pages/pump-live.html'),+ 'pump-dashboard': resolve(__dirname, 'pages/pump-dashboard.html'),+ 'pump-visualizer': resolve(__dirname, 'pages/pump-visualizer.html'),+ 'avatar-artifact': resolve(__dirname, 'pages/avatar-artifact.html'),+ 'launch-week': resolve(__dirname, 'pages/three-ws-launch-week.html'),+ community: resolve(__dirname, 'pages/community.html'),+ profile: resolve(__dirname, 'pages/profile.html'),+ 'avatar-page': resolve(__dirname, 'pages/avatar-page.html'),+ 'widget-studio': resolve(__dirname, 'pages/widget-studio.html'),+ walk: resolve(__dirname, 'pages/walk.html'),studio: resolve(__dirname, 'public/studio/index.html'),reputation: resolve(__dirname, 'public/reputation/index.html'),hydrate: resolve(__dirname, 'public/hydrate/index.html'),@@ -185,15 +185,15 @@ const appConfig = {configureServer(server) {const root = resolve(__dirname);const fileMap = {- '/app': resolve(root, 'app.html'),- '/app-demo': resolve(root, 'app-demo.html'),+ '/app': resolve(root, 'pages/app.html'),+ '/app-demo': resolve(root, 'pages/app-demo.html'),'/login': resolve(root, 'public/login.html'),- '/deploy': resolve(root, 'app.html'),+ '/deploy': resolve(root, 'pages/app.html'),'/agents': resolve(root, 'public/agents/index.html'),'/agents/': resolve(root, 'public/agents/index.html'),- '/create': resolve(root, 'create.html'),- '/create/selfie': resolve(root, 'create-selfie.html'),- '/create/selfie/': resolve(root, 'create-selfie.html'),+ '/create': resolve(root, 'pages/create.html'),+ '/create/selfie': resolve(root, 'pages/create-selfie.html'),+ '/create/selfie/': resolve(root, 'pages/create-selfie.html'),'/dashboard': resolve(root, 'public/dashboard/index.html'),'/studio': resolve(root, 'public/studio/index.html'),'/studio/': resolve(root, 'public/studio/index.html'),@@ -217,8 +217,8 @@ const appConfig = {'/discover/': resolve(root, 'public/discover/index.html'),'/gallery': resolve(root, 'public/gallery/index.html'),'/gallery/': resolve(root, 'public/gallery/index.html'),- '/marketplace': resolve(root, 'marketplace.html'),- '/marketplace/': resolve(root, 'marketplace.html'),+ '/marketplace': resolve(root, 'pages/marketplace.html'),+ '/marketplace/': resolve(root, 'pages/marketplace.html'),'/pay': resolve(root, 'public/pay/index.html'),'/pay/': resolve(root, 'public/pay/index.html'),'/pay/calls': resolve(root, 'public/pay/calls/index.html'),@@ -229,18 +229,18 @@ const appConfig = {'/explore': resolve(root, 'public/discover/index.html'),'/explore/': resolve(root, 'public/discover/index.html'),// END:DISCOVER_ROUTE- '/tutorials': resolve(root, 'tutorials.html'),- '/tutorials/': resolve(root, 'tutorials.html'),- '/pump-live': resolve(root, 'pump-live.html'),- '/pump-live/': resolve(root, 'pump-live.html'),- '/pump-dashboard': resolve(root, 'pump-dashboard.html'),- '/pump-dashboard/': resolve(root, 'pump-dashboard.html'),- '/pump-visualizer': resolve(root, 'pump-visualizer.html'),- '/pump-visualizer/': resolve(root, 'pump-visualizer.html'),- '/avatar-artifact': resolve(root, 'avatar-artifact.html'),- '/avatar-artifact/': resolve(root, 'avatar-artifact.html'),- '/walk': resolve(root, 'walk.html'),- '/walk/': resolve(root, 'walk.html'),+ '/tutorials': resolve(root, 'pages/tutorials.html'),+ '/tutorials/': resolve(root, 'pages/tutorials.html'),+ '/pump-live': resolve(root, 'pages/pump-live.html'),+ '/pump-live/': resolve(root, 'pages/pump-live.html'),+ '/pump-dashboard': resolve(root, 'pages/pump-dashboard.html'),+ '/pump-dashboard/': resolve(root, 'pages/pump-dashboard.html'),+ '/pump-visualizer': resolve(root, 'pages/pump-visualizer.html'),+ '/pump-visualizer/': resolve(root, 'pages/pump-visualizer.html'),+ '/avatar-artifact': resolve(root, 'pages/avatar-artifact.html'),+ '/avatar-artifact/': resolve(root, 'pages/avatar-artifact.html'),+ '/walk': resolve(root, 'pages/walk.html'),+ '/walk/': resolve(root, 'pages/walk.html'),'/walkaround': resolve(root, 'public/demos/walkaround.html'),'/walkaround/': resolve(root, 'public/demos/walkaround.html'),'/brain': resolve(root, 'public/demos/brain.html'),@@ -249,12 +249,12 @@ const appConfig = {'/lipsync/': resolve(root, 'public/demos/lipsync-tts.html'),'/lipsync/mic': resolve(root, 'public/demos/lipsync-mic.html'),'/lipsync/mic/': resolve(root, 'public/demos/lipsync-mic.html'),- '/pretext-demo': resolve(root, 'pretext-demo.html'),- '/pretext-demo/': resolve(root, 'pretext-demo.html'),- '/launch-week': resolve(root, 'three-ws-launch-week.html'),- '/launch-week/': resolve(root, 'three-ws-launch-week.html'),- '/launchpad': resolve(root, 'launchpad.html'),- '/launchpad/': resolve(root, 'launchpad.html'),+ '/pretext-demo': resolve(root, 'pages/pretext-demo.html'),+ '/pretext-demo/': resolve(root, 'pages/pretext-demo.html'),+ '/launch-week': resolve(root, 'pages/three-ws-launch-week.html'),+ '/launch-week/': resolve(root, 'pages/three-ws-launch-week.html'),+ '/launchpad': resolve(root, 'pages/launchpad.html'),+ '/launchpad/': resolve(root, 'pages/launchpad.html'),'/p': resolve(root, 'public/p/index.html'),'/p/': resolve(root, 'public/p/index.html'),'/eth-vanity': resolve(root, 'public/eth-vanity.html'),@@ -269,11 +269,11 @@ const appConfig = {'/demos/': resolve(root, 'public/demos/index.html'),'/demo/avatar-os': resolve(root, 'public/demo/avatar-os/index.html'),'/demo/avatar-os/': resolve(root, 'public/demo/avatar-os/index.html'),- '/': resolve(root, 'home.html'),- '/home': resolve(root, 'home.html'),- '/features': resolve(root, 'features.html'),- '/features/': resolve(root, 'features.html'),- '/agent': resolve(root, 'agent-home.html'),+ '/': resolve(root, 'pages/home.html'),+ '/home': resolve(root, 'pages/home.html'),+ '/features': resolve(root, 'pages/features.html'),+ '/features/': resolve(root, 'pages/features.html'),+ '/agent': resolve(root, 'pages/agent-home.html'),'/docs': resolve(root, 'docs/index.html'),'/docs/': resolve(root, 'docs/index.html'),};@@ -336,7 +336,7 @@ const appConfig = {}// /tutorials/<slug> → dedicated tutorial viewer templateelse if (!filePath && /^\/tutorials\/[a-z0-9-]+\/?$/.test(path))- filePath = resolve(root, 'tutorial.html');+ filePath = resolve(root, 'pages/tutorial.html');// /p/<slug> → public Launchpad Studio renderer (hydrates from /api/launchpad/get)else if (!filePath && /^\/p\/[a-z0-9-]+\/?$/.test(path))filePath = resolve(root, 'public/p/index.html');@@ -345,31 +345,31 @@ const appConfig = {filePath = resolve(root, 'public/pay/c/index.html');// /dashboard/x402 → x402 SKU dashboard (already in fileMap)else if (!filePath && /^\/marketplace\/agents\/[^/]+\/?$/.test(path))- filePath = resolve(root, 'marketplace.html');+ filePath = resolve(root, 'pages/marketplace.html');else if (!filePath && /^\/marketplace\/avatars\/[^/]+\/?$/.test(path))- filePath = resolve(root, 'marketplace.html');+ filePath = resolve(root, 'pages/marketplace.html');// /agents/:id → rich detail page (UUID expected, validated client-side)else if (!filePath && /^\/agents\/[^/]+\/?$/.test(path))- filePath = resolve(root, 'agent-detail.html');+ filePath = resolve(root, 'pages/agent-detail.html');else if (!filePath && /^\/agent\/[^/]+\/edit$/.test(path))- filePath = resolve(root, 'agent-edit.html');+ filePath = resolve(root, 'pages/agent-edit.html');else if (!filePath && /^\/agent\/[^/]+\/embed$/.test(path))- filePath = resolve(root, 'agent-embed.html');+ filePath = resolve(root, 'pages/agent-embed.html');else if (!filePath && /^\/agent\/[^/]+$/.test(path))- filePath = resolve(root, 'agent-home.html');+ filePath = resolve(root, 'pages/agent-home.html');else if (!filePath && /^\/character\/[^/]+\/?$/.test(path))filePath = resolve(root, 'public/character.html');else if (!filePath && (path === '/characters' || path === '/characters/'))filePath = resolve(root, 'public/characters.html');// /a/<chainId>/<agentId>/edit → chain-edit pageelse if (!filePath && /^\/a\/[^/]+(?:\/[^/]+){1,2}\/edit\/?$/.test(path))- filePath = resolve(root, 'a-edit.html');+ filePath = resolve(root, 'pages/a-edit.html');// /a/<chainId>/<agentId>/embed or /a/<chainId>/<registry>/<agentId>/embed → iframe viewerelse if (!filePath && /^\/a\/[^/]+(?:\/[^/]+){1,2}\/embed\/?$/.test(path))- filePath = resolve(root, 'a-embed.html');+ filePath = resolve(root, 'pages/a-embed.html');// /a/<chainId>/<agentId> or /a/<chainId>/<registry>/<agentId>else if (!filePath && /^\/a\/[^/]+(?:\/[^/]+){1,2}\/?$/.test(path))- filePath = resolve(root, 'app.html');+ filePath = resolve(root, 'pages/app.html');// /pay/calls/<base58 tx sig> → permalink for a paid x402 callelse if (!filePath && /^\/pay\/calls\/[1-9A-HJ-NP-Za-km-z]+\/?$/.test(path))filePath = resolve(root, 'public/pay/calls/index.html');@@ -390,6 +390,14 @@ const appConfig = {const slug = path.replace(/^\/dashboard\//, '').replace(/\/$/, '');filePath = resolve(root, `public/dashboard/${slug}.html`);}+ // Generic fallback: /<slug> or /<slug>.html → pages/<slug>.html+ // Catches the long tail of bundled root-level pages (community,+ // playground, embed, profile, …) without bloating fileMap.+ else if (!filePath && /^\/[a-z0-9][a-z0-9-]*(\.html)?\/?$/.test(path)) {+ const slug = path.replace(/^\//, '').replace(/\.html$/, '').replace(/\/$/, '');+ const candidate = resolve(root, `pages/${slug}.html`);+ if (existsSync(candidate)) filePath = candidate;+ }// Serve the rider webpack app as static files.// /footer-bot.js — serve the Vite-processed src/footer-bot.js at a// stable URL in dev so footer.js can load it without knowing the hash.@@ -594,6 +602,29 @@ const appConfig = {}},},+ {+ // Root-level HTML files now live under `pages/`. Vite bundles them+ // to `dist/pages/<name>.html`; flatten into `dist/<name>.html` so+ // vercel.json `dest` paths and existing /name URLs continue to+ // resolve without rewriting every route.+ name: 'flatten-pages-dir',+ closeBundle: {+ sequential: true,+ order: 'post',+ async handler() {+ const pagesOut = resolve(__dirname, 'dist/pages');+ if (!existsSync(pagesOut)) return;+ const { readdirSync, statSync } = await import('fs');+ for (const entry of readdirSync(pagesOut)) {+ const from = resolve(pagesOut, entry);+ const to = resolve(__dirname, 'dist', entry);+ if (!statSync(from).isFile()) continue;+ cpSync(from, to, { force: true });+ }+ rmSync(pagesOut, { recursive: true, force: true });+ },+ },+ },VitePWA({registerType: 'autoUpdate',includeAssets: ['favicon.ico', 'pwa-192x192.png', 'pwa-512x512.png', 'pwa-icon.svg'],