Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat: runtime and skill updates
nirholas39b41b9869cb
diff --git a/src/runtime/data-reactive.js b/src/runtime/data-reactive.jsindex 8bc476473..31657462b 100644--- a/src/runtime/data-reactive.js+++ b/src/runtime/data-reactive.js@@ -6,6 +6,7 @@* protocol actions to fire.*/+import { log } from '../shared/log.js';const MAX_WS_RETRIES = 10;const WS_BACKOFF_CAP_MS = 30_000;@@ -78,7 +79,7 @@ function startSSE(url, protocol, bindings, stats, signal) {if (signal) signal.addEventListener('abort', () => ac.abort(), { once: true });consumeSSE(url, protocol, bindings, stats, ac.signal).catch((err) => {- if (err?.name !== 'AbortError') console.error('[data-reactive] SSE error:', err);+ if (err?.name !== 'AbortError') log.error('[data-reactive] SSE error:', err);});return () => ac.abort();@@ -117,7 +118,7 @@ function startWS(url, subscribePayloads, reconnectBaseMs, protocol, bindings, st});ws.addEventListener('error', (e) => {- console.error('[data-reactive] WS error:', e.message ?? e);+ log.error('[data-reactive] WS error:', e.message ?? e);stats.errors++;});@@ -125,7 +126,7 @@ function startWS(url, subscribePayloads, reconnectBaseMs, protocol, bindings, stif (stopped) return;attempt++;if (attempt > MAX_WS_RETRIES) {- console.error('[data-reactive] WS max retries reached, giving up');+ log.error('[data-reactive] WS max retries reached, giving up');return;}const delay = Math.min(reconnectBaseMs * 2 ** (attempt - 1), WS_BACKOFF_CAP_MS);@@ -170,7 +171,7 @@ function startPoll(url, intervalMs, parseFn, protocol, bindings, stats, signal).catch((err) => {if (stopped) return;if (err?.name !== 'AbortError') {- console.error('[data-reactive] poll error:', err);+ log.error('[data-reactive] poll error:', err);stats.errors++;}});diff --git a/src/runtime/scene.js b/src/runtime/scene.jsindex a22e588e9..66ed5d22b 100644--- a/src/runtime/scene.js+++ b/src/runtime/scene.js@@ -7,6 +7,7 @@ import { Vector3 } from 'three';import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';import { resolveURI } from '../ipfs.js';import { resolveSlot } from './animation-slots.js';+import { log } from '../shared/log.js';const EXPRESSION_MAP = {neutral: {@@ -202,7 +203,7 @@ export class SceneController {lookAt(target) {const t = this._resolveTarget(target);if (!t) {- if (target != null) console.warn(`[SceneController] unknown lookAt target: "${target}"`);+ if (target != null) log.warn(`[SceneController] unknown lookAt target: "${target}"`);return;}if (!this.viewer.content) return;diff --git a/src/runtime/tools.js b/src/runtime/tools.jsindex a6763af74..48ca72a4d 100644--- a/src/runtime/tools.js+++ b/src/runtime/tools.js@@ -1,6 +1,7 @@// Built-in scene-tools — available to every agent without any skill installed.// See specs/AGENT_MANIFEST.md § Built-in tools.+import { log } from '../shared/log.js';export const BUILTIN_TOOLS = [{name: 'wave',@@ -148,7 +149,7 @@ export const BUILTIN_HANDLERS = {const played = ctx.viewer.playClipByName?.(resolved, { loop, fade_ms });if (!played) {if (resolved !== name)- console.warn(`[play_clip] slot "${name}" → "${resolved}" not found in library`);+ log.warn(`[play_clip] slot "${name}" → "${resolved}" not found in library`);return { ok: false, error: `No clip named "${resolved}"` };}return { ok: true, name, resolved };diff --git a/src/runtime/voice-client.js b/src/runtime/voice-client.jsindex 55c49e57c..1aef13f83 100644--- a/src/runtime/voice-client.js+++ b/src/runtime/voice-client.js@@ -2,6 +2,7 @@// Lazy-loaded — only imported when the voice-server attribute is present.// The server handles all STT/TTS; this module only streams mic audio and plays responses.+import { log } from '../shared/log.js';export class VoiceClient {constructor({ serverUrl, element }) {this._url = serverUrl.replace(/\/$/, '');@@ -25,7 +26,7 @@ export class VoiceClient {try {({ io } = await import(/* @vite-ignore */ `${this._url}/socket.io/socket.io.esm.min.js`));} catch (err) {- console.warn('[voice-client] socket.io load failed', err);+ log.warn('[voice-client] socket.io load failed', err);this._active = false;this._emitState('idle');return;@@ -52,7 +53,7 @@ export class VoiceClient {if (status === 'idle' && this._active) this._emitState('listening');});socket.on('connect_error', (err) => {- console.warn('[voice-client] connect error', err.message);+ log.warn('[voice-client] connect error', err.message);this.stop();});socket.on('disconnect', () => this._emitState('idle'));@@ -75,7 +76,7 @@ export class VoiceClient {try {this._stream = await navigator.mediaDevices.getUserMedia({ audio: true });} catch (err) {- console.warn('[voice-client] mic access denied', err);+ log.warn('[voice-client] mic access denied', err);this.stop();return;}diff --git a/src/skill-manifest.js b/src/skill-manifest.jsindex 45f0190ce..b21479208 100644--- a/src/skill-manifest.js+++ b/src/skill-manifest.js@@ -5,6 +5,7 @@* @param {Object|undefined} inputSchema* @returns {Record<string, string>}*/+import { log } from './shared/log.js';function schemaToArgs(inputSchema) {if (!inputSchema?.properties) return {};const required = new Set(inputSchema.required || []);@@ -27,7 +28,7 @@ export function buildSkillManifest({ agentId, version, skills }) {const entries = [];for (const skill of skills) {if (!skill.description) {- console.warn(`[skill-manifest] Skill "${skill.name}" has no description — omitting`);+ log.warn(`[skill-manifest] Skill "${skill.name}" has no description — omitting`);continue;}entries.push({diff --git a/src/skills/index.js b/src/skills/index.jsindex c28935e5b..f37c697bd 100644--- a/src/skills/index.js+++ b/src/skills/index.js@@ -4,6 +4,7 @@import { resolveURI } from '../ipfs.js';import { getHost } from './sandbox-host.js';import { startDataReactive } from '../runtime/data-reactive.js';+import { log } from '../shared/log.js';/** Injected into every skill handler ctx as ctx.dataReactive */const dataReactive = { start: startDataReactive };@@ -141,7 +142,7 @@ export class SkillRegistry {for (const skill of this.skills.values()) {for (const tool of skill.tools) {if (merged.has(tool.name)) {- console.warn(+ log.warn(`[skills] tool "${tool.name}" overridden by skill "${skill.name}"`,);}@@ -196,7 +197,7 @@ export class SkillRegistry {const mod = await import(/* @vite-ignore */ url);return mod;} catch (e) {- console.warn(`[skills] handlers load failed: ${url}`, e);+ log.warn(`[skills] handlers load failed: ${url}`, e);return null;}}diff --git a/src/skills/sandbox-host.js b/src/skills/sandbox-host.jsindex cc6f11b70..c99df1d49 100644--- a/src/skills/sandbox-host.js+++ b/src/skills/sandbox-host.js@@ -5,6 +5,7 @@// no code-split chunk, compatible with both ES and UMD lib builds.// The worker is created at runtime as a classic-script blob: URL.import _workerSrc from './sandbox-worker.js?raw';+import { log } from '../shared/log.js';/** @type {Worker | null} */let _worker = null;@@ -60,7 +61,7 @@ function _getWorker() {}function _onError(err) {- console.error('[sandbox] worker crashed:', err);+ log.error('[sandbox] worker crashed:', err);_worker = null;_installPromises.clear();_installCallbacks.clear();