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
const HTML_ESCAPE_MAP: Record<string, string> = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
};
export function escapeHtml(str: string): string {
if (!str) return '';
return String(str).replace(/[&<>"']/g, (char) => HTML_ESCAPE_MAP[char] || char);
}
export function sanitizeUrl(url: string): string {
if (!url) return '';
const trimmed = String(url).trim();
if (!trimmed) return '';
const isAllowedProtocol = (protocol: string) => protocol === 'http:' || protocol === 'https:';
try {
const parsed = new URL(trimmed);
if (isAllowedProtocol(parsed.protocol)) {
return escapeAttr(parsed.toString());
}
} catch {
// Not an absolute URL, continue and validate as relative.
}
if (!/^(\/|\.\/|\.\.\/|\?|#)/.test(trimmed)) {
return '';
}
try {
const base = typeof window !== 'undefined' ? window.location.origin : 'https://example.com';
const resolved = new URL(trimmed, base);
if (!isAllowedProtocol(resolved.protocol)) {
return '';
}
return escapeAttr(trimmed);
} catch {
return '';
}
}
export function escapeAttr(str: string): string {
return escapeHtml(str);
}