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: privy-login overhaul, SNS updates, blog/home pages, SDK bridge

nirholas9749d8f0e461
diff --git a/api/_lib/rss-feed.js b/api/_lib/rss-feed.js
index 6de89906e..43cae2ff9 100644
--- a/api/_lib/rss-feed.js
+++ b/api/_lib/rss-feed.js
@@ -11,7 +11,6 @@ const DATA_ROOT = path.resolve(fileURLToPath(import.meta.url), '..', '..', '..',
const ARCHIVES_DIR = path.join(DATA_ROOT, 'archives');
const CURATED_FILE = path.join(DATA_ROOT, 'rss', 'items.json');
const MIN_LENGTH = 140;
-const MAX_ITEMS = 50;
export const SITE_ORIGIN = 'https://three.ws';
export const NEWS_PATH_PREFIX = '/news';
@@ -83,7 +82,7 @@ export async function loadCuratedItems({ includeDrafts = false } = {}) {
});
}
items.sort((a, b) => b.timestamp - a.timestamp);
- return items.slice(0, MAX_ITEMS);
+ return items;
}
function deriveSummary(html) {
@@ -138,7 +137,6 @@ export async function loadAnnouncementItems({ source = 'all' } = {}) {
if (seen.has(it.id)) continue;
seen.add(it.id);
deduped.push(it);
- if (deduped.length >= MAX_ITEMS) break;
}
return deduped;
}
diff --git a/api/_lib/solana/sdk-bridge.js b/api/_lib/solana/sdk-bridge.js
index 07e7c4150..abc4e98bc 100644
--- a/api/_lib/solana/sdk-bridge.js
+++ b/api/_lib/solana/sdk-bridge.js
@@ -31,6 +31,11 @@ async function fetchState(connection, mint) {
sdk.fetchFeeConfig(),
sdk.fetchBondingCurve(mint),
]);
+ // A graduated coin has virtualTokenReserves = 0 (fully migrated to a DEX).
+ // All SDK price/quote helpers divide by this value, so guard here once.
+ if (bondingCurve.virtualTokenReserves.isZero()) {
+ throw Object.assign(new Error('coin is graduated — no bonding curve price'), { graduated: true });
+ }
const mintSupply = bondingCurve.tokenTotalSupply.sub(bondingCurve.virtualTokenReserves);
return { sdk, global, feeConfig, bondingCurve, mintSupply };
}
diff --git a/api/sns.js b/api/sns.js
index 4e8dfd542..771f6dfe1 100644
--- a/api/sns.js
+++ b/api/sns.js
@@ -1,6 +1,13 @@
// GET /api/sns?name=<label>[.sol] → resolve .sol → owner base58
// GET /api/sns?address=<base58> → reverse-lookup wallet → primary .sol
//
+// Both directions always answer 200 with a `{ data: { name, address, network,
+// resolved } }` envelope. A miss is `resolved: false` with the unresolved side
+// set to null — NOT a 404. A reverse lookup ("does this wallet have a favorite
+// .sol?") runs automatically on page load for any wallet, so "no domain" is an
+// expected, routine answer; surfacing it as a 404 only spammed the browser
+// console with phantom failures. Malformed input is still a 400.
+//
// Public, rate-limited per IP. Both directions are cached in-process for
// 5 minutes (negative results for 60s) so repeated UX previews don't hammer
// the Bonfida RPC pool. Mainnet only — SNS is not deployed on devnet.
@@ -69,12 +76,11 @@ export default wrap(async (req, res) => {
setCached(forwardCache, bare, address);
}
if (!address) {
- return json(res, 404, {
- error: 'not_found',
- error_description: `${domain} does not resolve`,
+ return json(res, 200, {
+ data: { name: domain, address: null, network: 'solana', resolved: false },
}, { 'cache-control': 'public, max-age=30' });
}
- return json(res, 200, { data: { name: domain, address, network: 'solana' } }, {
+ return json(res, 200, { data: { name: domain, address, network: 'solana', resolved: true } }, {
'cache-control': 'public, max-age=300',
});
}
@@ -88,12 +94,11 @@ export default wrap(async (req, res) => {
setCached(reverseCache, addr, name);
}
if (!name) {
- return json(res, 404, {
- error: 'not_found',
- error_description: 'no primary .sol domain set for this address',
+ return json(res, 200, {
+ data: { name: null, address: addr, network: 'solana', resolved: false },
}, { 'cache-control': 'public, max-age=30' });
}
- return json(res, 200, { data: { name, address: addr, network: 'solana' } }, {
+ return json(res, 200, { data: { name, address: addr, network: 'solana', resolved: true } }, {
'cache-control': 'public, max-age=300',
});
}
diff --git a/blog/index.html b/blog/index.html
index d88881d82..20b249dd0 100644
--- a/blog/index.html
+++ b/blog/index.html
@@ -41,6 +41,14 @@
.bl-tag { padding: 2px 8px; border-radius: 999px; background: rgba(154,212,255,.08); color: #9ad4ff; font-size: 11px; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.bl-title { font-size: 22px; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.01em; line-height: 1.25; color: #fff; }
.bl-summary { color: #b6b6cf; font-size: 15px; line-height: 1.55; margin: 0; }
+ .bl-press { margin-top: 64px; padding-top: 48px; border-top: 1px solid rgba(255,255,255,.08); }
+ .bl-press-heading { font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: 0.12em; color: #7a85a8; margin: 0 0 20px; }
+ .bl-press-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
+ .bl-press-card { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.015); color: inherit; text-decoration: none; transition: background .15s, border-color .15s, transform .15s; position: relative; }
+ .bl-press-card:hover { background: rgba(120,140,255,.06); border-color: rgba(150,170,255,.3); transform: translateY(-1px); }
+ .bl-press-outlet { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #9ad4ff; }
+ .bl-press-title { font-size: 15px; font-weight: 500; color: #e7e7f5; line-height: 1.4; }
+ .bl-press-arrow { position: absolute; top: 20px; right: 20px; font-size: 14px; color: #7a85a8; }
</style>
</head>
<body>
@@ -326,7 +334,25 @@
</li>
</ul>
+
+ <section class="bl-press">
+ <h2 class="bl-press-heading">In the press</h2>
+ <div class="bl-press-grid">
+ <a class="bl-press-card" href="https://markets.businessinsider.com/news/stocks/three-ws-and-ibm-announce-strategic-partnership-to-advance-ai-powered-3d-agent-technology-1036222181" target="_blank" rel="noopener">
+ <span class="bl-press-outlet">Business Insider</span>
+ <span class="bl-press-title">three.ws and IBM Announce Strategic Partnership to Advance AI-Powered 3D Agent Technology</span>
+ <span class="bl-press-arrow">↗</span>
+ </a>
+ <a class="bl-press-card" href="https://finance.yahoo.com/sectors/technology/articles/ibm-extends-ai-narrative-three-010650764.html" target="_blank" rel="noopener">
+ <span class="bl-press-outlet">Yahoo Finance</span>
+ <span class="bl-press-title">IBM Extends AI Narrative with three.ws Partnership</span>
+ <span class="bl-press-arrow">↗</span>
+ </a>
+ </div>
+ </section>
</main>
+ <div id="footer-container"></div>
<script src="/nav.js"></script>
+ <script src="/footer.js"></script>
</body>
</html>
diff --git a/pages/home.html b/pages/home.html
index b1a720206..a01d24f49 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -1029,6 +1029,16 @@
color: var(--text-4); font-size: 13px; font-family: var(--font-mono);
letter-spacing: 0.04em;
}
+ .foot-ca {
+ display: flex; align-items: center; gap: 8px;
+ background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
+ border-radius: 999px; padding: 5px 12px; cursor: pointer;
+ font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3);
+ transition: background .15s, border-color .15s, color .15s;
+ }
+ .foot-ca:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: var(--text); }
+ .foot-ca-label { color: #9ad4ff; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
+ .foot-ca-addr { opacity: .7; }
/* ── MOBILE NAV ─────────────────────────────────────────── */
.nav-toggle {
@@ -3931,6 +3941,10 @@
</nav>
<div class="foot-inner">
<div>© 2026 · three.ws · the 3D agent layer of the internet</div>
+ <button class="foot-ca" id="foot-ca-btn" title="Copy contract address">
+ <span class="foot-ca-label">$THREE</span>
+ <span class="foot-ca-addr" id="foot-ca-addr">FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump</span>
+ </button>
</div>
</div>
</footer>
@@ -6093,5 +6107,20 @@
</script>
<script src="/brand.js" defer></script>
<script src="/getting-started.js" defer></script>
+ <script>
+ (function () {
+ var btn = document.getElementById('foot-ca-btn');
+ var addr = document.getElementById('foot-ca-addr');
+ if (!btn || !addr) return;
+ var CA = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';
+ btn.addEventListener('click', function () {
+ navigator.clipboard.writeText(CA).then(function () {
+ var orig = addr.textContent;
+ addr.textContent = 'Copied!';
+ setTimeout(function () { addr.textContent = orig; }, 1500);
+ });
+ });
+ })();
+ </script>
</body>
</html>
diff --git a/scripts/bundle-api.mjs b/scripts/bundle-api.mjs
index 4f8401253..a6f48adf0 100644
--- a/scripts/bundle-api.mjs
+++ b/scripts/bundle-api.mjs
@@ -108,7 +108,10 @@ const EXTERNALS = [
// font read ENOENTs at load. External keeps the package (and its font assets)
// resolvable from node_modules at runtime.
'@vercel/og',
- 'jsdom',
+ // jsdom removed: api/_lib/text-extract.js now uses node-html-parser, so
+ // no API route imports jsdom. Keeping it external caused NFT to bundle the
+ // jsdom→html-encoding-sniffer@6→@exodus/bytes (ESM-only) chain into every
+ // widgets function, crashing them with ERR_REQUIRE_ESM at cold start.
'ethers',
'@elevenlabs/elevenlabs-js',
'playwright',
diff --git a/scripts/run-migrations.mjs b/scripts/run-migrations.mjs
index 579a2bbe2..05cd4a6ef 100644
--- a/scripts/run-migrations.mjs
+++ b/scripts/run-migrations.mjs
@@ -71,13 +71,18 @@ const __dir = dirname(fileURLToPath(import.meta.url));
const MIGRATIONS_DIR = join(__dir, '../api/_lib/migrations');
async function main() {
- // Ensure tracking table exists.
+ // Ensure tracking table exists (sha256 column aligns with apply-migrations.mjs schema).
await sql`
CREATE TABLE IF NOT EXISTS schema_migrations (
filename text PRIMARY KEY,
+ sha256 text,
applied_at timestamptz NOT NULL DEFAULT now()
)
`;
+ // Add sha256 column to pre-existing tables that were created without it.
+ await sql`
+ ALTER TABLE schema_migrations ADD COLUMN IF NOT EXISTS sha256 text
+ `;
const applied = new Set(
(await sql`SELECT filename FROM schema_migrations`).map(r => r.filename)
diff --git a/src/agent-detail.js b/src/agent-detail.js
index 991e4a135..c8a4280a2 100644
--- a/src/agent-detail.js
+++ b/src/agent-detail.js
@@ -909,11 +909,6 @@ function makeSnsResolver(inputEl, statusEl) {
credentials: 'include',
});
if (myId !== seq) return null; // superseded
- if (r.status === 404) {
- setStatus('warn', `${name} does not resolve`);
- lastResolved = null;
- return null;
- }
if (!r.ok) {
const j = await r.json().catch(() => ({}));
setStatus('warn', j?.error_description || `lookup failed (${r.status})`);
@@ -922,6 +917,12 @@ function makeSnsResolver(inputEl, statusEl) {
}
const { data } = await r.json();
if (myId !== seq) return null;
+ // A miss is now a 200 with `resolved: false` / `address: null`, not a 404.
+ if (!data?.address) {
+ setStatus('warn', `${name} does not resolve`);
+ lastResolved = null;
+ return null;
+ }
setStatus('ok', `→ ${data.address}`);
lastResolved = { name: data.name, address: data.address };
return lastResolved;
diff --git a/src/dashboard-next/pages/account.js b/src/dashboard-next/pages/account.js
index 00fa0b30f..3a85e990b 100644
--- a/src/dashboard-next/pages/account.js
+++ b/src/dashboard-next/pages/account.js
@@ -554,9 +554,9 @@ async function renderSns(host, wallets) {
solanaWallets.map(async (w) => {
try {
const r = await get(`/api/sns?address=${encodeURIComponent(w.address)}`);
- return { wallet: w, domain: r?.data?.name || null, status: 'Active' };
- } catch (err) {
- return { wallet: w, domain: null, status: err?.status === 404 ? null : 'error' };
+ return { wallet: w, domain: r?.data?.name || null };
+ } catch {
+ return { wallet: w, domain: null };
}
}),
);
diff --git a/src/privy-login.js b/src/privy-login.js
index 598408817..31734f25b 100644
--- a/src/privy-login.js
+++ b/src/privy-login.js
@@ -1,5 +1,5 @@
-// Privy headless email-OTP auth for login and register pages.
-// Wires up the #privy-section UI block that both pages include.
+// Privy headless auth for login and register pages.
+// Handles email-OTP and EVM wallet (SIWE via Privy).
// On success POSTs the Privy identity_token to /api/auth/privy/verify
// which issues our standard session cookie, then redirects.
@@ -38,10 +38,32 @@ if (!appId) {
mountPrivyUI(privy);
}
+// ── Shared backend verify ─────────────────────────────────────────────────────
+
+async function verifyWithBackend(identity_token) {
+ const res = await fetch('/api/auth/privy/verify', {
+ method: 'POST',
+ credentials: 'include',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({ token: identity_token }),
+ });
+ const data = await res.json().catch(() => ({}));
+ if (!res.ok) throw new Error(data.error_description || 'Sign-in failed.');
+
+ try {
+ localStorage.setItem(
+ '3dagent:auth-hint',
+ JSON.stringify({ authed: true, name: data.user?.display_name || '', ts: Date.now() }),
+ );
+ } catch { /* ignore */ }
+
+ location.href = next;
+}
+
// ── UI ───────────────────────────────────────────────────────────────────────
function mountPrivyUI(privy) {
- // Elements
+ // Elements — email OTP
const toggleBtn = document.getElementById('privy-toggle-btn');
const expandedArea = document.getElementById('privy-expanded');
const stepEmail = document.getElementById('privy-step-email');
@@ -53,6 +75,11 @@ function mountPrivyUI(privy) {
const backBtn = document.getElementById('privy-back-btn');
const errEl = document.getElementById('privy-inline-err');
+ // Elements — wallet
+ const walletWrap = document.getElementById('privy-wallet-wrap');
+ const walletBtn = document.getElementById('privy-wallet-btn');
+ const walletStatus = document.getElementById('privy-wallet-status');
+
if (!toggleBtn || !expandedArea) return;
let pendingEmail = '';
@@ -76,19 +103,23 @@ function mountPrivyUI(privy) {
clearErr();
if (emailInput) emailInput.value = '';
if (codeInput) codeInput.value = '';
+ if (walletStatus) { walletStatus.textContent = ''; walletStatus.hidden = true; }
}
function showStep(step) {
clearErr();
- stepEmail.hidden = step !== 'email';
- stepCode.hidden = step !== 'code';
+ stepEmail.hidden = step !== 'email';
+ stepCode.hidden = step !== 'code';
+ // Wallet option only shown on email step
+ if (walletWrap) walletWrap.hidden = step !== 'email';
}
// Open / close
toggleBtn.addEventListener('click', expand);
backBtn?.addEventListener('click', collapse);
- // Send OTP code
+ // ── Email OTP ──────────────────────────────────────────────────────────────
+
sendBtn?.addEventListener('click', async () => {
const email = emailInput?.value.trim();
if (!email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
@@ -109,12 +140,10 @@ function mountPrivyUI(privy) {
}
});
- // Keyboard submit on email field
emailInput?.addEventListener('keydown', (e) => {
if (e.key === 'Enter') { e.preventDefault(); sendBtn?.click(); }
});
- // Verify OTP code
verifyBtn?.addEventListener('click', async () => {
const code = codeInput?.value.trim();
if (!code || code.length < 4) {
@@ -126,25 +155,8 @@ function mountPrivyUI(privy) {
try {
const { identity_token } = await privy.auth.email.loginWithCode(pendingEmail, code);
if (!identity_token) throw new Error('No identity token returned.');
-
verifyBtn.textContent = 'Signing in…';
- const res = await fetch('/api/auth/privy/verify', {
- method: 'POST',
- credentials: 'include',
- headers: { 'content-type': 'application/json' },
- body: JSON.stringify({ token: identity_token }),
- });
- const data = await res.json().catch(() => ({}));
- if (!res.ok) throw new Error(data.error_description || 'Sign-in failed.');
-
- try {
- localStorage.setItem(
- '3dagent:auth-hint',
- JSON.stringify({ authed: true, name: data.user?.display_name || '', ts: Date.now() }),
- );
- } catch { /* ignore */ }
-
- location.href = next;
+ await verifyWithBackend(identity_token);
} catch (e) {
showErr(e?.message || 'Verification failed. Check the code and try again.');
verifyBtn.disabled = false;
@@ -152,13 +164,61 @@ function mountPrivyUI(privy) {
}
});
- // Keyboard submit on code field
codeInput?.addEventListener('keydown', (e) => {
if (e.key === 'Enter') { e.preventDefault(); verifyBtn?.click(); }
});
- // Auto-format OTP (digits only)
codeInput?.addEventListener('input', () => {
codeInput.value = codeInput.value.replace(/\D/g, '').slice(0, 6);
});
+
+ // ── EVM Wallet (SIWE via Privy) ────────────────────────────────────────────
+
+ walletBtn?.addEventListener('click', async () => {
+ if (!window.ethereum) {
+ showErr('No wallet detected. Install MetaMask or another browser wallet.');
+ return;
+ }
+ walletBtn.disabled = true;
+ walletBtn.textContent = 'Connecting…';
+ if (walletStatus) { walletStatus.textContent = 'Requesting accounts…'; walletStatus.hidden = false; }
+ clearErr();
+
+ try {
+ const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });
+ const address = accounts[0];
+ if (!address) throw new Error('No account returned from wallet.');
+
+ const chainIdHex = await window.ethereum.request({ method: 'eth_chainId' });
+ const chainId = parseInt(chainIdHex, 16);
+
+ if (walletStatus) walletStatus.textContent = 'Generating sign-in message…';
+ const { message } = await privy.auth.siwe.init(
+ { address, chainId },
+ location.hostname,
+ location.origin,
+ );
+
+ if (walletStatus) walletStatus.textContent = 'Sign the message in your wallet…';
+ const signature = await window.ethereum.request({
+ method: 'personal_sign',
+ params: [message, address],
+ });
+
+ if (walletStatus) walletStatus.textContent = 'Signing in…';
+ const { identity_token } = await privy.auth.siwe.loginWithSiwe(signature);
+ if (!identity_token) throw new Error('No identity token returned.');
+
+ await verifyWithBackend(identity_token);
+ } catch (e) {
+ const raw = e?.message || '';
+ const msg = /reject|denied|cancel|user refused/i.test(raw)
+ ? 'Signature cancelled.'
+ : raw || 'Wallet sign-in failed.';
+ showErr(msg);
+ walletBtn.disabled = false;
+ walletBtn.textContent = 'Connect Wallet';
+ if (walletStatus) { walletStatus.textContent = ''; walletStatus.hidden = true; }
+ }
+ });
}
diff --git a/tests/api/sns.test.js b/tests/api/sns.test.js
index da7ab14c1..4c305da3d 100644
--- a/tests/api/sns.test.js
+++ b/tests/api/sns.test.js
@@ -56,7 +56,7 @@ describe('GET /api/sns?name=…', () => {
resolveSnsName.mockResolvedValue(ADDR);
const { res, body } = await call('/api/sns?name=bonfida.sol');
expect(res.statusCode).toBe(200);
- expect(body.data).toEqual({ name: 'bonfida.sol', address: ADDR, network: 'solana' });
+ expect(body.data).toEqual({ name: 'bonfida.sol', address: ADDR, network: 'solana', resolved: true });
expect(res.getHeader('cache-control')).toMatch(/max-age=300/);
expect(resolveSnsName).toHaveBeenCalledWith('bonfida');
});