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.

Mocap studio refinements and NVIDIA vision verify script

nirholas3f0bc56ffe29
diff --git a/data/changelog.json b/data/changelog.json
index 5a11dd612..abcebb0f3 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,15 @@
{
"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-06-23",
+ "title": "See the agent economy move, live, on the home page",
+ "summary": "The home page now carries a live readout of real value moving between agents — every tip, payment, trade, and token launch as it happens on-chain. It calls out the hottest-earning agent right now as a discovery hook, shows running totals for the window, and lists the most recent flows; each one links straight to the agent and to its real transaction on Solscan. Nothing is simulated — when the market is quiet, it says so honestly instead of inventing activity. It's the compact face of the Agent Galaxy's Money-Cam, and the whole widget is a doorway into the full 3D money map.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/galaxy"
+ },
{
"date": "2026-06-23",
"title": "Creating an agent never dead-ends on wallet setup",
diff --git a/scripts/verify-nvidia-vision.mjs b/scripts/verify-nvidia-vision.mjs
new file mode 100644
index 000000000..dae66de93
--- /dev/null
+++ b/scripts/verify-nvidia-vision.mjs
@@ -0,0 +1,89 @@
+#!/usr/bin/env node
+// Live verification for the free NVIDIA NIM vision lane.
+//
+// node scripts/verify-nvidia-vision.mjs # describe a synthetic image (needs NVIDIA_API_KEY)
+// node scripts/verify-nvidia-vision.mjs --model meta/llama-3.2-11b-vision-instruct
+//
+// Builds a real PNG in memory (a solid-color square — proper IHDR/IDAT/IEND
+// chunks with CRCs, zlib-deflated scanlines), asks the hosted VLM what color it
+// is, and asserts a non-empty answer that names the color. No fixture files are
+// written; the whole check stays in memory.
+
+import { config as dotenv } from 'dotenv';
+import { deflateSync } from 'node:zlib';
+
+dotenv({ path: new URL('../.env.local', import.meta.url) });
+delete process.env.NODE_ENV;
+delete process.env.VERCEL_ENV;
+
+if (!process.env.NVIDIA_API_KEY) {
+ console.error('[vision] NVIDIA_API_KEY missing from environment/.env.local — cannot verify');
+ process.exit(1);
+}
+
+const modelArg = process.argv.indexOf('--model');
+const model = modelArg !== -1 ? process.argv[modelArg + 1] : undefined;
+
+// ── minimal PNG encoder (solid RGB square) ──────────────────────────────────
+const CRC_TABLE = (() => {
+ const t = new Uint32Array(256);
+ for (let n = 0; n < 256; n++) {
+ let c = n;
+ for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
+ t[n] = c >>> 0;
+ }
+ return t;
+})();
+function crc32(buf) {
+ let c = 0xffffffff;
+ for (let i = 0; i < buf.length; i++) c = CRC_TABLE[(c ^ buf[i]) & 0xff] ^ (c >>> 8);
+ return (c ^ 0xffffffff) >>> 0;
+}
+function chunk(type, data) {
+ const len = Buffer.alloc(4);
+ len.writeUInt32BE(data.length, 0);
+ const typeBuf = Buffer.from(type, 'ascii');
+ const crc = Buffer.alloc(4);
+ crc.writeUInt32BE(crc32(Buffer.concat([typeBuf, data])), 0);
+ return Buffer.concat([len, typeBuf, data, crc]);
+}
+function solidPng(size, [r, g, b]) {
+ const ihdr = Buffer.alloc(13);
+ ihdr.writeUInt32BE(size, 0);
+ ihdr.writeUInt32BE(size, 4);
+ ihdr[8] = 8; // bit depth
+ ihdr[9] = 2; // color type: truecolor RGB
+ // rows: a leading filter byte (0 = none) then size*3 color bytes
+ const row = Buffer.concat([Buffer.from([0]), Buffer.concat(Array.from({ length: size }, () => Buffer.from([r, g, b])))]);
+ const raw = Buffer.concat(Array.from({ length: size }, () => row));
+ const idat = deflateSync(raw);
+ const sig = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
+ return Buffer.concat([sig, chunk('IHDR', ihdr), chunk('IDAT', idat), chunk('IEND', Buffer.alloc(0))]);
+}
+
+const { describeImage } = await import('../api/_lib/vision-nvidia.js');
+
+try {
+ // A 128px solid red square — small enough to ride inline, unambiguous to name.
+ const png = solidPng(128, [220, 20, 20]);
+ console.log(`[vision] built a ${png.length}-byte synthetic red PNG; asking the model…`);
+ const t0 = Date.now();
+ const out = await describeImage({
+ imageBytes: png,
+ contentType: 'image/png',
+ prompt: 'What is the single dominant color of this image? Answer with just the color name.',
+ model,
+ maxTokens: 32,
+ });
+ console.log(`[vision] model=${out.model} assetUpload=${Boolean(out.assetId)} in ${Date.now() - t0} ms`);
+ console.log(`[vision] answer: "${out.text}"`);
+ if (!out.text.trim()) throw new Error('empty completion');
+ if (!/red|crimson|scarlet/i.test(out.text)) {
+ console.warn('[vision] WARN — answer did not name red; the lane responded but recognition is suspect.');
+ } else {
+ console.log('[vision] PASS — the VLM correctly identified the color. Vision lane works.');
+ }
+} catch (e) {
+ console.error(`[vision] FAIL — ${e?.code ? `${e.code}: ` : ''}${e?.message || e}`);
+ process.exit(1);
+}
diff --git a/src/mocap-studio.js b/src/mocap-studio.js
index 35df15cb8..e251e1d58 100644
--- a/src/mocap-studio.js
+++ b/src/mocap-studio.js
@@ -50,8 +50,11 @@ const state = {
rafId: 0,
playback: null,
signedIn: false,
+ username: null, // signed-in user's handle (lowercased) — used to gate avatar_id on save
};
+const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
+
// ── Bring up the Three.js scene ────────────────────────────────────────────
const viewer = new Viewer(stage, { kiosk: true });
viewer.renderer?.setClearAlpha(0);
@@ -63,9 +66,10 @@ handleInput.value = '';
nameInput.value = '';
// ── Auth state ────────────────────────────────────────────────────────────
-detectAuth().then((ok) => {
- state.signedIn = ok;
- authWarning.classList.toggle('visible', !ok);
+fetchMe().then((user) => {
+ state.signedIn = !!user;
+ state.username = user?.username ? String(user.username).toLowerCase() : null;
+ authWarning.classList.toggle('visible', !user);
});
// ── Boot: try to load user's primary public avatar ────────────────────────
@@ -119,8 +123,17 @@ async function fetchMe() {
}
}
-async function detectAuth() {
- return !!(await fetchMe());
+// True only when the loaded avatar is one the signed-in user owns — i.e. it was
+// resolved from their own handle and carries a real UUID. The save endpoint
+// rejects an avatar_id the caller doesn't own (404) and the non-UUID 'default'
+// sentinel (400 uuid-validation), so attaching the id in any other case would
+// make "Save clip" fail. When false we simply omit avatar_id: the clip still
+// saves, just without an avatar association.
+function ownsLoadedAvatar() {
+ const a = state.avatar;
+ if (!a || !a.id || !UUID_RE.test(a.id)) return false;
+ if (!state.username || !a.handle) return false;
+ return String(a.handle).toLowerCase() === state.username;
}
async function bootAvatar() {
@@ -328,7 +341,7 @@ async function saveClip() {
description: (descInput.value || '').trim() || undefined,
tags,
visibility: visibilityInput.value,
- avatar_id: state.avatar?.id,
+ avatar_id: ownsLoadedAvatar() ? state.avatar.id : undefined,
clip: state.lastClip,
};
saveBtn.disabled = true;
diff --git a/src/shared/networth-presence.js b/src/shared/networth-presence.js
index 3bbd510ad..970799908 100644
--- a/src/shared/networth-presence.js
+++ b/src/shared/networth-presence.js
@@ -138,6 +138,10 @@ export function createPresencePanel({ agentId, onPrefsSaved } = {}) {
: `Portfolio <strong>${esc(fmtUsd(usd))}</strong>${hub ? ` · <a href="${esc(hub)}">wallet</a>` : ''}`;
const controls = isOwner ? renderControls(prefs) : '';
+ // The live "why": the real 24h flow behind the glow. Visitors see the honest
+ // trend qualitatively (earning / cooling) + public stream/tip signals; the
+ // owner additionally sees the exact dollar momentum and in/out breakdown.
+ const flowRow = renderFlow(data.flow, isOwner);
el.innerHTML = `
<div class="nwp-head">
@@ -148,6 +152,7 @@ export function createPresencePanel({ agentId, onPrefsSaved } = {}) {
</div>
</div>
${next && next.usd_to_next > 0 ? `<div class="nwp-next" title="${esc(fmtUsd(next.usd_to_next))} to ${esc(next.label)}"><i style="width:${nextPct}%"></i></div>` : ''}
+ ${flowRow}
${marks ? `<div class="nwp-marks" data-marks${repHidden ? ' hidden' : ''}>${marks}</div>` : ''}
${controls}
<div class="nwp-foot">◎ Driven by this agent's real on-chain wallet</div>