Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(ux): a11y improvements, mobile breakpoints, docs link, OAuth token revocation
nirholas9a3b2e3dbed8
diff --git a/3d-demo/README.md b/3d-demo/README.mdnew file mode 100644index 000000000..fdf2b3d6a--- /dev/null+++ b/3d-demo/README.md@@ -0,0 +1,28 @@+# 3d-demo++A standalone React + Three.js interactive demo showing pointer-driven 3D cube displacement using `@react-three/fiber`.++## What it is++An isolated Create React App project. It renders a 4×4×4 grid of rounded cubes that push away from the cursor in 3D space, with bloom and ambient occlusion post-processing effects. Source: https://discourse.threejs.org/t/meshes-push-away-from-mouse-hover/68397++## Status++**Unlinked / standalone.** This project is not part of the main three.ws platform:++- Not referenced in `vercel.json` — it does not deploy as part of the site.+- Not linked from any nav or page in `public/` or `index.html`.+- Has its own `package.json` and must be run separately with `npm start`.++It is a local prototype/experiment. To run it:++```sh+cd 3d-demo+npm install+npm start+```++## Not to be confused with++- The main `src/` directory — the three.ws viewer/editor built with Vite.+- `sims-demo/` — a separate demo project also unlinked from main nav.diff --git a/api/auth/logout-everywhere.js b/api/auth/logout-everywhere.jsindex 0b6f7f293..1a9745f79 100644--- a/api/auth/logout-everywhere.js+++ b/api/auth/logout-everywhere.js@@ -1,6 +1,7 @@-// Revoke every session for the caller, including the current one, and clear the cookie.-// Different from DELETE /api/auth/sessions (which keeps the current session):-// this fully signs the user out on every device.+// Revoke every session AND every OAuth refresh token for the caller, including+// the current session, and clear the cookie. This fully signs the user out on+// every device and invalidates any OAuth tokens issued to third-party clients.+// Different from DELETE /api/auth/sessions (which keeps the current session).import { sql } from '../_lib/db.js';import { getSessionUser, sessionCookie } from '../_lib/auth.js';@@ -18,17 +19,27 @@ export default wrap(async (req, res) => {const rl = await limits.authIp(ip);if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');- const result = await sql`+ // Revoke all active sessions across every device.+ const sessionResult = await sql`update sessionsset revoked_at = now()where user_id = ${user.id}and revoked_at is null`;+ // Revoke all OAuth refresh tokens so third-party clients can no longer+ // obtain new access tokens on behalf of this user.+ await sql`+ update oauth_refresh_tokens+ set revoked_at = now()+ where user_id = ${user.id}+ and revoked_at is null+ `;+const clearCookies = sessionCookie('', { clear: true });const existing = res.getHeader('set-cookie') || [];const arr = Array.isArray(existing) ? existing : [existing];res.setHeader('set-cookie', [...arr, ...clearCookies]);- return json(res, 200, { ok: true, revoked: result.count });+ return json(res, 200, { ok: true, revoked: sessionResult.count });});diff --git a/docs/index.html b/docs/index.htmlnew file mode 100644index 000000000..fa57f7f9c--- /dev/null+++ b/docs/index.html@@ -0,0 +1,75 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width,initial-scale=1" />+ <title>Docs · three.ws</title>+ <link rel="icon" href="/favicon.ico" />+ <style>+ :root { color-scheme: dark; --accent: #6a5cff; }+ * { box-sizing: border-box; }+ body {+ font: 15px/1.6 -apple-system, system-ui, Segoe UI, Roboto, sans-serif;+ background: #0b0b10;+ color: #eee;+ margin: 0;+ padding: 40px 24px 80px;+ }+ a { color: #9a8cff; text-decoration: none; }+ a:hover { text-decoration: underline; }+ .container { max-width: 680px; margin: 0 auto; }+ .brand { font-size: 13px; color: #555; margin-bottom: 32px; }+ h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: -0.02em; }+ .sub { color: #888; margin: 0 0 36px; font-size: 15px; }+ h2 { font-size: 14px; font-weight: 600; color: #aaa; text-transform: uppercase; letter-spacing: 0.08em; margin: 32px 0 10px; }+ ul { margin: 0; padding: 0; list-style: none; }+ li { border-top: 1px solid #1e1e28; }+ li:last-child { border-bottom: 1px solid #1e1e28; }+ li a { display: block; padding: 11px 0; color: #ccc; font-size: 14px; }+ li a:hover { color: #fff; text-decoration: none; }+ li a span { font-size: 12px; color: #555; display: block; margin-top: 2px; }+ </style>+ </head>+ <body>+ <div class="container">+ <p class="brand"><a href="/">← three.ws</a></p>+ <h1>Documentation</h1>+ <p class="sub">Guides, API reference, and architecture notes for three.ws.</p>++ <h2>Getting started</h2>+ <ul>+ <li><a href="/docs/SETUP.md">Setup <span>Local development and environment variables</span></a></li>+ <li><a href="/docs/DEVELOPMENT.md">Development guide <span>Running, building, and testing</span></a></li>+ <li><a href="/docs/DEPLOYMENT.md">Deployment <span>Deploying to Vercel</span></a></li>+ </ul>++ <h2>Architecture</h2>+ <ul>+ <li><a href="/docs/ARCHITECTURE.md">Architecture overview <span>How the platform is structured</span></a></li>+ <li><a href="/docs/how-it-works.md">How it works <span>End-to-end flow from GLB to embedded agent</span></a></li>+ </ul>++ <h2>API reference</h2>+ <ul>+ <li><a href="/docs/API.md">REST API <span>Avatars, agents, OAuth, MCP endpoints</span></a></li>+ <li><a href="/docs/MCP.md">MCP <span>Model Context Protocol integration</span></a></li>+ <li><a href="/docs/WIDGETS.md">Widgets <span>Widget types, embed codes, and the Widget Studio</span></a></li>+ <li><a href="/docs/widgets">Widgets reference (interactive) <span>Full widget API docs</span></a></li>+ </ul>++ <h2>Tutorials</h2>+ <ul>+ <li><a href="/docs/tutorial-build-pai-site.md">Build a PAI site <span>Step-by-step: deploy a personal AI agent site</span></a></li>+ <li><a href="/docs/your-own-layers.md">Custom layers <span>Adding your own scene layers</span></a></li>+ <li><a href="/docs/avaturn-docs.md">Avaturn integration <span>Selfie-to-avatar via Avaturn</span></a></li>+ </ul>++ <h2>Operations</h2>+ <ul>+ <li><a href="/docs/SMOKE_TEST.md">Smoke test <span>Manual verification checklist</span></a></li>+ <li><a href="/docs/VALIDATION_DEPLOY.md">Validation deployment <span>Pre-release checklist</span></a></li>+ <li><a href="/docs/api-inventory.md">API inventory <span>Full list of API endpoints</span></a></li>+ </ul>+ </div>+ </body>+</html>diff --git a/index.html b/index.htmlindex de0f9d1cd..3d527e07d 100644--- a/index.html+++ b/index.html@@ -762,6 +762,7 @@<a href="/discover">Discover</a><a href="/features">Features</a><a href="/widgets">Widgets</a>+ <a href="/docs">Docs</a><a href="/dashboard" class="nav-dashboard">Dashboard</a><a href="/my-agents" id="nav-my-agents" hidden>My Agents</a><a href="/login" class="nav-sign-in" id="nav-sign-in">Sign in</a>diff --git a/prompts/README.md b/prompts/README.mdindex 0662b898e..be413d3ee 100644--- a/prompts/README.md+++ b/prompts/README.md@@ -25,6 +25,51 @@ Do not open these while anything in the priority stack above is broken:- [widget-studio/](./widget-studio/) — turntable, animation gallery, passport, hotspot tour- [embed/03-embed-allowlist.md](./embed/03-embed-allowlist.md) — referrer allowlist+## Active vs. archival++**None of these files are imported by application code.** All files in this directory are planning prompts (markdown) consumed by AI agents, not by the runtime.++### Active (in-flight or upcoming)++Directories corresponding to unshipped or partially-shipped work:++| Directory | Status |+|---|---|+| `wallet-auth/` | Active — SIWE auth foundation |+| `selfie-agent/` | Active — photo-to-avatar pipeline |+| `selfie-onboarding/` | Active — onboarding UX |+| `avatar-platform/` | Active — avatar platform backend |+| `avatar-edit/` | Active — post-creation editing |+| `avatar-editing/` | Active — material/texture editing |+| `drop-edit-embed/` | Active — anyone-can-drop-and-embed flow |+| `embed/` | Active — embed polish |+| `portable-embed/` | Active — portable embed (Claude/LobeHub) |+| `claude-artifact/` | Active — Claude artifact integration |+| `claude-lobehub/` | Active — LobeHub integration |+| `lobehub-embed/` | Active — LobeHub embed |+| `onchain/` | Active — ERC-8004 on-chain deployment |+| `cz-demo/` | Active — ship target demo |+| `embed-hardening/` | Active — embed security hardening |+| `widget-studio/` | Side lane — not a blocker |+| `scalability/` | Side lane — revisit when traffic shape known |+| `pretext/` | Side lane — shipped/shelved |++### Archival (completed work, kept for reference)++| Directory | Status |+|---|---|+| `archive/` | Completed prompts no longer actionable |+| `complete/` | Finished sprints |+| `build/` | Master flat index (bands 1–5); use as alternative dispatch |+| `agent-3d/` | agent-3d component prompts — shipped |+| `discover-rename/` | Discover page rename — shipped |+| `erc8004-parity/` | ERC-8004 parity work — shipped |+| `final-integration/` | Final integration pass — shipped |+| `onboarding-flow/` | Onboarding flow — shipped |+| `parallel-finish/` | Parallel finish tasks — shipped |+| `permissions/` | Permissions model — shipped |+| `sprint-100/` | Sprint 100 tasks — shipped |+## Rules that apply to every task- No new runtime dependencies unless the task file explicitly allows them.diff --git a/public/agent-edit/index.html b/public/agent-edit/index.htmlindex bb5fc544c..3710b3d37 100644--- a/public/agent-edit/index.html+++ b/public/agent-edit/index.html@@ -387,6 +387,22 @@color: #aaa;}+ @media (max-width: 768px) {+ .layout {+ grid-template-columns: 1fr;+ height: auto;+ grid-template-rows: 50vw auto;+ }+ .preview-pane {+ border-right: none;+ border-bottom: 1px solid var(--border);+ height: 50vw;+ }+ .editor-pane {+ padding: 18px 16px 60px;+ }+ }+/* ── Voice picker ──────────────────────────────────────────────────────── */.vp-toggle {display: flex;diff --git a/public/dashboard/index.html b/public/dashboard/index.htmlindex 58cd392ab..91250548f 100644--- a/public/dashboard/index.html+++ b/public/dashboard/index.html@@ -5,15 +5,6 @@<meta name="viewport" content="width=device-width,initial-scale=1" /><title>Dashboard · three.ws</title><link rel="icon" href="/favicon.ico" />-- <meta property="og:type" content="website">- <meta property="og:url" content="https://three.ws/dashboard">- <meta property="og:title" content="Dashboard · three.ws">- <meta property="og:image" content="https://three.ws/assets/og-image.png">- <meta property="og:image:width" content="1200">- <meta property="og:image:height" content="630">- <meta name="twitter:card" content="summary_large_image">- <meta name="twitter:image" content="https://three.ws/assets/og-image.png"><style>:root {color-scheme: dark;@@ -785,6 +776,33 @@}}+ @media (max-width: 768px) {+ .layout {+ grid-template-columns: 1fr;+ }+ aside {+ border-right: none;+ border-bottom: 1px solid var(--border);+ padding: 8px 0;+ display: flex;+ flex-wrap: wrap;+ overflow-x: auto;+ }+ aside a {+ padding: 8px 14px;+ border-left: none;+ border-bottom: 2px solid transparent;+ white-space: nowrap;+ }+ aside a.active {+ border-left: none;+ border-bottom-color: var(--accent);+ }+ main {+ padding: 18px 16px;+ }+ }+/* ── Animations tab ──────────────────────────────────────────────── */.anim-cols {display: grid;diff --git a/public/login.html b/public/login.htmlindex 32f0ec434..853c2e15e 100644--- a/public/login.html+++ b/public/login.html@@ -170,7 +170,7 @@<h1>Welcome back</h1><p class="sub">Sign in to manage your avatars.</p><label for="email">Email or username</label>- <input id="email" type="text" autocomplete="username email" required />+ <input id="email" type="text" autocomplete="username email" required aria-describedby="err" /><label for="password">Password</label><inputid="password"@@ -178,20 +178,21 @@autocomplete="current-password"requiredminlength="10"+ aria-describedby="err"/><p class="hint" style="font-size:12px;color:#666;margin-top:4px;text-align:right"><a href="/forgot-password">Forgot password?</a></p><button id="submit" type="submit">Sign in</button><div class="divider">or connect wallet</div>- <div class="chain-tabs">- <button type="button" class="chain-tab active" data-chain="evm">EVM</button>- <button type="button" class="chain-tab" data-chain="solana">Solana</button>+ <div class="chain-tabs" role="tablist" aria-label="Wallet chain">+ <button type="button" class="chain-tab active" data-chain="evm" role="tab" aria-selected="true" aria-controls="evm-panel">EVM</button>+ <button type="button" class="chain-tab" data-chain="solana" role="tab" aria-selected="false" aria-controls="solana-panel">Solana</button></div>- <div id="evm-panel" class="chain-panel active">+ <div id="evm-panel" class="chain-panel active" role="tabpanel"><div id="wallet-mount"></div></div>- <div id="solana-panel" class="chain-panel">+ <div id="solana-panel" class="chain-panel" role="tabpanel"><div id="solana-wallet-mount"></div><div class="chain-hints" id="solana-hints" style="margin-top:8px;font-size:12px;color:#555;display:flex;gap:8px;justify-content:center;"><button type="button" class="wallet-hint-btn" data-wallet="phantom">Phantom</button>@@ -199,7 +200,7 @@<button type="button" class="wallet-hint-btn" data-wallet="solflare">Solflare</button></div></div>- <div class="err" id="err"></div>+ <div class="err" id="err" role="alert" aria-live="polite"></div><p class="foot">No account? <a href="/register">Create one</a></p></form><style>diff --git a/public/register.html b/public/register.htmlindex 26d946a32..cce4a3396 100644--- a/public/register.html+++ b/public/register.html@@ -132,8 +132,9 @@maxlength="30"pattern="[a-zA-Z0-9_-]+"placeholder="e.g. cool_agent"+ aria-describedby="username-hint err"/>- <p class="hint">3–30 characters, letters, numbers, _ or -</p>+ <p class="hint" id="username-hint">3–30 characters, letters, numbers, _ or -</p><label for="password">Password</label><inputid="password"@@ -142,10 +143,11 @@requiredminlength="10"maxlength="200"+ aria-describedby="password-hint err"/>- <p class="hint">Minimum 10 characters</p>+ <p class="hint" id="password-hint">Minimum 10 characters</p><button id="submit" type="submit">Create account</button>- <div class="err" id="err"></div>+ <div class="err" id="err" role="alert" aria-live="polite"></div><p class="foot">Already have an account? <a href="/login">Sign in</a></p></form><script>diff --git a/vercel.json b/vercel.jsonindex 38ba68c6e..0b936427e 100644--- a/vercel.json+++ b/vercel.json@@ -106,6 +106,8 @@{ "src": "/widgets", "dest": "/widgets-gallery/index.html" },{ "src": "/widgets/", "dest": "/widgets-gallery/index.html" },{ "src": "/widgets/(.*)", "dest": "/widgets-gallery/$1" },+ { "src": "/docs", "dest": "/docs/index.html" },+ { "src": "/docs/", "dest": "/docs/index.html" },{ "src": "/docs/widgets", "dest": "/docs-widgets.html" },{ "src": "/artifact", "dest": "/artifact/index.html" },