Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat: snapshot API Lambda, mainland realtime room, mobile UX fixes

nirholas1467e084c287
diff --git a/.gitignore b/.gitignore
index 6785a971f..3e8885c75 100644
--- a/.gitignore
+++ b/.gitignore
@@ -113,3 +113,6 @@ docs/internal/COINMARKETCAP_ARTICLE.md
docs/internal/PRESS_RELEASE_SHORT.md
scripts/load-test.mjs
scripts/load-test-fleet.sh
+
+# CDK synth output (build artifact)
+infra/cdk.out
diff --git a/infra/lambda/pump-snapshot/index.mjs b/infra/lambda/pump-snapshot/index.mjs
new file mode 100644
index 000000000..eb010feaf
--- /dev/null
+++ b/infra/lambda/pump-snapshot/index.mjs
@@ -0,0 +1,462 @@
+// three.ws — Pump.fun Token Snapshot API
+//
+// A zero-dependency AWS Lambda (Node 22) behind a Function URL. It serves:
+// GET / → live demo page (HTML)
+// GET /api/snapshot?token=X → real-time token snapshot (JSON)
+// GET /healthz → liveness probe (JSON)
+//
+// Every number is fetched live from a public source. No fallback arrays, no
+// mocked values — if a source is unreachable the field is null so callers see
+// the gap rather than fake data. Mirrors mcp-server/src/tools/pump-snapshot.js
+// but reimplemented with raw fetch (incl. the Solana RPC call) so the function
+// ships with no npm dependencies.
+//
+// Sources:
+// - Jupiter Lite price API → price, 24h change, liquidity, decimals
+// - Dexscreener → 24h volume, primary DEX pair, FDV, txns
+// - pump.fun frontend-api-v3 → name, symbol, image, market cap, socials
+// - Solana RPC getTokenLargestAccounts → top-holder distribution
+// - Helius DAS getAsset (optional, if HELIUS_API_KEY set) → supply/price
+
+const SOLANA_RPC_URL = process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';
+const HELIUS_API_KEY = process.env.HELIUS_API_KEY || '';
+
+const JSON_HEADERS = {
+ 'content-type': 'application/json; charset=utf-8',
+ 'access-control-allow-origin': '*',
+ 'access-control-allow-methods': 'GET, OPTIONS',
+ 'access-control-allow-headers': 'content-type',
+ 'cache-control': 'public, max-age=10',
+};
+
+// ── Solana base58 validation (no deps) ──────────────────────────────────────
+const B58_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+function isValidSolanaPubkey(s) {
+ return typeof s === 'string' && B58_RE.test(s);
+}
+
+async function fetchJson(url, init = {}, timeoutMs = 8000) {
+ const controller = new AbortController();
+ const t = setTimeout(() => controller.abort(), timeoutMs);
+ try {
+ const res = await fetch(url, { ...init, signal: controller.signal });
+ if (!res.ok) throw new Error(`${url} → HTTP ${res.status}`);
+ return await res.json();
+ } finally {
+ clearTimeout(t);
+ }
+}
+
+async function getJupiterPrice(mint) {
+ try {
+ const data = await fetchJson(`https://lite-api.jup.ag/price/v3?ids=${mint}`);
+ const entry = data?.[mint];
+ if (!entry) return null;
+ return {
+ usdPrice: entry.usdPrice ?? null,
+ priceChange24hPct: entry.priceChange24h ?? null,
+ liquidityUsd: entry.liquidity ?? null,
+ decimals: entry.decimals ?? null,
+ blockId: entry.blockId ?? null,
+ };
+ } catch (err) {
+ return { error: err.message };
+ }
+}
+
+async function getDexscreener(mint) {
+ try {
+ const data = await fetchJson(`https://api.dexscreener.com/latest/dex/tokens/${mint}`);
+ const pairs = Array.isArray(data?.pairs) ? data.pairs : [];
+ if (pairs.length === 0) return null;
+ const pair = pairs.reduce((best, p) => {
+ const v = Number(p?.volume?.h24 || 0);
+ return v > (best?.vol || 0) ? { pair: p, vol: v } : best;
+ }, null)?.pair;
+ if (!pair) return null;
+ return {
+ volume24hUsd: Number(pair.volume?.h24 || 0),
+ priceUsd: pair.priceUsd ? Number(pair.priceUsd) : null,
+ priceChange24hPct: pair.priceChange?.h24 ?? null,
+ liquidityUsd: pair.liquidity?.usd ?? null,
+ fdvUsd: pair.fdv ?? null,
+ marketCapUsd: pair.marketCap ?? null,
+ pairAddress: pair.pairAddress,
+ dex: pair.dexId,
+ chain: pair.chainId,
+ url: pair.url,
+ txns24h: pair.txns?.h24 ?? null,
+ };
+ } catch (err) {
+ return { error: err.message };
+ }
+}
+
+async function getPumpFunMeta(mint) {
+ try {
+ const data = await fetchJson(`https://frontend-api-v3.pump.fun/coins/${mint}`);
+ if (!data || data.error) return null;
+ return {
+ name: data.name || null,
+ symbol: data.symbol || null,
+ description: data.description || null,
+ imageUrl: data.image_uri || null,
+ twitter: data.twitter || null,
+ telegram: data.telegram || null,
+ website: data.website || null,
+ creator: data.creator || null,
+ createdAtMs: data.created_timestamp || null,
+ complete: !!data.complete,
+ marketCapUsd: data.usd_market_cap ?? null,
+ marketCapQuote: data.market_cap ?? null,
+ totalSupply: data.total_supply_str || data.total_supply || null,
+ poolAddress: data.pool_address || null,
+ lastTradeTimestampMs: data.last_trade_timestamp || null,
+ athMarketCapUsd: data.ath_market_cap ?? null,
+ program: data.program || null,
+ };
+ } catch (err) {
+ return { error: err.message };
+ }
+}
+
+// Solana RPC getTokenLargestAccounts via raw JSON-RPC (no @solana/web3.js).
+async function getTopHolders(mint) {
+ try {
+ const data = await fetchJson(SOLANA_RPC_URL, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({
+ jsonrpc: '2.0',
+ id: 'largest',
+ method: 'getTokenLargestAccounts',
+ params: [mint, { commitment: 'confirmed' }],
+ }),
+ });
+ if (data?.error) return { error: data.error.message || 'rpc error' };
+ const value = data?.result?.value || [];
+ const top = value.map((acct) => ({
+ address: acct.address,
+ uiAmount: acct.uiAmount,
+ amount: acct.amount,
+ decimals: acct.decimals,
+ }));
+ return { topHolderCount: top.length, topHolders: top };
+ } catch (err) {
+ return { error: err.message };
+ }
+}
+
+async function getHeliusHolderInfo(mint) {
+ if (!HELIUS_API_KEY) return null;
+ try {
+ const data = await fetchJson(`https://mainnet.helius-rpc.com/?api-key=${HELIUS_API_KEY}`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({
+ jsonrpc: '2.0',
+ id: 'getAsset',
+ method: 'getAsset',
+ params: { id: mint, options: { showFungible: true } },
+ }),
+ });
+ const info = data?.result?.token_info ?? null;
+ if (!info) return null;
+ return {
+ supply: info.supply != null ? String(info.supply) : null,
+ decimals: info.decimals ?? null,
+ heliusPriceUsd: info.price_info?.price_per_token ?? null,
+ };
+ } catch (err) {
+ return { error: err.message };
+ }
+}
+
+async function buildSnapshot(token) {
+ const [price, volume24h, meta, holders, helius] = await Promise.all([
+ getJupiterPrice(token),
+ getDexscreener(token),
+ getPumpFunMeta(token),
+ getTopHolders(token),
+ getHeliusHolderInfo(token),
+ ]);
+ return {
+ token,
+ fetchedAt: new Date().toISOString(),
+ price,
+ volume24h,
+ meta,
+ holders,
+ helius,
+ image: meta?.imageUrl || null,
+ sources: {
+ price: 'https://lite-api.jup.ag/price/v3',
+ volume24h: 'https://api.dexscreener.com',
+ meta: 'https://frontend-api-v3.pump.fun',
+ holders: SOLANA_RPC_URL,
+ helius: HELIUS_API_KEY ? 'https://mainnet.helius-rpc.com' : null,
+ },
+ };
+}
+
+function jsonResponse(statusCode, body) {
+ return { statusCode, headers: JSON_HEADERS, body: JSON.stringify(body) };
+}
+
+// ── Lambda Function URL handler ──────────────────────────────────────────────
+export const handler = async (event) => {
+ const method = event?.requestContext?.http?.method || 'GET';
+ const rawPath = event?.rawPath || '/';
+ const path = rawPath.replace(/\/+$/, '') || '/';
+
+ if (method === 'OPTIONS') {
+ return { statusCode: 204, headers: JSON_HEADERS, body: '' };
+ }
+
+ if (path === '/healthz') {
+ return jsonResponse(200, { ok: true, service: 'pump-snapshot', rpc: SOLANA_RPC_URL });
+ }
+
+ if (path === '/api/snapshot') {
+ const token = event?.queryStringParameters?.token?.trim();
+ if (!token) {
+ return jsonResponse(400, { error: 'missing_token', message: 'Provide ?token=<mint>' });
+ }
+ if (!isValidSolanaPubkey(token)) {
+ return jsonResponse(400, { error: 'invalid_mint', token });
+ }
+ const snapshot = await buildSnapshot(token);
+ return jsonResponse(200, snapshot);
+ }
+
+ if (path === '/') {
+ return {
+ statusCode: 200,
+ headers: {
+ 'content-type': 'text/html; charset=utf-8',
+ 'cache-control': 'public, max-age=60',
+ },
+ body: PAGE_HTML,
+ };
+ }
+
+ return jsonResponse(404, { error: 'not_found', path });
+};
+
+// ── Live demo page ───────────────────────────────────────────────────────────
+const PAGE_HTML = /* html */ `<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Pump.fun Token Snapshot API — three.ws</title>
+<meta name="description" content="Real-time Solana / pump.fun token snapshots: price, 24h volume, market cap, and on-chain top-holder distribution. Live API on AWS." />
+<style>
+ :root {
+ --bg: #07080c; --panel: #0e1018; --panel-2: #141826; --line: #1f2433;
+ --text: #e8ecf4; --muted: #8a93a8; --accent: #7c5cff; --accent-2: #18d6a8;
+ --red: #ff5d6c; --green: #18d6a8; --radius: 14px;
+ --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
+ --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
+ }
+ * { box-sizing: border-box; }
+ body {
+ margin: 0; font-family: var(--sans); color: var(--text);
+ background:
+ radial-gradient(1200px 600px at 80% -10%, rgba(124,92,255,.18), transparent 60%),
+ radial-gradient(900px 500px at 0% 10%, rgba(24,214,168,.10), transparent 55%),
+ var(--bg);
+ min-height: 100vh; -webkit-font-smoothing: antialiased;
+ }
+ .wrap { max-width: 920px; margin: 0 auto; padding: 56px 24px 80px; }
+ header .badge {
+ display: inline-flex; align-items: center; gap: 8px; font-size: 12px;
+ color: var(--accent-2); border: 1px solid var(--line); border-radius: 999px;
+ padding: 5px 12px; background: var(--panel); letter-spacing: .02em;
+ }
+ .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green);
+ box-shadow: 0 0 0 0 rgba(24,214,168,.5); animation: pulse 2s infinite; }
+ @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(24,214,168,.5);} 70% { box-shadow: 0 0 0 8px rgba(24,214,168,0);} 100% { box-shadow: 0 0 0 0 rgba(24,214,168,0);} }
+ h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.05; margin: 20px 0 10px; letter-spacing: -.02em; }
+ h1 .grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
+ .lede { color: var(--muted); font-size: 17px; max-width: 640px; line-height: 1.55; margin: 0 0 28px; }
+ form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
+ input[type=text] {
+ flex: 1; min-width: 240px; background: var(--panel); border: 1px solid var(--line);
+ color: var(--text); border-radius: 12px; padding: 14px 16px; font-size: 15px;
+ font-family: var(--mono); outline: none; transition: border-color .15s, box-shadow .15s;
+ }
+ input[type=text]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
+ button {
+ background: linear-gradient(90deg, var(--accent), #6b4cff); color: #fff; border: 0;
+ border-radius: 12px; padding: 14px 22px; font-size: 15px; font-weight: 600; cursor: pointer;
+ transition: transform .1s, filter .15s; font-family: var(--sans);
+ }
+ button:hover { filter: brightness(1.08); }
+ button:active { transform: translateY(1px); }
+ button:disabled { opacity: .55; cursor: progress; }
+ .examples { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
+ .examples a { color: var(--accent); text-decoration: none; cursor: pointer; }
+ .examples a:hover { text-decoration: underline; }
+ .card { background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line);
+ border-radius: var(--radius); padding: 0; overflow: hidden; }
+ .card.hidden { display: none; }
+ .token-head { display: flex; align-items: center; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
+ .token-head img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--panel-2); }
+ .token-head .name { font-size: 20px; font-weight: 700; }
+ .token-head .sym { color: var(--muted); font-family: var(--mono); font-size: 13px; }
+ .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); }
+ .stat { background: var(--panel); padding: 18px 20px; }
+ .stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
+ .stat .value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
+ .value.pos { color: var(--green); } .value.neg { color: var(--red); }
+ .value.null { color: var(--muted); font-size: 15px; }
+ .holders { padding: 20px 24px; }
+ .holders h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
+ .holders ol { margin: 0; padding-left: 0; list-style: none; }
+ .holders li { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
+ .holders li:last-child { border-bottom: 0; }
+ .holders .addr { color: var(--muted); }
+ .holders .amt { color: var(--text); font-variant-numeric: tabular-nums; }
+ .skel { animation: shimmer 1.2s infinite linear; background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; border-radius: 8px; color: transparent !important; }
+ @keyframes shimmer { to { background-position: -200% 0; } }
+ .error { padding: 22px 24px; color: var(--red); font-size: 15px; }
+ .error .hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
+ footer { margin-top: 40px; color: var(--muted); font-size: 13px; line-height: 1.7; }
+ footer code { font-family: var(--mono); background: var(--panel); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--text); }
+ footer a { color: var(--accent); text-decoration: none; }
+ footer a:hover { text-decoration: underline; }
+ .api-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-family: var(--mono); font-size: 13px; overflow-x: auto; }
+ .api-line .verb { color: var(--accent-2); font-weight: 700; }
+</style>
+</head>
+<body>
+<div class="wrap">
+ <header>
+ <span class="badge"><span class="dot"></span> Live on AWS Lambda</span>
+ <h1>Pump.fun <span class="grad">Token Snapshot</span> API</h1>
+ <p class="lede">Real-time market data for any Solana SPL or pump.fun token — USD price, 24h volume, market cap, and on-chain top-holder distribution. One request, every source, no mocks.</p>
+ </header>
+
+ <form id="form">
+ <input id="token" type="text" placeholder="Solana mint address (base58)" autocomplete="off" spellcheck="false" />
+ <button id="go" type="submit">Snapshot</button>
+ </form>
+ <p class="examples">Try:
+ <a data-mint="HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3">PYTH</a> ·
+ <a data-mint="EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm">WIF</a> ·
+ <a data-mint="DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263">BONK</a>
+ </p>
+
+ <div id="result" class="card hidden"></div>
+
+ <div class="api-line">
+ <span class="verb">GET</span><span id="apiExample">/api/snapshot?token=&lt;mint&gt;</span>
+ </div>
+
+ <footer>
+ <p>Public JSON API. <code>GET /api/snapshot?token=&lt;mint&gt;</code> returns the full snapshot. <code>GET /healthz</code> for liveness.</p>
+ <p>Data: Jupiter · Dexscreener · pump.fun · Solana RPC. Part of <a href="https://three.ws">three.ws</a> — the platform for 3D AI agents on-chain.</p>
+ </footer>
+</div>
+
+<script>
+const $ = (s) => document.querySelector(s);
+const form = $('#form'), input = $('#token'), btn = $('#go'), result = $('#result');
+
+function fmtUsd(n, opts = {}) {
+ if (n == null || isNaN(n)) return null;
+ const abs = Math.abs(n);
+ const max = abs > 0 && abs < 0.01 ? 8 : (opts.compact && abs >= 1000 ? 1 : 2);
+ if (opts.compact && abs >= 1000) {
+ return '$' + Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 1 }).format(n);
+ }
+ return '$' + Intl.NumberFormat('en', { maximumFractionDigits: max }).format(n);
+}
+function fmtPct(n) {
+ if (n == null || isNaN(n)) return null;
+ return (n >= 0 ? '+' : '') + Number(n).toFixed(2) + '%';
+}
+function shortAddr(a) { return a ? a.slice(0, 4) + '…' + a.slice(-4) : ''; }
+function esc(s) { return String(s ?? '').replace(/[&<>"]/g, (c) => ({ '&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;' }[c])); }
+
+function statCell(label, value, cls) {
+ const isNull = value == null;
+ return '<div class="stat"><div class="label">' + label + '</div>' +
+ '<div class="value ' + (isNull ? 'null' : (cls || '')) + '">' + (isNull ? '—' : value) + '</div></div>';
+}
+
+function renderLoading() {
+ result.classList.remove('hidden');
+ result.innerHTML =
+ '<div class="token-head"><div class="skel" style="width:56px;height:56px;border-radius:12px"></div>' +
+ '<div><div class="skel" style="width:160px;height:20px;margin-bottom:8px">.</div>' +
+ '<div class="skel" style="width:90px;height:13px">.</div></div></div>' +
+ '<div class="grid">' + Array(4).fill('<div class="stat"><div class="skel" style="width:60px;height:11px;margin-bottom:8px">.</div><div class="skel" style="width:90px;height:20px">.</div></div>').join('') + '</div>';
+}
+
+function renderError(msg, hint) {
+ result.classList.remove('hidden');
+ result.innerHTML = '<div class="error">' + esc(msg) + (hint ? '<div class="hint">' + esc(hint) + '</div>' : '') + '</div>';
+}
+
+function render(d) {
+ const meta = d.meta || {}, price = d.price || {}, vol = d.volume24h || {}, holders = d.holders || {};
+ const usd = price.usdPrice ?? vol.priceUsd;
+ const chg = price.priceChange24hPct ?? vol.priceChange24hPct;
+ const mcap = meta.marketCapUsd ?? vol.marketCapUsd ?? vol.fdvUsd;
+ const liq = price.liquidityUsd ?? vol.liquidityUsd;
+ const name = meta.name || (d.token.slice(0, 4) + '…' + d.token.slice(-4));
+ const sym = meta.symbol ? '$' + meta.symbol : d.token.slice(0, 8);
+ const img = d.image || meta.imageUrl;
+
+ let html = '<div class="token-head">';
+ html += img ? '<img src="' + esc(img) + '" alt="" onerror="this.style.visibility=\\'hidden\\'" />' : '<div style="width:56px;height:56px;border-radius:12px;background:var(--panel-2)"></div>';
+ html += '<div><div class="name">' + esc(name) + '</div><div class="sym">' + esc(sym) + ' · ' + shortAddr(d.token) + '</div></div></div>';
+
+ html += '<div class="grid">';
+ html += statCell('Price', fmtUsd(usd, { compact: false }));
+ html += statCell('24h Change', fmtPct(chg), chg == null ? '' : (chg >= 0 ? 'pos' : 'neg'));
+ html += statCell('Market Cap', fmtUsd(mcap, { compact: true }));
+ html += statCell('24h Volume', fmtUsd(vol.volume24hUsd, { compact: true }));
+ html += statCell('Liquidity', fmtUsd(liq, { compact: true }));
+ html += statCell('DEX', vol.dex ? esc(vol.dex) : null);
+ html += '</div>';
+
+ const list = Array.isArray(holders.topHolders) ? holders.topHolders.slice(0, 8) : [];
+ if (list.length) {
+ html += '<div class="holders"><h3>Top holders · on-chain (' + (holders.topHolderCount || list.length) + ')</h3><ol>';
+ for (const h of list) {
+ const amt = h.uiAmount != null ? Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 2 }).format(h.uiAmount) : '—';
+ html += '<li><span class="addr">' + shortAddr(h.address) + '</span><span class="amt">' + amt + '</span></li>';
+ }
+ html += '</ol></div>';
+ }
+ result.classList.remove('hidden');
+ result.innerHTML = html;
+}
+
+async function snapshot(mint) {
+ const token = (mint || input.value).trim();
+ if (!token) { input.focus(); return; }
+ input.value = token;
+ $('#apiExample').textContent = '/api/snapshot?token=' + token;
+ btn.disabled = true;
+ renderLoading();
+ try {
+ const res = await fetch('/api/snapshot?token=' + encodeURIComponent(token));
+ const data = await res.json();
+ if (!res.ok) { renderError(data.message || data.error || 'Request failed', data.error === 'invalid_mint' ? 'That does not look like a base58 Solana mint address.' : ''); return; }
+ render(data);
+ } catch (e) {
+ renderError('Network error', e.message);
+ } finally {
+ btn.disabled = false;
+ }
+}
+
+form.addEventListener('submit', (e) => { e.preventDefault(); snapshot(); });
+document.querySelectorAll('.examples a').forEach((a) => a.addEventListener('click', (e) => { e.preventDefault(); snapshot(a.dataset.mint); }));
+</script>
+</body>
+</html>`;
diff --git a/infra/lambda/pump-snapshot/package.json b/infra/lambda/pump-snapshot/package.json
new file mode 100644
index 000000000..602d3cd56
--- /dev/null
+++ b/infra/lambda/pump-snapshot/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "three-ws-pump-snapshot",
+ "version": "1.0.0",
+ "private": true,
+ "type": "module",
+ "description": "Zero-dependency Lambda: real-time pump.fun / Solana token snapshot API + demo page"
+}
diff --git a/infra/lib/three-ws-stack.ts b/infra/lib/three-ws-stack.ts
index ad63f8f06..980fa9a1e 100644
--- a/infra/lib/three-ws-stack.ts
+++ b/infra/lib/three-ws-stack.ts
@@ -1,6 +1,8 @@
import * as cdk from 'aws-cdk-lib';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as logs from 'aws-cdk-lib/aws-logs';
+import * as lambda from 'aws-cdk-lib/aws-lambda';
+import * as path from 'path';
import { Construct } from 'constructs';
export class ThreeWsStack extends cdk.Stack {
@@ -44,6 +46,49 @@ export class ThreeWsStack extends cdk.Stack {
removalPolicy: cdk.RemovalPolicy.RETAIN,
});
+ // ── Pump.fun Token Snapshot API ──────────────────────────────────────────
+ // Zero-dependency Node Lambda serving a live demo page (/) and a real-time
+ // token snapshot JSON API (/api/snapshot). Exposed publicly via a Lambda
+ // Function URL — no API Gateway needed. Source: infra/lambda/pump-snapshot.
+ const snapshotLogGroup = new logs.LogGroup(this, 'PumpSnapshotLogGroup', {
+ logGroupName: '/aws/lambda/three-ws-pump-snapshot',
+ retention: logs.RetentionDays.ONE_MONTH,
+ removalPolicy: cdk.RemovalPolicy.DESTROY,
+ });
+
+ const snapshotFn = new lambda.Function(this, 'PumpSnapshotFn', {
+ functionName: 'three-ws-pump-snapshot',
+ runtime: lambda.Runtime.NODEJS_22_X,
+ handler: 'index.handler',
+ code: lambda.Code.fromAsset(path.join(__dirname, '..', 'lambda', 'pump-snapshot')),
+ memorySize: 256,
+ timeout: cdk.Duration.seconds(15),
+ architecture: lambda.Architecture.ARM_64,
+ description: 'three.ws — real-time pump.fun / Solana token snapshot API',
+ environment: {
+ // Public mainnet RPC by default; set a dedicated RPC for production load.
+ SOLANA_RPC_URL: process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com',
+ // Optional: enables Helius DAS holder/supply enrichment when present.
+ HELIUS_API_KEY: process.env.HELIUS_API_KEY || '',
+ },
+ logGroup: snapshotLogGroup,
+ });
+
+ const snapshotUrl = snapshotFn.addFunctionUrl({
+ authType: lambda.FunctionUrlAuthType.NONE,
+ cors: {
+ allowedOrigins: ['*'],
+ allowedMethods: [lambda.HttpMethod.GET],
+ allowedHeaders: ['content-type'],
+ maxAge: cdk.Duration.hours(1),
+ },
+ });
+
+ new cdk.CfnOutput(this, 'PumpSnapshotUrl', {
+ value: snapshotUrl.url,
+ description: 'Public URL for the pump.fun token snapshot API + demo page',
+ });
+
// Associate this CloudFormation stack with the three.ws MyApplications entry.
// This surfaces all stack resources in the AWS MyApplications dashboard.
new cdk.CfnResource(this, 'AppRegistryAssociation', {
diff --git a/infra/package-lock.json b/infra/package-lock.json
new file mode 100644
index 000000000..f09c908ed
--- /dev/null
+++ b/infra/package-lock.json
@@ -0,0 +1,688 @@
+{
+ "name": "three-ws-infra",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "three-ws-infra",
+ "version": "1.0.0",
+ "dependencies": {
+ "aws-cdk-lib": "^2.180.0",
+ "constructs": "^10.4.2"
+ },
+ "devDependencies": {
+ "@types/node": "^22.0.0",
+ "aws-cdk": "^2.180.0",
+ "ts-node": "^10.9.2",
+ "typescript": "^5.7.0"
+ }
+ },
+ "node_modules/@aws-cdk/asset-awscli-v1": {
+ "version": "2.2.273",
+ "resolved": "https://registry.npmjs.org/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.273.tgz",
+ "integrity": "sha512-X57HYUtHt9BQrlrzUNcMyRsDUCoakYNnY6qh5lNwRCHPtQoTfXmuISkfLk0AjLkcbS5lw1LLTQFiQhTDXfiTvg==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@aws-cdk/asset-node-proxy-agent-v6": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.1.2.tgz",
+ "integrity": "sha512-pDiuqH+qY3zM9lhhLjbKJ1tnKOHzQ2V4Wr/3qsxyKeKAkuPMI/BVGvZG1PbrikUw949cGVTfVEt4ETKKYnrj0Q==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@aws-cdk/cloud-assembly-schema": {
+ "version": "53.28.0",
+ "resolved": "https://registry.npmjs.org/@aws-cdk/cloud-assembly-schema/-/cloud-assembly-schema-53.28.0.tgz",
+ "integrity": "sha512-pZS+9bLGv2tCqcgxfA0WD3XjcqT3yE4ICvKeJEicw6aTdCxBl8FQ/AUsorY/6f2JrMS3kUQgvhXxA30MWcji0A==",
+ "bundleDependencies": [
+ "jsonschema",
+ "semver"
+ ],
+ "license": "Apache-2.0",
+ "dependencies": {
+ "jsonschema": "^1.5.0",
+ "semver": "^7.8.0"
+ },
+ "engines": {
+ "node": ">= 18.0.0"
+ }
+ },
+ "node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema": {
+ "version": "1.5.0",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver": {
+ "version": "7.8.0",
+ "inBundle": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@cspotcode/source-map-support": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/trace-mapping": "0.3.9"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
+ "node_modules/@tsconfig/node10": {
+ "version": "1.0.12",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz",
+ "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@tsconfig/node12": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
+ "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@tsconfig/node14": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
+ "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@tsconfig/node16": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
+ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "22.19.19",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.19.tgz",
+ "integrity": "sha512-dyh/xO2Fh5bYrfWaaqGrRQQGkNdmYw6AmaAUvYeUMNTWQtvb796ikLdmTchRmOlOiIJ1TDXfWgVx1QkUlQ6Hew==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~6.21.0"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz",
+ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-walk": {
+ "version": "8.3.5",
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz",
+ "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "acorn": "^8.11.0"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/arg": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
+ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/aws-cdk": {
+ "version": "2.1125.0",
+ "resolved": "https://registry.npmjs.org/aws-cdk/-/aws-cdk-2.1125.0.tgz",
+ "integrity": "sha512-QAvsE2XQMcyNOjMMqAS7eDADR9t6vcFcMQvhOmtLfDqgfJXSyTkHvzM5zgwZCdJ4FNqWr5Y/zXvL1Cv5ECKXwQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "cdk": "bin/cdk"
+ },
+ "engines": {
+ "node": ">= 18.0.0"
+ }
+ },
+ "node_modules/aws-cdk-lib": {
+ "version": "2.257.0",
+ "resolved": "https://registry.npmjs.org/aws-cdk-lib/-/aws-cdk-lib-2.257.0.tgz",
+ "integrity": "sha512-GoHfWklrBJcMwLtDlY64pvaT7cD2KyDXC8sik89DR6jHl6nQsBtYTKSJCM+C/k4jgXaecbv8myNX75FySejq0A==",
+ "bundleDependencies": [
+ "@balena/dockerignore",
+ "@aws-cdk/cloud-assembly-api",
+ "case",
+ "fs-extra",
+ "ignore",
+ "jsonschema",
+ "minimatch",
+ "punycode",
+ "semver",
+ "table",
+ "yaml",
+ "mime-types"
+ ],
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@aws-cdk/asset-awscli-v1": "2.2.273",
+ "@aws-cdk/asset-node-proxy-agent-v6": "^2.1.1",
+ "@aws-cdk/cloud-assembly-api": "^2.2.4",
+ "@aws-cdk/cloud-assembly-schema": "^53.25.0",
+ "@balena/dockerignore": "^1.0.2",
+ "case": "1.6.3",
+ "fs-extra": "^11.3.3",
+ "ignore": "^5.3.2",
+ "jsonschema": "^1.5.0",
+ "mime-types": "^2.1.35",
+ "minimatch": "^10.2.3",
+ "punycode": "^2.3.1",
+ "semver": "^7.7.4",
+ "table": "^6.9.0",
+ "yaml": "1.10.3"
+ },
+ "engines": {
+ "node": ">= 20.0.0"
+ },
+ "peerDependencies": {
+ "constructs": "^10.5.0"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/@aws-cdk/cloud-assembly-api": {
+ "version": "2.2.4",
+ "inBundle": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "jsonschema": "^1.5.0",
+ "semver": "^7.8.0"
+ },
+ "engines": {
+ "node": ">= 18.0.0"
+ },
+ "peerDependencies": {
+ "@aws-cdk/cloud-assembly-schema": ">=53.25.0"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/@aws-cdk/cloud-assembly-api/node_modules/semver": {
+ "version": "7.8.0",
+ "inBundle": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/@balena/dockerignore": {
+ "version": "1.0.2",
+ "inBundle": true,
+ "license": "Apache-2.0"
+ },
+ "node_modules/aws-cdk-lib/node_modules/ajv": {
+ "version": "8.18.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/astral-regex": {
+ "version": "2.0.0",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/balanced-match": {
+ "version": "4.0.4",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/brace-expansion": {
+ "version": "5.0.5",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^4.0.2"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/case": {
+ "version": "1.6.3",
+ "inBundle": true,
+ "license": "(MIT OR GPL-3.0-or-later)",
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/color-convert": {
+ "version": "2.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/color-name": {
+ "version": "1.1.4",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/aws-cdk-lib/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/aws-cdk-lib/node_modules/fast-deep-equal": {
+ "version": "3.1.3",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/aws-cdk-lib/node_modules/fast-uri": {
+ "version": "3.1.2",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fastify"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fastify"
+ }
+ ],
+ "inBundle": true,
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/aws-cdk-lib/node_modules/fs-extra": {
+ "version": "11.3.3",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=14.14"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/graceful-fs": {
+ "version": "4.2.11",
+ "inBundle": true,
+ "license": "ISC"
+ },
+ "node_modules/aws-cdk-lib/node_modules/ignore": {
+ "version": "5.3.2",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/json-schema-traverse": {
+ "version": "1.0.0",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/aws-cdk-lib/node_modules/jsonfile": {
+ "version": "6.2.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/jsonschema": {
+ "version": "1.5.0",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/lodash.truncate": {
+ "version": "4.4.2",
+ "inBundle": true,
+ "license": "MIT"
+ },
+ "node_modules/aws-cdk-lib/node_modules/mime-db": {
+ "version": "1.52.0",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/mime-types": {
+ "version": "2.1.35",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/minimatch": {
+ "version": "10.2.5",
+ "inBundle": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "brace-expansion": "^5.0.5"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/punycode": {
+ "version": "2.3.1",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/require-from-string": {
+ "version": "2.0.2",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/semver": {
+ "version": "7.7.4",
+ "inBundle": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/slice-ansi": {
+ "version": "4.0.0",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "astral-regex": "^2.0.0",
+ "is-fullwidth-code-point": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/slice-ansi?sponsor=1"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/string-width": {
+ "version": "4.2.3",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/table": {
+ "version": "6.9.0",
+ "inBundle": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "ajv": "^8.0.1",
+ "lodash.truncate": "^4.4.2",
+ "slice-ansi": "^4.0.0",
+ "string-width": "^4.2.3",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/universalify": {
+ "version": "2.0.1",
+ "inBundle": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/aws-cdk-lib/node_modules/yaml": {
+ "version": "1.10.3",
+ "inBundle": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/constructs": {
+ "version": "10.6.0",
+ "resolved": "https://registry.npmjs.org/constructs/-/constructs-10.6.0.tgz",
+ "integrity": "sha512-TxHOnBO5zMo/G76ykzGF/wMpEHu257TbWiIxP9K0Yv/+t70UzgBQiTqjkAsWOPC6jW91DzJI0+ehQV6xDRNBuQ==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/create-require": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
+ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/diff": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz",
+ "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/make-error": {
+ "version": "1.3.6",
+ "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
+ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/ts-node": {
+ "version": "10.9.2",
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
+ "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@cspotcode/source-map-support": "^0.8.0",
+ "@tsconfig/node10": "^1.0.7",
+ "@tsconfig/node12": "^1.0.7",
+ "@tsconfig/node14": "^1.0.0",
+ "@tsconfig/node16": "^1.0.2",
+ "acorn": "^8.4.1",
+ "acorn-walk": "^8.1.1",
+ "arg": "^4.1.0",
+ "create-require": "^1.1.0",
+ "diff": "^4.0.1",
+ "make-error": "^1.1.1",
+ "v8-compile-cache-lib": "^3.0.1",
+ "yn": "3.1.1"
+ },
+ "bin": {
+ "ts-node": "dist/bin.js",
+ "ts-node-cwd": "dist/bin-cwd.js",
+ "ts-node-esm": "dist/bin-esm.js",
+ "ts-node-script": "dist/bin-script.js",
+ "ts-node-transpile-only": "dist/bin-transpile.js",
+ "ts-script": "dist/bin-script-deprecated.js"
+ },
+ "peerDependencies": {
+ "@swc/core": ">=1.2.50",
+ "@swc/wasm": ">=1.2.50",
+ "@types/node": "*",
+ "typescript": ">=2.7"
+ },
+ "peerDependenciesMeta": {
+ "@swc/core": {
+ "optional": true
+ },
+ "@swc/wasm": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/v8-compile-cache-lib": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
+ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/yn": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
+ "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ }
+ }
+}
diff --git a/multiplayer/src/index.js b/multiplayer/src/index.js
index 2cf035147..aad48f83d 100644
--- a/multiplayer/src/index.js
+++ b/multiplayer/src/index.js
@@ -11,6 +11,7 @@ import { WebSocketTransport } from '@colyseus/ws-transport';
import { monitor } from '@colyseus/monitor';
import { WalkRoom } from './rooms/WalkRoom.js';
+import { GameRoom } from './rooms/GameRoom.js';
const PORT = Number(process.env.PORT || 2567);
const HOST = process.env.HOST || '0.0.0.0';
@@ -86,6 +87,7 @@ const transport = new WebSocketTransport({
const gameServer = new Server({ transport });
gameServer.define('walk_world', WalkRoom);
+gameServer.define('game_mainland', GameRoom);
gameServer
.listen(PORT, HOST)
diff --git a/multiplayer/src/rooms/GameRoom.js b/multiplayer/src/rooms/GameRoom.js
new file mode 100644
index 000000000..4e946772c
Binary files /dev/null and b/multiplayer/src/rooms/GameRoom.js differ
diff --git a/multiplayer/src/rooms/mainland.js b/multiplayer/src/rooms/mainland.js
new file mode 100644
index 000000000..1393eb2a1
--- /dev/null
+++ b/multiplayer/src/rooms/mainland.js
@@ -0,0 +1,71 @@
+// Mainland realm definition — the authoritative map the GameRoom validates
+// against. The client renders the *same* layout from this data (it's also
+// imported browser-side), so the visual world and the walkable world can never
+// drift apart. Coordinates are tile indices on a GRID×GRID board.
+
+export const GRID = 48;
+
+// Solid, non-walkable rectangles (inclusive bounds). Buildings and the plaza
+// fountain. The map border is implicitly solid (see inBounds).
+const BLOCKED_RECTS = [
+ { x0: 8, y0: 8, x1: 12, y1: 11 }, // bank building footprint
+ { x0: 23, y0: 23, x1: 24, y1: 24 }, // plaza fountain (2×2)
+];
+
+// Hand-placed so the client and server agree exactly. Trees cluster in a grove
+// to the west; the rock/coal field sits to the northeast like a small mine.
+const TREES = [
+ [12, 28], [14, 30], [16, 29], [13, 33], [15, 35], [11, 31], [18, 34], [20, 30],
+ [17, 37], [19, 38], [10, 36], [22, 36], [8, 30], [9, 33], [21, 40], [13, 40],
+];
+const ROCKS = [
+ [34, 14], [36, 16], [38, 13], [40, 15], [35, 18], [39, 18], [42, 12], [33, 16],
+];
+const COAL = [
+ [37, 20], [41, 20], [34, 21], [39, 22],
+];
+
+function nodesFrom(coords, kind, prefix) {
+ return coords.map(([tx, ty], i) => ({ id: `${prefix}${i}`, kind, tx, ty }));
+}
+
+export const MAINLAND = {
+ name: 'mainland',
+ grid: GRID,
+ spawn: { tx: 24, ty: 30 },
+ fountain: { tx: 23, ty: 23 }, // top-left of the 2×2 plaza fountain
+
+ // Tiles where standing lets you open bank storage (the counter row directly
+ // south of the bank building). Must be walkable.
+ bankZone: [
+ { tx: 8, ty: 12 }, { tx: 9, ty: 12 }, { tx: 10, ty: 12 },
+ { tx: 11, ty: 12 }, { tx: 12, ty: 12 },
+ ],
+
+ nodes: [
+ ...nodesFrom(TREES, 'tree', 't'),
+ ...nodesFrom(ROCKS, 'rock', 'r'),
+ ...nodesFrom(COAL, 'coal', 'c'),
+ ],
+
+ // Training dummies near the armory ground (northeast of spawn).
+ mobs: [
+ { id: 'd0', kind: 'dummy', tx: 36, ty: 34, hp: 50 },
+ { id: 'd1', kind: 'dummy', tx: 38, ty: 34, hp: 50 },
+ { id: 'd2', kind: 'dummy', tx: 37, ty: 36, hp: 50 },
+ ],
+};
+
+export function inBounds(tx, ty) {
+ return tx >= 0 && ty >= 0 && tx < GRID && ty < GRID;
+}
+
+export function isBlocked(tx, ty) {
+ for (const r of BLOCKED_RECTS) {
+ if (tx >= r.x0 && tx <= r.x1 && ty >= r.y0 && ty <= r.y1) return true;
+ }
+ return false;
+}
+
+export const BANK_BUILDING = BLOCKED_RECTS[0];
+export const FOUNTAIN_RECT = BLOCKED_RECTS[1];
diff --git a/multiplayer/src/schemas/game.js b/multiplayer/src/schemas/game.js
new file mode 100644
index 000000000..a5f4f4620
--- /dev/null
+++ b/multiplayer/src/schemas/game.js
@@ -0,0 +1,163 @@
+// Game schema — authoritative state for the Kintara isometric MMO realm.
+//
+// Mirrors the design notes in the player guide: a tile world where players
+// gather resources, manage an inventory + hotbar, fight, bank items, and earn
+// gold. Like schemas.js (the /walk experience), every field here is paid for
+// on each delta patch, so we keep types primitive and the shapes flat.
+//
+// @colyseus/schema sends only the fields that changed since the last patch,
+// so large-but-stable structures (a 24-slot inventory) are cheap once synced.
+
+import { Schema, MapSchema, ArraySchema, defineTypes } from '@colyseus/schema';
+
+// ---------------------------------------------------------------------------
+// Inventory
+// ---------------------------------------------------------------------------
+
+// A single inventory / hotbar / bank slot. `item` is '' for an empty slot.
+// `qty` stacks up to 999 for stackable items (wood, stone, coal, fish, gold);
+// tools (axe, pickaxe, rod, hammer, sword) are non-stackable (qty stays 1).
+export class Slot extends Schema {
+ constructor(item = '', qty = 0) {
+ super();
+ this.item = item;
+ this.qty = qty;
+ }
+}
+defineTypes(Slot, { item: 'string', qty: 'uint16' });
+
+// ---------------------------------------------------------------------------
+// Player
+// ---------------------------------------------------------------------------
+
+export class GamePlayer extends Schema {
+ constructor() {
+ super();
+ this.id = '';
+ this.name = 'guest';
+ this.color = 0xffffff;
+
+ // Tile position (grid coordinates) + a render-facing yaw for facing.
+ this.tx = 0;
+ this.ty = 0;
+ this.yaw = 0;
+ this.motion = 'idle'; // 'idle' | 'walk'
+
+ // Vitals + currency.
+ this.hp = 100;
+ this.maxHp = 100;
+ this.gold = 0;
+ this.dead = false;
+ this.respawnAt = 0; // epoch ms the player can act again after dying
+
+ // Skills (levels). XP is tracked server-side off-schema; only the level
+ // is broadcast since that's all clients render.
+ this.combat = 1;
+ this.woodcutting = 1;
+ this.mining = 1;
+ this.fishing = 1;
+
+ // 24-slot backpack + 6 hotbar slots. Fixed length so indices are stable
+ // references the client can drag between.
+ this.inv = new ArraySchema();
+ this.hotbar = new ArraySchema();
+ this.activeSlot = -1; // index into hotbar; -1 = nothing equipped
+
+ this.tsServer = 0;
+ }
+}
+defineTypes(GamePlayer, {
+ id: 'string',
+ name: 'string',
+ color: 'uint32',
+ tx: 'int16',
+ ty: 'int16',
+ yaw: 'float32',
+ motion: 'string',
+ hp: 'int16',
+ maxHp: 'int16',
+ gold: 'uint32',
+ dead: 'boolean',
+ respawnAt: 'float64',
+ combat: 'uint16',
+ woodcutting: 'uint16',
+ mining: 'uint16',
+ fishing: 'uint16',
+ inv: [Slot],
+ hotbar: [Slot],
+ activeSlot: 'int8',
+ tsServer: 'float64',
+});
+
+// ---------------------------------------------------------------------------
+// World objects
+// ---------------------------------------------------------------------------
+
+// A harvestable node (tree, rock, coal). When `depleted` it renders as a stump
+// and respawns at `respawnAt`. `kind` drives which tool + skill applies.
+export class ResourceNode extends Schema {
+ constructor() {
+ super();
+ this.id = '';
+ this.kind = 'tree'; // 'tree' | 'rock' | 'coal'
+ this.tx = 0;
+ this.ty = 0;
+ this.depleted = false;
+ this.respawnAt = 0; // epoch ms it comes back
+ }
+}
+defineTypes(ResourceNode, {
+ id: 'string',
+ kind: 'string',
+ tx: 'int16',
+ ty: 'int16',
+ depleted: 'boolean',
+ respawnAt: 'float64',
+});
+
+// A combat target (training dummy for the slice; same shape extends to mobs).
+export class Mob extends Schema {
+ constructor() {
+ super();
+ this.id = '';
+ this.kind = 'dummy';
+ this.tx = 0;
+ this.ty = 0;
+ this.hp = 50;
+ this.maxHp = 50;
+ this.dead = false;
+ this.respawnAt = 0;
+ this.hitTs = 0; // epoch ms of last hit, for client flash
+ }
+}
+defineTypes(Mob, {
+ id: 'string',
+ kind: 'string',
+ tx: 'int16',
+ ty: 'int16',
+ hp: 'int16',
+ maxHp: 'int16',
+ dead: 'boolean',
+ respawnAt: 'float64',
+ hitTs: 'float64',
+});
+
+// ---------------------------------------------------------------------------
+// Root state
+// ---------------------------------------------------------------------------
+
+export class GameState extends Schema {
+ constructor() {
+ super();
+ this.realm = 'mainland';
+ this.players = new MapSchema();
+ this.nodes = new MapSchema();
+ this.mobs = new MapSchema();
+ }
+}
+defineTypes(GameState, {
+ realm: 'string',
+ players: { map: GamePlayer },
+ nodes: { map: ResourceNode },
+ mobs: { map: Mob },
+});
diff --git a/pages/walk.html b/pages/walk.html
index c94cb25cd..df6f23be6 100644
--- a/pages/walk.html
+++ b/pages/walk.html
@@ -206,7 +206,11 @@
#walk-joystick,
#walk-look-joystick {
position: fixed;
- z-index: 5;
+ /* Above the bottom HUD (chat z8, status/record z6, emote z5) so a
+ touch inside a stick's 140px square always reaches nipplejs
+ instead of the chat input or status pill stacked over it. Stays
+ below real modals (avatar picker z10, zen z11, palettes z9998+). */
+ z-index: 9;
bottom: calc(28px + env(safe-area-inset-bottom, 0));
width: 140px;
height: 140px;
@@ -840,7 +844,11 @@
}
.walk-chat-send:hover { background: rgba(255,255,255,0.12); }
@media (hover: none) {
- .walk-chat { width: min(300px, calc(100vw - 200px)); bottom: calc(80px + env(safe-area-inset-bottom, 0)); }
+ /* Lift the chat clear of the move/look sticks, which now own both
+ bottom corners up to ~168px. Sitting it above that band keeps the
+ input tappable instead of buried under a joystick. */
+ .walk-chat { width: min(340px, calc(100vw - 32px)); bottom: calc(184px + env(safe-area-inset-bottom, 0)); }
+ .walk-chat-messages { max-height: 120px; }
}
/* ── Chat bubble above remote players ───────────────────────────── */
diff --git a/public/nav.html b/public/nav.html
index 83aef0e84..481f399c0 100644
--- a/public/nav.html
+++ b/public/nav.html
@@ -30,7 +30,7 @@
>
</li>
<li role="none">
- <a href="/create-selfie" role="menuitem"
+ <a href="/create/selfie" role="menuitem"
><span class="nav-mi-title">Selfie to avatar<span class="nav-pill" aria-hidden="true">NEW</span></span
><span class="nav-mi-sub">One photo → rigged 3D avatar</span></a
>
@@ -290,12 +290,6 @@
><span class="nav-mi-sub">Place your avatar in the real world — WebXR &amp; AR</span></a
>
</li>
- <li role="none">
- <a href="/pretext-demo" role="menuitem"
- ><span class="nav-mi-title">Pretext demo</span
- ><span class="nav-mi-sub">Give your AI a body</span></a
- >
- </li>
<li role="none">
<a href="/gmgn" role="menuitem"
><span class="nav-mi-title">GMGN Smart Money<span class="nav-pill" aria-hidden="true">NEW</span></span
diff --git a/scripts/verify-walk-mobile.mjs b/scripts/verify-walk-mobile.mjs
new file mode 100644
index 000000000..74bf5354a
--- /dev/null
+++ b/scripts/verify-walk-mobile.mjs
@@ -0,0 +1,87 @@
+// Verifies the /walk mobile-touch fixes:
+// 1. joystick z-index lifts above the bottom HUD (z9)
+// 2. on touch, the chat sits above the joystick band (~184px from bottom)
+// 3. on touch, the keyboard help overlay does NOT auto-show on first visit
+// (and, as a control, DOES auto-show on desktop)
+import puppeteer from 'puppeteer';
+
+const URL = process.env.WALK_URL || 'http://localhost:3000/walk';
+
+async function probe({ touch }) {
+ const browser = await puppeteer.launch({
+ headless: 'new',
+ args: ['--no-sandbox', '--disable-setuid-sandbox'],
+ });
+ const page = await browser.newPage();
+ if (touch) {
+ // hasTouch + isMobile makes Chrome report pointer:coarse / hover:none
+ // and exposes ontouchstart — both branches of IS_TOUCH are satisfied.
+ await page.setViewport({ width: 375, height: 812, isMobile: true, hasTouch: true, deviceScaleFactor: 3 });
+ } else {
+ await page.setViewport({ width: 1440, height: 900, isMobile: false, hasTouch: false });
+ }
+ const consoleErrors = [];
+ page.on('console', (m) => { if (m.type() === 'error') consoleErrors.push(m.text()); });
+ page.on('pageerror', (e) => consoleErrors.push('pageerror: ' + e.message));
+
+ // The walk page holds open sockets (multiplayer) so it never reaches
+ // networkidle — wait for DOM + a settle window for joystick/help mount.
+ await page.goto(URL, { waitUntil: 'domcontentloaded', timeout: 45000 });
+ await page.waitForSelector('#walk-joystick', { timeout: 20000 }).catch(() => {});
+ await new Promise((r) => setTimeout(r, 2500));
+
+ const result = await page.evaluate(() => {
+ const isTouchDetected = matchMedia('(hover: none) and (pointer: coarse)').matches
+ || ('ontouchstart' in window && navigator.maxTouchPoints > 0);
+ const cs = (sel) => {
+ const el = document.querySelector(sel);
+ if (!el) return null;
+ const s = getComputedStyle(el);
+ const r = el.getBoundingClientRect();
+ return { zIndex: s.zIndex, bottom: s.bottom, width: s.width, display: s.display,
+ visible: r.width > 0 && r.height > 0 && s.display !== 'none' };
+ };
+ const overlay = document.getElementById('walk-help-overlay');
+ return {
+ isTouchDetected,
+ joystick: cs('#walk-joystick'),
+ lookJoystick: cs('#walk-look-joystick'),
+ chat: cs('.walk-chat'),
+ helpOverlay: overlay ? {
+ ariaHidden: overlay.getAttribute('aria-hidden'),
+ opacity: getComputedStyle(overlay).opacity,
+ } : null,
+ };
+ });
+ await browser.close();
+ return { ...result, consoleErrors };
+}
+
+const mobile = await probe({ touch: true });
+const desktop = await probe({ touch: false });
+
+const checks = [];
+const ok = (name, pass, detail) => checks.push({ name, pass, detail });
+
+ok('mobile: touch detected', mobile.isTouchDetected === true, `IS_TOUCH=${mobile.isTouchDetected}`);
+ok('mobile: joystick z-index = 9', mobile.joystick?.zIndex === '9', `z=${mobile.joystick?.zIndex}`);
+ok('mobile: look-joystick z-index = 9', mobile.lookJoystick?.zIndex === '9', `z=${mobile.lookJoystick?.zIndex}`);
+ok('mobile: chat lifted above stick band (bottom ≥ 180px)',
+ parseFloat(mobile.chat?.bottom) >= 180, `bottom=${mobile.chat?.bottom}`);
+ok('mobile: help overlay NOT auto-shown',
+ !mobile.helpOverlay || mobile.helpOverlay.ariaHidden === 'true' || mobile.helpOverlay.opacity === '0',
+ `aria-hidden=${mobile.helpOverlay?.ariaHidden} opacity=${mobile.helpOverlay?.opacity}`);
+ok('mobile: no console errors', mobile.consoleErrors.length === 0, mobile.consoleErrors.slice(0, 3).join(' | '));
+
+ok('desktop control: touch NOT detected', desktop.isTouchDetected === false, `IS_TOUCH=${desktop.isTouchDetected}`);
+ok('desktop control: help overlay DOES auto-show (proves guard is the suppressor)',
+ desktop.helpOverlay && desktop.helpOverlay.ariaHidden === 'false',
+ `aria-hidden=${desktop.helpOverlay?.ariaHidden} opacity=${desktop.helpOverlay?.opacity}`);
+
+let failed = 0;
+for (const c of checks) {
+ console.log(`${c.pass ? 'PASS' : 'FAIL'} ${c.name}${c.detail ? ` (${c.detail})` : ''}`);
+ if (!c.pass) failed++;
+}
+console.log(`\n${checks.length - failed}/${checks.length} checks passed`);
+process.exit(failed ? 1 : 0);
diff --git a/src/walk.js b/src/walk.js
index a740d3332..e528321bc 100644
--- a/src/walk.js
+++ b/src/walk.js
@@ -2511,6 +2511,11 @@ function updateMinimapFrame() {
// ── Help overlay first-visit auto-show ───────────────────────────────────
const HELP_FIRST_VISIT_KEY = 'walk:help-shown';
function showHelpOnFirstVisit() {
+ // The overlay is a keyboard cheat-sheet (WASD/Shift/Space) and its card is
+ // tall enough to cover the joystick on a phone. Both are wrong on touch, so
+ // skip the auto-popup there — the on-screen sticks are self-explanatory and
+ // the help button still opens it on demand.
+ if (IS_TOUCH) return;
try {
if (localStorage.getItem(HELP_FIRST_VISIT_KEY) === '1') return;
localStorage.setItem(HELP_FIRST_VISIT_KEY, '1');