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
refactor: update aria-labels for accessibility and remove unused stylesheet link
nirholas5eee0edc172a
diff --git a/api/agents/[id]/manifest.js b/api/agents/[id]/manifest.jsnew file mode 100644index 000000000..019b0fbb4--- /dev/null+++ b/api/agents/[id]/manifest.js@@ -0,0 +1,98 @@+/**+ * GET /api/agents/:id/manifest+ *+ * Public, canonical agent manifest JSON. Served as the off-chain `agentURI`+ * on ERC-8004 registries when the user opts for `https://` over `ipfs://`.+ * Stable URL shape so on-chain tokens don't break when the underlying+ * record is edited.+ *+ * No auth — intentionally public so any consumer (block explorer, Lobehub+ * plugin, third-party renderer) can resolve the manifest.+ */++import { sql } from '../../_lib/db.js';+import { resolveAvatarUrl } from '../../_lib/avatars.js';+import { cors, json, method, wrap, error } from '../../_lib/http.js';++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,OPTIONS', credentials: false })) return;+ if (!method(req, res, ['GET'])) return;++ const id = req.query?.id || new URL(req.url, 'http://x').pathname.split('/').slice(-2, -1)[0];+ if (!id || !/^[0-9a-f-]{36}$/i.test(id)) {+ return error(res, 400, 'invalid_request', 'agent id required');+ }++ const [row] = await sql`+ select+ a.id, a.name, a.description, a.avatar_id, a.skills, a.meta,+ a.chain_id, a.erc8004_agent_id, a.erc8004_registry, a.registration_cid,+ a.created_at,+ av.id as avatar_db_id, av.storage_key, av.content_type+ from agent_identities a+ left join avatars av on av.id = a.avatar_id and av.deleted_at is null+ where a.id = ${id} and a.deleted_at is null+ limit 1+ `;++ if (!row) return error(res, 404, 'not_found', 'agent not found');++ let bodyUri = '';+ if (row.avatar_db_id) {+ try {+ const urlInfo = await resolveAvatarUrl({+ storage_key: row.storage_key,+ visibility: 'public',+ });+ bodyUri = urlInfo?.url || '';+ } catch {+ /* fall through with empty body uri */+ }+ }++ const origin = _origin(req);++ const manifest = {+ $schema: 'https://3d-agent.io/schemas/manifest/0.1.json',+ spec: 'agent-manifest/0.1',+ id: row.id,+ name: row.name || 'Agent',+ description: row.description || '',+ image: '',+ tags: Array.isArray(row.meta?.tags) ? row.meta.tags : [],+ body: bodyUri+ ? { uri: bodyUri, format: row.content_type || 'gltf-binary' }+ : undefined,+ skills: Array.isArray(row.skills) ? row.skills : [],+ homeUrl: `${origin}/agent/${row.id}`,+ // Surface registrations array so consumers can find every chain this+ // agent lives on. For now we only have a single canonical record on+ // agent_identities; a junction table is the next step.+ registrations:+ row.chain_id && row.erc8004_agent_id+ ? [+ {+ agentRegistry: `eip155:${row.chain_id}:${row.erc8004_registry}`,+ agentId: row.erc8004_agent_id,+ },+ ]+ : [],+ createdAt: row.created_at,+ };++ // Cache moderately — manifest changes when the user edits name/desc, but+ // it's safe to serve stale for a few minutes. The headers arg here wins+ // over the helper's default `cache-control: no-store`.+ return json(res, 200, manifest, {+ 'cache-control': 'public, max-age=60, s-maxage=300, stale-while-revalidate=86400',+ 'access-control-allow-origin': '*',+ });+});++function _origin(req) {+ const env = process.env.PUBLIC_APP_ORIGIN;+ if (env) return env.replace(/\/$/, '');+ const proto = req.headers['x-forwarded-proto'] || 'https';+ const host = req.headers['x-forwarded-host'] || req.headers.host || '3dagent.vercel.app';+ return `${proto}://${host}`;+}diff --git a/public/.well-known/3d-agent-card.schema.json b/public/.well-known/3d-agent-card.schema.jsonnew file mode 100644index 000000000..3b6c462e1--- /dev/null+++ b/public/.well-known/3d-agent-card.schema.json@@ -0,0 +1,123 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "$id": "https://3dagent.vercel.app/.well-known/3d-agent-card.schema.json",+ "title": "3D Agent Card v1",+ "description": "Strict superset of the ERC-8004 registration card (https://eips.ethereum.org/EIPS/eip-8004#registration-v1) for agents whose primary embodiment is a 3D model. Pointed to by the ERC-721 tokenURI on the Identity Registry.",+ "type": "object",+ "required": ["type", "name", "description", "model"],+ "properties": {+ "type": {+ "description": "Conformance URI. MUST include the ERC-8004 registration-v1 URI; SHOULD include the 3D Agent Card v1 URI.",+ "oneOf": [+ { "type": "string" },+ { "type": "array", "items": { "type": "string" }, "minItems": 1 }+ ]+ },+ "name": { "type": "string", "minLength": 1, "maxLength": 128 },+ "description": { "type": "string", "minLength": 1, "maxLength": 2048 },+ "image": {+ "type": "string",+ "description": "Poster / preview image. SHOULD be ipfs:// for immutability."+ },+ "active": { "type": "boolean" },++ "services": {+ "type": "array",+ "description": "ERC-8004 service endpoints (web, A2A, MCP, etc).",+ "items": {+ "type": "object",+ "required": ["name", "endpoint"],+ "properties": {+ "name": { "type": "string" },+ "endpoint": { "type": "string", "format": "uri" },+ "version": { "type": "string" }+ }+ }+ },++ "x402Support": { "type": "boolean" },++ "registrations": {+ "type": "array",+ "description": "ERC-8004 on-chain registrations as CAIP-10 references.",+ "items": {+ "type": "object",+ "required": ["agentId", "agentRegistry"],+ "properties": {+ "agentId": { "type": ["integer", "string"] },+ "agentRegistry": {+ "type": "string",+ "pattern": "^eip155:[0-9]+:0x[a-fA-F0-9]{40}$"+ }+ }+ }+ },++ "supportedTrust": {+ "type": "array",+ "items": { "type": "string", "enum": ["reputation", "validation", "tee"] }+ },++ "model": {+ "type": "object",+ "description": "3D embodiment. Required for 3D Agent Card v1.",+ "required": ["uri", "format", "sha256"],+ "properties": {+ "uri": {+ "type": "string",+ "description": "Pointer to the GLB/glTF/VRM file. SHOULD be ipfs:// for immutability."+ },+ "format": {+ "type": "string",+ "enum": ["gltf-binary", "gltf", "vrm"]+ },+ "sha256": {+ "type": "string",+ "pattern": "^[a-f0-9]{64}$",+ "description": "Lowercase hex SHA-256 of the model bytes. Lets consumers verify the file independently of the URI."+ },+ "sizeBytes": { "type": "integer", "minimum": 0 },+ "polygonCount": { "type": "integer", "minimum": 0 },+ "boundingBox": {+ "type": "object",+ "description": "Axis-aligned bounding box in meters, model space.",+ "required": ["min", "max"],+ "properties": {+ "min": { "type": "array", "items": { "type": "number" }, "minItems": 3, "maxItems": 3 },+ "max": { "type": "array", "items": { "type": "number" }, "minItems": 3, "maxItems": 3 }+ }+ },+ "license": {+ "type": "string",+ "description": "SPDX license identifier or URL to a license document."+ }+ }+ },++ "manifest": {+ "type": "object",+ "description": "Optional pointer to the full off-chain agent manifest (see specs/AGENT_MANIFEST.md). Use when the agent has a brain/voice/skills bundle.",+ "required": ["uri"],+ "properties": {+ "uri": { "type": "string" },+ "spec": { "type": "string", "description": "e.g. \"agent-manifest/0.2\"" }+ }+ },++ "validation": {+ "type": "object",+ "description": "Optional pointer to a signed validation report (see public/validation/REPORT_FORMAT.md).",+ "required": ["reportUri"],+ "properties": {+ "reportUri": { "type": "string" },+ "reportType": { "type": "string", "description": "e.g. \"agent-validation-report/0.1\"" },+ "validator": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$" }+ }+ },++ "previousVersion": {+ "type": "string",+ "description": "URI of the prior agent card (provenance chain). SHOULD be ipfs:// content hash."+ }+ }+}diff --git a/public/animations/manifest.json b/public/animations/manifest.jsonindex b6f2105df..fe51488c7 100644--- a/public/animations/manifest.json+++ b/public/animations/manifest.json@@ -1,128 +1 @@-[- {- "name": "idle",- "url": "/animations/Old Man Idle.fbx",- "label": "Idle",- "icon": "🧍",- "loop": true- },- {- "name": "dance",- "url": "/animations/Hip Hop Dancing.fbx",- "label": "Dance",- "icon": "💃",- "loop": true- },- {- "name": "celebrate",- "url": "/animations/Joyful Jump.fbx",- "label": "Celebrate",- "icon": "🎉",- "loop": false- },- {- "name": "angry",- "url": "/animations/Angry.fbx",- "label": "Angry",- "icon": "😡",- "loop": false- },- {- "name": "defeated",- "url": "/animations/Defeated.fbx",- "label": "Defeated",- "icon": "😞",- "loop": false- },- {- "name": "dying",- "url": "/animations/Dying.fbx",- "label": "Dying",- "icon": "💀",- "loop": false- },- {- "name": "falling",- "url": "/animations/Falling.fbx",- "label": "Falling",- "icon": "🪂",- "loop": false- },- {- "name": "jump",- "url": "/animations/Joyful Jump.fbx",- "label": "Jump",- "icon": "🦘",- "loop": false- },- {- "name": "kiss",- "url": "/animations/Kiss.fbx",- "label": "Kiss",- "icon": "💋",- "loop": false- },- {- "name": "pray",- "url": "/animations/Praying.fbx",- "label": "Pray",- "icon": "🙏",- "loop": false- },- {- "name": "reaction",- "url": "/animations/Reaction.fbx",- "label": "Reaction",- "icon": "😲",- "loop": false- },- {- "name": "rumba",- "url": "/animations/Rumba Dancing.fbx",- "label": "Rumba",- "icon": "🕺",- "loop": true- },- {- "name": "silly",- "url": "/animations/Silly Dancing.fbx",- "label": "Silly Dance",- "icon": "🤪",- "loop": true- },- {- "name": "sitclap",- "url": "/animations/Sitting Clap.fbx",- "label": "Sit Clap",- "icon": "👏",- "loop": false- },- {- "name": "sitlaugh",- "url": "/animations/Sitting Laughing.fbx",- "label": "Sit Laugh",- "icon": "😂",- "loop": false- },- {- "name": "taunt",- "url": "/animations/Taunt.fbx",- "label": "Taunt",- "icon": "😝",- "loop": false- },- {- "name": "thriller",- "url": "/animations/Thriller Part 3.fbx",- "label": "Thriller",- "icon": "🧟",- "loop": true- },- {- "name": "capoeira",- "url": "/animations/Capoeira.fbx",- "label": "Capoeira",- "icon": "🥋",- "loop": true- }-]+[]diff --git a/public/animations/presets.json b/public/animations/presets.jsonindex 508658819..97aee5843 100644--- a/public/animations/presets.json+++ b/public/animations/presets.json@@ -35,15 +35,6 @@"label": "Shrug","icon": "🚫"},- {- "name": "thinking",- "url": "/animations/robotexpressive.glb",- "clipName": "Sitting",- "loop": true,- "source": "preset",- "label": "Thinking",- "icon": "🤔"- },{"name": "celebrate","url": "/animations/robotexpressive.glb",@@ -54,13 +45,13 @@"icon": "🎉"},{- "name": "typing",+ "name": "jump","url": "/animations/robotexpressive.glb",- "clipName": "Standing",- "loop": true,+ "clipName": "Jump",+ "loop": false,"source": "preset",- "label": "Typing",- "icon": "⌨️"+ "label": "Jump",+ "icon": "⤴️"},{"name": "walking",@@ -88,5 +79,14 @@"source": "preset","label": "Dance","icon": "💃"+ },+ {+ "name": "sitting",+ "url": "/animations/robotexpressive.glb",+ "clipName": "Sitting",+ "loop": true,+ "source": "preset",+ "label": "Sitting",+ "icon": "🪑"}]diff --git a/public/dashboard/dashboard.js b/public/dashboard/dashboard.jsindex 0351f33e3..ab9f1c587 100644--- a/public/dashboard/dashboard.js+++ b/public/dashboard/dashboard.js@@ -865,7 +865,7 @@ async function renderEmbed(root) {const embedUrl = `${origin}/agent/${encodeURIComponent(agent.id)}/embed`;const homeUrl = `${origin}/agent/${encodeURIComponent(agent.id)}`;const iframeSnippet = `<iframe src="${embedUrl}" allow="camera; microphone" style="width:320px;height:420px;border:0;border-radius:16px;overflow:hidden" title="${esc(agent.name || 'Agent')}"></iframe>`;- const lobehubSnippet = [+ const sidecarSnippet = ['// Drop into a chat host — renders the agent alongside the chat panel','// and forwards assistant messages to it so the avatar speaks/emotes.',"import { useEffect, useRef } from 'react';",@@ -928,33 +928,39 @@ async function renderEmbed(root) {'</script>',].join('\n');+ const tabs = [+ { label: 'SDK · recommended', code: sdkSnippet },+ { label: 'Universal iframe', code: iframeSnippet },+ { label: 'React sidecar', code: sidecarSnippet },+ { label: 'Claude Artifact', code: claudeSnippet },+ { label: 'Raw postMessage', code: postMessageSnippet },+ ];+body.innerHTML = `- <div style="display:grid; grid-template-columns:minmax(260px,1fr) minmax(320px,1.4fr); gap:20px; align-items:start">- <div class="card" style="padding:8px">- <iframe src="${attr(embedUrl + '?preview=1&bg=dark')}" style="width:100%;aspect-ratio:3/4;border:0;border-radius:10px;background:#0f0f17" title="Preview"></iframe>- <div class="row" style="justify-content:space-between; padding:10px 6px 4px">- <strong>${esc(agent.name || 'My Agent')}</strong>- <a href="${attr(homeUrl)}" target="_blank" class="muted">Home page →</a>+ <div class="embed-grid">+ <div class="embed-preview-col">+ <div class="card" style="padding:8px">+ <iframe src="${attr(embedUrl + '?preview=1&bg=dark')}" style="width:100%;aspect-ratio:3/4;border:0;border-radius:10px;background:#0f0f17" title="Preview"></iframe>+ <div class="row" style="justify-content:space-between; padding:10px 6px 4px">+ <strong>${esc(agent.name || 'My Agent')}</strong>+ <a href="${attr(homeUrl)}" target="_blank" class="muted">Home page →</a>+ </div>+ <p class="muted" style="padding:0 6px">Agent ID <code>${esc(agent.id)}</code></p>+ ${+ agent.wallet_address+ ? `+ <p class="muted" style="padding:0 6px; margin-top:6px; line-height:1.4">+ Agent wallet<br>+ <code style="font-size:11px; word-break:break-all">${esc(agent.wallet_address)}</code><br>+ <span style="font-size:11px">Server-held. Agents sign autonomously via <code style="font-size:11px; word-break:break-all">POST /api/agents/${esc(agent.id)}/sign</code>.</span>+ </p>+ `+ : ''+ }</div>- <p class="muted" style="padding:0 6px">Agent ID <code>${esc(agent.id)}</code></p>- ${- agent.wallet_address- ? `- <p class="muted" style="padding:0 6px; margin-top:6px; line-height:1.4">- Agent wallet<br>- <code style="font-size:11px; word-break:break-all">${esc(agent.wallet_address)}</code><br>- <span style="font-size:11px">Server-held. Agents sign autonomously via <code style="font-size:11px">POST /api/agents/${esc(agent.id)}/sign</code>.</span>- </p>- `- : ''- }</div><div>- ${snippetBlock('Universal iframe (any site)', iframeSnippet, 'html')}- ${snippetBlock('Chat host React sidecar', lobehubSnippet, 'tsx')}- ${snippetBlock('Claude Artifact', claudeSnippet, 'html')}- ${snippetBlock('postMessage bridge (speak + listen)', postMessageSnippet, 'js')}- ${snippetBlock('Custom embed (Agent3D SDK · Bridge v1)', sdkSnippet, 'html')}+ ${snippetTabs(tabs)}<div class="card" style="margin-top:14px"><h3 style="margin:0 0 6px">Who can embed?</h3><p class="muted" style="margin:0 0 10px">By default anyone. Lock it down to specific hosts (your chat host, your Substack…) on the <a href="/dashboard/embed-policy?agent=${encodeURIComponent(agent.id)}">embed-policy page</a>.</p>@@ -963,8 +969,40 @@ async function renderEmbed(root) {${myAgentsCard()}</div></div>+ <style>+ .embed-grid {+ display: grid;+ grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr);+ gap: 20px;+ align-items: start;+ }+ .embed-preview-col { position: sticky; top: 16px; }+ @media (max-width: 760px) {+ .embed-grid { grid-template-columns: 1fr; }+ .embed-preview-col { position: static; }+ }+ .embed-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }+ .embed-tab {+ background: transparent;+ border: 1px solid var(--border);+ color: inherit;+ padding: 6px 10px;+ border-radius: 8px;+ font: inherit;+ font-size: 12px;+ cursor: pointer;+ }+ .embed-tab[aria-selected="true"] {+ background: var(--panel);+ border-color: #6c5cff;+ color: #fff;+ }+ .embed-tab-panel[hidden] { display: none; }+ </style>`;+ bindSnippetTabs(body);+for (const btn of body.querySelectorAll('[data-copy]')) {btn.addEventListener('click', async () => {const target = body.querySelector(btn.dataset.copy);@@ -999,6 +1037,49 @@ function snippetBlock(title, code, _lang) {`;}+function snippetTabs(tabs) {+ const groupId = 'tabs-' + Math.random().toString(36).slice(2, 8);+ const buttons = tabs+ .map(+ (t, i) =>+ `<button class="embed-tab" role="tab" type="button" data-tab-index="${i}" aria-selected="${i === 0}">${esc(t.label)}</button>`,+ )+ .join('');+ const panels = tabs+ .map((t, i) => {+ const preId = `${groupId}-pre-${i}`;+ return `+ <div class="embed-tab-panel" role="tabpanel" data-panel-index="${i}"${i === 0 ? '' : ' hidden'}>+ <div class="row" style="justify-content:flex-end; margin-bottom:8px">+ <button class="btn sec" data-copy="#${preId}" type="button">Copy</button>+ </div>+ <pre id="${preId}" style="margin:0; max-height:340px; overflow:auto; white-space:pre">${esc(t.code)}</pre>+ </div>+ `;+ })+ .join('');+ return `+ <div class="card" data-tabs="${groupId}">+ <div class="embed-tabs" role="tablist">${buttons}</div>+ ${panels}+ </div>+ `;+}++function bindSnippetTabs(root) {+ for (const group of root.querySelectorAll('[data-tabs]')) {+ const tabs = group.querySelectorAll('.embed-tab');+ const panels = group.querySelectorAll('.embed-tab-panel');+ for (const tab of tabs) {+ tab.addEventListener('click', () => {+ const idx = tab.dataset.tabIndex;+ for (const t of tabs) t.setAttribute('aria-selected', t === tab);+ for (const p of panels) p.hidden = p.dataset.panelIndex !== idx;+ });+ }+ }+}+// ── Onchain deploy card ─────────────────────────────────────────────────────// Mints the agent on ERC-8004 so any host (Lobehub / Claude / etc.) can resolve// it from its onchain ID instead of needing the /agent/:id URL. Uses the@@ -2148,10 +2229,13 @@ async function renderAnimations(root) {let animations = Array.isArray(agent.meta?.animations) ? [...agent.meta.animations] : [];let presets = [];+ let presetsError = null;try {- presets = await fetch('/animations/presets.json').then((r) => r.json());- } catch {- /* presets unavailable */+ const r = await fetch('/animations/presets.json');+ if (!r.ok) throw new Error(`HTTP ${r.status}`);+ presets = await r.json();+ } catch (e) {+ presetsError = e.message || 'Could not load presets';}let saveTimer;@@ -2211,10 +2295,18 @@ async function renderAnimations(root) {debounceSync();});row.querySelector('.detach-btn').addEventListener('click', () => {- animations = animations.filter((a) => a !== clip);+ const idx = animations.indexOf(clip);+ if (idx === -1) return;+ animations.splice(idx, 1);renderClipList();renderPresetGrid();debounceSync();+ toastUndo(`Removed "${clip.name}"`, () => {+ animations.splice(idx, 0, clip);+ renderClipList();+ renderPresetGrid();+ debounceSync();+ });});row.querySelector('.preview-btn').addEventListener('click', () =>openAnimPreview(clip, avatarUrl),@@ -2291,6 +2383,12 @@ async function renderAnimations(root) {presetGridEl = document.createElement('div');presetGridEl.className = 'preset-grid';rightCol.appendChild(presetGridEl);+ } else if (presetsError) {+ const pe = document.createElement('div');+ pe.className = 'anim-inline-err';+ pe.style.marginBottom = '12px';+ pe.textContent = `Couldn’t load presets (${presetsError}).`;+ rightCol.appendChild(pe);}const uploadDiv = document.createElement('div');diff --git a/public/features/features.css b/public/features/features.cssnew file mode 100644index 000000000..98143e0d9--- /dev/null+++ b/public/features/features.css@@ -0,0 +1,791 @@+/******************************************************************************+ * /features — pure-CSS 3D parallax across three acts.+ *+ * Technique: <main class="parallax"> establishes a perspective scroll+ * container. Each <section class="parallax-act"> is a stacking context with+ * absolutely-positioned .parallax-layer children. Each layer is pushed back+ * in Z by `--depth * --perspective` and scaled up by `--depth + 1` to+ * compensate, so it still fills the viewport but drifts slower than the+ * front layer during scroll. Zero JS drives the parallax — the browser's+ * native 3D projection during scroll does the work.+ *+ * Live <agent-3d> elements live on the front-most layer of each act and+ * lazy-boot via IntersectionObserver in features.js.+ *+ * Honors prefers-reduced-motion (collapses to flat) and narrow viewports+ * (single-column flat layout, parallax disabled).+ ******************************************************************************/++:root {+ --features-perspective: 2.4rem;+ --features-act-height: 140vh;+ --features-content-pad: clamp(1rem, 4vw, 3rem);+ --features-bg: #06070b;+ --features-fg: #f1efe9;+ --features-gold: #ffd76a;+ --features-violet: #a78bfa;+ --features-mint: #6ee7b7;+ --features-cyan: #67e8f9;+}++/* ── Page shell ─────────────────────────────────────────────────────────── */++.features-parallax-page {+ background: var(--features-bg);+ color: var(--features-fg);+ margin: 0;+ overflow: hidden;+ height: 100vh;+}++.features-parallax-page header {+ position: fixed;+ inset: 0 0 auto 0;+ z-index: 50;+ background: linear-gradient(+ to bottom,+ rgba(6, 7, 11, 0.85) 0%,+ rgba(6, 7, 11, 0) 100%+ );+ backdrop-filter: blur(8px);+ -webkit-backdrop-filter: blur(8px);+}++/* ── The scroll container — establishes perspective ─────────────────────── */++.parallax {+ position: relative;+ height: 100vh;+ width: 100vw;+ overflow-x: hidden;+ overflow-y: auto;+ overscroll-behavior-y: none;+ perspective: var(--features-perspective);+ perspective-origin: 50% 0%;+ scroll-behavior: smooth;+}++/* Hide WebKit scrollbar without affecting scroll behavior. */+.parallax::-webkit-scrollbar {+ width: 0;+ height: 0;+}++.parallax {+ scrollbar-width: none;+}++/* ── Each act: a perspective-aware stacking context ─────────────────────── */++.parallax-act {+ position: relative;+ display: block;+ height: var(--features-act-height);+ transform-style: preserve-3d;+ overflow: hidden;+ isolation: isolate;+}++.parallax-act + .parallax-act {+ border-top: 1px solid rgba(255, 255, 255, 0.04);+}++/* ── Layers: pushed back in Z, scaled up to compensate ──────────────────── */++.parallax-layer {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ pointer-events: none;+ transform-origin: 50% 50%;+ transform: translateZ(calc(var(--features-perspective) * var(--depth) * -1))+ scale(calc(var(--depth) + 1));+ z-index: calc(10 - var(--depth, 0));+}++.parallax-layer--front {+ pointer-events: auto;+}++/* ── Background layer styles (pure CSS, no images) ──────────────────────── */++.layer-bg {+ position: absolute;+ inset: 0;+}++.layer-bg--nebula {+ background:+ radial-gradient(+ ellipse at 20% 30%,+ rgba(255, 215, 106, 0.12) 0%,+ transparent 55%+ ),+ radial-gradient(+ ellipse at 80% 70%,+ rgba(103, 232, 249, 0.1) 0%,+ transparent 55%+ ),+ linear-gradient(180deg, #0a0c12 0%, #06070b 100%);+}++.layer-bg--violet {+ background:+ radial-gradient(+ ellipse at 70% 30%,+ rgba(167, 139, 250, 0.18) 0%,+ transparent 55%+ ),+ radial-gradient(+ ellipse at 25% 75%,+ rgba(236, 72, 153, 0.08) 0%,+ transparent 60%+ ),+ linear-gradient(180deg, #0c0915 0%, #06070b 100%);+}++.layer-bg--mint {+ background:+ radial-gradient(+ ellipse at 30% 40%,+ rgba(110, 231, 183, 0.14) 0%,+ transparent 55%+ ),+ radial-gradient(+ ellipse at 80% 80%,+ rgba(255, 215, 106, 0.08) 0%,+ transparent 55%+ ),+ linear-gradient(180deg, #06120e 0%, #06070b 100%);+}++/* ── Mid-depth: grid lines ──────────────────────────────────────────────── */++.layer-grid {+ position: absolute;+ inset: 0;+ background-image:+ linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),+ linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);+ background-size: 64px 64px;+ mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);+ -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);+}++/* ── Mid-depth: floating glow orbs ──────────────────────────────────────── */++.layer-orb {+ position: absolute;+ width: clamp(280px, 38vw, 560px);+ aspect-ratio: 1;+ border-radius: 50%;+ filter: blur(60px);+ opacity: 0.55;+}++.layer-orb--gold {+ background: radial-gradient(circle, var(--features-gold), transparent 70%);+ top: 12%;+ left: 8%;+}++.layer-orb--cyan {+ background: radial-gradient(circle, var(--features-cyan), transparent 70%);+ bottom: 14%;+ right: 6%;+}++.layer-orb--violet {+ background: radial-gradient(circle, var(--features-violet), transparent 70%);+ top: 20%;+ right: 10%;+}++.layer-orb--mint {+ background: radial-gradient(circle, var(--features-mint), transparent 70%);+ top: 18%;+ left: 12%;+}++/* ── Mid-depth: emotion glyphs (Act 2) ──────────────────────────────────── */++.layer-glyphs {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+}++.layer-glyphs .glyph {+ font-family: 'Space Grotesk', 'Inter', sans-serif;+ font-size: 48px;+ font-weight: 600;+ fill: rgba(167, 139, 250, 0.18);+ letter-spacing: 0.04em;+}++.layer-glyphs .glyph--big {+ font-size: 96px;+ fill: rgba(255, 255, 255, 0.08);+}++/* ── Mid-depth: chain ribbon (Act 3, populated by features.js) ──────────── */++.layer-chains {+ position: absolute;+ inset: 0;+ display: flex;+ flex-wrap: wrap;+ align-content: center;+ justify-content: center;+ gap: 1.5rem 2.5rem;+ padding: 6rem 4rem;+}++.layer-chains .chain-pill {+ font-family: 'Space Grotesk', sans-serif;+ font-size: 18px;+ font-weight: 600;+ letter-spacing: 0.08em;+ color: rgba(110, 231, 183, 0.32);+ text-transform: uppercase;+ border: 1px solid rgba(110, 231, 183, 0.2);+ border-radius: 999px;+ padding: 0.4rem 1rem;+ white-space: nowrap;+}++/* ── Front-layer stage (where the live agent lives) ─────────────────────── */++.act-stage {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ pointer-events: none;+}++.act-agent {+ display: block;+ width: clamp(280px, 32vw, 480px);+ aspect-ratio: 4 / 5;+ pointer-events: auto;+ filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.5));+ opacity: 0;+ transition: opacity 0.6s ease 0.1s;+}++.act-agent[data-ready='true'] {+ opacity: 1;+}++/* Passport tag (Act 3) */+.act-passport {+ position: absolute;+ bottom: 16%;+ left: 50%;+ transform: translateX(-50%);+ display: inline-flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.4rem 0.9rem;+ background: rgba(6, 7, 11, 0.7);+ border: 1px solid rgba(110, 231, 183, 0.4);+ border-radius: 999px;+ color: var(--features-mint);+ font-family: 'JetBrains Mono', monospace;+ font-size: 13px;+ letter-spacing: 0.04em;+ pointer-events: auto;+ backdrop-filter: blur(6px);+ -webkit-backdrop-filter: blur(6px);+}++.act-passport[hidden] {+ display: none;+}++.passport-label {+ color: rgba(255, 255, 255, 0.55);+}++.passport-divider {+ opacity: 0.4;+}++/* ── Act content (sticky-positioned text overlay) ───────────────────────── */++.act-content {+ position: sticky;+ top: 0;+ height: 100vh;+ margin-bottom: -100vh;+ z-index: 20;+ display: flex;+ flex-direction: column;+ justify-content: flex-end;+ padding: 0 var(--features-content-pad) clamp(2rem, 5vh, 4rem);+ pointer-events: none;+ max-width: 720px;+}++.act-content > * {+ pointer-events: auto;+}++.act-eyebrow {+ display: inline-flex;+ align-items: center;+ gap: 0.5rem;+ font-family: 'Space Grotesk', sans-serif;+ font-size: 13px;+ font-weight: 500;+ letter-spacing: 0.12em;+ text-transform: uppercase;+ color: rgba(255, 255, 255, 0.65);+ margin-bottom: 1rem;+ width: fit-content;+}++.act-eyebrow-dot {+ width: 6px;+ height: 6px;+ border-radius: 50%;+ background: var(--features-gold);+ box-shadow: 0 0 12px var(--features-gold);+ animation: features-pulse 2.4s ease-in-out infinite;+}++.parallax-act--empathy .act-eyebrow-dot {+ background: var(--features-violet);+ box-shadow: 0 0 12px var(--features-violet);+}++.parallax-act--onchain .act-eyebrow-dot {+ background: var(--features-mint);+ box-shadow: 0 0 12px var(--features-mint);+}++@keyframes features-pulse {+ 0%,+ 100% {+ opacity: 1;+ transform: scale(1);+ }+ 50% {+ opacity: 0.55;+ transform: scale(0.85);+ }+}++.act-content h2 {+ font-family: 'Space Grotesk', 'Inter', sans-serif;+ font-size: clamp(2rem, 5.5vw, 4rem);+ font-weight: 600;+ line-height: 1.05;+ letter-spacing: -0.02em;+ margin: 0 0 1rem;+ color: #fff;+ text-wrap: balance;+}++.act-content h2 em {+ font-style: italic;+ font-weight: 500;+ color: var(--features-gold);+}++.parallax-act--empathy h2 em {+ color: var(--features-violet);+}++.parallax-act--onchain h2 em {+ color: var(--features-mint);+}++.act-lede {+ font-size: clamp(1rem, 1.5vw, 1.2rem);+ line-height: 1.5;+ color: rgba(241, 239, 233, 0.78);+ max-width: 56ch;+ margin: 0 0 1.5rem;+ text-wrap: pretty;+}++/* ── Embed code block (Act 1) ───────────────────────────────────────────── */++.act-code {+ position: relative;+ background: rgba(0, 0, 0, 0.45);+ border: 1px solid rgba(255, 255, 255, 0.08);+ border-radius: 10px;+ padding: 1rem 1.2rem;+ margin: 0 0 1.5rem;+ font-family: 'JetBrains Mono', monospace;+ font-size: 13px;+ line-height: 1.55;+ color: rgba(241, 239, 233, 0.88);+ overflow-x: auto;+ max-width: 100%;+ backdrop-filter: blur(6px);+ -webkit-backdrop-filter: blur(6px);+}++.act-code pre {+ margin: 0;+ white-space: pre;+}++.act-code code {+ font: inherit;+}++.act-code .code-em {+ color: var(--features-gold);+}++.act-code-copy {+ position: absolute;+ top: 0.6rem;+ right: 0.6rem;+ background: rgba(255, 255, 255, 0.06);+ border: 1px solid rgba(255, 255, 255, 0.12);+ color: rgba(255, 255, 255, 0.78);+ font-family: 'Space Grotesk', sans-serif;+ font-size: 12px;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ padding: 0.3rem 0.6rem;+ border-radius: 6px;+ cursor: pointer;+ transition: background 0.15s ease, color 0.15s ease;+}++.act-code-copy:hover,+.act-code-copy:focus-visible {+ background: rgba(255, 215, 106, 0.16);+ color: var(--features-gold);+ outline: none;+}++.act-code-copy[data-copied='true'] {+ color: var(--features-mint);+ border-color: var(--features-mint);+}++/* ── Emotion chips (Act 2) ──────────────────────────────────────────────── */++.emotion-chips {+ display: flex;+ flex-wrap: wrap;+ gap: 0.5rem;+ margin: 0 0 1.5rem;+}++.emotion-chip {+ display: inline-flex;+ align-items: center;+ gap: 0.4rem;+ padding: 0.5rem 0.9rem;+ background: rgba(255, 255, 255, 0.04);+ border: 1px solid rgba(167, 139, 250, 0.28);+ border-radius: 999px;+ color: rgba(241, 239, 233, 0.9);+ font: inherit;+ font-size: 14px;+ font-weight: 500;+ cursor: pointer;+ transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;+}++.emotion-chip:hover,+.emotion-chip:focus-visible {+ background: rgba(167, 139, 250, 0.16);+ border-color: var(--features-violet);+ outline: none;+}++.emotion-chip[data-active='true'] {+ background: rgba(167, 139, 250, 0.24);+ border-color: var(--features-violet);+ transform: scale(0.98);+}++.emotion-chip-glyph {+ color: var(--features-violet);+ font-weight: 700;+}++/* ── Stats (Act 3) ──────────────────────────────────────────────────────── */++.act-stats {+ display: grid;+ grid-template-columns: repeat(3, minmax(0, 1fr));+ gap: 1rem 2rem;+ margin: 0 0 1.5rem;+ padding: 0;+ max-width: 540px;+}++.act-stats > div {+ display: flex;+ flex-direction: column;+ gap: 0.25rem;+}++.act-stats dt {+ font-family: 'Space Grotesk', sans-serif;+ font-size: 11px;+ font-weight: 500;+ letter-spacing: 0.12em;+ text-transform: uppercase;+ color: rgba(255, 255, 255, 0.55);+}++.act-stats dd {+ font-family: 'Space Grotesk', sans-serif;+ font-size: clamp(1.1rem, 1.8vw, 1.5rem);+ font-weight: 600;+ color: var(--features-mint);+ margin: 0;+}++/* ── CTAs ───────────────────────────────────────────────────────────────── */++.act-cta {+ display: flex;+ flex-wrap: wrap;+ gap: 0.75rem;+}++.btn-primary,+.btn-ghost {+ display: inline-flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.85rem 1.4rem;+ border-radius: 10px;+ font-family: 'Space Grotesk', 'Inter', sans-serif;+ font-size: 15px;+ font-weight: 500;+ letter-spacing: 0.01em;+ text-decoration: none;+ transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;+}++.btn-primary {+ background: var(--features-gold);+ color: #1a1610;+ border: 1px solid var(--features-gold);+}++.parallax-act--empathy .btn-primary {+ background: var(--features-violet);+ color: #1a1530;+ border-color: var(--features-violet);+}++.parallax-act--onchain .btn-primary {+ background: var(--features-mint);+ color: #04201a;+ border-color: var(--features-mint);+}++.btn-primary:hover,+.btn-primary:focus-visible {+ transform: translateY(-1px);+ outline: none;+}++.btn-ghost {+ background: transparent;+ color: rgba(255, 255, 255, 0.85);+ border: 1px solid rgba(255, 255, 255, 0.2);+}++.btn-ghost:hover,+.btn-ghost:focus-visible {+ background: rgba(255, 255, 255, 0.06);+ border-color: rgba(255, 255, 255, 0.4);+ outline: none;+}++.btn-arrow {+ transition: transform 0.15s ease;+}++.btn-primary:hover .btn-arrow,+.btn-ghost:hover .btn-arrow {+ transform: translateX(2px);+}++/* ── Outro (flat) ───────────────────────────────────────────────────────── */++.features-outro {+ position: relative;+ background: var(--features-bg);+ color: var(--features-fg);+ padding: clamp(3rem, 8vh, 6rem) var(--features-content-pad)+ clamp(2rem, 5vh, 4rem);+ z-index: 30;+}++.features-outro h3 {+ font-family: 'Space Grotesk', sans-serif;+ font-size: clamp(1.6rem, 3.2vw, 2.4rem);+ font-weight: 600;+ letter-spacing: -0.01em;+ margin: 0 0 2rem;+ color: #fff;+}++.outro-grid {+ list-style: none;+ margin: 0 0 3rem;+ padding: 0;+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));+ gap: 1.5rem;+ max-width: 1200px;+}++.outro-grid li {+ background: rgba(255, 255, 255, 0.025);+ border: 1px solid rgba(255, 255, 255, 0.06);+ border-radius: 12px;+ padding: 1.4rem 1.5rem;+}++.outro-grid h4 {+ font-family: 'Space Grotesk', sans-serif;+ font-size: 1.05rem;+ font-weight: 600;+ margin: 0 0 0.5rem;+ color: #fff;+}++.outro-grid p {+ font-size: 14px;+ line-height: 1.55;+ color: rgba(241, 239, 233, 0.7);+ margin: 0;+}++.outro-grid code {+ font-family: 'JetBrains Mono', monospace;+ font-size: 12px;+ color: var(--features-gold);+ background: rgba(255, 215, 106, 0.08);+ padding: 0.1rem 0.35rem;+ border-radius: 4px;+}++.features-footer {+ border-top: 1px solid rgba(255, 255, 255, 0.06);+ padding-top: 1.5rem;+ font-size: 13px;+ color: rgba(255, 255, 255, 0.5);+}++.features-footer a {+ color: rgba(255, 255, 255, 0.7);+ text-decoration: none;+ border-bottom: 1px solid rgba(255, 255, 255, 0.2);+}++.features-footer a:hover {+ color: var(--features-gold);+ border-color: var(--features-gold);+}++/* ── Responsive: narrow viewports collapse to flat layout ───────────────── */++@media (max-width: 768px) {+ .features-parallax-page {+ overflow: auto;+ height: auto;+ }++ .parallax {+ perspective: none;+ height: auto;+ overflow: visible;+ scroll-behavior: auto;+ }++ .parallax-act {+ height: auto;+ min-height: 100vh;+ padding: 7rem 0 2rem;+ }++ .parallax-layer {+ transform: none;+ position: absolute;+ }++ .parallax-layer--front {+ position: relative;+ }++ .act-stage {+ position: relative;+ height: 50vh;+ padding: 1rem;+ }++ .act-content {+ position: relative;+ height: auto;+ margin-bottom: 0;+ padding: 1.5rem var(--features-content-pad) 2rem;+ }++ .act-stats {+ grid-template-columns: repeat(2, minmax(0, 1fr));+ }+}++/* ── Reduced motion: disable parallax + animation, keep agents ──────────── */++@media (prefers-reduced-motion: reduce) {+ .features-parallax-page {+ overflow: auto;+ height: auto;+ }++ .parallax {+ perspective: none;+ height: auto;+ overflow: visible;+ scroll-behavior: auto;+ }++ .parallax-act {+ height: auto;+ min-height: 100vh;+ padding: 6rem 0 2rem;+ }++ .parallax-layer {+ transform: none;+ }++ .act-stage,+ .act-content {+ position: relative;+ height: auto;+ margin-bottom: 0;+ }++ .act-eyebrow-dot {+ animation: none;+ }++ .act-agent {+ opacity: 1;+ transition: none;+ }+}diff --git a/public/features/index.html b/public/features/index.htmlnew file mode 100644index 000000000..5f254d821--- /dev/null+++ b/public/features/index.html@@ -0,0 +1,327 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8" />+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />+ <title>Features · 3D Agent</title>+ <meta name="author" content="nirholas" />+ <meta+ name="description"+ content="3D Agent: a verifiable, on-chain identity for every AI avatar. ERC-8004 native, with a built-in empathy layer and one-click deploy across 20+ EVM chains."+ />+ <meta name="theme-color" content="#000000" />++ <meta property="og:type" content="website" />+ <meta property="og:title" content="Features · 3D Agent" />+ <meta+ property="og:description"+ content="ERC-8004 native 3D agents with an empathy layer. Deploy on-chain in one transaction."+ />+ <meta property="og:url" content="https://3dagent.vercel.app/features" />+ <meta property="og:image" content="https://3dagent.vercel.app/og-image.png" />++ <link rel="canonical" href="https://3dagent.vercel.app/features" />+ <link rel="shortcut icon" href="/favicon.ico" />+ <link rel="preconnect" href="https://fonts.googleapis.com" />+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />+ <link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/features/features.css" />+ <link+ href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap"+ rel="stylesheet"+ />+ <script+ type="module"+ src="https://3dagent.vercel.app/agent-3d/latest/agent-3d.js"+ ></script>+ </head>+ <body class="features-page features-parallax-page">+ <a href="#deploy" class="skip-link">Skip to deploy</a>++ <header>+ <h1>+ <a href="/"><span class="wordmark-dot" aria-hidden="true"></span>3D Agent</a>+ </h1>+ <nav class="features-nav" aria-label="Primary">+ <a href="/app">Viewer</a>+ <a href="/discover">Discover</a>+ <a href="/features" class="active" aria-current="page">Features</a>+ <a href="/widgets">Widgets</a>+ <a href="/dashboard" class="nav-dashboard">Dashboard</a>+ <a href="/login" class="nav-sign-in">Sign in</a>+ </nav>+ </header>++ <main class="parallax" data-role="parallax-root">+ <!-- ─── ACT 1 — Live 3D, in your browser ─────────────────────────── -->+ <section class="parallax-act" data-act="1" aria-labelledby="act1-title">+ <div class="parallax-layer" style="--depth: 8" aria-hidden="true">+ <div class="layer-bg layer-bg--nebula"></div>+ </div>+ <div class="parallax-layer" style="--depth: 5" aria-hidden="true">+ <div class="layer-grid"></div>+ </div>+ <div class="parallax-layer" style="--depth: 2" aria-hidden="true">+ <div class="layer-orb layer-orb--gold"></div>+ <div class="layer-orb layer-orb--cyan"></div>+ </div>+ <div class="parallax-layer parallax-layer--front" style="--depth: 1">+ <div class="act-stage" data-role="act1-stage">+ <agent-3d+ class="act-agent"+ data-role="act1-agent"+ kiosk+ eager+ aria-label="Live 3D avatar — drag to rotate"+ ></agent-3d>+ </div>+ </div>++ <div class="act-content act-content--bottom">+ <div class="act-eyebrow">+ <span class="act-eyebrow-dot"></span>+ <span>Live, in your browser</span>+ </div>+ <h2 id="act1-title">+ A 3D agent is <em>one tag</em> away.+ </h2>+ <p class="act-lede">+ No SDK. No iframe. Drop a single web component into any page and you have a+ lazy-loading, render-anywhere AI avatar with built-in identity, memory, and+ emotion.+ </p>+ <div class="act-code" aria-label="Embed code">+ <pre><code><script type="module" src="https://3dagent.vercel.app/agent-3d/latest/agent-3d.js"></script>+<agent-3d agent-id="<span class="code-em" data-role="code-agent-id">0x3d…a9f</span>"></agent-3d></code></pre>+ <button+ type="button"+ class="act-code-copy"+ data-role="copy-embed"+ aria-label="Copy embed code"+ >+ Copy+ </button>+ </div>+ <div class="act-cta">+ <a href="#act-empathy" class="btn-primary">+ <span>See the empathy layer</span>+ <span class="btn-arrow" aria-hidden="true">↓</span>+ </a>+ <a href="/widgets" class="btn-ghost">Browse embeds</a>+ </div>+ </div>+ </section>++ <!-- ─── ACT 2 — Empathy layer ───────────────────────────────────── -->+ <section+ class="parallax-act parallax-act--empathy"+ data-act="2"+ id="act-empathy"+ aria-labelledby="act2-title"+ >+ <div class="parallax-layer" style="--depth: 8" aria-hidden="true">+ <div class="layer-bg layer-bg--violet"></div>+ </div>+ <div class="parallax-layer" style="--depth: 5" aria-hidden="true">+ <svg+ class="layer-glyphs"+ viewBox="0 0 1600 900"+ preserveAspectRatio="xMidYMid slice"+ role="presentation"+ >+ <g class="layer-glyphs-g">+ <text x="120" y="220" class="glyph">celebration</text>+ <text x="980" y="160" class="glyph">curiosity</text>+ <text x="220" y="640" class="glyph">empathy</text>+ <text x="1180" y="720" class="glyph">concern</text>+ <text x="640" y="420" class="glyph glyph--big">neutral</text>+ <text x="60" y="820" class="glyph">patience</text>+ </g>+ </svg>+ </div>+ <div class="parallax-layer" style="--depth: 2" aria-hidden="true">+ <div class="layer-orb layer-orb--violet"></div>+ </div>+ <div class="parallax-layer parallax-layer--front" style="--depth: 1">+ <div class="act-stage" data-role="act2-stage">+ <agent-3d+ class="act-agent"+ data-role="act2-agent"+ kiosk+ aria-label="3D avatar reacting to emotion triggers"+ ></agent-3d>+ </div>+ </div>++ <div class="act-content act-content--bottom">+ <div class="act-eyebrow">+ <span class="act-eyebrow-dot"></span>+ <span>Empathy layer</span>+ </div>+ <h2 id="act2-title">+ Six emotions. Continuous blend. <em>Real time.</em>+ </h2>+ <p class="act-lede">+ Every avatar runs an emotion engine that reacts to the agent's own actions —+ speaking, thinking, succeeding, failing. Tap a chip to see it move.+ </p>+ <div+ class="emotion-chips"+ data-role="emotion-chips"+ role="group"+ aria-label="Emotion triggers"+ >+ <button type="button" class="emotion-chip" data-emotion="celebration">+ <span class="emotion-chip-glyph">✦</span>celebration+ </button>+ <button type="button" class="emotion-chip" data-emotion="curiosity">+ <span class="emotion-chip-glyph">?</span>curiosity+ </button>+ <button type="button" class="emotion-chip" data-emotion="empathy">+ <span class="emotion-chip-glyph">♥</span>empathy+ </button>+ <button type="button" class="emotion-chip" data-emotion="concern">+ <span class="emotion-chip-glyph">!</span>concern+ </button>+ <button type="button" class="emotion-chip" data-emotion="patience">+ <span class="emotion-chip-glyph">…</span>patience+ </button>+ </div>+ <div class="act-cta">+ <a href="/app" class="btn-primary">+ <span>Talk to it</span>+ <span class="btn-arrow" aria-hidden="true">→</span>+ </a>+ <a href="#act-onchain" class="btn-ghost">Deploy on-chain ↓</a>+ </div>+ </div>+ </section>++ <!-- ─── ACT 3 — On-chain (ERC-8004) ─────────────────────────────── -->+ <section+ class="parallax-act parallax-act--onchain"+ data-act="3"+ id="act-onchain"+ aria-labelledby="act3-title"+ >+ <div class="parallax-layer" style="--depth: 8" aria-hidden="true">+ <div class="layer-bg layer-bg--mint"></div>+ </div>+ <div class="parallax-layer" style="--depth: 5" aria-hidden="true">+ <div class="layer-chains" data-role="chain-ribbon"></div>+ </div>+ <div class="parallax-layer" style="--depth: 2" aria-hidden="true">+ <div class="layer-orb layer-orb--mint"></div>+ </div>+ <div class="parallax-layer parallax-layer--front" style="--depth: 1">+ <div class="act-stage" data-role="act3-stage">+ <agent-3d+ class="act-agent"+ data-role="act3-agent"+ kiosk+ aria-label="A registered on-chain ERC-8004 agent"+ ></agent-3d>+ <div class="act-passport" data-role="passport" hidden>+ <span class="passport-label">agentId</span>+ <span class="passport-value" data-role="passport-id">—</span>+ <span class="passport-divider" aria-hidden="true">·</span>+ <span class="passport-chain" data-role="passport-chain">—</span>+ </div>+ </div>+ </div>++ <div class="act-content act-content--bottom">+ <div class="act-eyebrow">+ <span class="act-eyebrow-dot"></span>+ <span>ERC-8004 native</span>+ </div>+ <h2 id="act3-title">One transaction. <em>One identity.</em> Every chain.</h2>+ <p class="act-lede">+ Mint an ERC-721 on any of <span data-role="chain-count">20+</span> EVM+ networks. Your avatar gets a portable, verifiable agentId — discoverable by+ any A2A or MCP client, anywhere.+ </p>+ <dl class="act-stats" aria-label="Agent registry stats">+ <div>+ <dt>Chains supported</dt>+ <dd data-role="stat-chains">20+</dd>+ </div>+ <div>+ <dt>Agents indexed</dt>+ <dd data-role="stat-agents">—</dd>+ </div>+ <div>+ <dt>Standards</dt>+ <dd>ERC-721 · A2A · MCP</dd>+ </div>+ </dl>+ <div class="act-cta" id="deploy">+ <a href="/deploy" class="btn-primary">+ <span>Deploy your agent</span>+ <span class="btn-arrow" aria-hidden="true">→</span>+ </a>+ <a href="/discover" class="btn-ghost">See who's already on-chain</a>+ </div>+ </div>+ </section>++ <!-- ─── Flat outro ──────────────────────────────────────────────── -->+ <section class="features-outro" aria-labelledby="outro-title">+ <h3 id="outro-title">Everything an agent needs.</h3>+ <ul class="outro-grid">+ <li>+ <h4>Identity Registry</h4>+ <p>+ ERC-721 based. Each agent has an <code>agentId</code> and a URI that+ resolves to its registration JSON.+ </p>+ </li>+ <li>+ <h4>Reputation Registry</h4>+ <p>+ Signed feedback on quality, uptime, and response time. On-chain+ composability + off-chain aggregation.+ </p>+ </li>+ <li>+ <h4>Validation Registry</h4>+ <p>+ Stake-secured re-execution, zkML proofs, TEE attestations. Trust+ proportional to value at risk.+ </p>+ </li>+ <li>+ <h4>Memory + skills</h4>+ <p>+ Frontmatter-`.md` memory, recursive skill bundles, signed action history.+ Portable across hosts.+ </p>+ </li>+ </ul>+ <footer class="features-footer">+ <p>+ 3D Agent ·+ <a+ href="https://github.com/nirholas/3D"+ target="_blank"+ rel="noopener"+ aria-label="3D Agent on GitHub (opens in a new tab)"+ >GitHub</a+ >+ · Built on+ <a+ href="https://eips.ethereum.org/EIPS/eip-8004"+ target="_blank"+ rel="noopener"+ aria-label="ERC-8004 specification (opens in a new tab)"+ >ERC-8004</a+ >+ </p>+ </footer>+ </section>+ </main>++ <script type="module" src="/features/features.js"></script>+ </body>+</html>diff --git a/public/my-agents/index.html b/public/my-agents/index.htmlindex a059363b7..899e5cdc7 100644--- a/public/my-agents/index.html+++ b/public/my-agents/index.html@@ -37,7 +37,7 @@id="discover-grid"class="discover-grid"role="list"- aria-label="Discovered agents"+ aria-label="Your on-chain agents"aria-live="polite"aria-busy="true"></div>diff --git a/public/my-agents/my-agents.js b/public/my-agents/my-agents.jsindex c63288f8d..891f16e27 100644--- a/public/my-agents/my-agents.js+++ b/public/my-agents/my-agents.js@@ -240,9 +240,10 @@ async function loadAgents() {if (!user) {showState('🔐',- 'Sign in to discover your agents',+ 'Sign in to see your agents','Link a wallet and sign in to see your on-chain agents.',{ label: 'Sign in', href: '/login.html' },+ { label: 'Or browse community agents →', href: '/discover' },);return;}diff --git a/public/studio/index.html b/public/studio/index.htmlindex d619c564d..570a436b6 100644--- a/public/studio/index.html+++ b/public/studio/index.html@@ -18,7 +18,6 @@href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap"rel="stylesheet"/>- <link rel="stylesheet" href="/style.css" /><link rel="stylesheet" href="/studio/studio.css" /></head><body class="studio-body">diff --git a/scripts/animations.config.json b/scripts/animations.config.jsonnew file mode 100644index 000000000..205b36c8d--- /dev/null+++ b/scripts/animations.config.json@@ -0,0 +1,21 @@+[+ { "name": "idle", "source": "Old Man Idle.fbx", "label": "Idle", "icon": "🧍", "loop": true },+ { "name": "dance", "source": "Hip Hop Dancing.fbx", "label": "Dance", "icon": "💃", "loop": true },+ { "name": "celebrate", "source": "Joyful Jump.fbx", "label": "Celebrate", "icon": "🎉", "loop": false },+ { "name": "angry", "source": "Angry.fbx", "label": "Angry", "icon": "😡", "loop": false },+ { "name": "defeated", "source": "Defeated.fbx", "label": "Defeated", "icon": "😞", "loop": false },+ { "name": "dying", "source": "Dying.fbx", "label": "Dying", "icon": "💀", "loop": false },+ { "name": "falling", "source": "Falling.fbx", "label": "Falling", "icon": "🪂", "loop": false },+ { "name": "jump", "source": "Joyful Jump.fbx", "label": "Jump", "icon": "🦘", "loop": false },+ { "name": "kiss", "source": "Kiss.fbx", "label": "Kiss", "icon": "💋", "loop": false },+ { "name": "pray", "source": "Praying.fbx", "label": "Pray", "icon": "🙏", "loop": false },+ { "name": "reaction", "source": "Reaction.fbx", "label": "Reaction", "icon": "😲", "loop": false },+ { "name": "rumba", "source": "Rumba Dancing.fbx", "label": "Rumba", "icon": "🕺", "loop": true },+ { "name": "silly", "source": "Silly Dancing.fbx", "label": "Silly Dance", "icon": "🤪", "loop": true },+ { "name": "sitclap", "source": "Sitting Clap.fbx", "label": "Sit Clap", "icon": "👏", "loop": false },+ { "name": "sitlaugh", "source": "Sitting Laughing.fbx", "label": "Sit Laugh", "icon": "😂", "loop": false },+ { "name": "taunt", "source": "Taunt.fbx", "label": "Taunt", "icon": "😝", "loop": false },+ { "name": "thriller", "source": "Thriller Part 3.fbx", "label": "Thriller", "icon": "🧟", "loop": true },+ { "name": "capoeira", "source": "Capoeira.fbx", "label": "Capoeira", "icon": "🥋", "loop": true },+ { "name": "wave", "source": "Standing Cover Turn.fbx", "label": "Wave", "icon": "👋", "loop": false }+]diff --git a/scripts/build-animations.mjs b/scripts/build-animations.mjsnew file mode 100644index 000000000..2f287ab15--- /dev/null+++ b/scripts/build-animations.mjs@@ -0,0 +1,232 @@+#!/usr/bin/env node+/**+ * Animation build pipeline.+ *+ * Reads Mixamo FBX clips listed in scripts/animations.config.json, retargets+ * them to the canonical Avaturn skeleton (cz.glb), and writes one GLB per+ * clip into public/animations/clips/. Also rewrites public/animations/manifest.json+ * to point only at clips that retargeted successfully.+ *+ * Why pre-bake?+ * - On-chain agents must animate without runtime retargeting fragility.+ * - Browser cold-loads should not re-parse FBX or guess bone names.+ * - Build-time validation = clips that don't survive retargeting are dropped+ * here, not silently broken in production.+ *+ * Run via: npm run build:animations+ */+import { readFileSync, writeFileSync, mkdirSync, existsSync, rmSync } from 'node:fs';+import { fileURLToPath } from 'node:url';+import { dirname, resolve, basename } from 'node:path';+import { Blob } from 'node:buffer';++// three's loaders + exporter touch a handful of DOM globals; stub them out for node.+globalThis.self = globalThis;+globalThis.window = globalThis;+globalThis.document = { createElementNS: () => ({}) };+globalThis.Blob = Blob;++// GLTFExporter calls FileReader.readAsDataURL on Blob-wrapped texture/binary+// chunks. Node has no FileReader; the minimal stub below handles the two+// methods three's exporter actually invokes.+class NodeFileReader extends EventTarget {+ readAsDataURL(blob) {+ blob.arrayBuffer().then((buf) => {+ const b64 = Buffer.from(buf).toString('base64');+ this.result = `data:${blob.type || 'application/octet-stream'};base64,${b64}`;+ this.onload?.({ target: this });+ this.dispatchEvent(new Event('load'));+ });+ }+ readAsArrayBuffer(blob) {+ blob.arrayBuffer().then((buf) => {+ this.result = buf;+ this.onload?.({ target: this });+ this.dispatchEvent(new Event('load'));+ });+ }+}+globalThis.FileReader = NodeFileReader;++const __dirname = dirname(fileURLToPath(import.meta.url));+const ROOT = resolve(__dirname, '..');+const ANIM_DIR = resolve(ROOT, 'public/animations');+const OUT_DIR = resolve(ANIM_DIR, 'clips');+const REFERENCE_GLB = resolve(ROOT, 'public/avatars/cz.glb');+const CONFIG = resolve(__dirname, 'animations.config.json');+const MANIFEST_OUT = resolve(ANIM_DIR, 'manifest.json');++const MIXAMO_PREFIX = /^mixamorig\d*[_:]?/i;+// Mixamo FBX exports hip translation in centimeters relative to the rig's+// natural scale. FBXLoader applies a 0.01 unit scale (cm→m), but the hip+// translation track itself is a *delta* baked into the clip and survives that+// rescale. We rescale the hips position track to match Avaturn's meter rig.+// 0.01 = the empirical factor that lands feet on the ground for the Avaturn+// rig (verified against cz.glb). Adjust here if a future rig diverges.+const HIPS_POSITION_SCALE = 0.01;++async function loadGLB(path) {+ const { GLTFLoader } = await import('three/examples/jsm/loaders/GLTFLoader.js');+ const buf = readFileSync(path);+ const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);+ const loader = new GLTFLoader();+ return new Promise((res, rej) => loader.parse(ab, '', res, rej));+}++async function loadFBX(path) {+ const { FBXLoader } = await import('three/examples/jsm/loaders/FBXLoader.js');+ const buf = readFileSync(path);+ const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);+ const loader = new FBXLoader();+ return loader.parse(ab, '');+}++function collectBoneNames(root) {+ const names = new Set();+ root.traverse((n) => {+ if (n.isBone) names.add(n.name);+ });+ return names;+}++/**+ * Retarget a single clip from a Mixamo skeleton to the canonical Avaturn rig.+ *+ * @param {import('three').AnimationClip} clip+ * @param {Set<string>} avaturnBones+ * @returns {{ clip: import('three').AnimationClip, matched: number, total: number, dropped: string[] }}+ */+function retargetClip(clip, avaturnBones) {+ const dropped = [];+ const newTracks = [];+ for (const track of clip.tracks) {+ const dot = track.name.indexOf('.');+ const boneRaw = track.name.slice(0, dot);+ const property = track.name.slice(dot + 1);+ const stripped = boneRaw.replace(MIXAMO_PREFIX, '');+ if (!avaturnBones.has(stripped)) {+ dropped.push(boneRaw);+ continue;+ }+ const newTrack = track.clone();+ newTrack.name = `${stripped}.${property}`;+ // Mixamo bakes hip translation in cm even after FBXLoader rescaling.+ // Without this, the avatar floats ~100m in the air for clips that have+ // vertical motion (Joyful Jump, Falling, etc.) and slides off-screen+ // for any clip with horizontal motion.+ if (stripped === 'Hips' && property === 'position') {+ for (let i = 0; i < newTrack.values.length; i++) {+ newTrack.values[i] *= HIPS_POSITION_SCALE;+ }+ }+ newTracks.push(newTrack);+ }+ const out = clip.clone();+ out.tracks = newTracks;+ return { clip: out, matched: newTracks.length, total: clip.tracks.length, dropped };+}++/**+ * Build a minimal scene containing only the bone hierarchy from a reference+ * skinned model. Skips meshes/textures so each exported clip GLB stays small+ * (~bone count × keyframes) instead of carrying a copy of the avatar mesh.+ */+async function buildBonesOnlyScene(referenceScene) {+ const { Scene } = await import('three');+ const scene = new Scene();+ scene.name = 'AnimationRig';+ // Find the root bone (first bone with no bone parent) and clone the bone tree.+ let rootBone = null;+ referenceScene.traverse((n) => {+ if (n.isBone && !rootBone && (!n.parent || !n.parent.isBone)) rootBone = n;+ });+ if (!rootBone) throw new Error('reference scene has no bones');+ scene.add(rootBone.clone(true));+ return scene;+}++async function exportClipAsGLB(clip, bonesScene) {+ const { GLTFExporter } = await import('three/examples/jsm/exporters/GLTFExporter.js');+ const exporter = new GLTFExporter();+ return new Promise((resolve, reject) => {+ exporter.parse(+ bonesScene,+ (arrayBuffer) => resolve(Buffer.from(arrayBuffer)),+ (err) => reject(err),+ { binary: true, animations: [clip], onlyVisible: false },+ );+ });+}++async function main() {+ const config = JSON.parse(readFileSync(CONFIG, 'utf8'));+ if (existsSync(OUT_DIR)) rmSync(OUT_DIR, { recursive: true, force: true });+ mkdirSync(OUT_DIR, { recursive: true });++ console.log('[animations] loading reference Avaturn rig:', basename(REFERENCE_GLB));+ const reference = await loadGLB(REFERENCE_GLB);+ const avaturnBones = collectBoneNames(reference.scene);+ console.log(`[animations] reference rig has ${avaturnBones.size} bones`);++ const bonesScene = await buildBonesOnlyScene(reference.scene);++ const manifest = [];+ let okCount = 0;+ let failCount = 0;++ for (const def of config) {+ const fbxPath = resolve(ANIM_DIR, def.source);+ if (!existsSync(fbxPath)) {+ console.warn(`[animations] SKIP ${def.name}: missing source ${def.source}`);+ failCount++;+ continue;+ }+ try {+ const fbx = await loadFBX(fbxPath);+ const sourceClip = fbx.animations?.[0];+ if (!sourceClip) {+ console.warn(`[animations] SKIP ${def.name}: no clip in FBX`);+ failCount++;+ continue;+ }+ const { clip, matched, total, dropped } = retargetClip(sourceClip, avaturnBones);+ const matchPct = (matched / total) * 100;+ if (matchPct < 60) {+ console.warn(+ `[animations] SKIP ${def.name}: only ${matchPct.toFixed(0)}% bones matched`,+ );+ failCount++;+ continue;+ }+ clip.name = def.name;+ const glbBytes = await exportClipAsGLB(clip, bonesScene);+ const outName = `${def.name}.glb`;+ writeFileSync(resolve(OUT_DIR, outName), glbBytes);+ manifest.push({+ name: def.name,+ url: `/animations/clips/${outName}`,+ label: def.label,+ icon: def.icon,+ loop: def.loop !== false,+ });+ okCount++;+ const droppedNote = dropped.length ? ` (dropped ${dropped.length} unknown bones)` : '';+ console.log(+ `[animations] OK ${def.name.padEnd(12)} ${matched}/${total} tracks, ${(glbBytes.length / 1024).toFixed(0)}kB${droppedNote}`,+ );+ } catch (err) {+ console.warn(`[animations] FAIL ${def.name}: ${err.message}`);+ failCount++;+ }+ }++ writeFileSync(MANIFEST_OUT, JSON.stringify(manifest, null, '\t') + '\n');+ console.log(`\n[animations] wrote manifest with ${manifest.length} clips → ${MANIFEST_OUT}`);+ console.log(`[animations] ${okCount} ok, ${failCount} failed`);+ if (okCount === 0) process.exit(1);+}++main().catch((err) => {+ console.error('[animations] build failed:', err);+ process.exit(1);+});diff --git a/specs/3D_AGENT_CARD.md b/specs/3D_AGENT_CARD.mdnew file mode 100644index 000000000..9f84084ef--- /dev/null+++ b/specs/3D_AGENT_CARD.md@@ -0,0 +1,83 @@+# 3D Agent Card v1++A strict superset of the [ERC-8004 registration card](https://eips.ethereum.org/EIPS/eip-8004#registration-v1) for agents whose primary embodiment is a 3D model. This is the JSON document the ERC-721 `tokenURI` resolves to on the Identity Registry.++- **Type URI:** `https://3dagent.vercel.app/specs/3d-agent-card-v1`+- **JSON Schema:** [/.well-known/3d-agent-card.schema.json](../public/.well-known/3d-agent-card.schema.json)+- **Base spec:** ERC-8004 registration v1+- **Companion specs:** [AGENT_MANIFEST.md](AGENT_MANIFEST.md) (rich off-chain bundle), [REPORT_FORMAT.md](../public/validation/REPORT_FORMAT.md) (validation reports)++## Why++ERC-8004 is format-agnostic — the agent card can describe anything. That works for text/LLM agents but says nothing about 3D. Without a shared schema, every 3D agent registry and viewer reinvents the same fields (model URI, hash, bounding box, license) incompatibly. v1 pins those fields so any 3D-aware consumer can:++1. Render the agent without parsing vendor-specific JSON.+2. Verify the model bytes match the card (`sha256`).+3. Surface a trust badge from a signed validation report.+4. Walk a provenance chain across versions.++## Required fields beyond ERC-8004++Only `model` is new and required. The block is intentionally small:++```json+"model": {+ "uri": "ipfs://bafy.../body.glb",+ "format": "gltf-binary",+ "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"+}+```++| Field | Required | Notes |+| -------------- | -------- | ------------------------------------------------------------------------- |+| `uri` | ✓ | SHOULD be `ipfs://` — mutable URIs disqualify "trustless" claims. |+| `format` | ✓ | `gltf-binary` \| `gltf` \| `vrm`. |+| `sha256` | ✓ | Lowercase hex of the model bytes. Lets consumers verify independently. |+| `sizeBytes` | — | For load-time budgeting. |+| `polygonCount` | — | For perf/quality discovery. |+| `boundingBox` | — | `{min:[x,y,z], max:[x,y,z]}` in meters. Lets viewers normalize scale. |+| `license` | — | SPDX identifier or URL. |++## Optional extension blocks++- **`manifest`** — pointer to a full [AGENT_MANIFEST](AGENT_MANIFEST.md) bundle when the agent has a brain/voice/skills.+- **`validation`** — pointer to a signed [validation report](../public/validation/REPORT_FORMAT.md).+- **`previousVersion`** — URI of the prior card. Forms a provenance chain across model updates.++## Conformance++A document conforms to 3D Agent Card v1 if:++1. It validates against the JSON Schema linked above.+2. Its `type` field includes both:+ - `https://eips.ethereum.org/EIPS/eip-8004#registration-v1`+ - `https://3dagent.vercel.app/specs/3d-agent-card-v1`+3. The bytes at `model.uri` hash to `model.sha256`.++Consumers MUST treat any document missing point 3 as unverified, regardless of validation reports.++## Minimal example++```json+{+ "type": [+ "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",+ "https://3dagent.vercel.app/specs/3d-agent-card-v1"+ ],+ "name": "Coach Leo",+ "description": "A football coach who reviews your form.",+ "image": "ipfs://bafy.../poster.webp",+ "model": {+ "uri": "ipfs://bafy.../body.glb",+ "format": "gltf-binary",+ "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",+ "polygonCount": 48211,+ "boundingBox": { "min": [-0.4, 0, -0.3], "max": [0.4, 1.78, 0.3] },+ "license": "CC-BY-4.0"+ },+ "registrations": [+ { "agentId": 1, "agentRegistry": "eip155:8453:0x8004A818BFB912233c491871b3d84c89A494BD9e" }+ ],+ "supportedTrust": ["reputation", "validation"]+}+```