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(agent-picker): implement GLB URL rewriting for CORS compliance and add proxy configuration

nirholas96d5462549d5
diff --git a/rider/src/components/agent-picker.js b/rider/src/components/agent-picker.js
index 53df02bf5..3fe26767a 100644
--- a/rider/src/components/agent-picker.js
+++ b/rider/src/components/agent-picker.js
@@ -50,7 +50,7 @@ AFRAME.registerSystem('agent-picker', {
.map(it => ({
id: `${it.kind}-${it.agentId || it.name}-${it.sortDate}`,
name: it.name || 'Untitled',
- url: it.glbUrl,
+ url: rewriteGlbUrl(it.glbUrl),
owner: it.ownerShort || ''
}));
this.agents = FALLBACK_AGENTS.concat(fetched);
@@ -213,3 +213,9 @@ AFRAME.registerSystem('agent-picker', {
function escapeHtml (s) {
return String(s).replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
}
+
+// R2 public bucket sends no CORS headers, so three.js can't fetch GLBs
+// cross-origin. Route them through the dev-server proxy.
+function rewriteGlbUrl (url) {
+ return url.replace(/^https:\/\/pub-2534e921bf9c4314addcd4d8a6e98b7b\.r2\.dev/, '/r2-proxy');
+}
diff --git a/rider/webpack.config.js b/rider/webpack.config.js
index 10e359a00..a6eb7342c 100644
--- a/rider/webpack.config.js
+++ b/rider/webpack.config.js
@@ -31,6 +31,12 @@ module.exports = {
changeOrigin: true,
secure: true,
pathRewrite: { '^/threews-api': '/api' }
+ },
+ '/r2-proxy': {
+ target: 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev',
+ changeOrigin: true,
+ secure: true,
+ pathRewrite: { '^/r2-proxy': '' }
}
}
},