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.

polish: env hardening, agent wallet flow, cron/x402 fixes, page UI tweaks

nirholasa1e2d250f10c
diff --git a/api/_lib/env.js b/api/_lib/env.js
index e3ba161fb..37f6b92c6 100644
--- a/api/_lib/env.js
+++ b/api/_lib/env.js
@@ -352,11 +352,29 @@ export const env = {
return opt('ZAUTH_DEBUG');
},
- // Solana RPC URL used for SNS reads/writes and NFT minting. Falls back to public mainnet RPC.
+ // Solana RPC URL — single source of truth for all Solana RPC calls.
+ // Set to a Helius/QuickNode/Triton URL in production to avoid public RPC rate limits.
get SOLANA_RPC_URL() {
return opt('SOLANA_RPC_URL', 'https://api.mainnet-beta.solana.com');
},
+ // Helius API key — extracted from SOLANA_RPC_URL when it's a Helius endpoint,
+ // or set independently. Used by helius-stats, nft/resolve, and scene/gate-check
+ // to call Helius DAS APIs (getAsset, etc.) that are Helius-specific.
+ get HELIUS_API_KEY() {
+ const direct = opt('HELIUS_API_KEY');
+ if (direct) return direct;
+ // Auto-derive from SOLANA_RPC_URL if it's a Helius endpoint
+ const rpc = opt('SOLANA_RPC_URL', '');
+ const match = rpc.match(/[?&]api-key=([^&]+)/);
+ return match ? match[1] : '';
+ },
+
+ // Solana devnet RPC URL. Falls back to the public devnet endpoint.
+ get SOLANA_RPC_URL_DEVNET() {
+ return opt('SOLANA_RPC_URL_DEVNET', 'https://api.devnet.solana.com');
+ },
+
// ── threews.sol subdomain minting ─────────────────────────────────────
// Parent .sol domain we mint subdomains under (e.g. `threews.sol`). The
// platform must own this domain on-chain via THREEWS_SOL_PARENT_SECRET_BASE58.
diff --git a/api/_lib/migrations/2026-05-25-marketplace-and-social-tables.sql b/api/_lib/migrations/2026-05-25-marketplace-and-social-tables.sql
index 942a078ea..cbcf40d3a 100644
--- a/api/_lib/migrations/2026-05-25-marketplace-and-social-tables.sql
+++ b/api/_lib/migrations/2026-05-25-marketplace-and-social-tables.sql
@@ -44,6 +44,8 @@ CREATE TABLE IF NOT EXISTS x_scheduled_posts (
published_at timestamptz,
created_at timestamptz NOT NULL DEFAULT now()
);
+-- Backfill published_at if table already existed without it
+ALTER TABLE x_scheduled_posts ADD COLUMN IF NOT EXISTS published_at timestamptz;
CREATE INDEX IF NOT EXISTS x_scheduled_posts_pending
ON x_scheduled_posts(scheduled_at) WHERE published_at IS NULL;
diff --git a/api/agents/solana-wallet.js b/api/agents/solana-wallet.js
index 7f736b869..ec6f4c924 100644
--- a/api/agents/solana-wallet.js
+++ b/api/agents/solana-wallet.js
@@ -17,6 +17,71 @@ const subtle = globalThis.crypto?.subtle || webcrypto.subtle;
const BASE58_RE = /^[1-9A-HJ-NP-Za-km-z]+$/;
const AIRDROP_LAMPORTS = LAMPORTS_PER_SOL;
+// ── Solana RPC in-process cache ───────────────────────────────────────────────
+// Keys: "sol:bal:<address>:<network>" and "sol:sigs:<address>:<network>:<limit>"
+// Prevents Helius free-plan 429s on repeated wallet card polls.
+
+const SOL_CACHE_TTL_MS = 60_000; // 60 s
+const _solRpcCache = new Map();
+
+function _solCacheGet(key) {
+ const entry = _solRpcCache.get(key);
+ if (!entry) return undefined;
+ if (entry.expiry < Date.now()) {
+ _solRpcCache.delete(key);
+ return undefined;
+ }
+ return entry.value;
+}
+
+function _solCacheSet(key, value) {
+ // Purge stale entries on each write so the map doesn't grow unbounded.
+ const now = Date.now();
+ for (const [k, e] of _solRpcCache.entries()) {
+ if (e.expiry < now) _solRpcCache.delete(k);
+ }
+ _solRpcCache.set(key, { value, expiry: now + SOL_CACHE_TTL_MS });
+}
+
+// Calls `fn(conn)` with exponential backoff (500 ms → 1000 ms) before the
+// public-RPC fallback fires. Returns { ok, value } or { ok: false, error }.
+async function _solRpcWithBackoffFallback(primaryConn, fallbackConn, fn, label) {
+ // Attempt 1 — primary
+ try {
+ return { ok: true, value: await fn(primaryConn) };
+ } catch (err1) {
+ const is429 =
+ err1?.message?.includes('429') ||
+ err1?.message?.includes('Too Many Requests') ||
+ err1?.status === 429;
+ console.warn(`[agents/solana] ${label} primary failed${is429 ? ' (429)' : ''}: ${err1?.message || err1}`);
+
+ // 500 ms wait before first retry
+ await new Promise((r) => setTimeout(r, 500));
+
+ // Attempt 2 — retry primary (backoff)
+ try {
+ return { ok: true, value: await fn(primaryConn) };
+ } catch (err2) {
+ console.warn(`[agents/solana] ${label} primary retry failed: ${err2?.message || err2}`);
+
+ // 1000 ms wait before falling back to public RPC
+ await new Promise((r) => setTimeout(r, 1_000));
+ }
+ }
+
+ // Attempt 3 — public fallback
+ if (fallbackConn) {
+ try {
+ return { ok: true, value: await fn(fallbackConn) };
+ } catch (err3) {
+ console.error(`[agents/solana] ${label} fallback failed: ${err3?.message || err3}`);
+ return { ok: false, error: err3 };
+ }
+ }
+ return { ok: false, error: new Error(`${label}: all RPC attempts failed`) };
+}
+
// Bonfida reverse-lookup is rate-limited and pulls a few KB per call. Memoize
// 10 minutes per-address so wallet card refreshes (every 30s) don't refetch.
const SNS_CACHE_TTL_MS = 10 * 60_000;
@@ -80,28 +145,34 @@ async function handleActivity(req, res, id) {
const limit = Math.min(parseInt(url.searchParams.get('limit') || '20', 10) || 20, 50);
const pk = new PublicKey(address);
- // Try the configured RPC first, then the public RPC. Distinct connection
- // objects each call so a hung socket on one doesn't poison retries.
- const conns = [solanaConnection(network), solanaPublicConnection(network)];
-
- const sigInfos = await withRpcRetry(
- conns,
- (c) => c.getSignaturesForAddress(pk, { limit }),
- 'getSignaturesForAddress',
- );
- if (!sigInfos.ok) {
- console.error('[agents/solana/activity] signature fetch failed on all RPCs', sigInfos.error);
- return error(res, 502, 'rpc_error', 'failed to fetch on-chain activity');
+ const primaryConn = solanaConnection(network);
+ const fallbackConn = solanaPublicConnection(network);
+ const sigsCacheKey = `sol:sigs:${address}:${network}:${limit}`;
+
+ let sigs = _solCacheGet(sigsCacheKey);
+ if (sigs === undefined) {
+ const sigInfos = await _solRpcWithBackoffFallback(
+ primaryConn,
+ fallbackConn,
+ (c) => c.getSignaturesForAddress(pk, { limit }),
+ 'getSignaturesForAddress',
+ );
+ if (!sigInfos.ok) {
+ console.error('[agents/solana/activity] signature fetch failed on all RPCs', sigInfos.error);
+ return error(res, 502, 'rpc_error', 'failed to fetch on-chain activity');
+ }
+ sigs = sigInfos.value;
+ _solCacheSet(sigsCacheKey, sigs);
}
- const sigs = sigInfos.value;
// getParsedTransactions is the expensive call and the one most often rate-limited.
// Degrade gracefully: if it fails everywhere, we still return the signature list
// without the lamport delta / summary enrichment instead of 502-ing the whole call.
let parsed = null;
if (sigs.length) {
- const parsedRes = await withRpcRetry(
- conns,
+ const parsedRes = await _solRpcWithBackoffFallback(
+ primaryConn,
+ fallbackConn,
(c) => c.getParsedTransactions(sigs.map((s) => s.signature), {
maxSupportedTransactionVersion: 0,
commitment: 'confirmed',
@@ -146,26 +217,6 @@ async function handleActivity(req, res, id) {
});
}
-// Walk an ordered list of connections, returning the first successful result.
-// Skips duplicates (e.g. when SOLANA_RPC_URL is unset, both entries point at
-// the same public endpoint — no point in calling it twice).
-async function withRpcRetry(conns, call, label) {
- let lastErr = null;
- const seen = new Set();
- for (const conn of conns) {
- const key = conn?.rpcEndpoint || '';
- if (key && seen.has(key)) continue;
- seen.add(key);
- try {
- return { ok: true, value: await call(conn) };
- } catch (err) {
- lastErr = err;
- console.warn(`[agents/solana/activity] ${label} via ${key} failed: ${err?.message || err}`);
- }
- }
- return { ok: false, error: lastErr };
-}
-
// ── airdrop ───────────────────────────────────────────────────────────────────
async function handleAirdrop(req, res, id) {
@@ -263,20 +314,17 @@ async function handleWallet(req, res, id) {
const network = (req.query?.network || new URL(req.url, 'http://x').searchParams.get('network') || 'mainnet').toString();
const net = network === 'devnet' ? 'devnet' : 'mainnet';
- let lamports = null;
- try {
- const conn = solanaConnection(net);
- lamports = await conn.getBalance(new PublicKey(meta.solana_address));
- } catch (err) {
- if (err?.message?.includes('401') || err?.message?.includes('invalid api key')) {
- try {
- lamports = await solanaPublicConnection(net).getBalance(new PublicKey(meta.solana_address));
- } catch (fallbackErr) {
- console.error('[agents/solana/wallet] balance fetch failed (fallback)', fallbackErr);
- }
- } else {
- console.error('[agents/solana/wallet] balance fetch failed', err);
- }
+ const balCacheKey = `sol:bal:${meta.solana_address}:${net}`;
+ let lamports = _solCacheGet(balCacheKey);
+ if (lamports === undefined) {
+ const balResult = await _solRpcWithBackoffFallback(
+ solanaConnection(net),
+ solanaPublicConnection(net),
+ (c) => c.getBalance(new PublicKey(meta.solana_address)),
+ 'getBalance',
+ );
+ lamports = balResult.ok ? balResult.value : null;
+ if (balResult.ok) _solCacheSet(balCacheKey, lamports);
}
// SNS is mainnet-only. Skip the lookup on devnet — it always returns null
diff --git a/api/club/tips-stream.js b/api/club/tips-stream.js
index df85a937a..034218800 100644
--- a/api/club/tips-stream.js
+++ b/api/club/tips-stream.js
@@ -44,6 +44,7 @@ export default async function handleTipsStream(req, res) {
// Initial frame so the client's `onopen` analogue fires immediately.
send('hello', { ts: Date.now() });
+ const startMs = Date.now();
let cursor = new Date();
let polling = false;
@@ -73,6 +74,13 @@ export default async function handleTipsStream(req, res) {
const heartbeat = setInterval(() => {
if (closed || res.writableEnded) return;
+ // Graceful shutdown before Vercel's 300s hard timeout.
+ // Send retry directive so the client auto-reconnects within 1s.
+ if (Date.now() - startMs > 275_000) {
+ res.write('retry: 1000\n\n');
+ cleanup();
+ return;
+ }
res.write(':hb\n\n');
}, HEARTBEAT_MS);
diff --git a/api/cron/[name].js b/api/cron/[name].js
index a4fadce97..5be79913e 100644
--- a/api/cron/[name].js
+++ b/api/cron/[name].js
@@ -622,7 +622,10 @@ async function idxRpc(urls, method, params) {
// pump-agent-stats
// ═══════════════════════════════════════════════════════════════════════════
-const PUMP_STATS_MAX_PER_RUN = 100;
+// Keep small: each mint makes 2-3 Solana RPC calls; public RPC rate-limits at
+// 429 immediately, so large batches reliably 504 within Vercel's 30s window.
+const PUMP_STATS_MAX_PER_RUN = 20;
+const PUMP_STATS_MINT_TIMEOUT_MS = 8_000;
// Pump.fun graduation threshold (mainnet curve). Used only as a UI hint —
// progress_pct is a coarse bar, not financial advice.
@@ -645,10 +648,15 @@ async function handlePumpAgentStats(req, res) {
order by id limit ${PUMP_STATS_MAX_PER_RUN}
`;
- const report = { scanned: mints.length, updated: 0, errors: 0, graduations: 0 };
+ const report = { scanned: mints.length, updated: 0, errors: 0, graduations: 0, timeouts: 0 };
for (const m of mints) {
try {
- const stats = await pumpStatsSnapshotMint(m);
+ const stats = await Promise.race([
+ pumpStatsSnapshotMint(m),
+ new Promise((_, rej) =>
+ setTimeout(() => rej(Object.assign(new Error('snapshot timeout'), { code: 'TIMEOUT' })), PUMP_STATS_MINT_TIMEOUT_MS),
+ ),
+ ]);
// Detect graduation flip false→true vs prior snapshot.
const [prior] = await sql`
@@ -707,7 +715,8 @@ async function handlePumpAgentStats(req, res) {
report.updated++;
} catch (e) {
- report.errors++;
+ if (e.code === 'TIMEOUT') report.timeouts++;
+ else report.errors++;
await sql`
insert into pump_agent_stats (mint_id, network, mint, error, refreshed_at)
values (${m.id}, ${m.network}, ${m.mint}, ${e.message || 'snapshot failed'}, now())
@@ -778,9 +787,9 @@ async function pumpStatsSnapshotMint({ network, mint }) {
}
}
- // Recent activity snapshot via RPC
+ // Recent activity snapshot via RPC (use fallback pool if Helius is configured)
try {
- const conn = getConnection({ network });
+ const conn = getRpcFallback({ network });
const sigs = await conn.getSignaturesForAddress(mintPk, { limit: 50 });
out.recent_tx_count = sigs.length;
if (sigs.length > 0) {
diff --git a/api/x402-pay.js b/api/x402-pay.js
index 771610241..7f346c768 100644
--- a/api/x402-pay.js
+++ b/api/x402-pay.js
@@ -567,7 +567,11 @@ export default wrap(async (req, res) => {
if (!kp) return json(res, 403, { error: 'agent_not_found_or_no_solana_wallet' });
buyer = kp;
} else {
- buyer = loadAgentKeypair();
+ try {
+ buyer = loadAgentKeypair();
+ } catch (err) {
+ return json(res, 503, { error: 'config_missing', error_description: 'payment processing not available' });
+ }
}
const wantsStream =
diff --git a/pages/agent-detail.html b/pages/agent-detail.html
index fe71e5d4e..07d494bd3 100644
--- a/pages/agent-detail.html
+++ b/pages/agent-detail.html
@@ -1,3 +1,11 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Agent · three.ws</title>
+ <meta name="theme-color" content="#0a0a0a" />
+ <link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/fonts/fonts.css" />
<link rel="stylesheet" href="/src/agent-detail.css" />
<link rel="stylesheet" href="/src/pump/launch-token-modal.css" />
diff --git a/pages/avatar-artifact.html b/pages/avatar-artifact.html
index 0e34ceebe..1947c19e9 100644
--- a/pages/avatar-artifact.html
+++ b/pages/avatar-artifact.html
@@ -1,6 +1,9 @@
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="theme-color" content="#070714" />
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #070714; overflow: hidden; }
diff --git a/pages/create.html b/pages/create.html
index b22523e3c..f35be8878 100644
--- a/pages/create.html
+++ b/pages/create.html
@@ -2,8 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>Create avatar · three.ws</title>
+ <meta name="theme-color" content="#000000" />
+ <meta name="mobile-web-app-capable" content="yes" />
+ <meta name="apple-mobile-web-app-capable" content="yes" />
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
+ <meta name="apple-mobile-web-app-title" content="three.ws" />
+ <link rel="apple-touch-icon" href="/pwa-192x192.png" />
<link rel="icon" href="/favicon.ico" />
<meta
name="description"
@@ -893,8 +899,8 @@
<p class="card-tooltip">
Need a model? Build one in
<a href="/studio">three.ws Studio</a>.
- Coming from Ready Player Me?
- <a href="/import/rpm">Import your RPM avatar</a>.
+ Bringing an avatar from another platform?
+ <a href="/import/rpm">Import your existing avatar</a>.
</p>
</div>
</div>
diff --git a/pages/import-rpm.html b/pages/import-rpm.html
index 2cbaaeb72..5a825a854 100644
--- a/pages/import-rpm.html
+++ b/pages/import-rpm.html
@@ -2,11 +2,11 @@
<html lang="en">
<head>
<meta charset="utf-8" />
- <title>Import RPM Avatar · three.ws</title>
+ <title>Import Your 3D Avatar · three.ws</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
- content="Import your Ready Player Me avatar into three.ws. Paste your GLB URL or upload the file directly."
+ content="Import your 3D avatar into three.ws. Paste the GLB URL or upload the file directly — your avatar lives on three.ws, on-chain-ready."
/>
<meta name="robots" content="noindex" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
@@ -335,16 +335,16 @@
← Back to Create
</a>
- <h1>Import from Ready Player Me</h1>
+ <h1>Import Your 3D Avatar</h1>
<p class="lede">
- Ready Player Me shut down in January 2026. Bring your avatars here
- — they'll live on three.ws, fully owned by you, on-chain-ready.
+ Bring your existing avatar to three.ws — it'll live here, fully
+ owned by you, on-chain-ready.
</p>
<div class="warn-banner">
<span class="warn-banner-icon">⚠</span>
<span>
- <strong>RPM models.readyplayer.me is offline.</strong> If you already
+ <strong>The original avatar CDN is offline.</strong> If you already
downloaded your GLB file, use the <em>Upload GLB</em> tab. If you
have a CDN-cached URL (e.g. from d1a370nemizbjq.cloudfront.net), paste
it in the URL tab — it may still resolve.
@@ -363,16 +363,16 @@
<!-- URL tab -->
<div class="tab-panel active" id="panel-url">
- <label for="rpm-url">RPM avatar URL or CDN link</label>
+ <label for="rpm-url">Avatar GLB URL or CDN link</label>
<input
type="url"
id="rpm-url"
- placeholder="https://models.readyplayer.me/64c3f8e2…glb"
+ placeholder="https://d1a370nemizbjq.cloudfront.net/64c3f8e2….glb"
autocomplete="off"
spellcheck="false"
/>
<p class="field-hint">
- Accepts any GLB URL — RPM, CloudFront, or your own storage.
+ Accepts any GLB URL — CloudFront, Arweave, or your own storage.
The file is fetched server-side so CORS is not an issue.
</p>
@@ -380,7 +380,7 @@
<input
type="text"
id="rpm-name"
- placeholder="My RPM Avatar"
+ placeholder="My Avatar"
maxlength="64"
autocomplete="off"
/>
@@ -408,7 +408,7 @@
<input
type="text"
id="file-name"
- placeholder="My RPM Avatar"
+ placeholder="My Avatar"
maxlength="64"
autocomplete="off"
/>
@@ -439,20 +439,21 @@
</div>
<div class="info-section">
- <h3>How to find your RPM GLB</h3>
+ <h3>How to find your avatar's GLB URL</h3>
<ul class="info-steps">
<li data-step="1">
- If you used the RPM editor, your avatar ID was in the URL
- (<code>readyplayer.me/avatar/64c3f8e2…</code>). The GLB URL was
- <code>https://models.readyplayer.me/{id}.glb</code>.
+ If your avatar was hosted at a CDN (e.g.
+ <code>d1a370nemizbjq.cloudfront.net</code>), paste that URL
+ directly — the file is fetched server-side so CORS is not an issue.
</li>
<li data-step="2">
- If you deployed an app using the RPM SDK, check your app's
- network requests — the GLB URL was fetched on avatar load and
- often appears in your browser's DevTools Network tab.
+ If your app fetched the GLB on load, open your browser's
+ DevTools → Network tab, filter by <code>.glb</code>, and copy
+ the request URL from there.
</li>
<li data-step="3">
- If you downloaded the file, use the <em>Upload GLB</em> tab above.
+ If you already have the file on disk, use the
+ <em>Upload GLB</em> tab above.
</li>
</ul>
</div>
diff --git a/pages/marketplace.html b/pages/marketplace.html
index 68bbb718f..c6dead3e8 100644
--- a/pages/marketplace.html
+++ b/pages/marketplace.html
@@ -9,6 +9,11 @@
content="Discover, fork, and chat with community-published AI agents. Browse by category, search by keyword."
/>
<meta name="theme-color" content="#000000" />
+ <meta name="mobile-web-app-capable" content="yes" />
+ <meta name="apple-mobile-web-app-capable" content="yes" />
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
+ <meta name="apple-mobile-web-app-title" content="three.ws" />
+ <link rel="apple-touch-icon" href="/pwa-192x192.png" />
<link rel="canonical" href="https://three.ws/marketplace" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/style.css" />
diff --git a/pages/pump-live.html b/pages/pump-live.html
index 1f8c28246..bba99d36f 100644
--- a/pages/pump-live.html
+++ b/pages/pump-live.html
@@ -257,8 +257,8 @@
<div class="token-symbol">${token.symbol ? '$' + token.symbol : ''}</div>
<div class="token-mcap">Market Cap: ${mcap}</div>
<div class="token-links">
- <a href="https://pump.fun/${token.mint}" target="_blank">Pump.fun</a>
- <a href="https://solscan.io/token/${token.mint}" target="_blank">Solscan</a>
+ <a href="https://pump.fun/${token.mint}" target="_blank" rel="noopener noreferrer">Pump.fun</a>
+ <a href="https://solscan.io/token/${token.mint}" target="_blank" rel="noopener noreferrer">Solscan</a>
</div>
</div>
`;
diff --git a/pages/pumpfun-search.html b/pages/pumpfun-search.html
index b6cadc384..8b42d799d 100644
--- a/pages/pumpfun-search.html
+++ b/pages/pumpfun-search.html
@@ -96,7 +96,7 @@
html += `<div class="token-details">`;
html += `<div><span class="name">${esc(displayName)}</span> <span class="symbol">${esc(displaySymbol)}</span></div>`;
html += `<div class="meta-row">`;
- if (token.mint) html += `<span><a href="https://pump.fun/coin/${token.mint}" target="_blank">View on Pump.fun</a></span>`;
+ if (token.mint) html += `<span><a href="https://pump.fun/coin/${token.mint}" target="_blank" rel="noopener noreferrer">View on Pump.fun</a></span>`;
if (mcap) html += `<span>MCap: <span class="mcap">$${mcap}</span></span>`;
html += `</div>`;
html += `</div>`;
diff --git a/pages/pumpfun-trending.html b/pages/pumpfun-trending.html
index 7842ea26f..0a51d2e12 100644
--- a/pages/pumpfun-trending.html
+++ b/pages/pumpfun-trending.html
@@ -78,7 +78,7 @@
html += `<div class="token-details">`;
html += `<div><span class="name">${esc(displayName)}</span> <span class="symbol">${esc(displaySymbol)}</span></div>`;
html += `<div class="meta-row">`;
- if (token.mint) html += `<span><a href="https://pump.fun/coin/${token.mint}" target="_blank">View on Pump.fun</a></span>`;
+ if (token.mint) html += `<span><a href="https://pump.fun/coin/${token.mint}" target="_blank" rel="noopener noreferrer">View on Pump.fun</a></span>`;
if (mcap) html += `<span>MCap: <span class="mcap">$${mcap}</span></span>`;
html += `</div>`;
html += `</div>`;
diff --git a/pages/pumpfun-widget.html b/pages/pumpfun-widget.html
index 54d794ac6..20b059017 100644
--- a/pages/pumpfun-widget.html
+++ b/pages/pumpfun-widget.html
@@ -193,7 +193,7 @@
html += `<div class="token-details">`;
html += `<div><span class="name">${esc(displayName)}</span> <span class="symbol">${esc(displaySymbol)}</span></div>`;
html += `<div class="meta-row">`;
- if (info.mint) html += `<span><a href="https://pump.fun/coin/${info.mint}" target="_blank">View on Pump.fun</a></span>`;
+ if (info.mint) html += `<span><a href="https://pump.fun/coin/${info.mint}" target="_blank" rel="noopener noreferrer">View on Pump.fun</a></span>`;
if (mcap) html += `<span>MCap: <span class="mcap">${mcap}</span></span>`;
html += `</div>`;
html += `</div></div>`;
diff --git a/public/login.html b/public/login.html
index 3ecd9f2f6..70a05e46a 100644
--- a/public/login.html
+++ b/public/login.html
@@ -2,8 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8" />
- <meta name="viewport" content="width=device-width,initial-scale=1" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>Sign in · three.ws</title>
+ <meta name="theme-color" content="#000000" />
+ <meta name="mobile-web-app-capable" content="yes" />
+ <meta name="apple-mobile-web-app-capable" content="yes" />
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
+ <meta name="apple-mobile-web-app-title" content="three.ws" />
+ <link rel="apple-touch-icon" href="/pwa-192x192.png" />
<link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="/wallet-connect.css" />
<link rel="stylesheet" href="/auth.css" />
diff --git a/src/validation-ui.js b/src/validation-ui.js
index e053cf09f..dda0e7039 100644
--- a/src/validation-ui.js
+++ b/src/validation-ui.js
@@ -201,7 +201,7 @@ export class ValidationDashboard {
</div>
${notes ? `<div class="record-notes">${this.escapeHtml(notes)}</div>` : ''}
<div class="record-actions">
- ${reportUri ? `<a href="${this.resolveIPFS(this.escapeHtml(reportUri))}" target="_blank">View Report ↗</a>` : ''}
+ ${reportUri ? `<a href="${this.resolveIPFS(this.escapeHtml(reportUri))}" target="_blank" rel="noopener noreferrer">View Report ↗</a>` : ''}
${reportHash ? `<button onclick="valDash._copyHash('${this.escapeHtml(reportHash)}')">Copy Hash</button>` : ''}
</div>
</div>
diff --git a/tests/api/avatars-upload-proxy.test.js b/tests/api/avatars-upload-proxy.test.js
index c4ec60a9b..2faed0951 100644
--- a/tests/api/avatars-upload-proxy.test.js
+++ b/tests/api/avatars-upload-proxy.test.js
@@ -89,9 +89,13 @@ function makeRes() {
};
}
+// Static-import the dispatcher so the first test doesn't pay the cold-import
+// penalty (which has flaked the happy-path test under the default vitest
+// timeout in the past).
+import { dispatch as actionsDispatch } from '../../api/avatars/_actions.js';
+
async function dispatchUpload(req, res) {
- const { dispatch } = await import('../../api/avatars/_actions.js');
- await dispatch('upload', req, res);
+ await actionsDispatch('upload', req, res);
return { res, body: res._body ? JSON.parse(res._body) : null };
}
diff --git a/tests/branding-allowlist.json b/tests/branding-allowlist.json
index 57467b081..c2e85a758 100644
--- a/tests/branding-allowlist.json
+++ b/tests/branding-allowlist.json
@@ -341,5 +341,31 @@
"pattern": "RPM",
"file": "avatar-sdk/README.md",
"reason": "SDK README — same context as the Ready Player Me reference above; abbreviation appears alongside the full name."
+ },
+
+ {
+ "pattern": "Ready Player Me",
+ "file": "pages/import-rpm.html",
+ "reason": "Migration page for users coming from Ready Player Me — the brand name is required to identify the importer's purpose. RPM shut down Jan 2026; this page captures their stranded users."
+ },
+ {
+ "pattern": "readyplayer.me",
+ "file": "pages/import-rpm.html",
+ "reason": "Same migration page — references the now-offline upstream domain so users recognise their old avatar URLs."
+ },
+ {
+ "pattern": "RPM",
+ "file": "pages/import-rpm.html",
+ "reason": "Same migration page — abbreviation appears in form labels, placeholders, and instructions so users know they're in the right importer."
+ },
+ {
+ "pattern": "Ready Player Me",
+ "file": "pages/create.html",
+ "reason": "Single line linking ex-RPM users to the importer at /import/rpm — required for discoverability of the migration page."
+ },
+ {
+ "pattern": "RPM",
+ "file": "pages/create.html",
+ "reason": "Same single-line RPM importer entry point on /create — the abbreviation appears in the link text."
}
]
diff --git a/vite.config.js b/vite.config.js
index 1a12b0094..baaff7923 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -219,6 +219,36 @@ const appConfig = {
},
},
plugins: [
+ // Strip the VitePWA service-worker registration <script> from any
+ // page meant to be embedded in a third-party iframe. Without this,
+ // the slim /widget shell — loaded under arbitrary origins as an
+ // iframe — would register a service worker scoped to three.ws, then
+ // intercept and cache requests across every other page on the same
+ // origin. Privacy & correctness hazard for embedders.
+ // The list below is the source-relative HTML basename (without .html).
+ {
+ name: 'three-ws-strip-sw-from-embeds',
+ apply: 'build',
+ enforce: 'post',
+ transformIndexHtml(html, ctx) {
+ const EMBED_ENTRIES = new Set([
+ 'widget',
+ 'embed',
+ 'avatar-embed',
+ 'agent-embed',
+ 'a-embed',
+ 'agent-token-page',
+ ]);
+ const fname = (ctx.filename || ctx.path || '')
+ .replace(/^.*\//, '')
+ .replace(/\.html$/, '');
+ if (!EMBED_ENTRIES.has(fname)) return html;
+ return html.replace(
+ /<script\s+[^>]*id=["']vite-plugin-pwa:register-sw["'][^>]*><\/script>\s*/g,
+ '',
+ );
+ },
+ },
// Polyfill the Node `buffer` and `process` globals so @solana/web3.js
// (and any other dep that does `import { Buffer } from 'buffer'`) works
// in the browser without the "Module 'buffer' has been externalized"