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: enhance share panel with SVG fallback for QR codes

nirholas17cc1d2853cf
diff --git a/api/_lib/env.js b/api/_lib/env.js
index bfe2b245c..a17d7394f 100644
--- a/api/_lib/env.js
+++ b/api/_lib/env.js
@@ -118,6 +118,13 @@ export const env = {
return opt('PERMISSIONS_RELAYER_ENABLED', 'false') === 'true';
},
+ // IPFS pinning provider credentials. Optional — when unset, pin endpoints
+ // fall back to a content-hash stub so the rest of the flow still works in
+ // dev. Set PINATA_JWT in production for real pins.
+ get PINATA_JWT() {
+ return opt('PINATA_JWT');
+ },
+
// Per-chain RPC URLs for on-chain delegation calls.
// Pattern: RPC_URL_<CHAINID> e.g. RPC_URL_84532 for Base Sepolia.
// Falls back to public RPC nodes when unset; set Alchemy/Infura URLs for production.
diff --git a/api/agents/[id]/animations.js b/api/agents/[id]/animations.js
new file mode 100644
index 000000000..9c0e369c8
--- /dev/null
+++ b/api/agents/[id]/animations.js
@@ -0,0 +1,83 @@
+// PUT /api/agents/:id/animations — owner-only; atomically replaces meta.animations
+//
+// Uses jsonb_set so the rest of `meta` (including encrypted_wallet_key) is never
+// read by the client or overwritten. The generic PUT /api/agents/:id handler
+// overwrites `meta` wholesale which would leak/clobber sibling fields — this
+// endpoint exists specifically to avoid that.
+
+import { getSessionUser, authenticateBearer, extractBearer } from '../../_lib/auth.js';
+import { sql } from '../../_lib/db.js';
+import { cors, json, method, readJson, wrap, error } from '../../_lib/http.js';
+import { z } from 'zod';
+
+const animationEntrySchema = z.object({
+ name: z.string().trim().min(1).max(60),
+ url: z
+ .string()
+ .trim()
+ .min(1)
+ .max(2048)
+ .refine(
+ (u) => /^(https?|ipfs|ar):\/\//.test(u) || u.startsWith('/') || /^u\//.test(u),
+ 'url must be http, https, ipfs, ar, a root-relative path, or a storage key',
+ ),
+ loop: z.boolean().default(true),
+ clipName: z.string().trim().max(120).optional(),
+ source: z.enum(['mixamo', 'preset', 'custom']),
+ addedAt: z.string().optional(),
+});
+
+const bodySchema = z.object({
+ animations: z.array(animationEntrySchema).max(30),
+});
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'PUT,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['PUT'])) return;
+
+ const id = req.query?.id || new URL(req.url, 'http://x').pathname.split('/').filter(Boolean)[2];
+ if (!id) return error(res, 400, 'invalid_request', 'agent id required');
+
+ const auth = await resolveAuth(req);
+ if (!auth) return error(res, 401, 'unauthorized', 'sign in required');
+
+ const [existing] = await sql`
+ SELECT id, user_id FROM agent_identities
+ WHERE id = ${id} AND deleted_at IS NULL
+ `;
+ if (!existing) return error(res, 404, 'not_found', 'agent not found');
+ if (existing.user_id !== auth.userId) return error(res, 403, 'forbidden', 'not your agent');
+
+ let parsed;
+ try {
+ parsed = bodySchema.parse(await readJson(req));
+ } catch (err) {
+ if (err.name === 'ZodError') {
+ return error(res, 400, 'validation_error', err.errors[0]?.message || 'invalid body', {
+ fields: err.errors,
+ });
+ }
+ throw err;
+ }
+
+ await sql`
+ UPDATE agent_identities
+ SET meta = jsonb_set(
+ COALESCE(meta, '{}'::jsonb),
+ '{animations}',
+ ${JSON.stringify(parsed.animations)}::jsonb,
+ true
+ )
+ WHERE id = ${id}
+ `;
+
+ return json(res, 200, { animations: parsed.animations });
+});
+
+async function resolveAuth(req) {
+ const session = await getSessionUser(req);
+ if (session) return { userId: session.id };
+ const bearer = await authenticateBearer(extractBearer(req));
+ if (bearer) return { userId: bearer.userId };
+ return null;
+}
diff --git a/api/avatars/[id]/pin-ipfs.js b/api/avatars/[id]/pin-ipfs.js
index 73441e6e2..63eff1c64 100644
--- a/api/avatars/[id]/pin-ipfs.js
+++ b/api/avatars/[id]/pin-ipfs.js
@@ -1,10 +1,16 @@
-// STUB — real pinning (Pinata / Web3.Storage) is a follow-up. For now this
-// computes a placeholder CID from the stored sha256 and flips pinned_ipfs.
+// Pin an avatar's GLB to IPFS. Uses Pinata when PINATA_JWT is configured;
+// otherwise falls back to a content-hash stub CID so dev environments still
+// flip the pinned flag.
+import { GetObjectCommand } from '@aws-sdk/client-s3';
import { sql } from '../../_lib/db.js';
import { getSessionUser } from '../../_lib/auth.js';
import { cors, json, method, wrap, error } from '../../_lib/http.js';
import { readStorageMode } from '../../_lib/storage-mode.js';
+import { r2 } from '../../_lib/r2.js';
+import { env } from '../../_lib/env.js';
+
+const PINATA_ENDPOINT = 'https://api.pinata.cloud/pinning/pinFileToIPFS';
export default wrap(async (req, res) => {
if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;
@@ -17,7 +23,8 @@ export default wrap(async (req, res) => {
if (!session) return error(res, 401, 'unauthorized', 'sign in required');
const [row] = await sql`
- SELECT id, owner_id, checksum_sha256 FROM avatars WHERE id = ${id} AND deleted_at IS NULL
+ SELECT id, owner_id, checksum_sha256, storage_key, content_type, name
+ FROM avatars WHERE id = ${id} AND deleted_at IS NULL
`;
if (!row) return error(res, 404, 'not_found', 'avatar not found');
if (row.owner_id !== session.id) return error(res, 403, 'forbidden', 'not your avatar');
@@ -25,15 +32,64 @@ export default wrap(async (req, res) => {
const mode = await readStorageMode(id);
if (!mode) return error(res, 500, 'internal', 'storage_mode unavailable');
- const stubCid = row.checksum_sha256
- ? `stub:sha256-${row.checksum_sha256}`
- : `stub:no-hash-${id}`;
+ const pinataJwt = env.PINATA_JWT;
+ let cid;
+ let isStub = false;
+
+ if (pinataJwt && row.storage_key) {
+ try {
+ cid = await pinToPinata({
+ jwt: pinataJwt,
+ key: row.storage_key,
+ name: row.name || `avatar-${id}`,
+ contentType: row.content_type || 'model/gltf-binary',
+ });
+ } catch (err) {
+ return error(res, 502, 'upstream_error', `Pinata upload failed: ${err.message}`);
+ }
+ } else {
+ isStub = true;
+ cid = row.checksum_sha256 ? `stub:sha256-${row.checksum_sha256}` : `stub:no-hash-${id}`;
+ }
const next = {
...mode,
- ipfs: { pinned: true, cid: stubCid, pinned_at: new Date().toISOString() },
+ ipfs: { pinned: true, cid, pinned_at: new Date().toISOString() },
};
await sql`UPDATE avatars SET storage_mode = ${JSON.stringify(next)}::jsonb WHERE id = ${id}`;
- return json(res, 200, { storage_mode: next, stub: true });
+ return json(res, 200, { storage_mode: next, stub: isStub });
});
+
+async function pinToPinata({ jwt, key, name, contentType }) {
+ const obj = await r2.send(new GetObjectCommand({ Bucket: env.S3_BUCKET, Key: key }));
+ const bytes = await streamToBuffer(obj.Body);
+ const blob = new Blob([bytes], { type: contentType });
+
+ const form = new FormData();
+ form.append('file', blob, name);
+ form.append('pinataMetadata', JSON.stringify({ name }));
+
+ const res = await fetch(PINATA_ENDPOINT, {
+ method: 'POST',
+ headers: { Authorization: `Bearer ${jwt}` },
+ body: form,
+ });
+ if (!res.ok) {
+ const body = await res.text().catch(() => '');
+ throw new Error(`HTTP ${res.status} ${body.slice(0, 200)}`);
+ }
+ const data = await res.json();
+ if (!data?.IpfsHash) throw new Error('no IpfsHash in Pinata response');
+ return data.IpfsHash;
+}
+
+async function streamToBuffer(stream) {
+ if (stream instanceof Uint8Array) return stream;
+ if (typeof stream?.transformToByteArray === 'function') {
+ return stream.transformToByteArray();
+ }
+ const chunks = [];
+ for await (const chunk of stream) chunks.push(chunk);
+ return Buffer.concat(chunks);
+}
diff --git a/docs/WIDGETS.md b/docs/WIDGETS.md
index 0075cb68d..ce9098844 100644
--- a/docs/WIDGETS.md
+++ b/docs/WIDGETS.md
@@ -85,9 +85,22 @@ The viewer supports the following hash params (combine with `&`):
**Size guidance:**
- Turntable / hotspot-tour: 1:1 or 4:3 — let the user breathe.
+- Animation-gallery: 1:1 or slightly wider — picker docks to the top-right on desktop, bottom on mobile.
- Talking-agent: 7:10 portrait — chat needs vertical space.
- Passport: anything ≥ 360 × 480.
+### Animation Gallery specifics
+
+The `animation-gallery` widget renders every skinned clip on the avatar as a keyboard-navigable list.
+
+| Config key | Type | Default | Description |
+| ---------------- | --------- | ------- | ----------------------------------------------------------------------------------- |
+| `defaultClip` | `string` | `''` | Clip name to autoplay on mount. Falls back to the first clip if the name is unknown. |
+| `loopAll` | `boolean` | `false` | When true, each clip plays once then advances to the next; wraps to the first. |
+| `showClipPicker` | `boolean` | `true` | Hide the picker chrome while keeping clip playback driven by `widget:command`. |
+
+Keyboard: ↑/↓ (or `k`/`j`) to move, Home/End to jump, Enter or Space to (re)play the highlighted clip. The picker pins to the top-right; on narrow viewports it docks to the bottom.
+
### Script embed
```html
diff --git a/package-lock.json b/package-lock.json
index ab3e1fcdd..2877e64a9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -32,6 +32,7 @@
"zod": "^3.23.8"
},
"devDependencies": {
+ "cheerio": "^1.2.0",
"playwright": "^1.59.1",
"prettier": "^3.2.5",
"sharp": "^0.34.5",
@@ -5340,6 +5341,13 @@
"integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==",
"license": "MIT"
},
+ "node_modules/boolbase": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
+ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==",
+ "dev": true,
+ "license": "ISC"
+ },
"node_modules/bowser": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/bowser/-/bowser-2.14.1.tgz",
@@ -5490,6 +5498,50 @@
"node": ">=18"
}
},
+ "node_modules/cheerio": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.2.0.tgz",
+ "integrity": "sha512-WDrybc/gKFpTYQutKIK6UvfcuxijIZfMfXaYm8NMsPQxSYvf+13fXUJ4rztGGbJcBQ/GF55gvrZ0Bc0bj/mqvg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cheerio-select": "^2.1.0",
+ "dom-serializer": "^2.0.0",
+ "domhandler": "^5.0.3",
+ "domutils": "^3.2.2",
+ "encoding-sniffer": "^0.2.1",
+ "htmlparser2": "^10.1.0",
+ "parse5": "^7.3.0",
+ "parse5-htmlparser2-tree-adapter": "^7.1.0",
+ "parse5-parser-stream": "^7.1.2",
+ "undici": "^7.19.0",
+ "whatwg-mimetype": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=20.18.1"
+ },
+ "funding": {
+ "url": "https://github.com/cheeriojs/cheerio?sponsor=1"
+ }
+ },
+ "node_modules/cheerio-select": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz",
+ "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "boolbase": "^1.0.0",
+ "css-select": "^5.1.0",
+ "css-what": "^6.1.0",
+ "domelementtype": "^2.3.0",
+ "domhandler": "^5.0.3",
+ "domutils": "^3.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/fb55"
+ }
+ },
"node_modules/commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
@@ -5553,6 +5605,36 @@
"node": ">=8"
}
},
+ "node_modules/css-select": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz",
+ "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "boolbase": "^1.0.0",
+ "css-what": "^6.1.0",
+ "domhandler": "^5.0.2",
+ "domutils": "^3.0.1",
+ "nth-check": "^2.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/fb55"
+ }
+ },
+ "node_modules/css-what": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz",
+ "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">= 6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/fb55"
+ }
+ },
"node_modules/dat.gui": {
"version": "0.7.9",
"resolved": "https://registry.npmjs.org/dat.gui/-/dat.gui-0.7.9.tgz",
@@ -5696,6 +5778,65 @@
"node": ">=8"
}
},
+ "node_modules/dom-serializer": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
+ "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "domelementtype": "^2.3.0",
+ "domhandler": "^5.0.2",
+ "entities": "^4.2.0"
+ },
+ "funding": {
+ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
+ }
+ },
+ "node_modules/domelementtype": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
+ "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ ],
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/domhandler": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
+ "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "domelementtype": "^2.3.0"
+ },
+ "engines": {
+ "node": ">= 4"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/domhandler?sponsor=1"
+ }
+ },
+ "node_modules/domutils": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz",
+ "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "dom-serializer": "^2.0.0",
+ "domelementtype": "^2.3.0",
+ "domhandler": "^5.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/domutils?sponsor=1"
+ }
+ },
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
@@ -5734,6 +5875,33 @@
"dev": true,
"license": "ISC"
},
+ "node_modules/encoding-sniffer": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.1.tgz",
+ "integrity": "sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "iconv-lite": "^0.6.3",
+ "whatwg-encoding": "^3.1.1"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/encoding-sniffer?sponsor=1"
+ }
+ },
+ "node_modules/entities": {
+ "version": "4.5.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
+ "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.12"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
"node_modules/es-abstract": {
"version": "1.24.2",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.2.tgz",
@@ -6493,6 +6661,52 @@
"node": ">= 0.4"
}
},
+ "node_modules/htmlparser2": {
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz",
+ "integrity": "sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==",
+ "dev": true,
+ "funding": [
+ "https://github.com/fb55/htmlparser2?sponsor=1",
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fb55"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "domelementtype": "^2.3.0",
+ "domhandler": "^5.0.3",
+ "domutils": "^3.2.2",
+ "entities": "^7.0.1"
+ }
+ },
+ "node_modules/htmlparser2/node_modules/entities": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz",
+ "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.12"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/idb": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz",
@@ -7190,6 +7404,19 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/nth-check": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
+ "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "boolbase": "^1.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/nth-check?sponsor=1"
+ }
+ },
"node_modules/object-inspect": {
"version": "1.13.4",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
@@ -7345,6 +7572,59 @@
"dev": true,
"license": "BlueOak-1.0.0"
},
+ "node_modules/parse5": {
+ "version": "7.3.0",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",
+ "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "entities": "^6.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
+ "node_modules/parse5-htmlparser2-tree-adapter": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz",
+ "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "domhandler": "^5.0.3",
+ "parse5": "^7.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
+ "node_modules/parse5-parser-stream": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz",
+ "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "parse5": "^7.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
+ "node_modules/parse5/node_modules/entities": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
+ "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.12"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
"node_modules/path-expression-matcher": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.5.0.tgz",
@@ -7900,6 +8180,13 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/semver": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
@@ -8629,6 +8916,16 @@
"integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==",
"license": "MIT"
},
+ "node_modules/undici": {
+ "version": "7.25.0",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.25.0.tgz",
+ "integrity": "sha512-xXnp4kTyor2Zq+J1FfPI6Eq3ew5h6Vl0F/8d9XU5zZQf1tX9s2Su1/3PiMmUANFULpmksxkClamIZcaUqryHsQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
"node_modules/undici-types": {
"version": "7.19.2",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz",
@@ -9054,6 +9351,30 @@
"dev": true,
"license": "BSD-2-Clause"
},
+ "node_modules/whatwg-encoding": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz",
+ "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==",
+ "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "iconv-lite": "0.6.3"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/whatwg-mimetype": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz",
+ "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/whatwg-url": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz",
diff --git a/package.json b/package.json
index 72698c50e..d5b66379e 100644
--- a/package.json
+++ b/package.json
@@ -73,6 +73,7 @@
"zod": "^3.23.8"
},
"devDependencies": {
+ "cheerio": "^1.2.0",
"playwright": "^1.59.1",
"prettier": "^3.2.5",
"sharp": "^0.34.5",
diff --git a/public/artifact/index.html b/public/artifact/index.html
index f0353fb8a..4c288f2e8 100644
--- a/public/artifact/index.html
+++ b/public/artifact/index.html
@@ -139,7 +139,7 @@
</div>
<!-- The artifact bundle -->
- <script src="artifact.js"></script>
+ <script src="/artifact.js"></script>
<script>
function getAgentIdFromUrl() {
diff --git a/public/dashboard/dashboard.js b/public/dashboard/dashboard.js
index 2039ac2a8..8ef030232 100644
--- a/public/dashboard/dashboard.js
+++ b/public/dashboard/dashboard.js
@@ -22,6 +22,11 @@ export const api = {
createAvatarSession: (id) => j('POST', `/api/avatars/${id}/session`),
getAvatarVersions: (id) => j('GET', `/api/avatars/${id}/versions`),
patchAgent: (agentId, patch) => j('PUT', `/api/agents/${agentId}`, patch),
+ getAgentMe: () => j('GET', '/api/agents/me'),
+ getAvatar: (id) => j('GET', `/api/avatars/${encodeURIComponent(id)}`),
+ patchAgentAnimations: (agentId, animations) =>
+ j('PUT', `/api/agents/${encodeURIComponent(agentId)}/animations`, { animations }),
+ presignAnimation: (body) => j('POST', '/api/animations/presign', body),
};
async function j(method, path, body) {
@@ -70,6 +75,7 @@ const tabs = {
create: renderCreate,
edit: renderEdit,
upload: renderUpload,
+ animations: renderAnimations,
widgets: renderWidgets,
embed: renderEmbed,
keys: renderKeys,
@@ -1168,6 +1174,106 @@ function uriToHttp(uri) {
return uri;
}
+// Re-pin the agent's on-chain manifest with the current animations. Fetches the
+// existing tokenURI metadata to preserve services/registrations/trust fields
+// that live outside the DB (so skills, A2A endpoints, x402, etc. aren't lost).
+async function rePinAgentManifest({ agent, animations, logEl }) {
+ const btn = logEl.parentElement.querySelector('#anim-repin-btn');
+ const say = (msg, err = false) => {
+ const line = document.createElement('div');
+ if (err) line.style.color = '#ffb3b3';
+ line.textContent = msg;
+ logEl.appendChild(line);
+ };
+
+ const agentIdOnchain = agent.erc8004_agent_id;
+ const chainIdExpected = Number(agent.chain_id || 0);
+ if (!agentIdOnchain || !chainIdExpected) {
+ say('Missing erc8004_agent_id or chain_id on this agent.', true);
+ return;
+ }
+
+ btn.disabled = true;
+ logEl.textContent = '';
+ try {
+ const [{ connectWallet, getIdentityRegistry, pinFile, buildRegistrationJSON }, { REGISTRY_DEPLOYMENTS }] =
+ await Promise.all([
+ import('/src/erc8004/agent-registry.js'),
+ import('/src/erc8004/abi.js'),
+ ]);
+
+ say('Connecting wallet…');
+ const { signer, chainId } = await connectWallet();
+ if (Number(chainId) !== chainIdExpected) {
+ throw new Error(
+ `Wallet is on chain ${chainId} but this agent lives on chain ${chainIdExpected}. Switch networks and try again.`,
+ );
+ }
+
+ const deployment = REGISTRY_DEPLOYMENTS[chainId];
+ if (!deployment?.identityRegistry) {
+ throw new Error(`No ERC-8004 registry deployed on chain ${chainId}.`);
+ }
+
+ say('Reading current manifest from chain…');
+ const registry = getIdentityRegistry(chainId, signer);
+ const currentURI = await registry.tokenURI(agentIdOnchain);
+ let currentMeta = {};
+ if (currentURI) {
+ try {
+ const r = await fetch(uriToHttp(currentURI));
+ if (r.ok && (r.headers.get('content-type') || '').includes('json')) {
+ currentMeta = await r.json();
+ }
+ } catch {
+ /* fall through — treat as empty and rebuild */
+ }
+ }
+
+ // Preserve non-avatar services (skills, A2A, MCP, etc.) from the existing
+ // manifest. The avatar + 3D services are rebuilt from the current GLB URL.
+ const preservedServices = (currentMeta.services || []).filter(
+ (s) => s?.name !== 'avatar' && s?.name !== '3D',
+ );
+ const glbUrl =
+ currentMeta.body?.uri ||
+ (currentMeta.services || []).find((s) => s?.name === 'avatar' && s?.endpoint)?.endpoint ||
+ '';
+
+ say('Building new registration JSON…');
+ const registrationJSON = buildRegistrationJSON({
+ name: currentMeta.name || agent.name || 'Agent',
+ description: currentMeta.description || agent.description || '',
+ imageUrl: currentMeta.image || '',
+ glbUrl,
+ agentId: Number(agentIdOnchain),
+ chainId,
+ registryAddr: deployment.identityRegistry,
+ services: preservedServices,
+ x402Support: !!(currentMeta.x402Support || currentMeta.x402),
+ animations,
+ });
+
+ say('Pinning new manifest…');
+ const jsonBlob = new Blob([JSON.stringify(registrationJSON, null, 2)], {
+ type: 'application/json',
+ });
+ const newUri = await pinFile(jsonBlob);
+ say(`New metadata URI: ${newUri}`);
+
+ say('Calling setAgentURI on-chain…');
+ const tx = await registry.setAgentURI(agentIdOnchain, newUri);
+ say(`Transaction submitted: ${tx.hash}`);
+ await tx.wait();
+ say('✓ Manifest updated on-chain.');
+ toast('On-chain manifest re-pinned');
+ } catch (err) {
+ say(`Failed: ${err.shortMessage || err.message || String(err)}`, true);
+ } finally {
+ btn.disabled = false;
+ }
+}
+
function renderAgentRows(list, onchainAgents, dbAgents) {
const dbByAgentId = new Map();
for (const a of dbAgents) {
@@ -2083,8 +2189,12 @@ async function renderAnimations(root) {
if (agent.is_registered) {
const warn = document.createElement('div');
warn.className = 'anim-notice';
- warn.innerHTML = `<strong>On-chain notice:</strong> Your agent has an ERC-8004 registration. Animation changes won't be visible on-chain until you re-pin the manifest. <button class="btn sec" style="margin-left:8px;font-size:11px;padding:4px 10px;" disabled title="Re-pin not implemented — update your manifest manually">Re-pin manifest</button>`;
+ warn.innerHTML = `<strong>On-chain notice:</strong> Your agent has an ERC-8004 registration. Animation changes aren't visible on-chain until you re-pin the manifest. <button class="btn sec" id="anim-repin-btn" style="margin-left:8px;font-size:11px;padding:4px 10px;" title="Pin a new manifest with the current animations and call setAgentURI()">Re-pin manifest</button><div id="anim-repin-log" class="muted" style="font-size:12px;margin-top:6px;white-space:pre-wrap"></div>`;
body.appendChild(warn);
+
+ warn.querySelector('#anim-repin-btn').addEventListener('click', () =>
+ rePinAgentManifest({ agent, animations, logEl: warn.querySelector('#anim-repin-log') }),
+ );
}
const cols = document.createElement('div');
diff --git a/public/dashboard/embed-policy.html b/public/dashboard/embed-policy.html
index 1ae89bd0a..e0f17ec8a 100644
--- a/public/dashboard/embed-policy.html
+++ b/public/dashboard/embed-policy.html
@@ -214,9 +214,12 @@
.hidden {
display: none !important;
}
+ body[data-auth-pending] {
+ visibility: hidden;
+ }
</style>
</head>
- <body>
+ <body data-auth-pending>
<header>
<div class="brand"><a href="/dashboard">← Dashboard</a></div>
<div class="muted"><span id="agent-name">Agent</span></div>
@@ -437,6 +440,7 @@
async function loadMe() {
try {
await api('GET', '/api/auth/me');
+ document.body.removeAttribute('data-auth-pending');
} catch {
location.href =
'/login?next=' + encodeURIComponent(location.pathname + location.search);
diff --git a/public/dashboard/index.html b/public/dashboard/index.html
index 977148a1e..24fd0283a 100644
--- a/public/dashboard/index.html
+++ b/public/dashboard/index.html
@@ -663,6 +663,7 @@
<a href="#avatars" class="active" data-tab="avatars">Avatars</a>
<a href="#create" data-tab="create">Create from selfie</a>
<a href="#upload" data-tab="upload">Upload</a>
+ <a href="#animations" data-tab="animations">Animations</a>
<a href="#widgets" data-tab="widgets">Widgets</a>
<a href="#embed" data-tab="embed">Embed</a>
<a href="#keys" data-tab="keys">API keys</a>
diff --git a/public/dashboard/storage.html b/public/dashboard/storage.html
index bc9170d24..e6709698a 100644
--- a/public/dashboard/storage.html
+++ b/public/dashboard/storage.html
@@ -207,9 +207,12 @@
.hidden {
display: none !important;
}
+ body[data-auth-pending] {
+ visibility: hidden;
+ }
</style>
</head>
- <body>
+ <body data-auth-pending>
<header>
<div class="brand"><a href="/dashboard">← Dashboard</a></div>
<div class="muted"><span id="avatar-name">Avatar</span></div>
@@ -255,11 +258,12 @@
<span id="ipfs-pinned-at" class="kv-value muted">—</span>
</div>
<div class="actions">
- <button class="btn" id="pin-btn">Pin to IPFS (stub)</button>
+ <button class="btn" id="pin-btn">Pin to IPFS</button>
</div>
<p class="muted" style="margin-top: 10px">
- Real Pinata / Web3.Storage integration is a follow-up. This stub records a
- placeholder CID derived from the content hash.
+ Real pinning runs through Pinata when <code>PINATA_JWT</code> is configured
+ on the server. Otherwise the endpoint records a content-hash stub CID so
+ the rest of the flow still works in dev.
</p>
</fieldset>
</div>
@@ -365,7 +369,7 @@
ipfsBadge.textContent = 'Not pinned';
ipfsBadge.className = 'badge grey';
document.getElementById('pin-btn').disabled = false;
- document.getElementById('pin-btn').textContent = 'Pin to IPFS (stub)';
+ document.getElementById('pin-btn').textContent = 'Pin to IPFS';
}
document.getElementById('ipfs-cid').textContent = mode.ipfs?.cid || '—';
document.getElementById('ipfs-pinned-at').textContent = mode.ipfs?.pinned_at
@@ -386,6 +390,7 @@
async function loadMe() {
try {
await api('GET', '/api/auth/me');
+ document.body.removeAttribute('data-auth-pending');
} catch {
location.href =
'/login?next=' + encodeURIComponent(location.pathname + location.search);
@@ -423,10 +428,12 @@
setStatus('');
document.getElementById('pin-btn').disabled = true;
try {
- const { storage_mode } = await api('POST', `/api/avatars/${avatarId}/pin-ipfs`);
- populateMode(storage_mode);
+ const result = await api('POST', `/api/avatars/${avatarId}/pin-ipfs`);
+ populateMode(result.storage_mode);
setStatus(
- '<div class="ok">Pinned (stub). Real IPFS pinning is a follow-up.</div>',
+ result.stub
+ ? '<div class="ok">Pinned (stub CID). Set PINATA_JWT on the server for real IPFS pins.</div>'
+ : '<div class="ok">Pinned to IPFS via Pinata.</div>',
);
} catch (e) {
document.getElementById('pin-btn').disabled = false;
diff --git a/public/dashboard/usage.html b/public/dashboard/usage.html
index 3d46aae13..57e176257 100644
--- a/public/dashboard/usage.html
+++ b/public/dashboard/usage.html
@@ -4,7 +4,6 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>LLM Usage — 3D Agent</title>
- <link rel="stylesheet" href="/assets/dashboard.css" />
<style>
body {
font-family:
diff --git a/sdk/src/erc8004/abi.js b/sdk/src/erc8004/abi.js
index 6e01b6887..500cc7e7a 100644
--- a/sdk/src/erc8004/abi.js
+++ b/sdk/src/erc8004/abi.js
@@ -79,29 +79,52 @@ export const VALIDATION_REGISTRY_ABI = [
'event ValidationRecorded(uint256 indexed agentId, address indexed validator, bool passed, bytes32 proofHash, string kind)',
];
+// Canonical ERC-8004 reference deployments — same address on every chain via
+// CREATE2. Source: https://github.com/nirholas/erc8004-agents
+// Validation Registry is testnet-only for now; mainnet entry is empty.
+
+const TESTNET = {
+ identityRegistry: '0x8004A818BFB912233c491871b3d84c89A494BD9e',
+ reputationRegistry: '0x8004B663056A597Dffe9eCcC1965A193B7388713',
+ validationRegistry: '0x8004Cb1BF31DAf7788923b405b754f57acEB4272',
+};
+
+const MAINNET = {
+ identityRegistry: '0x8004A169FB4a3325136EB29fA0ceB6D2e539a432',
+ reputationRegistry: '0x8004BAa17C55a88189AE136b182e5fdA19dE9b63',
+ validationRegistry: '',
+};
+
/**
- * Known deployments — add chain-specific addresses here.
+ * Known deployments keyed by chainId.
* Format follows agentRegistry spec: eip155:{chainId}:{address}
*/
export const REGISTRY_DEPLOYMENTS = {
- // Base mainnet (chain 8453)
- 8453: {
- identityRegistry: '', // TODO: fill once deployed
- reputationRegistry: '', // TODO: fill once deployed
- validationRegistry: '', // TODO: fill once deployed
- },
- // Base Sepolia testnet (chain 84532)
- 84532: {
- identityRegistry: '', // TODO: fill in from Deploy.s.sol broadcast output
- reputationRegistry: '',
- validationRegistry: '',
- },
- // Ethereum mainnet (chain 1) — if deployed
- 1: {
- identityRegistry: '',
- reputationRegistry: '',
- validationRegistry: '',
- },
+ // Mainnets
+ 1: MAINNET, // Ethereum
+ 10: MAINNET, // Optimism
+ 56: MAINNET, // BSC
+ 100: MAINNET, // Gnosis
+ 137: MAINNET, // Polygon
+ 250: MAINNET, // Fantom
+ 324: MAINNET, // zkSync Era
+ 1284: MAINNET, // Moonbeam
+ 5000: MAINNET, // Mantle
+ 8453: MAINNET, // Base
+ 42161: MAINNET, // Arbitrum One
+ 42220: MAINNET, // Celo
+ 43114: MAINNET, // Avalanche
+ 59144: MAINNET, // Linea
+ 534352: MAINNET, // Scroll
+
+ // Testnets
+ 97: TESTNET, // BSC Testnet
+ 11155111: TESTNET, // Ethereum Sepolia
+ 84532: TESTNET, // Base Sepolia
+ 421614: TESTNET, // Arbitrum Sepolia
+ 11155420: TESTNET, // Optimism Sepolia
+ 80002: TESTNET, // Polygon Amoy
+ 43113: TESTNET, // Avalanche Fuji
};
/**
diff --git a/src/agent-protocol.js b/src/agent-protocol.js
index 64f44612e..f4f28a207 100644
--- a/src/agent-protocol.js
+++ b/src/agent-protocol.js
@@ -36,7 +36,7 @@ export const ACTION_TYPES = {
* @property {string} [sourceSkill] — skill name if emitted by a skill
*/
-class AgentProtocol extends EventTarget {
+export class AgentProtocol extends EventTarget {
constructor() {
super();
this._history = [];
diff --git a/src/components/validator-report.jsx b/src/components/validator-report.jsx
index 6c6316b0e..4c674e847 100644
--- a/src/components/validator-report.jsx
+++ b/src/components/validator-report.jsx
@@ -11,13 +11,25 @@ export function ValidatorReport({
warnings,
hints,
infos,
+ reportJSON,
}) {
const totalIssues =
issues.numErrors + issues.numWarnings + issues.numInfos + issues.numHints;
const isClean = totalIssues === 0;
return (
<div class="report">
- <h1>Validation report</h1>
+ <div class="report-head">
+ <h1>Validation report</h1>
+ {reportJSON && (
+ <a
+ class="report-download"
+ href={reportJSON}
+ download="gltf-validation-report.json"
+ >
+ Download JSON
+ </a>
+ )}
+ </div>
{isClean ? (
<div class="report-banner report-banner-clean" role="status">
<span class="report-banner-icon" aria-hidden="true">
@@ -107,7 +119,7 @@ export function ValidatorReport({
<li>None</li>
)}
</ul>
- {info.extensionsUsed?.length && (
+ {info.extensionsUsed?.length > 0 && (
<p>
<i>
NOTE: Extensions above are present in the model, but may or may not
@@ -134,12 +146,18 @@ export function ValidatorReport({
</a>{' '}
{validatorVersion}.
</p>
- {issues.numErrors && <ValidatorTable messages={errors} color="#f44336" title="Error" />}
- {issues.numWarnings && (
+ {issues.numErrors > 0 && (
+ <ValidatorTable messages={errors} color="#f44336" title="Error" />
+ )}
+ {issues.numWarnings > 0 && (
<ValidatorTable messages={warnings} color="#f9a825" title="Warning" />
)}
- {issues.numHints && <ValidatorTable messages={hints} color="#8bc34a" title="Hint" />}
- {issues.numInfos && <ValidatorTable messages={infos} color="#2196f3" title="Info" />}
+ {issues.numHints > 0 && (
+ <ValidatorTable messages={hints} color="#8bc34a" title="Hint" />
+ )}
+ {issues.numInfos > 0 && (
+ <ValidatorTable messages={infos} color="#2196f3" title="Info" />
+ )}
</div>
);
}
diff --git a/src/erc8004/agent-registry.js b/src/erc8004/agent-registry.js
index b8f331179..b890e6475 100644
--- a/src/erc8004/agent-registry.js
+++ b/src/erc8004/agent-registry.js
@@ -122,6 +122,10 @@ export async function pinFile(blob, apiToken) {
* @param {string} opts.registryAddr
* @param {Array} [opts.services] Extra service entries
* @param {boolean}[opts.x402Support]
+ * @param {Array<{name:string,url:string,loop?:boolean,clipName?:string,source?:string}>} [opts.animations]
+ * Optional animation clip list — emitted as a top-level `animations` extension
+ * field (ERC-8004 permits extensions). Viewers that understand the field can
+ * attach extra clips; others ignore it harmlessly.
*/
export function buildRegistrationJSON({
name,
@@ -133,6 +137,7 @@ export function buildRegistrationJSON({
registryAddr,
services = [],
x402Support = false,
+ animations,
}) {
const baseServices = [];
if (glbUrl) {
@@ -173,6 +178,10 @@ export function buildRegistrationJSON({
json.body = { uri: glbUrl, format: 'gltf-binary' };
}
+ if (Array.isArray(animations) && animations.length > 0) {
+ json.animations = animations;
+ }
+
return json;
}
diff --git a/src/erc8004/qr.js b/src/erc8004/qr.js
index 6a2c1724b..c4764ce6d 100644
--- a/src/erc8004/qr.js
+++ b/src/erc8004/qr.js
@@ -368,6 +368,33 @@ function penalty(modules) {
// Renderers
// ───────────────────────────────────────────────────────────────────────────
+/**
+ * Render a QR code as an SVG string. Works in any environment that can hold a
+ * string — no canvas required. Useful as a fallback when 2D canvas is
+ * unavailable or as a directly embeddable inline SVG.
+ *
+ * @param {string} text
+ * @param {{ scale?: number, margin?: number, dark?: string, light?: string }} [opts]
+ * @returns {string} SVG markup
+ */
+export function renderQRToSVG(text, opts = {}) {
+ const scale = opts.scale ?? 8;
+ const margin = opts.margin ?? 2;
+ const dark = opts.dark ?? '#000';
+ const light = opts.light ?? '#fff';
+ const { size, modules } = generateQR(text);
+ const px = (size + margin * 2) * scale;
+ let rects = '';
+ for (let y = 0; y < size; y++) {
+ for (let x = 0; x < size; x++) {
+ if (modules[y][x]) {
+ rects += `<rect x="${(x + margin) * scale}" y="${(y + margin) * scale}" width="${scale}" height="${scale}"/>`;
+ }
+ }
+ }
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${px}" height="${px}" viewBox="0 0 ${px} ${px}" shape-rendering="crispEdges"><rect width="${px}" height="${px}" fill="${light}"/><g fill="${dark}">${rects}</g></svg>`;
+}
+
/**
* Render a QR code into a canvas. Returns the canvas.
* @param {string} text
diff --git a/src/share-panel.js b/src/share-panel.js
index 927f1231e..3ead2206e 100644
--- a/src/share-panel.js
+++ b/src/share-panel.js
@@ -1,4 +1,4 @@
-import { renderQRToCanvas } from './erc8004/qr.js';
+import { renderQRToCanvas, renderQRToSVG } from './erc8004/qr.js';
import './share-panel.css';
/**
@@ -126,12 +126,18 @@ export class SharePanel {
this._container.appendChild(backdrop);
this._backdrop = backdrop;
- // Render QR
+ // Render QR — prefer canvas; fall back to inline SVG when canvas isn't
+ // available (older browsers, jsdom, restricted contexts).
+ const qrMount = modal.querySelector('#share-panel-qr-mount');
try {
const canvas = renderQRToCanvas(link, { scale: 6, margin: 2 });
- modal.querySelector('#share-panel-qr-mount').appendChild(canvas);
+ qrMount.appendChild(canvas);
} catch {
- modal.querySelector('#share-panel-qr-mount').textContent = 'QR coming soon';
+ try {
+ qrMount.innerHTML = renderQRToSVG(link, { scale: 6, margin: 2 });
+ } catch {
+ qrMount.textContent = link;
+ }
}
// Focus trap + keyboard
diff --git a/src/validator.js b/src/validator.js
index 235987436..03920e2a3 100644
--- a/src/validator.js
+++ b/src/validator.js
@@ -173,6 +173,7 @@ export class Validator {
showLightbox() {
if (!this.report) return;
const tab = window.open('', '_blank');
+ const reportJSON = _buildDownloadHref(this.report);
tab.document.body.innerHTML = `
<!DOCTYPE html>
<title>glTF 2.0 validation report</title>
@@ -182,7 +183,18 @@ export class Validator {
body { overflow-y: auto; }
html, body { background: #FFFFFF; }
</style>
- ${ValidatorReport({ ...this.report, location })}`;
+ ${ValidatorReport({ ...this.report, location, reportJSON })}`;
+ }
+}
+
+function _buildDownloadHref(report) {
+ try {
+ const { errors, warnings, infos, hints, issues, info, generator } = report;
+ const payload = { generator, info, issues, errors, warnings, infos, hints };
+ const json = JSON.stringify(payload, null, 2);
+ return 'data:application/json;charset=utf-8,' + encodeURIComponent(json);
+ } catch {
+ return '';
}
}
diff --git a/src/wallet-auth.js b/src/wallet-auth.js
index eeb1cffa9..208b9f025 100644
--- a/src/wallet-auth.js
+++ b/src/wallet-auth.js
@@ -52,7 +52,7 @@ export async function signInWithWallet() {
/** @returns {Promise<void>} */
export async function signOut() {
- await fetch('/api/auth/signout', {
+ await fetch('/api/auth/logout', {
method: 'POST',
credentials: 'include',
}).catch(() => {});
diff --git a/src/widgets/animation-gallery.js b/src/widgets/animation-gallery.js
index 6aee5d6a7..3bd464cf9 100644
--- a/src/widgets/animation-gallery.js
+++ b/src/widgets/animation-gallery.js
@@ -167,6 +167,8 @@ function _renderPicker(container, names, initialIdx, onSelect) {
panel.className = 'anim-gallery-panel';
panel.setAttribute('role', 'listbox');
panel.setAttribute('aria-label', 'Animation clips');
+ panel.setAttribute('aria-activedescendant', `anim-gallery-opt-${initialIdx}`);
+ panel.tabIndex = 0;
const header = document.createElement('div');
header.className = 'anim-gallery-header';
@@ -181,6 +183,7 @@ function _renderPicker(container, names, initialIdx, onSelect) {
const btn = document.createElement('button');
btn.type = 'button';
btn.className = 'anim-gallery-item';
+ btn.id = `anim-gallery-opt-${i}`;
btn.setAttribute('role', 'option');
btn.dataset.idx = String(i);
btn.textContent = name;
@@ -194,6 +197,37 @@ function _renderPicker(container, names, initialIdx, onSelect) {
});
panel.appendChild(list);
+
+ panel.addEventListener('keydown', (ev) => {
+ const current = Number(panel.getAttribute('data-current') || initialIdx);
+ let next = current;
+ switch (ev.key) {
+ case 'ArrowDown':
+ case 'j':
+ next = (current + 1) % names.length;
+ break;
+ case 'ArrowUp':
+ case 'k':
+ next = (current - 1 + names.length) % names.length;
+ break;
+ case 'Home':
+ next = 0;
+ break;
+ case 'End':
+ next = names.length - 1;
+ break;
+ case 'Enter':
+ case ' ':
+ onSelect(current);
+ ev.preventDefault();
+ return;
+ default:
+ return;
+ }
+ ev.preventDefault();
+ onSelect(next);
+ });
+
container.appendChild(panel);
_injectStyles();
return panel;
@@ -201,10 +235,13 @@ function _renderPicker(container, names, initialIdx, onSelect) {
function _highlight(panel, idx) {
if (!panel) return;
+ panel.setAttribute('data-current', String(idx));
+ panel.setAttribute('aria-activedescendant', `anim-gallery-opt-${idx}`);
panel.querySelectorAll('.anim-gallery-item').forEach((btn) => {
const active = Number(btn.dataset.idx) === idx;
btn.classList.toggle('is-active', active);
btn.setAttribute('aria-selected', active ? 'true' : 'false');
+ if (active) btn.scrollIntoView({ block: 'nearest' });
});
}
diff --git a/style.css b/style.css
index 0cfe5b764..26a6e21df 100644
--- a/style.css
+++ b/style.css
@@ -709,6 +709,29 @@ footer .separator {
font-weight: bold;
}
+.report-head {
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: var(--space-md);
+ flex-wrap: wrap;
+}
+
+.report-download {
+ display: inline-block;
+ padding: 6px 12px;
+ font-size: 0.85rem;
+ border: 1px solid rgba(255, 255, 255, 0.18);
+ border-radius: 6px;
+ color: rgba(255, 255, 255, 0.85);
+ text-decoration: none;
+ transition: background-color 120ms ease;
+}
+
+.report-download:hover {
+ background: rgba(255, 255, 255, 0.08);
+}
+
/******************************************************************************
* CSS Spinner
*
diff --git a/tests/src/agent-protocol.test.js b/tests/src/agent-protocol.test.js
new file mode 100644
index 000000000..527fe4947
--- /dev/null
+++ b/tests/src/agent-protocol.test.js
@@ -0,0 +1,173 @@
+import { describe, it, expect, beforeEach, vi } from 'vitest';
+import { AgentProtocol, ACTION_TYPES } from '../../src/agent-protocol.js';
+
+describe('ACTION_TYPES', () => {
+ it('exposes the canonical action vocabulary', () => {
+ const expected = [
+ 'SPEAK',
+ 'THINK',
+ 'GESTURE',
+ 'EMOTE',
+ 'LOOK_AT',
+ 'PERFORM_SKILL',
+ 'SKILL_DONE',
+ 'SKILL_ERROR',
+ 'REMEMBER',
+ 'SIGN',
+ 'LOAD_START',
+ 'LOAD_END',
+ 'VALIDATE',
+ 'PRESENCE',
+ ];
+ for (const k of expected) expect(ACTION_TYPES).toHaveProperty(k);
+ });
+
+ it('uses kebab-case values for multi-word keys', () => {
+ expect(ACTION_TYPES.LOOK_AT).toBe('look-at');
+ expect(ACTION_TYPES.SKILL_DONE).toBe('skill-done');
+ expect(ACTION_TYPES.LOAD_START).toBe('load-start');
+ });
+});
+
+describe('AgentProtocol.emit', () => {
+ let bus;
+ beforeEach(() => {
+ bus = new AgentProtocol();
+ });
+
+ it('delivers events of a matching type', () => {
+ const handler = vi.fn();
+ bus.on('speak', handler);
+ bus.emit({ type: 'speak', payload: { text: 'hi' } });
+ expect(handler).toHaveBeenCalledOnce();
+ expect(handler.mock.calls[0][0]).toMatchObject({
+ type: 'speak',
+ payload: { text: 'hi' },
+ agentId: 'default',
+ sourceSkill: null,
+ });
+ });
+
+ it('does not deliver to other types', () => {
+ const speakHandler = vi.fn();
+ const thinkHandler = vi.fn();
+ bus.on('speak', speakHandler);
+ bus.on('think', thinkHandler);
+ bus.emit({ type: 'speak' });
+ expect(speakHandler).toHaveBeenCalledOnce();
+ expect(thinkHandler).not.toHaveBeenCalled();
+ });
+
+ it('delivers to wildcard subscribers', () => {
+ const star = vi.fn();
+ bus.on('*', star);
+ bus.emit({ type: 'speak' });
+ bus.emit({ type: 'think' });
+ expect(star).toHaveBeenCalledTimes(2);
+ });
+
+ it('injects a timestamp', () => {
+ const handler = vi.fn();
+ const before = Date.now();
+ bus.on('speak', handler);
+ bus.emit({ type: 'speak' });
+ const after = Date.now();
+ const action = handler.mock.calls[0][0];
+ expect(action.timestamp).toBeGreaterThanOrEqual(before);
+ expect(action.timestamp).toBeLessThanOrEqual(after);
+ });
+
+ it('defaults payload to an empty object', () => {
+ const handler = vi.fn();
+ bus.on('speak', handler);
+ bus.emit({ type: 'speak' });
+ expect(handler.mock.calls[0][0].payload).toEqual({});
+ });
+
+ it('preserves agentId and sourceSkill when provided', () => {
+ const handler = vi.fn();
+ bus.on('speak', handler);
+ bus.emit({ type: 'speak', agentId: 'alice', sourceSkill: 'greet' });
+ expect(handler.mock.calls[0][0].agentId).toBe('alice');
+ expect(handler.mock.calls[0][0].sourceSkill).toBe('greet');
+ });
+});
+
+describe('AgentProtocol.once', () => {
+ it('fires only once per event type', () => {
+ const bus = new AgentProtocol();
+ const handler = vi.fn();
+ bus.once('speak', handler);
+ bus.emit({ type: 'speak' });
+ bus.emit({ type: 'speak' });
+ expect(handler).toHaveBeenCalledOnce();
+ });
+});
+
+describe('AgentProtocol.off', () => {
+ it('unsubscribes a handler registered via on()', () => {
+ const bus = new AgentProtocol();
+ const handler = vi.fn();
+ bus.on('speak', handler);
+ bus.off('speak', handler);
+ bus.emit({ type: 'speak' });
+ expect(handler).not.toHaveBeenCalled();
+ });
+});
+
+describe('AgentProtocol.history', () => {
+ it('tracks recent actions in order', () => {
+ const bus = new AgentProtocol();
+ bus.emit({ type: 'speak', payload: { text: 'a' } });
+ bus.emit({ type: 'think', payload: { thought: 'b' } });
+ const h = bus.history;
+ expect(h).toHaveLength(2);
+ expect(h[0].type).toBe('speak');
+ expect(h[1].type).toBe('think');
+ });
+
+ it('returns a snapshot, not a live reference', () => {
+ const bus = new AgentProtocol();
+ bus.emit({ type: 'speak' });
+ const snapshot = bus.history;
+ bus.emit({ type: 'think' });
+ expect(snapshot).toHaveLength(1);
+ });
+
+ it('caps history at the internal max', () => {
+ const bus = new AgentProtocol();
+ for (let i = 0; i < 250; i++) {
+ bus.emit({ type: 'speak', payload: { i } });
+ }
+ expect(bus.history.length).toBeLessThanOrEqual(200);
+ // Newest entries retained
+ const last = bus.history.at(-1);
+ expect(last.payload.i).toBe(249);
+ });
+});
+
+describe('AgentProtocol.recent', () => {
+ it('filters history by type', () => {
+ const bus = new AgentProtocol();
+ bus.emit({ type: 'speak', payload: { i: 0 } });
+ bus.emit({ type: 'think', payload: { i: 1 } });
+ bus.emit({ type: 'speak', payload: { i: 2 } });
+ const recent = bus.recent('speak');
+ expect(recent).toHaveLength(2);
+ expect(recent.every((a) => a.type === 'speak')).toBe(true);
+ });
+
+ it('returns at most N matches (newest)', () => {
+ const bus = new AgentProtocol();
+ for (let i = 0; i < 15; i++) bus.emit({ type: 'speak', payload: { i } });
+ const r = bus.recent('speak', 5);
+ expect(r).toHaveLength(5);
+ expect(r[r.length - 1].payload.i).toBe(14);
+ });
+
+ it('defaults to 10 entries', () => {
+ const bus = new AgentProtocol();
+ for (let i = 0; i < 20; i++) bus.emit({ type: 'speak', payload: { i } });
+ expect(bus.recent('speak')).toHaveLength(10);
+ });
+});
diff --git a/tests/src/ipfs.test.js b/tests/src/ipfs.test.js
new file mode 100644
index 000000000..f59d302ca
--- /dev/null
+++ b/tests/src/ipfs.test.js
@@ -0,0 +1,80 @@
+import { describe, it, expect } from 'vitest';
+import { isDecentralizedURI, resolveURI } from '../../src/ipfs.js';
+
+describe('isDecentralizedURI', () => {
+ it('matches ipfs:// URIs', () => {
+ expect(isDecentralizedURI('ipfs://QmCID')).toBe(true);
+ });
+
+ it('matches ar:// URIs', () => {
+ expect(isDecentralizedURI('ar://txId')).toBe(true);
+ });
+
+ it('is case-insensitive', () => {
+ expect(isDecentralizedURI('IPFS://QmCID')).toBe(true);
+ expect(isDecentralizedURI('Ar://tx')).toBe(true);
+ });
+
+ it('rejects http/https URLs', () => {
+ expect(isDecentralizedURI('https://example.com/foo')).toBe(false);
+ expect(isDecentralizedURI('http://example.com/foo')).toBe(false);
+ });
+
+ it('rejects bare paths', () => {
+ expect(isDecentralizedURI('/local/path.glb')).toBe(false);
+ expect(isDecentralizedURI('model.glb')).toBe(false);
+ });
+
+ it('rejects empty string', () => {
+ expect(isDecentralizedURI('')).toBe(false);
+ });
+});
+
+describe('resolveURI', () => {
+ it('maps ipfs:// CID to HTTPS gateway', () => {
+ const out = resolveURI('ipfs://QmTestCID');
+ expect(out).toMatch(/^https:\/\/.+\/ipfs\/QmTestCID$/);
+ });
+
+ it('preserves subpath on ipfs:// URIs', () => {
+ const out = resolveURI('ipfs://QmTestCID/nested/file.glb');
+ expect(out).toMatch(/\/ipfs\/QmTestCID\/nested\/file\.glb$/);
+ });
+
+ it('maps ar:// txId to arweave.net', () => {
+ expect(resolveURI('ar://someTxId')).toBe('https://arweave.net/someTxId');
+ });
+
+ it('returns http(s) URLs unchanged', () => {
+ expect(resolveURI('https://example.com/model.glb')).toBe(
+ 'https://example.com/model.glb',
+ );
+ expect(resolveURI('http://example.com/x')).toBe('http://example.com/x');
+ });
+
+ it('returns falsy input unchanged', () => {
+ expect(resolveURI('')).toBe('');
+ expect(resolveURI(null)).toBe(null);
+ expect(resolveURI(undefined)).toBe(undefined);
+ });
+
+ it('cycles through gateways based on index', () => {
+ const first = resolveURI('ipfs://QmCID', 0);
+ const second = resolveURI('ipfs://QmCID', 1);
+ const third = resolveURI('ipfs://QmCID', 2);
+ // At least two of them should differ — we have 3 gateways configured.
+ const set = new Set([first, second, third]);
+ expect(set.size).toBeGreaterThan(1);
+ });
+
+ it('wraps gateway index modulo', () => {
+ const zero = resolveURI('ipfs://QmCID', 0);
+ const three = resolveURI('ipfs://QmCID', 3);
+ expect(zero).toBe(three);
+ });
+
+ it('is case-insensitive on the scheme', () => {
+ expect(resolveURI('IPFS://QmCID')).toMatch(/\/ipfs\/QmCID$/);
+ expect(resolveURI('AR://tx')).toBe('https://arweave.net/tx');
+ });
+});
diff --git a/tmp-http-sweep.mjs b/tmp-http-sweep.mjs
new file mode 100644
index 000000000..970b43507
--- /dev/null
+++ b/tmp-http-sweep.mjs
@@ -0,0 +1,95 @@
+// HTTP-level sweep: for each HTML path, fetch it, then fetch every <script src>, <link href>,
+// and <img src> it references. Report broken (4xx/5xx) sub-resources.
+
+import { load as loadHtml } from 'cheerio';
+
+const BASE = 'http://127.0.0.1:4173';
+
+const paths = [
+ '/',
+ '/app.html',
+ '/home.html',
+ '/features.html',
+ '/create.html',
+ '/agent-home.html',
+ '/agent-edit.html',
+ '/agent-embed.html',
+ '/embed.html',
+ '/a-embed.html',
+ '/login.html',
+ '/register.html',
+ '/agent/',
+ '/dashboard/',
+ '/dashboard/storage.html',
+ '/dashboard/usage.html',
+ '/dashboard/wallets.html',
+ '/dashboard/sessions.html',
+ '/dashboard/embed-policy.html',
+ '/hydrate/',
+ '/studio/',
+ '/explore/',
+ '/artifact/',
+ '/widgets-gallery/',
+ '/docs-widgets.html',
+ '/reputation/',
+ '/discover/',
+ '/wallet-connect-demo.html',
+];
+
+async function probe(url) {
+ try {
+ const r = await fetch(url, { redirect: 'manual' });
+ return { status: r.status, ok: r.ok || r.status < 400, body: r.status < 400 ? await r.text() : null };
+ } catch (e) {
+ return { status: 0, ok: false, err: e.message };
+ }
+}
+
+async function head(url) {
+ try {
+ const r = await fetch(url, { method: 'GET', redirect: 'manual' });
+ return r.status;
+ } catch {
+ return 0;
+ }
+}
+
+const findings = [];
+for (const p of paths) {
+ const r = await probe(BASE + p);
+ const entry = { path: p, status: r.status, broken: [] };
+ if (!r.ok || !r.body) {
+ console.log(`[SKIP ${r.status}] ${p}`);
+ findings.push(entry);
+ continue;
+ }
+ try {
+ const $ = loadHtml(r.body);
+ const refs = new Set();
+ $('script[src]').each((_, el) => refs.add($(el).attr('src')));
+ $('link[href]').each((_, el) => refs.add($(el).attr('href')));
+ $('img[src]').each((_, el) => refs.add($(el).attr('src')));
+ const refList = [...refs].filter((u) => u && !u.startsWith('http') && !u.startsWith('//') && !u.startsWith('data:'));
+ const results = await Promise.all(
+ refList.map(async (ref) => {
+ const abs = ref.startsWith('/') ? BASE + ref : new URL(ref, BASE + p).toString();
+ return { ref, status: await head(abs) };
+ })
+ );
+ for (const { ref, status } of results) {
+ if (status >= 400 || status === 0) entry.broken.push({ ref, status });
+ }
+ } catch (e) {
+ entry.broken.push({ ref: '<parse>', status: e.message });
+ }
+ const n = entry.broken.length;
+ console.log(`[${n === 0 ? 'OK' : 'BAD'}] ${p} ${n} broken sub-resource${n === 1 ? '' : 's'}`);
+ findings.push(entry);
+}
+
+console.log('\n==== DETAILS ====');
+for (const f of findings) {
+ if (!f.broken?.length) continue;
+ console.log(`\n${f.path} (status ${f.status}):`);
+ for (const b of f.broken) console.log(` ${b.status} ${b.ref}`);
+}
diff --git a/tmp-page-sweep.mjs b/tmp-page-sweep.mjs
new file mode 100644
index 000000000..155d13e81
--- /dev/null
+++ b/tmp-page-sweep.mjs
@@ -0,0 +1,96 @@
+import { chromium } from 'playwright';
+import { readFileSync } from 'fs';
+
+const BASE = 'http://127.0.0.1:4173';
+
+// Pages to probe — mix of HTML files at root and vercel-route paths served by preview.
+// Vite preview will 404 on paths not in dist/, so we focus on direct HTML entries.
+const paths = [
+ '/',
+ '/index.html',
+ '/app.html',
+ '/home.html',
+ '/features.html',
+ '/create.html',
+ '/agent-home.html',
+ '/agent-edit.html',
+ '/agent-embed.html',
+ '/embed.html',
+ '/a-embed.html',
+ '/public/login.html',
+ '/public/register.html',
+ '/public/agent/index.html',
+ '/public/dashboard/index.html',
+ '/public/dashboard/storage.html',
+ '/public/dashboard/usage.html',
+ '/public/dashboard/wallets.html',
+ '/public/dashboard/sessions.html',
+ '/public/dashboard/embed-policy.html',
+ '/public/hydrate/index.html',
+ '/public/studio/index.html',
+ '/public/explore/index.html',
+ '/public/artifact/index.html',
+ '/public/widgets-gallery/index.html',
+ '/public/docs-widgets.html',
+ '/public/reputation/index.html',
+ '/public/discover/index.html',
+];
+
+const browser = await chromium.launch();
+const report = [];
+
+for (const p of paths) {
+ const ctx = await browser.newContext();
+ const page = await ctx.newPage();
+ const consoleErrors = [];
+ const pageErrors = [];
+ const failed = [];
+ page.on('console', (msg) => {
+ if (msg.type() === 'error') consoleErrors.push(msg.text().slice(0, 300));
+ });
+ page.on('pageerror', (err) => {
+ pageErrors.push((err.message || String(err)).slice(0, 300));
+ });
+ page.on('requestfailed', (req) => {
+ failed.push(`${req.failure()?.errorText || '?'} ${req.url()}`);
+ });
+ page.on('response', (resp) => {
+ const s = resp.status();
+ if (s >= 400) failed.push(`${s} ${resp.url()}`);
+ });
+
+ let loadErr = null;
+ try {
+ const resp = await page.goto(BASE + p, { waitUntil: 'networkidle', timeout: 15000 });
+ if (!resp || !resp.ok()) loadErr = `status=${resp?.status() ?? 'none'}`;
+ } catch (e) {
+ loadErr = e.message.slice(0, 200);
+ }
+ await ctx.close();
+
+ const entry = {
+ path: p,
+ loadErr,
+ consoleErrors,
+ pageErrors,
+ failed: failed.filter((x) => !/\/@vite\/|vite\/client|hot-update/.test(x)),
+ };
+ report.push(entry);
+ const problems = (entry.loadErr ? 1 : 0) + entry.consoleErrors.length + entry.pageErrors.length + entry.failed.length;
+ console.log(`[${problems === 0 ? 'OK' : 'WARN'}] ${p} (${problems} issue${problems === 1 ? '' : 's'})`);
+}
+
+await browser.close();
+
+// Print details
+console.log('\n\n==== DETAILS ====');
+for (const r of report) {
+ const issues = (r.loadErr ? 1 : 0) + r.consoleErrors.length + r.pageErrors.length + r.failed.length;
+ if (issues === 0) continue;
+ console.log(`\n--- ${r.path} ---`);
+ if (r.loadErr) console.log(' LOAD:', r.loadErr);
+ for (const e of r.pageErrors) console.log(' PAGE-ERR:', e);
+ for (const e of r.consoleErrors) console.log(' CONSOLE:', e);
+ for (const e of r.failed.slice(0, 10)) console.log(' REQ:', e);
+ if (r.failed.length > 10) console.log(` (+${r.failed.length - 10} more req failures)`);
+}
diff --git a/vercel.json b/vercel.json
index 050d3f644..a3a7c071d 100644
--- a/vercel.json
+++ b/vercel.json
@@ -54,6 +54,7 @@
"dest": "/api/agents/[id]/embed-policy?id=$1"
},
{ "src": "/api/agents/([^/]+)/sign", "dest": "/api/agents/[id]/sign?id=$1" },
+ { "src": "/api/agents/([^/]+)/animations", "dest": "/api/agents/[id]/animations?id=$1" },
{ "src": "/api/agents/([^/]+)", "dest": "/api/agents/[id]" },
{ "src": "/api/agents", "dest": "/api/agents" },
{ "src": "/api/agent-actions", "dest": "/api/agent-actions" },
diff --git a/yarn.lock b/yarn.lock
index a89a4457b..a3506aa34 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2423,6 +2423,11 @@ bcryptjs@^2.4.3:
resolved "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz"
integrity sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==
+boolbase@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz"
+ integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==
+
bowser@^2.11.0:
version "2.14.1"
resolved "https://registry.npmjs.org/bowser/-/bowser-2.14.1.tgz"
@@ -2499,6 +2504,35 @@ chai@^6.2.2:
resolved "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz"
integrity sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==
+cheerio-select@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz"
+ integrity sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==
+ dependencies:
+ boolbase "^1.0.0"
+ css-select "^5.1.0"
+ css-what "^6.1.0"
+ domelementtype "^2.3.0"
+ domhandler "^5.0.3"
+ domutils "^3.0.1"
+
+cheerio@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.npmjs.org/cheerio/-/cheerio-1.2.0.tgz"
+ integrity sha512-WDrybc/gKFpTYQutKIK6UvfcuxijIZfMfXaYm8NMsPQxSYvf+13fXUJ4rztGGbJcBQ/GF55gvrZ0Bc0bj/mqvg==
+ dependencies:
+ cheerio-select "^2.1.0"
+ dom-serializer "^2.0.0"
+ domhandler "^5.0.3"
+ domutils "^3.2.2"
+ encoding-sniffer "^0.2.1"
+ htmlparser2 "^10.1.0"
+ parse5 "^7.3.0"
+ parse5-htmlparser2-tree-adapter "^7.1.0"
+ parse5-parser-stream "^7.1.2"
+ undici "^7.19.0"
+ whatwg-mimetype "^4.0.0"
+
commander@^2.20.0:
version "2.20.3"
resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz"
@@ -2535,6 +2569,22 @@ crypto-random-string@^2.0.0:
resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz"
integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==
+css-select@^5.1.0:
+ version "5.2.2"
+ resolved "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz"
+ integrity sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==
+ dependencies:
+ boolbase "^1.0.0"
+ css-what "^6.1.0"
+ domhandler "^5.0.2"
+ domutils "^3.0.1"
+ nth-check "^2.0.1"
+
+css-what@^6.1.0:
+ version "6.2.2"
+ resolved "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz"
+ integrity sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==
+
dat.gui@^0.7.9:
version "0.7.9"
resolved "https://registry.npmjs.org/dat.gui/-/dat.gui-0.7.9.tgz"
@@ -2607,6 +2657,36 @@ detect-libc@^2.1.2:
resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz"
integrity sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==
+dom-serializer@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz"
+ integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==
+ dependencies:
+ domelementtype "^2.3.0"
+ domhandler "^5.0.2"
+ entities "^4.2.0"
+
+domelementtype@^2.3.0:
+ version "2.3.0"
+ resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz"
+ integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==
+
+domhandler@^5.0.2, domhandler@^5.0.3:
+ version "5.0.3"
+ resolved "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz"
+ integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==
+ dependencies:
+ domelementtype "^2.3.0"
+
+domutils@^3.0.1, domutils@^3.2.2:
+ version "3.2.2"
+ resolved "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz"
+ integrity sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==
+ dependencies:
+ dom-serializer "^2.0.0"
+ domelementtype "^2.3.0"
+ domhandler "^5.0.3"
+
dunder-proto@^1.0.0, dunder-proto@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz"
@@ -2628,6 +2708,29 @@ electron-to-chromium@^1.5.328:
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.336.tgz"
integrity sha512-AbH9q9J455r/nLmdNZes0G0ZKcRX73FicwowalLs6ijwOmCJSRRrLX63lcAlzy9ux3dWK1w1+1nsBJEWN11hcQ==
+encoding-sniffer@^0.2.1:
+ version "0.2.1"
+ resolved "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.1.tgz"
+ integrity sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==
+ dependencies:
+ iconv-lite "^0.6.3"
+ whatwg-encoding "^3.1.1"
+
+entities@^4.2.0:
+ version "4.5.0"
+ resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz"
+ integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==
+
+entities@^6.0.0:
+ version "6.0.1"
+ resolved "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz"
+ integrity sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==
+
+entities@^7.0.1:
+ version "7.0.1"
+ resolved "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz"
+ integrity sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==
+
es-abstract@^1.23.5, es-abstract@^1.23.6, es-abstract@^1.23.9:
version "1.24.2"
resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.2.tgz"
@@ -3037,6 +3140,23 @@ hasown@^2.0.2:
dependencies:
function-bind "^1.1.2"
+htmlparser2@^10.1.0:
+ version "10.1.0"
+ resolved "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz"
+ integrity sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==
+ dependencies:
+ domelementtype "^2.3.0"
+ domhandler "^5.0.3"
+ domutils "^3.2.2"
+ entities "^7.0.1"
+
+iconv-lite@^0.6.3, [email protected]:
+ version "0.6.3"
+ resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz"
+ integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
+ dependencies:
+ safer-buffer ">= 2.1.2 < 3.0.0"
+
idb@^7.0.1:
version "7.1.1"
resolved "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz"
@@ -3412,6 +3532,13 @@ node-releases@^2.0.36:
resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz"
integrity sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==
+nth-check@^2.0.1:
+ version "2.1.1"
+ resolved "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz"
+ integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==
+ dependencies:
+ boolbase "^1.0.0"
+
object-inspect@^1.13.3, object-inspect@^1.13.4:
version "1.13.4"
resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz"
@@ -3472,6 +3599,28 @@ package-json-from-dist@^1.0.0:
resolved "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz"
integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==
+parse5-htmlparser2-tree-adapter@^7.1.0:
+ version "7.1.0"
+ resolved "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz"
+ integrity sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==
+ dependencies:
+ domhandler "^5.0.3"
+ parse5 "^7.0.0"
+
+parse5-parser-stream@^7.1.2:
+ version "7.1.2"
+ resolved "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz"
+ integrity sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==
+ dependencies:
+ parse5 "^7.0.0"
+
+parse5@^7.0.0, parse5@^7.3.0:
+ version "7.3.0"
+ resolved "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz"
+ integrity sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==
+ dependencies:
+ entities "^6.0.0"
+
path-expression-matcher@^1.1.3, path-expression-matcher@^1.2.0:
version "1.5.0"
resolved "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.5.0.tgz"
@@ -3778,6 +3927,11 @@ safe-regex-test@^1.1.0:
es-errors "^1.3.0"
is-regex "^1.2.1"
+"safer-buffer@>= 2.1.2 < 3.0.0":
+ version "2.1.2"
+ resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz"
+ integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
+
semver@^6.3.1:
version "6.3.1"
resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz"
@@ -4210,6 +4364,11 @@ undici-types@~7.19.0:
resolved "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz"
integrity sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==
+undici@^7.19.0:
+ version "7.25.0"
+ resolved "https://registry.npmjs.org/undici/-/undici-7.25.0.tgz"
+ integrity sha512-xXnp4kTyor2Zq+J1FfPI6Eq3ew5h6Vl0F/8d9XU5zZQf1tX9s2Su1/3PiMmUANFULpmksxkClamIZcaUqryHsQ==
+
unicode-canonical-property-names-ecmascript@^2.0.0:
version "2.0.1"
resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz"
@@ -4338,6 +4497,18 @@ webidl-conversions@^4.0.2:
resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz"
integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==
+whatwg-encoding@^3.1.1:
+ version "3.1.1"
+ resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz"
+ integrity sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==
+ dependencies:
+ iconv-lite "0.6.3"
+
+whatwg-mimetype@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz"
+ integrity sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==
+
whatwg-url@^7.0.0:
version "7.1.0"
resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz"