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
add xspace-agent/public/js/agent-loader.js
oversteppingbca493f92a22
diff --git a/xspace-agent/public/js/agent-loader.js b/xspace-agent/public/js/agent-loader.jsnew file mode 100644index 000000000..971e7d972--- /dev/null+++ b/xspace-agent/public/js/agent-loader.js@@ -0,0 +1,35 @@+// SPDX-License-Identifier: Apache-2.0+// Copyright 2026 nirholas (https://github.com/nirholas/xspace-agent) [§72]++// Dynamic provider loader — fetches config and initializes the right provider+(async function() {+ // AGENT_CONFIG must be set before this script loads+ const config = window.AGENT_CONFIG+ if (!config) {+ console.error("AGENT_CONFIG not set")+ return+ }++ // Create the shared agent instance+ const agent = new AgentCommon(config)++ // Fetch server config to determine provider type+ try {+ const res = await fetch("/config")+ const serverConfig = await res.json()++ agent.log(`AI Provider: ${serverConfig.aiProvider} (${serverConfig.providerType} mode)`)++ if (serverConfig.providerType === "webrtc") {+ // Load OpenAI Realtime WebRTC provider+ initOpenAIRealtime(agent)+ } else {+ // Load Socket.IO-based provider (Claude/Groq)+ initSocketProvider(agent)+ }+ } catch (err) {+ agent.log("Failed to load config: " + err.message, "error")+ }+})()++