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: walk record + AR CTA, deploy mirror, home features section, discover routing

nirholas6bd8c508f5e9
diff --git a/api/agents/sns.js b/api/agents/sns.js
index 85e255adc..b497838d5 100644
--- a/api/agents/sns.js
+++ b/api/agents/sns.js
@@ -159,7 +159,13 @@ async function handleRegisterAgent(req, res, id, auth) {
data: { ok: true, address: meta.solana_address, sns_domain: domain, signature: sig, mode: 'agent' },
});
} catch (err) {
- console.error('[agents/sns/register-agent] failed', err);
+ console.error('[agents/sns/register-agent] failed', {
+ agentId: id,
+ domain,
+ agentAddress: meta.solana_address,
+ err: err?.message,
+ stack: err?.stack,
+ });
const msg = err?.message || 'registration failed';
return error(res, 502, 'upstream_error', msg);
}
@@ -189,25 +195,36 @@ async function handleRegisterPrep(req, res, id, auth) {
`;
if (!walletRow) return error(res, 403, 'forbidden', 'wallet not linked to your account');
- const { PublicKey, TransactionMessage, VersionedTransaction } = await import('@solana/web3.js');
- const conn = solanaConnection('mainnet');
- if (await getRegistryOwner(conn, domain).catch(() => null)) {
- return error(res, 409, 'conflict', `${domain}.sol is already registered`);
- }
+ try {
+ const { PublicKey, TransactionMessage, VersionedTransaction } = await import('@solana/web3.js');
+ const conn = solanaConnection('mainnet');
+ if (await getRegistryOwner(conn, domain).catch(() => null)) {
+ return error(res, 409, 'conflict', `${domain}.sol is already registered`);
+ }
- const buyer = new PublicKey(walletAddress);
- const ixs = await buildRegisterIxs({ connection: conn, domain, buyer, space });
- const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash('confirmed');
- const msg = new TransactionMessage({ payerKey: buyer, recentBlockhash: blockhash, instructions: ixs }).compileToV0Message();
- const tx = new VersionedTransaction(msg);
- return json(res, 200, {
- data: {
- tx_base64: Buffer.from(tx.serialize()).toString('base64'),
- blockhash,
- last_valid_block_height: lastValidBlockHeight,
+ const buyer = new PublicKey(walletAddress);
+ const ixs = await buildRegisterIxs({ connection: conn, domain, buyer, space });
+ const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash('confirmed');
+ const msg = new TransactionMessage({ payerKey: buyer, recentBlockhash: blockhash, instructions: ixs }).compileToV0Message();
+ const tx = new VersionedTransaction(msg);
+ return json(res, 200, {
+ data: {
+ tx_base64: Buffer.from(tx.serialize()).toString('base64'),
+ blockhash,
+ last_valid_block_height: lastValidBlockHeight,
+ domain,
+ },
+ });
+ } catch (err) {
+ console.error('[agents/sns/register-prep] failed', {
+ agentId: id,
domain,
- },
- });
+ wallet: walletAddress,
+ err: err?.message,
+ stack: err?.stack,
+ });
+ return error(res, 502, 'upstream_error', err?.message || 'failed to build registration tx');
+ }
}
// ── Option B step 2: confirm and attach ───────────────────────────────────
diff --git a/extensions/walk-avatar/PERMISSIONS.md b/extensions/walk-avatar/PERMISSIONS.md
new file mode 100644
index 000000000..b0cdac8ab
--- /dev/null
+++ b/extensions/walk-avatar/PERMISSIONS.md
@@ -0,0 +1,24 @@
+# Permission Justifications
+
+Required by the Chrome Web Store review process.
+
+## `storage`
+Used to persist the user's selected avatar ID, walk speed, position preference,
+site allowlist/blocklist, and narration settings across browser sessions via
+`chrome.storage.sync` (synced across user's devices) and the session auth token
+via `chrome.storage.local`.
+
+## `activeTab`
+Used to read the current tab's URL hostname so the popup can display "Enable on
+this site" with the correct domain name. Also used to send messages to the active
+tab's content script when the user toggles the avatar.
+
+## `scripting`
+Used to inject `content.js` into the user's active tab when they explicitly enable
+the walking avatar via the popup toggle. The script is never injected automatically
+on all pages — injection only occurs on user action.
+
+## `host_permissions: <all_urls>`
+Required because the user can enable the avatar on any website they choose to visit.
+The content script is injected only into tabs where the user has explicitly enabled
+the extension. The extension does not automatically run on every page.
diff --git a/extensions/walk-avatar/RELEASE.md b/extensions/walk-avatar/RELEASE.md
new file mode 100644
index 000000000..282896462
--- /dev/null
+++ b/extensions/walk-avatar/RELEASE.md
@@ -0,0 +1,61 @@
+# Chrome Web Store Release Checklist
+
+Complete every item before each submission.
+
+## Pre-build
+- [ ] Version bumped in `package.json` (semver)
+- [ ] `CHANGELOG.md` entry written for this version
+- [ ] All console.log / debug statements removed from production build
+- [ ] Privacy policy at `https://three.ws/extension/privacy` is live and accurate
+- [ ] Terms of service at `https://three.ws/extension/terms` is live and accurate
+
+## Build
+```bash
+npm run build:extension:prod
+```
+- [ ] Build succeeds with zero errors
+- [ ] `dist/extension-<version>.zip` created
+- [ ] Load `dist/extension/` via chrome://extensions → Load unpacked, confirm no manifest errors
+
+## Functional QA
+- [ ] Popup opens and renders correctly
+- [ ] Sign-in flow works (opens three.ws/login?redirect=extension)
+- [ ] Avatar list loads from real API after sign-in
+- [ ] Selecting avatar updates the walking iframe on the current tab
+- [ ] Enable toggle injects avatar on current tab
+- [ ] Disable toggle removes avatar cleanly
+- [ ] Avatar persists through SPA navigation (test on Twitter/X)
+- [ ] Drag handle repositions the avatar
+- [ ] Close button removes avatar from page
+- [ ] Settings page saves and syncs settings
+- [ ] Allowlist/blocklist filtering works
+- [ ] Narration reads sections aloud (if narration enabled)
+- [ ] Speed slider live-updates walk speed
+
+## Store Listing Assets
+Located in `extensions/walk-avatar/store-assets/`:
+- [ ] 128×128 icon (icon-128.png)
+- [ ] 440×280 small promotional tile
+- [ ] 1280×800 marquee promotional image
+- [ ] 5× screenshots (1280×800) showing real usage on real websites
+ - Screenshot 1: Avatar walking on a news article site
+ - Screenshot 2: Popup with avatar selection grid
+ - Screenshot 3: Settings page
+ - Screenshot 4: Avatar narrating sections (speech bubble visible)
+ - Screenshot 5: Avatar on a social media page
+
+## Policy Compliance
+Review against https://developer.chrome.com/docs/webstore/program-policies/
+- [ ] No deceptive behavior — extension only activates on explicit user action
+- [ ] No malware — no data sent to third parties without user awareness
+- [ ] Privacy disclosure accurate — only three.ws APIs contacted
+- [ ] No blocked/dangerous permissions used beyond what is documented in PERMISSIONS.md
+- [ ] Extension works offline (avatar still renders; only avatar-swap requires network)
+
+## Submission
+1. `npm run build:extension:prod`
+2. Upload `dist/extension-<version>.zip` to Chrome Web Store Developer Dashboard
+3. Fill in store listing description (under 132 chars for short, full for detailed)
+4. Upload all store assets
+5. Set privacy policy URL: `https://three.ws/extension/privacy`
+6. Submit for review (typically 1-3 business days)
diff --git a/pages/app-next.html b/pages/app-next.html
index 5cfceb6e1..ddfaa8d02 100644
--- a/pages/app-next.html
+++ b/pages/app-next.html
@@ -335,6 +335,21 @@
<input type="file" name="file-input[]" id="file-input" multiple hidden />
</label>
+ <a
+ class="nxt-action nxt-action--deploy"
+ id="nxt-deploy-btn"
+ hidden
+ aria-label="Publish this agent on-chain (ERC-8004)"
+ title="Publish this agent on-chain (ERC-8004)"
+ >
+ <svg viewBox="0 0 20 20" width="14" height="14" aria-hidden="true">
+ <polygon points="10 2 18 7 18 13 10 18 2 13 2 7 10 2" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round" />
+ <line x1="10" y1="2" x2="10" y2="18" stroke="currentColor" stroke-width="1.5" />
+ <polyline points="18 7 10 12 2 7" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round" />
+ </svg>
+ <span id="nxt-deploy-label" data-state-label>Deploy on-chain</span>
+ </a>
+
<button
class="nxt-action nxt-action--primary"
id="nxt-primary"
@@ -347,6 +362,17 @@
</button>
</div>
+ <!--
+ Hidden DOM hosts that /src/app.js drives directly (href, hidden,
+ [data-state-label]). The Next overlay mirrors their state into the
+ visible "Deploy on-chain" UI above and inside the share popover —
+ keep IDs and inner structure stable.
+ -->
+ <div class="nxt-hidden-hosts" aria-hidden="true" hidden>
+ <a id="deploy-onchain-btn" hidden><span data-state-label>Deploy on-chain</span></a>
+ <a id="view-public-profile-btn" hidden></a>
+ </div>
+
<!-- Animation picker sheet — slides up when "Animations" is clicked -->
<div class="nxt-anim-sheet" id="nxt-anim-sheet" hidden aria-hidden="true">
<div class="nxt-anim-sheet__head">
@@ -389,6 +415,29 @@
</div>
</label>
<p class="nxt-share-hint">Drop the snippet on any site. Same agent, same animations, same identity — embedded.</p>
+
+ <div class="nxt-share-divider" id="nxt-share-deploy-divider" hidden role="presentation"></div>
+ <a
+ class="nxt-share-deploy"
+ id="nxt-share-deploy"
+ hidden
+ aria-label="Publish this agent on-chain"
+ >
+ <span class="nxt-share-deploy__icon" aria-hidden="true">
+ <svg viewBox="0 0 20 20" width="16" height="16">
+ <polygon points="10 2 18 7 18 13 10 18 2 13 2 7 10 2" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round" />
+ <line x1="10" y1="2" x2="10" y2="18" stroke="currentColor" stroke-width="1.5" />
+ <polyline points="18 7 10 12 2 7" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round" />
+ </svg>
+ </span>
+ <span class="nxt-share-deploy__copy">
+ <span class="nxt-share-deploy__title" id="nxt-share-deploy-label" data-state-label>Deploy on-chain</span>
+ <span class="nxt-share-deploy__sub" id="nxt-share-deploy-sub">Register this agent's identity on ERC-8004 — anyone can find and embed it.</span>
+ </span>
+ <svg class="nxt-share-deploy__chev" viewBox="0 0 16 16" width="12" height="12" aria-hidden="true">
+ <path d="M5 3l5 5-5 5" stroke="currentColor" stroke-width="1.6" fill="none" stroke-linecap="round" stroke-linejoin="round" />
+ </svg>
+ </a>
</div>
</div>
diff --git a/pages/extension-privacy.html b/pages/extension-privacy.html
new file mode 100644
index 000000000..c0d937f7a
--- /dev/null
+++ b/pages/extension-privacy.html
@@ -0,0 +1,69 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <title>Privacy Policy — three.ws Walk Avatar Extension</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <style>
+ .legal-wrap { max-width: 720px; margin: 0 auto; padding: 80px 24px; }
+ h1 { font-size: 32px; font-weight: 600; margin-bottom: 8px; }
+ .updated { color: var(--text-2, #888); font-size: 13px; margin-bottom: 48px; }
+ h2 { font-size: 18px; font-weight: 600; margin: 40px 0 12px; }
+ p, li { font-size: 15px; line-height: 1.7; color: var(--text-2, #ccc); }
+ li { margin-bottom: 6px; }
+ ul { padding-left: 20px; }
+ a { color: var(--accent, #7dd3fc); }
+ </style>
+</head>
+<body>
+ <div id="nav-root"></div>
+ <div class="legal-wrap">
+ <h1>Privacy Policy</h1>
+ <p class="updated">three.ws Walk Avatar Chrome Extension · Last updated 2026-05-25</p>
+
+ <h2>What we collect</h2>
+ <p>The extension stores the following data locally on your device via <code>chrome.storage</code>:</p>
+ <ul>
+ <li><strong>Avatar selection</strong> — the ID of the avatar you chose to display</li>
+ <li><strong>Settings</strong> — walk speed, position, size, site allowlist/blocklist, narration preference, voice selection</li>
+ <li><strong>Session token</strong> — a three.ws authentication token if you sign in, stored in <code>chrome.storage.local</code> (device only, not synced)</li>
+ </ul>
+
+ <h2>What we do not collect</h2>
+ <ul>
+ <li>We do not collect or store the content of pages you visit</li>
+ <li>We do not track browsing history</li>
+ <li>We do not sell any data to third parties</li>
+ <li>We do not use analytics or tracking pixels in the extension itself</li>
+ </ul>
+
+ <h2>Network requests</h2>
+ <p>The extension makes network requests only to <strong>three.ws</strong>:</p>
+ <ul>
+ <li><code>https://three.ws/api/avatars/*</code> — to fetch your avatar list and GLB model URLs when you open the popup</li>
+ <li><code>https://three.ws/walk-embed</code> — the avatar iframe that renders the 3D character on your screen</li>
+ <li><code>https://three.ws/api/tts/speak</code> — only when you explicitly enable "Read page sections aloud" in settings. Text from the visible section is sent to this endpoint to generate audio. This feature is disabled by default.</li>
+ <li><code>https://three.ws/api/me</code> — once per popup open to verify your session, if signed in</li>
+ </ul>
+ <p>No requests are made to any third-party domains.</p>
+
+ <h2>Permissions used</h2>
+ <ul>
+ <li><strong>storage</strong> — to save your settings and session token locally</li>
+ <li><strong>activeTab</strong> — to read the current tab's domain name and send messages to the content script</li>
+ <li><strong>scripting</strong> — to inject the avatar into tabs where you have explicitly enabled it via the popup toggle</li>
+ <li><strong>&lt;all_urls&gt;</strong> — required because you can enable the avatar on any website you choose; the script is only injected when you explicitly enable it</li>
+ </ul>
+
+ <h2>Data retention</h2>
+ <p>All data is stored on your device and can be cleared at any time by clicking "Sign out" in the extension settings or by removing the extension from Chrome.</p>
+
+ <h2>Contact</h2>
+ <p>Questions? Email <a href="mailto:[email protected]">[email protected]</a> or visit <a href="https://three.ws">three.ws</a>.</p>
+ </div>
+ <script type="module" src="/public/nav.js"></script>
+</body>
+</html>
diff --git a/pages/extension-terms.html b/pages/extension-terms.html
new file mode 100644
index 000000000..2986d85d0
--- /dev/null
+++ b/pages/extension-terms.html
@@ -0,0 +1,54 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <title>Terms of Service — three.ws Walk Avatar Extension</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <style>
+ .legal-wrap { max-width: 720px; margin: 0 auto; padding: 80px 24px; }
+ h1 { font-size: 32px; font-weight: 600; margin-bottom: 8px; }
+ .updated { color: var(--text-2, #888); font-size: 13px; margin-bottom: 48px; }
+ h2 { font-size: 18px; font-weight: 600; margin: 40px 0 12px; }
+ p, li { font-size: 15px; line-height: 1.7; color: var(--text-2, #ccc); }
+ li { margin-bottom: 6px; }
+ ul { padding-left: 20px; }
+ a { color: var(--accent, #7dd3fc); }
+ </style>
+</head>
+<body>
+ <div id="nav-root"></div>
+ <div class="legal-wrap">
+ <h1>Terms of Service</h1>
+ <p class="updated">three.ws Walk Avatar Chrome Extension · Last updated 2026-05-25</p>
+
+ <h2>Acceptance</h2>
+ <p>By installing or using the three.ws Walk Avatar extension, you agree to these terms and the <a href="https://three.ws/legal/terms">three.ws Terms of Service</a>. If you do not agree, uninstall the extension.</p>
+
+ <h2>Use</h2>
+ <ul>
+ <li>You may use the extension for personal and commercial purposes.</li>
+ <li>You may not use the extension to circumvent security measures on websites, inject malicious content, or violate any applicable law.</li>
+ <li>You are responsible for the avatar content you choose to display.</li>
+ </ul>
+
+ <h2>Service</h2>
+ <p>The extension renders avatars hosted on three.ws servers. We may change, suspend, or discontinue the service at any time. The extension requires a network connection to load avatars; offline functionality is limited to avatars cached in your browser.</p>
+
+ <h2>Accounts</h2>
+ <p>Signing in is optional. An account is required to access your own three.ws avatars. Account use is governed by the <a href="https://three.ws/legal/terms">three.ws Terms of Service</a>.</p>
+
+ <h2>Intellectual Property</h2>
+ <p>The extension code and three.ws brand are owned by three.ws / Nirholas. Avatars you create are yours, subject to the three.ws avatar license.</p>
+
+ <h2>Disclaimer</h2>
+ <p>The extension is provided "as is" without warranty of any kind. We are not liable for any damages arising from your use of the extension.</p>
+
+ <h2>Contact</h2>
+ <p><a href="mailto:[email protected]">[email protected]</a></p>
+ </div>
+ <script type="module" src="/public/nav.js"></script>
+</body>
+</html>
diff --git a/pages/home-next.html b/pages/home-next.html
index 3567db348..c3499ddb0 100644
--- a/pages/home-next.html
+++ b/pages/home-next.html
@@ -535,10 +535,10 @@
<a class="btn primary" href="/create">Build an agent <span class="arrow">→</span></a>
<a class="btn" href="#embed">See the embed</a>
</div>
- <div class="metrics">
- <div class="metric"><strong id="m-agents">1,847</strong>agents live</div>
- <div class="metric"><strong id="m-sites">312</strong>sites embedded</div>
- <div class="metric"><strong id="m-chats">28,401</strong>chats today</div>
+ <div class="metrics" id="metrics-strip" style="display:none">
+ <div class="metric"><strong id="m-agents">—</strong>agents live</div>
+ <div class="metric"><strong id="m-sites">—</strong>widgets built</div>
+ <div class="metric"><strong id="m-onchain">—</strong>on-chain</div>
</div>
</div>
<div class="hero-stage" id="hero-stage">
@@ -883,19 +883,19 @@
} catch (e) {}
});
- // ── Live metric ticker ──────────────────────────────────
- const stats = { agents: 1847, sites: 312, chats: 28401 };
- const m = {
- agents: document.getElementById('m-agents'),
- sites: document.getElementById('m-sites'),
- chats: document.getElementById('m-chats'),
- };
- const fmt = (n) => n.toLocaleString('en-US');
- setInterval(() => {
- if (Math.random() < 0.45) { stats.chats += 1 + Math.floor(Math.random() * 3); m.chats.textContent = fmt(stats.chats); }
- if (Math.random() < 0.08) { stats.agents += 1; m.agents.textContent = fmt(stats.agents); }
- if (Math.random() < 0.04) { stats.sites += 1; m.sites.textContent = fmt(stats.sites); }
- }, 1400);
+ // ── Real marketing stats ────────────────────────────────
+ (async () => {
+ try {
+ const r = await fetch('/api/home-stats');
+ const d = await r.json();
+ if (!d.available) return;
+ const fmt = (n) => Number(n).toLocaleString('en-US');
+ document.getElementById('m-agents').textContent = fmt(d.agents);
+ document.getElementById('m-sites').textContent = fmt(d.widgets);
+ document.getElementById('m-onchain').textContent = fmt(d.onchain_agents);
+ document.getElementById('metrics-strip').style.display = '';
+ } catch (_) {}
+ })();
</script>
</body>
</html>
diff --git a/pages/home-v3.html b/pages/home-v3.html
index b649ba143..2857dfe88 100644
--- a/pages/home-v3.html
+++ b/pages/home-v3.html
@@ -20,6 +20,55 @@
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/pwa-192x192.png" />
+ <script type="application/ld+json">
+ {
+ "@context": "https://schema.org",
+ "@graph": [
+ {
+ "@type": "WebSite",
+ "@id": "https://three.ws/#website",
+ "url": "https://three.ws/",
+ "name": "three.ws",
+ "description": "The 3D layer of the internet",
+ "publisher": { "@id": "https://three.ws/#org" },
+ "potentialAction": {
+ "@type": "SearchAction",
+ "target": "https://three.ws/discover?q={search_term_string}",
+ "query-input": "required name=search_term_string"
+ }
+ },
+ {
+ "@type": "Organization",
+ "@id": "https://three.ws/#org",
+ "name": "three.ws",
+ "url": "https://three.ws/",
+ "logo": "https://three.ws/og-image.png",
+ "sameAs": [
+ "https://github.com/nirholas/three.ws",
+ "https://x.com/trythreews"
+ ]
+ },
+ {
+ "@type": "SoftwareApplication",
+ "name": "three.ws",
+ "applicationCategory": "DeveloperApplication",
+ "operatingSystem": "Web",
+ "browserRequirements": "Requires WebGL2",
+ "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }
+ }
+ ]
+ }
+ </script>
+
+ <script>
+ (function () {
+ var h = location.hash || '';
+ if (/^#(?:model|agent|onchain|widget|kiosk|preset|brain|deploy|type)=/.test(h)) {
+ location.replace('/app' + h);
+ }
+ })();
+ </script>
+
<link rel="preconnect" href="https://ajax.googleapis.com" crossorigin />
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>
<script src="/embed/v1.js" defer></script>
@@ -365,6 +414,53 @@
}
.deploy-fact p { color: var(--ink-2); font-size: 14px; line-height: 1.6; }
+ /* ── Features grid ── */
+ .features-grid {
+ margin-top: 56px;
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 2px;
+ border: 1px solid var(--ink-4);
+ border-radius: 12px;
+ overflow: hidden;
+ }
+ @media (max-width: 900px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
+ @media (max-width: 520px) { .features-grid { grid-template-columns: 1fr; } }
+ .feat {
+ padding: 28px 24px;
+ background: var(--panel);
+ border-right: 1px solid var(--ink-4);
+ border-bottom: 1px solid var(--ink-4);
+ transition: background .2s;
+ }
+ .feat:hover { background: rgba(255,255,255,0.02); }
+ .feat-tag {
+ display: inline-block;
+ font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
+ text-transform: uppercase; color: var(--ink-3);
+ border: 1px solid var(--ink-4); border-radius: 4px;
+ padding: 3px 8px; margin-bottom: 14px;
+ }
+ .feat-tag--mint { color: #6ee7b7; border-color: #6ee7b7; }
+ .feat-tag--violet { color: #c4b5fd; border-color: #c4b5fd; }
+ .feat h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 8px; }
+ .feat p { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
+ .feat .feat-link {
+ display: inline-block; margin-top: 14px;
+ font-family: var(--mono); font-size: 11px; color: var(--ink-3);
+ letter-spacing: 0.1em; text-transform: uppercase; transition: color .2s;
+ }
+ .feat:hover .feat-link { color: var(--ink); }
+ .feat-code {
+ margin-top: 12px;
+ background: rgba(255,255,255,0.04); border-radius: 6px;
+ padding: 10px 12px;
+ font-family: var(--mono); font-size: 12px; line-height: 1.7;
+ }
+ .feat-code .tag { color: #c8b8ff; }
+ .feat-code .attr { color: #b8e6c2; }
+ .feat-code .val { color: #ffd9a8; }
+
/* ── Install ── */
.install-wrap {
margin-top: 56px;
@@ -720,9 +816,55 @@
<hr class="sec-divider" />
-<!-- ── 07 Install ── -->
+<!-- ── 07 Features ── -->
+<section class="sec" id="features">
+ <div class="sec-eye reveal">07 — What you get</div>
+ <h2 class="sec-h reveal">everything an agent<br />needs to exist.</h2>
+ <p class="sec-p reveal">Open source. MIT licensed. Every piece ships today.</p>
+
+ <div class="features-grid">
+ <div class="feat reveal">
+ <span class="feat-tag">Viewer</span>
+ <h3>WebGL rendering, zero install.</h3>
+ <p>Drag any GLB into the browser. Full animations, lighting, and materials — instantly, on any device.</p>
+ <a href="/app" class="feat-link">Open viewer →</a>
+ </div>
+ <div class="feat reveal">
+ <span class="feat-tag">Embed</span>
+ <h3>One tag. Any site.</h3>
+ <p>Drop a web component into Notion, Ghost, WordPress, Framer, or your own app — no SDK required.</p>
+ <div class="feat-code"><span class="tag">&lt;three-d</span><br />&nbsp;&nbsp;<span class="attr">agent</span>=<span class="val">"erc8004:42"</span><br /><span class="tag">&gt;&lt;/three-d&gt;</span></div>
+ </div>
+ <div class="feat reveal">
+ <span class="feat-tag feat-tag--mint">On-chain</span>
+ <h3>Verifiable identity.</h3>
+ <p>Metaplex Core asset on Solana. One transaction, sub-cent fees. Discoverable by any A2A or MCP client.</p>
+ </div>
+ <div class="feat reveal">
+ <span class="feat-tag feat-tag--violet">AI</span>
+ <h3>Expression, in real time.</h3>
+ <p>Your agent reacts as it speaks, thinks, succeeds, and fails — emotion wired directly to model output, not scripted.</p>
+ </div>
+ <div class="feat reveal">
+ <span class="feat-tag">Widgets</span>
+ <h3>5 widget types.</h3>
+ <p>Turntable · Talking Agent · Animation Gallery · ERC-8004 Passport · Hotspot Tour</p>
+ <a href="/studio" class="feat-link">Widget Studio →</a>
+ </div>
+ <div class="feat reveal">
+ <span class="feat-tag feat-tag--mint">SNS · pay-by-name</span>
+ <h3>Get paid by name.</h3>
+ <p>Claim <code style="font-family:var(--mono);font-size:.88em;background:rgba(255,255,255,.06);padding:.1em .3em;border-radius:3px">yourname.threews.sol</code> as a Solana Name Service subdomain. Agents pay you in USDC by name, not address.</p>
+ <a href="/threews/claim" class="feat-link">Claim your subdomain →</a>
+ </div>
+ </div>
+</section>
+
+<hr class="sec-divider" />
+
+<!-- ── 08 Install ── -->
<section class="sec" id="install">
- <div class="sec-eye reveal">07 — Install</div>
+ <div class="sec-eye reveal">08 — Install</div>
<h2 class="sec-h reveal">two lines.<br />live.</h2>
<p class="sec-p reveal">Paste once in &lt;head&gt;. Use &lt;three-d&gt; anywhere. Works in React, Vue, Svelte, plain HTML, Webflow, Notion, Shopify — any host that allows a script tag.</p>
@@ -748,9 +890,9 @@
<hr class="sec-divider" />
-<!-- ── 08 Developer ── -->
+<!-- ── 09 Developer ── -->
<section class="sec" id="developers">
- <div class="sec-eye reveal">08 — Developers</div>
+ <div class="sec-eye reveal">09 — Developers</div>
<h2 class="sec-h reveal">drop one tag.<br />ship a 3d agent.</h2>
<div class="dev-wrap">
<div class="dev-text reveal">
diff --git a/pages/walk.html b/pages/walk.html
index 95a26c3ea..2893b41bc 100644
--- a/pages/walk.html
+++ b/pages/walk.html
@@ -11,7 +11,7 @@
<meta name="author" content="nirholas" />
<meta
name="description"
- content="Walk a 3D avatar around with a joystick — or through your phone camera in AR. Built on three.ws."
+ content="See a 3D agent walking on your real floor through your phone camera. Joystick or WASD. One-tap AR. Built on three.ws."
/>
<meta name="theme-color" content="#000000" />
@@ -328,6 +328,107 @@
-webkit-backdrop-filter: blur(6px);
will-change: transform;
}
+
+ /* ── IRL AR mobile CTA ─────────────────────────────────────────
+ Hidden until walk.js detects a touch device with camera
+ support and the avatar has finished loading. Sells the
+ project's IRL-not-metaverse positioning: "your agent on
+ your real floor" instead of "explore a virtual world".
+ */
+ #walk-ar-cta {
+ position: fixed;
+ z-index: 7;
+ left: 50%;
+ top: calc(env(safe-area-inset-top, 0) + 76px);
+ transform: translateX(-50%) translateY(-6px);
+ display: none;
+ align-items: center;
+ gap: 10px;
+ padding: 10px 14px 10px 12px;
+ background: linear-gradient(135deg, rgba(125, 211, 252, 0.92), rgba(96, 165, 250, 0.92));
+ color: #07111c;
+ border: 1px solid rgba(255, 255, 255, 0.35);
+ border-radius: 999px;
+ font-size: 13px;
+ font-weight: 600;
+ cursor: pointer;
+ box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
+ backdrop-filter: blur(10px);
+ -webkit-backdrop-filter: blur(10px);
+ opacity: 0;
+ transition: opacity 0.25s ease, transform 0.25s ease;
+ white-space: nowrap;
+ max-width: calc(100vw - 32px);
+ }
+ #walk-ar-cta.is-visible {
+ display: inline-flex;
+ opacity: 1;
+ transform: translateX(-50%) translateY(0);
+ }
+ #walk-ar-cta .pulse {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: #f87171;
+ box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.6);
+ animation: walk-cta-pulse 1.6s infinite;
+ }
+ @keyframes walk-cta-pulse {
+ 0% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.55); }
+ 70% { box-shadow: 0 0 0 10px rgba(248, 113, 113, 0); }
+ 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0); }
+ }
+ #walk-ar-cta .dismiss {
+ margin-left: 4px;
+ padding: 2px 6px;
+ font-size: 14px;
+ line-height: 1;
+ background: rgba(7, 17, 28, 0.18);
+ border-radius: 999px;
+ color: #07111c;
+ font-weight: 700;
+ }
+
+ /* ── Recording UI ──────────────────────────────────────────── */
+ #walk-record-btn .dot { transition: background 0.15s ease, box-shadow 0.15s ease; }
+ #walk-record-btn[data-recording="true"] .dot {
+ background: #f87171;
+ box-shadow: 0 0 8px rgba(248, 113, 113, 0.8);
+ animation: walk-rec-pulse 0.9s infinite;
+ }
+ @keyframes walk-rec-pulse {
+ 0%, 100% { opacity: 1; }
+ 50% { opacity: 0.45; }
+ }
+ #walk-record-status {
+ position: fixed;
+ z-index: 6;
+ left: 50%;
+ top: calc(env(safe-area-inset-top, 0) + 12px);
+ transform: translateX(-50%);
+ background: rgba(248, 113, 113, 0.92);
+ color: #fff;
+ border: 1px solid rgba(255, 255, 255, 0.25);
+ border-radius: 999px;
+ padding: 6px 12px;
+ font-size: 12px;
+ font-weight: 600;
+ letter-spacing: 0.02em;
+ display: none;
+ align-items: center;
+ gap: 8px;
+ pointer-events: none;
+ backdrop-filter: blur(6px);
+ -webkit-backdrop-filter: blur(6px);
+ }
+ #walk-record-status.is-visible { display: inline-flex; }
+ #walk-record-status .rec-dot {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: #fff;
+ animation: walk-rec-pulse 0.9s infinite;
+ }
</style>
</head>
<body>
@@ -356,17 +457,38 @@
class="walk-btn"
id="walk-ar-toggle"
aria-pressed="false"
- title="Toggle AR camera passthrough"
+ title="Put your avatar on your real floor"
>
<span class="dot"></span>
<span data-label>AR</span>
</button>
+ <button
+ type="button"
+ class="walk-btn"
+ id="walk-record-btn"
+ data-recording="false"
+ title="Record a 6-second clip to share"
+ >
+ <span class="dot"></span>
+ <span data-label>Record</span>
+ </button>
<a class="walk-btn" href="/" title="Back to three.ws home" style="text-decoration:none">
<span>← home</span>
</a>
</div>
</div>
+ <button type="button" id="walk-ar-cta" aria-hidden="true">
+ <span class="pulse"></span>
+ <span>See your avatar on your floor — tap for AR</span>
+ <span class="dismiss" aria-label="Dismiss">×</span>
+ </button>
+
+ <div id="walk-record-status" role="status" aria-live="polite">
+ <span class="rec-dot"></span>
+ <span data-label>REC 6s</span>
+ </div>
+
<div id="walk-joystick" aria-label="Movement joystick"></div>
<div id="walk-help" aria-hidden="true">
diff --git a/public/app-next.css b/public/app-next.css
index d49d21042..268e5dd79 100644
--- a/public/app-next.css
+++ b/public/app-next.css
@@ -493,6 +493,57 @@ body.app-next-body {
border-color: rgba(255, 255, 255, 0.25);
}
+/* ── Deploy on-chain action ────────────────────────────────────────────── */
+.nxt-action--deploy {
+ text-decoration: none;
+ color: var(--nxt-ink);
+ background: rgba(154, 124, 255, 0.10);
+ border: 1px solid rgba(154, 124, 255, 0.35);
+ box-shadow: 0 0 0 0 rgba(154, 124, 255, 0);
+ position: relative;
+}
+
+.nxt-action--deploy:hover {
+ background: rgba(154, 124, 255, 0.18);
+ border-color: rgba(154, 124, 255, 0.55);
+ transform: translateY(-1px);
+ box-shadow: 0 6px 16px rgba(154, 124, 255, 0.25);
+}
+
+.nxt-action--deploy::before {
+ content: '';
+ position: absolute;
+ top: 50%;
+ left: 14px;
+ width: 6px;
+ height: 6px;
+ border-radius: 999px;
+ background: #c4b5fd;
+ box-shadow: 0 0 8px rgba(196, 181, 253, 0.9);
+ transform: translateY(-50%);
+ opacity: 0;
+ pointer-events: none;
+}
+
+.nxt-action--deploy.is-deployed {
+ color: #d8ffe0;
+ background: rgba(34, 197, 94, 0.12);
+ border-color: rgba(34, 197, 94, 0.45);
+}
+
+.nxt-action--deploy.is-deployed:hover {
+ background: rgba(34, 197, 94, 0.20);
+ border-color: rgba(34, 197, 94, 0.65);
+ box-shadow: 0 6px 16px rgba(34, 197, 94, 0.25);
+}
+
+.nxt-action--deploy.is-deployed::before {
+ background: #4ade80;
+ box-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
+}
+
+.nxt-hidden-hosts { display: none !important; }
+
/* ── Animation picker sheet ────────────────────────────────────────────── */
.nxt-anim-sheet {
@@ -1127,6 +1178,84 @@ body.app-next-body.is-dragover::before {
line-height: 1.5;
}
+/* ── Share popover: Deploy on-chain row ────────────────────────────────── */
+.nxt-share-divider {
+ height: 1px;
+ background: var(--nxt-stroke);
+ margin: 14px -16px 12px;
+}
+
+.nxt-share-deploy {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 10px 12px;
+ margin: 0 -4px;
+ border-radius: 12px;
+ text-decoration: none;
+ color: var(--nxt-ink);
+ background: rgba(154, 124, 255, 0.08);
+ border: 1px solid rgba(154, 124, 255, 0.30);
+ transition: background 0.15s, border-color 0.15s, transform 0.15s;
+}
+
+.nxt-share-deploy:hover {
+ background: rgba(154, 124, 255, 0.16);
+ border-color: rgba(154, 124, 255, 0.55);
+}
+
+.nxt-share-deploy__icon {
+ flex: none;
+ width: 32px;
+ height: 32px;
+ display: grid;
+ place-items: center;
+ border-radius: 9px;
+ background: rgba(154, 124, 255, 0.18);
+ color: #c4b5fd;
+}
+
+.nxt-share-deploy.is-deployed .nxt-share-deploy__icon {
+ background: rgba(34, 197, 94, 0.20);
+ color: #86efac;
+}
+
+.nxt-share-deploy.is-deployed {
+ background: rgba(34, 197, 94, 0.10);
+ border-color: rgba(34, 197, 94, 0.40);
+}
+
+.nxt-share-deploy.is-deployed:hover {
+ background: rgba(34, 197, 94, 0.18);
+ border-color: rgba(34, 197, 94, 0.60);
+}
+
+.nxt-share-deploy__copy {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ flex: 1;
+ min-width: 0;
+}
+
+.nxt-share-deploy__title {
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--nxt-ink);
+ letter-spacing: 0.005em;
+}
+
+.nxt-share-deploy__sub {
+ font-size: 11.5px;
+ color: var(--nxt-ink-fade);
+ line-height: 1.4;
+}
+
+.nxt-share-deploy__chev {
+ flex: none;
+ color: var(--nxt-ink-fade);
+}
+
/* ── Keyboard help ─────────────────────────────────────────────────────── */
.nxt-help {
diff --git a/public/discover/discover.js b/public/discover/discover.js
index 1dbb7a63d..905e727f3 100644
--- a/public/discover/discover.js
+++ b/public/discover/discover.js
@@ -416,7 +416,7 @@ function renderAvatarCard(item) {
.join('');
const viewerUrl = item.viewerUrl || '#';
- const detailUrl = `/avatars/${item.avatarId}`;
+ const detailUrl = `/agent-next?id=${encodeURIComponent(item.avatarId)}`;
card.innerHTML = `
<a class="explore-card-thumb" href="${escapeAttr(detailUrl)}">
@@ -433,8 +433,7 @@ function renderAvatarCard(item) {
<div class="explore-card-foot">
<span class="explore-card-owner" title="Avatar made public by its creator">@${escapeHtml(item.slug || 'avatar')}</span>
<div class="explore-card-actions">
- <a class="explore-card-link" href="${escapeAttr(detailUrl)}">Details</a>
- <a class="explore-card-link" href="${escapeAttr(viewerUrl)}">View 3D</a>
+ <a class="explore-card-link" href="${escapeAttr(detailUrl)}">View agent</a>
<button type="button" class="explore-card-link explore-card-link--ghost" data-role="card-embed"
data-kind="avatar"
data-avatar-id="${escapeAttr(String(item.avatarId))}"
diff --git a/scripts/verify-avatar-links.mjs b/scripts/verify-avatar-links.mjs
new file mode 100644
index 000000000..acf222eb0
--- /dev/null
+++ b/scripts/verify-avatar-links.mjs
@@ -0,0 +1,166 @@
+// Verify avatar card link wiring across gallery, discover, avatar studio, and legacy redirect.
+import { chromium } from 'playwright';
+
+const LAUNCH_ARGS = [
+ '--use-gl=swiftshader',
+ '--enable-unsafe-swiftshader',
+ '--no-sandbox',
+ '--disable-dev-shm-usage',
+];
+
+const results = [];
+
+function record(step, status, detail) {
+ results.push({ step, status, detail });
+ console.log(`[${status}] ${step}: ${detail}`);
+}
+
+async function collectConsole(page, label, sink) {
+ page.on('console', (msg) => {
+ if (msg.type() === 'error') sink.push(`[${label}] ${msg.text()}`);
+ });
+ page.on('pageerror', (err) => {
+ sink.push(`[${label}] pageerror: ${err.message}`);
+ });
+}
+
+(async () => {
+ const browser = await chromium.launch({ args: LAUNCH_ARGS, headless: true });
+ const context = await browser.newContext();
+ const errors = [];
+
+ try {
+ // ---------------- Step 1: gallery ----------------
+ {
+ const page = await context.newPage();
+ await collectConsole(page, 'gallery', errors);
+ await page.goto('http://localhost:3000/gallery/', { waitUntil: 'domcontentloaded' });
+ // Wait for real (non-skeleton) cards: <a class="gallery-card-thumb">
+ await page.waitForSelector('a.gallery-card-thumb', { timeout: 20000 });
+ await page.waitForTimeout(300);
+ const data = await page.evaluate(() => {
+ const thumb = document.querySelector('a.gallery-card-thumb');
+ const name = document.querySelector('.gallery-card-name a');
+ return {
+ thumbHref: thumb ? thumb.getAttribute('href') : null,
+ nameHref: name ? name.getAttribute('href') : null,
+ };
+ });
+ const ok =
+ data.thumbHref && data.thumbHref.startsWith('/avatars/') &&
+ data.nameHref && data.nameHref.startsWith('/avatars/');
+ record('gallery card hrefs', ok ? 'PASS' : 'FAIL', JSON.stringify(data));
+ await page.close();
+ }
+
+ // ---------------- Step 2: discover ----------------
+ {
+ const page = await context.newPage();
+ await collectConsole(page, 'discover', errors);
+ let urlsToTry = [
+ 'http://localhost:3000/discover/',
+ 'http://localhost:3000/discover/?source=avatars',
+ ];
+ let found = null;
+ for (const url of urlsToTry) {
+ await page.goto(url, { waitUntil: 'domcontentloaded' });
+ try {
+ await page.waitForSelector('.explore-card--avatar', { timeout: 12000 });
+ found = url;
+ break;
+ } catch (_) {
+ // try next
+ }
+ }
+ if (!found) {
+ record('discover avatar card present', 'FAIL', 'no .explore-card--avatar found on either url');
+ } else {
+ await page.waitForTimeout(500);
+ const data = await page.evaluate(() => {
+ const card = document.querySelector('.explore-card--avatar');
+ if (!card) return null;
+ const thumb = card.querySelector('.explore-card-thumb');
+ const name = card.querySelector('.explore-card-name-link');
+ return {
+ thumbHref: thumb ? thumb.getAttribute('href') : null,
+ nameHref: name ? name.getAttribute('href') : null,
+ };
+ });
+ const ok =
+ data &&
+ data.thumbHref && data.thumbHref.startsWith('/avatars/') &&
+ data.nameHref && data.nameHref.startsWith('/avatars/');
+ record(`discover card hrefs (via ${found})`, ok ? 'PASS' : 'FAIL', JSON.stringify(data));
+ // Save first avatar href for step 3
+ if (data && data.thumbHref) {
+ global.__firstAvatarHref = data.thumbHref;
+ }
+ }
+ await page.close();
+ }
+
+ // ---------------- Step 3: avatar studio page ----------------
+ {
+ const page = await context.newPage();
+ await collectConsole(page, 'avatar-studio', errors);
+ const href = global.__firstAvatarHref || '/avatars/b8e1babc-a62a-4058-ae4e-8d09cd4fa07a';
+ const url = href.startsWith('http') ? href : `http://localhost:3000${href}`;
+ await page.goto(url, { waitUntil: 'domcontentloaded' });
+ await page.waitForTimeout(1200);
+ const title = await page.title();
+ const dom = await page.evaluate(() => {
+ const actionbar = document.querySelector('.av-actionbar');
+ const related = document.querySelector('.av-related');
+ let backLink = null;
+ if (actionbar) {
+ const a = actionbar.querySelector('a[href*="marketplace" i], a[href*="Marketplace" i]');
+ backLink = a ? a.getAttribute('href') : null;
+ if (!backLink) {
+ // fallback: any link whose text mentions marketplace
+ const all = Array.from(actionbar.querySelectorAll('a'));
+ const hit = all.find((el) => /marketplace/i.test(el.textContent || ''));
+ backLink = hit ? hit.getAttribute('href') : null;
+ }
+ }
+ return {
+ hasActionbar: !!actionbar,
+ hasRelated: !!related,
+ backLink,
+ };
+ });
+ const ok =
+ /Avatar Studio · three\.ws/.test(title) &&
+ dom.hasActionbar &&
+ dom.hasRelated &&
+ !!dom.backLink;
+ record('avatar studio page loads', ok ? 'PASS' : 'FAIL', JSON.stringify({ url, title, ...dom }));
+ await page.close();
+ }
+
+ // ---------------- Step 4: legacy redirect ----------------
+ {
+ const page = await context.newPage();
+ await collectConsole(page, 'legacy', errors);
+ const target = 'http://localhost:3000/discover/avatar/b8e1babc-a62a-4058-ae4e-8d09cd4fa07a';
+ await page.goto(target, { waitUntil: 'domcontentloaded' });
+ await page.waitForTimeout(800);
+ const finalUrl = page.url();
+ const ok = /\/avatars\/b8e1babc-a62a-4058-ae4e-8d09cd4fa07a/.test(finalUrl);
+ record('legacy /discover/avatar/:id redirect', ok ? 'PASS' : 'FAIL', finalUrl);
+ await page.close();
+ }
+ } catch (err) {
+ record('script error', 'FAIL', err.stack || err.message);
+ } finally {
+ await browser.close();
+ }
+
+ console.log('\n=== SUMMARY ===');
+ for (const r of results) console.log(`${r.status} — ${r.step}: ${r.detail}`);
+ console.log('\n=== CONSOLE ERRORS ===');
+ if (errors.length === 0) console.log('(none)');
+ else for (const e of errors) console.log(e);
+
+ const anyFail = results.some((r) => r.status === 'FAIL');
+ process.exit(anyFail ? 1 : 0);
+})();
diff --git a/src/app-next-overlay.js b/src/app-next-overlay.js
index cfea50b30..d56ca2ae5 100644
--- a/src/app-next-overlay.js
+++ b/src/app-next-overlay.js
@@ -63,6 +63,7 @@ function boot() {
wireCameraPresets();
wireHelp();
wireAutoHide();
+ wireDeployMirror();
waitForViewer().then((viewer) => {
if (!viewer) {
@@ -762,6 +763,103 @@ function wirePrimaryCTA() {
});
}
+// ── Deploy on-chain mirror ────────────────────────────────────────────────
+//
+// /src/app.js owns the canonical deploy CTA via #deploy-onchain-btn — it sets
+// .href, .hidden, and the inner [data-state-label] (e.g. "Deployed ✓ base").
+// We mirror that state into two visible Next surfaces:
+//
+// • #nxt-deploy-btn — pill in the secondary action bar
+// • #nxt-share-deploy — row inside the Share/Embed popover
+//
+// A MutationObserver on the source keeps the mirrors in sync as app.js
+// re-runs _refreshDeployButton (e.g. after the agent record is fetched and
+// the deployed state is known).
+
+function wireDeployMirror() {
+ const src = document.getElementById('deploy-onchain-btn');
+ if (!src) return;
+
+ const targets = [
+ {
+ btn: document.getElementById('nxt-deploy-btn'),
+ label: document.getElementById('nxt-deploy-label'),
+ subEl: null,
+ divider: null,
+ },
+ {
+ btn: document.getElementById('nxt-share-deploy'),
+ label: document.getElementById('nxt-share-deploy-label'),
+ subEl: document.getElementById('nxt-share-deploy-sub'),
+ divider: document.getElementById('nxt-share-deploy-divider'),
+ },
+ ].filter((t) => t.btn);
+
+ if (!targets.length) return;
+
+ const sync = () => {
+ const hidden = src.hidden || src.hasAttribute('hidden');
+ const href = src.getAttribute('href') || '';
+ const target = src.getAttribute('target') || '';
+ const rel = src.getAttribute('rel') || '';
+ const title = src.getAttribute('title') || '';
+ const aria = src.getAttribute('aria-label') || '';
+ const labelText =
+ src.querySelector('[data-state-label]')?.textContent?.trim() ||
+ src.textContent?.trim() ||
+ 'Deploy on-chain';
+ const isDeployed = src.classList.contains('is-deployed') || /Deployed/i.test(labelText);
+
+ for (const t of targets) {
+ t.btn.hidden = hidden;
+ if (t.divider) t.divider.hidden = hidden;
+
+ if (href) t.btn.setAttribute('href', href);
+ else t.btn.removeAttribute('href');
+
+ if (target) t.btn.setAttribute('target', target);
+ else t.btn.removeAttribute('target');
+
+ if (rel) t.btn.setAttribute('rel', rel);
+ else t.btn.removeAttribute('rel');
+
+ if (title) t.btn.setAttribute('title', title);
+ if (aria) t.btn.setAttribute('aria-label', aria);
+
+ t.btn.classList.toggle('is-deployed', isDeployed);
+ if (t.label) t.label.textContent = labelText;
+ if (t.subEl) {
+ t.subEl.textContent = isDeployed
+ ? 'This agent is live on-chain. Open the block explorer to verify.'
+ : "Register this agent's identity on ERC-8004 — anyone can find and embed it.";
+ }
+ }
+ };
+
+ sync();
+
+ // Re-run whenever app.js re-paints the source button.
+ const obs = new MutationObserver(sync);
+ obs.observe(src, {
+ attributes: true,
+ attributeFilter: ['href', 'hidden', 'target', 'rel', 'title', 'aria-label', 'class'],
+ childList: true,
+ subtree: true,
+ characterData: true,
+ });
+
+ // If the user clicks the share-popover row while the popover is open, dismiss
+ // it so the navigation feels intentional. (Anchor navigation handles the rest.)
+ const shareRow = document.getElementById('nxt-share-deploy');
+ const pop = document.getElementById('nxt-share-popover');
+ if (shareRow && pop) {
+ shareRow.addEventListener('click', () => {
+ pop.hidden = true;
+ document.getElementById('nxt-share-btn')?.setAttribute('aria-expanded', 'false');
+ });
+ }
+}
+
// ── Toast ─────────────────────────────────────────────────────────────────
let toastTimer = null;
diff --git a/src/walk-embed.js b/src/walk-embed.js
index 750287d13..2320c1a1e 100644
--- a/src/walk-embed.js
+++ b/src/walk-embed.js
@@ -48,14 +48,16 @@ const AUTOPLAY = params.get('autoplay') === 'true' || params.get('autoplay') ===
const SHOW_GROUND = params.get('ground') !== 'false';
const ORBIT_ENABLED = params.get('orbit') !== 'false';
-async function resolveAvatarUrl() {
+function resolveAvatarUrl() {
const id = params.get('avatar');
if (!id) return AVATAR_URL_DEFAULT;
- const res = await fetch(`/api/avatars/${encodeURIComponent(id)}`);
- if (!res.ok) throw new Error(`avatar ${id} not found (HTTP ${res.status})`);
- const { avatar } = await res.json();
- if (!avatar?.url) throw new Error(`avatar ${id} has no GLB URL`);
- return avatar.url;
+ // Go through the same-origin GLB proxy (api/avatars/[id]/glb) instead
+ // of the metadata JSON. The proxy streams the bytes with
+ // `Access-Control-Allow-Origin: *` so hosts on any origin can iframe
+ // this page. Fetching the JSON first would just give us back the raw
+ // R2 URL, which R2 only allows from the three.ws origin and breaks the
+ // moment the embed is dropped onto a third-party site.
+ return `/api/avatars/${encodeURIComponent(id)}/glb`;
}
const ANIMATIONS_MANIFEST_URL = '/animations/manifest.json';
@@ -295,7 +297,7 @@ let currentMotion = 'idle';
async function loadAvatar() {
setStatus('loading avatar…', { sticky: true });
- const avatarUrl = await resolveAvatarUrl();
+ const avatarUrl = resolveAvatarUrl();
const loader = new GLTFLoader();
const gltf = await loader.loadAsync(avatarUrl);
avatar = gltf.scene;
@@ -503,12 +505,8 @@ window.addEventListener('message', async (e) => {
if (!msg || typeof msg !== 'object') return;
if (msg.type === 'walk:setAvatar' && msg.id) {
try {
- const res = await fetch(`/api/avatars/${encodeURIComponent(msg.id)}`);
- if (!res.ok) throw new Error(`HTTP ${res.status}`);
- const { avatar: a } = await res.json();
- if (!a?.url) throw new Error('no GLB url');
const loader = new GLTFLoader();
- const gltf = await loader.loadAsync(a.url);
+ const gltf = await loader.loadAsync(`/api/avatars/${encodeURIComponent(msg.id)}/glb`);
if (avatar) avatarRig.remove(avatar);
avatar = gltf.scene;
avatar.traverse((n) => { if (n.isMesh) n.castShadow = true; });
diff --git a/src/walk.js b/src/walk.js
index 6e1555b13..e02ab0c94 100644
--- a/src/walk.js
+++ b/src/walk.js
@@ -84,6 +84,10 @@ const canvas = document.getElementById('walk-canvas');
const video = document.getElementById('walk-camera-feed');
const joystickEl = document.getElementById('walk-joystick');
const arBtn = document.getElementById('walk-ar-toggle');
+const arCta = document.getElementById('walk-ar-cta');
+const recordBtn = document.getElementById('walk-record-btn');
+const recordStatus = document.getElementById('walk-record-status');
+const recordStatusLabel = recordStatus?.querySelector('[data-label]');
const statusEl = document.getElementById('walk-status');
const onlinePill = document.getElementById('walk-online');
const onlineCountEl = document.getElementById('walk-online-count');
@@ -100,7 +104,10 @@ function setStatus(text, { error = false, sticky = false } = {}) {
}
// ── Renderer / scene ──────────────────────────────────────────────────────
-const renderer = new WebGLRenderer({ canvas, antialias: true, alpha: true });
+// preserveDrawingBuffer is required so the canvas pixels remain readable for
+// the "Record" feature — without it, drawImage(renderer.domElement, …) into
+// the offscreen compositor canvas returns blank pixels after the next paint.
+const renderer = new WebGLRenderer({ canvas, antialias: true, alpha: true, preserveDrawingBuffer: true });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight, false);
renderer.shadowMap.enabled = true;
@@ -491,8 +498,206 @@ function disableAR() {
arBtn.addEventListener('click', () => {
if (arActive) disableAR();
else enableAR();
+ hideArCta();
});
+// ── Mobile AR CTA ────────────────────────────────────────────────────────
+// three.ws is "3D agents in real life," not a metaverse — the AR camera
+// feature is the point. On touch devices the small "AR" pill in the corner
+// is easy to miss, so we surface a prominent CTA after the avatar loads
+// inviting the user to put their agent on their real floor. Dismissible.
+const IS_TOUCH = (() => {
+ if (typeof window === 'undefined') return false;
+ return matchMedia('(hover: none) and (pointer: coarse)').matches
+ || ('ontouchstart' in window && navigator.maxTouchPoints > 0);
+})();
+const CAMERA_SUPPORTED = !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia);
+const AR_CTA_DISMISS_KEY = 'walk:ar-cta-dismissed';
+
+function showArCta() {
+ if (!arCta) return;
+ if (arActive) return;
+ if (!IS_TOUCH || !CAMERA_SUPPORTED) return;
+ try { if (sessionStorage.getItem(AR_CTA_DISMISS_KEY) === '1') return; } catch {}
+ arCta.classList.add('is-visible');
+ arCta.setAttribute('aria-hidden', 'false');
+}
+function hideArCta() {
+ if (!arCta) return;
+ arCta.classList.remove('is-visible');
+ arCta.setAttribute('aria-hidden', 'true');
+}
+if (arCta) {
+ arCta.addEventListener('click', (e) => {
+ // Tap the explicit dismiss "×" → remember and don't re-show this session.
+ const target = /** @type {HTMLElement} */(e.target);
+ if (target?.classList?.contains('dismiss')) {
+ try { sessionStorage.setItem(AR_CTA_DISMISS_KEY, '1'); } catch {}
+ hideArCta();
+ return;
+ }
+ hideArCta();
+ enableAR();
+ });
+}
+
+// ── Recording (6s composite clip → Web Share API or download) ────────────
+// Composites the live camera feed (when AR is active) plus the WebGL canvas
+// into a single offscreen canvas, runs MediaRecorder on its captureStream,
+// and hands the resulting blob to navigator.share — the IRL viral loop.
+const RECORD_SECONDS = 6;
+let recording = false;
+
+function pickRecorderMime() {
+ if (typeof MediaRecorder === 'undefined') return null;
+ const candidates = [
+ 'video/mp4;codecs=avc1',
+ 'video/mp4',
+ 'video/webm;codecs=vp9',
+ 'video/webm;codecs=vp8',
+ 'video/webm',
+ ];
+ for (const t of candidates) {
+ try { if (MediaRecorder.isTypeSupported(t)) return t; } catch {}
+ }
+ return '';
+}
+
+async function startRecording() {
+ if (recording) return;
+ if (typeof MediaRecorder === 'undefined') {
+ setStatus('recording not supported on this browser', { error: true });
+ return;
+ }
+ const mime = pickRecorderMime();
+ if (mime === null) {
+ setStatus('recording not supported on this browser', { error: true });
+ return;
+ }
+
+ const w = renderer.domElement.width;
+ const h = renderer.domElement.height;
+ const compose = document.createElement('canvas');
+ compose.width = w;
+ compose.height = h;
+ const cctx = compose.getContext('2d');
+ if (!cctx) {
+ setStatus('recording context unavailable', { error: true });
+ return;
+ }
+
+ const stream = compose.captureStream(30);
+ let recorder;
+ try {
+ recorder = mime ? new MediaRecorder(stream, { mimeType: mime }) : new MediaRecorder(stream);
+ } catch (err) {
+ setStatus(`recorder error: ${err?.message ?? err}`, { error: true });
+ return;
+ }
+ const chunks = [];
+ recorder.ondataavailable = (e) => { if (e.data && e.data.size) chunks.push(e.data); };
+
+ recording = true;
+ recordBtn?.setAttribute('data-recording', 'true');
+ recordStatus?.classList.add('is-visible');
+ if (recordStatusLabel) recordStatusLabel.textContent = `REC ${RECORD_SECONDS}s`;
+
+ const startMs = performance.now();
+ const renderCanvas = renderer.domElement;
+
+ function paint() {
+ if (!recording) return;
+ // 1. Camera feed (covers in AR; opaque dark fill otherwise).
+ if (arActive && video.readyState >= 2 && video.videoWidth > 0) {
+ const vw = video.videoWidth;
+ const vh = video.videoHeight;
+ const scale = Math.max(w / vw, h / vh);
+ const dw = vw * scale;
+ const dh = vh * scale;
+ cctx.drawImage(video, (w - dw) / 2, (h - dh) / 2, dw, dh);
+ } else {
+ cctx.fillStyle = '#0a0a0a';
+ cctx.fillRect(0, 0, w, h);
+ }
+ // 2. Composite the 3D canvas on top (transparent regions show camera).
+ cctx.drawImage(renderCanvas, 0, 0, w, h);
+
+ const elapsed = (performance.now() - startMs) / 1000;
+ const remaining = Math.max(0, Math.ceil(RECORD_SECONDS - elapsed));
+ if (recordStatusLabel) recordStatusLabel.textContent = `REC ${remaining}s`;
+
+ if (elapsed < RECORD_SECONDS) {
+ requestAnimationFrame(paint);
+ } else {
+ try { recorder.stop(); } catch {}
+ }
+ }
+
+ recorder.onstop = async () => {
+ recording = false;
+ recordBtn?.setAttribute('data-recording', 'false');
+ recordStatus?.classList.remove('is-visible');
+
+ const isMp4 = (recorder.mimeType || mime || '').includes('mp4');
+ const ext = isMp4 ? 'mp4' : 'webm';
+ const blobType = isMp4 ? 'video/mp4' : 'video/webm';
+ const blob = new Blob(chunks, { type: blobType });
+ const filename = `three-ws-walk-${Date.now()}.${ext}`;
+ const file = new File([blob], filename, { type: blobType });
+
+ const canShareFile = !!(navigator.canShare && navigator.canShare({ files: [file] }));
+ if (canShareFile) {
+ try {
+ await navigator.share({
+ files: [file],
+ title: 'My 3D agent on three.ws',
+ text: 'Walking around on three.ws — your AI, in the real world.',
+ });
+ setStatus('shared');
+ return;
+ } catch (err) {
+ // User cancelled or share failed — fall through to download.
+ if (err?.name !== 'AbortError') {
+ console.warn('[walk] share failed, falling back to download:', err);
+ } else {
+ setStatus('share cancelled');
+ return;
+ }
+ }
+ }
+
+ // Download fallback (desktop, or mobile browsers without file share).
+ const url = URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = filename;
+ document.body.appendChild(a);
+ a.click();
+ a.remove();
+ setTimeout(() => URL.revokeObjectURL(url), 4000);
+ setStatus('clip saved');
+ };
+
+ recorder.onerror = (e) => {
+ console.error('[walk] recorder error:', e);
+ recording = false;
+ recordBtn?.setAttribute('data-recording', 'false');
+ recordStatus?.classList.remove('is-visible');
+ setStatus('recording failed', { error: true });
+ };
+
+ recorder.start();
+ requestAnimationFrame(paint);
+}
+
+if (recordBtn) {
+ recordBtn.addEventListener('click', () => {
+ if (recording) return; // single shot — must finish first
+ startRecording();
+ hideArCta(); // recording is a user gesture; if they hit record, dismiss the CTA
+ });
+}
+
// ── Resize ────────────────────────────────────────────────────────────────
function resize() {
const w = window.innerWidth;
@@ -869,6 +1074,9 @@ loadAvatar()
.then(() => {
requestAnimationFrame(tick);
startNet();
+ // Mobile + camera-capable → invite the user into AR. Delayed so it
+ // lands after the "walk it" status fade, not on top of it.
+ setTimeout(showArCta, 900);
})
.catch((err) => {
console.error('[walk] failed to load avatar:', err);
diff --git a/vercel.json b/vercel.json
index 0b4b767e5..24eeaf2b5 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1285,7 +1285,8 @@
},
{
"src": "/avatars/([^/]+)",
- "dest": "/avatar-page.html"
+ "status": 301,
+ "headers": { "Location": "/agent-next?id=$1" }
},
{
"src": "/api/characters",