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.

1.8 KB
Raw Blame
<!doctype html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title data-i18n="lobehub_iframe_index.meta_title">three.ws — Chat Embed</title>
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<meta name="robots" content="noindex" />
		<style>
			html,
			body {
				margin: 0;
				padding: 0;
				width: 100%;
				height: 100%;
				background: transparent;
				overflow: hidden;
			}
			agent-3d {
				display: block;
				width: 100%;
				height: 100%;
			}
			#status {
				position: absolute;
				inset: 0;
				display: flex;
				align-items: center;
				justify-content: center;
				color: rgba(255, 255, 255, 0.4);
				font:
					13px system-ui,
					sans-serif;
				pointer-events: none;
			}
		</style>
		<!--
			Loads the <agent-3d> web component. In production loads from CDN; in dev
			loads from the local Vite dev server so local changes are reflected immediately.
			The host's sandbox CSP (LobeChat / SperaxOS) must allow module scripts from
			this origin. boot.js speaks the LobeChat + SperaxOS standalone-plugin protocol.
		-->
		<script type="module">
			const CDN = 'https://three.ws/agent-3d/latest/agent-3d.js';
			const h = location.hostname;
			const isLocal =
				h === 'localhost' ||
				h === '127.0.0.1' ||
				h.endsWith('.github.dev') ||
				h.endsWith('.local');
			if (isLocal) {
				const { defineElement } = await import('/src/lib.js');
				defineElement();
			} else {
				await import(CDN);
			}
		</script>
	</head>
	<body>
		<div id="status">Loading…</div>
		<!-- agent-id is set dynamically by boot.js from ?agent= query param -->
		<agent-3d id="agent" kiosk eager></agent-3d>
		<script type="module" src="/lobehub/iframe/boot.js"></script>
		<!-- Runtime i18n: detects locale, swaps annotated copy, mounts <lang-switcher>. -->
	<script type="module" src="/i18n.js"></script>
</body>
</html>