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
Treat src="agent://…" as chat mode; document the chat opt-in
nirholas6edcd01521ee
diff --git a/examples/_verify-modes.html b/examples/_verify-modes.htmldeleted file mode 100644index 49130bfce..000000000--- a/examples/_verify-modes.html+++ /dev/null@@ -1,21 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <meta charset="utf-8" />- <title>verify modes</title>- <style>- body { margin: 0; display: flex; gap: 8px; background: #222; }- .cell { width: 360px; height: 600px; }- </style>- </head>- <body>- <!-- 1: default → BARE -->- <agent-3d id="a" class="cell" body="/avatars/cz.glb" eager></agent-3d>- <!-- 2: chat attr → CHAT -->- <agent-3d id="b" class="cell" chat body="/avatars/cz.glb" instructions="hi" eager></agent-3d>- <!-- 3: kiosk → BARE (force) -->- <agent-3d id="c" class="cell" kiosk body="/avatars/cz.glb" eager></agent-3d>-- <script type="module" src="../src/element.js"></script>- </body>-</html>diff --git a/public/docs/web-component.md b/public/docs/web-component.mdindex 2bc59d61a..3ce71f182 100644--- a/public/docs/web-component.md+++ b/public/docs/web-component.md@@ -9,7 +9,15 @@<agent-3d src="agent://base/42" style="width:400px;height:500px"></agent-3d>```-All four layout modes, voice I/O, the LLM brain, persistent memory, and an extensible skill system are built in. Every feature is opt-in — a bare `<agent-3d body="./avatar.glb">` renders a silent 3D viewer with no API key and no external calls beyond the GLB itself.+All four layout modes, voice I/O, the LLM brain, persistent memory, and an extensible skill system are built in. Every feature is opt-in — and so is the chat UI. A plain `<agent-3d body="./avatar.glb">` renders **just the avatar** on a transparent background: no chat, no input bar, no debug GUI, no name-plate, no API key, no external calls beyond the GLB itself.++Add the `chat` attribute to turn it into a full conversational agent. A bound published agent — `agent-id`, `manifest`, or `src="agent://…"` — implies `chat` automatically, since it carries a brain and persona of its own:++```html+<agent-3d body="./avatar.glb"></agent-3d> <!-- just the avatar -->+<agent-3d chat body="./avatar.glb"></agent-3d> <!-- avatar + chat -->+<agent-3d src="agent://base/42"></agent-3d> <!-- published agent: chats -->+```---@@ -17,7 +25,7 @@ All four layout modes, voice I/O, the LLM brain, persistent memory, and an extenThe element is designed to be zero-overhead until it is needed.-1. **Element added to DOM** — `connectedCallback` fires. Shadow DOM shell (canvas container, chat chrome, poster, loading indicator) is rendered immediately.+1. **Element added to DOM** — `connectedCallback` fires. Shadow DOM shell (canvas container, poster, loading indicator — plus the chat chrome when in chat mode) is rendered immediately.2. **IntersectionObserver** starts watching the element. Nothing else happens until at least one pixel is visible in the viewport. Add the `eager` attribute to skip this and boot immediately on connection.3. **Manifest resolved** — the element reads its source attributes (`src`, `agent-id`, `manifest`, or `body`) in priority order and fetches or constructs an agent manifest. See [Source attributes](#source-attributes) for the priority chain.4. **Embed policy checked** — if the manifest maps to a backend agent ID, the element fetches the agent's embed policy and refuses to continue if the current origin is not permitted.@@ -123,7 +131,8 @@ Using `body` with no manifest creates an ad-hoc agent. Its name, instructions, a| Attribute | Description ||-----------|-------------|| `eager` | Boot immediately on DOM connection, bypassing the IntersectionObserver lazy-load. |-| `kiosk` | Hides all UI chrome: chat input, mic button, validator panel, editor links. Use for display contexts where end users should not interact. |+| `chat` | Adds the conversational UI (chat log, input row, mic, thought bubble, name-plate) to the bare avatar. A bound `agent-id`/`manifest`/`src="agent://…"` enables this automatically. |+| `kiosk` | Forces the bare avatar — hides all chat/control/debug chrome even on a bound agent. Use for signage and display contexts. (A plain `<agent-3d>` is already bare.) || `debug` | Overlays scene graph stats, tool-call log, and memory inspector in the shadow DOM. || `name-plate` | Controls the name overlay. Set to `"off"` to hide it. |diff --git a/specs/EMBED_SPEC.md b/specs/EMBED_SPEC.mdindex 08dd76c9f..26018cf34 100644--- a/specs/EMBED_SPEC.md+++ b/specs/EMBED_SPEC.md@@ -29,6 +29,36 @@ That's the full install for 95% of users. Everything below is optional.When multiple are set, priority is `src` > `agent-id` > `manifest` > `body`.All on-chain forms resolve through [`src/erc8004/resolver.js`](../src/erc8004/resolver.js).+### Chrome — bare avatar (default) vs chat agent++A plain `<agent-3d>` ships **just the avatar**: the transparent 3D canvas and+nothing else — no chat, no input bar, no debug GUI, no name-plate. This is the+default so the one-liner drops a clean embodied avatar onto any page.++The conversational chrome (chat log, input row, mic, thought bubble,+name-plate) is **opt-in**:++| Attribute | Effect |+| ---------- | ---------------------------------------------------------------------------------------------- |+| `chat` | Adds the full conversational UI. The documented way to turn a bare avatar into a chat agent. |+| `agent-id` | Implies `chat` — a bound published agent carries a brain + persona, so it talks by default. |+| `manifest` | Implies `chat` — same reasoning as `agent-id`. |+| `kiosk` | Forces bare even when an `agent-id`/`manifest` is bound (render a bound agent as decoration). |+| `viewer` | Forces bare; alias intended for pure decoration (landing pages, launchpads). |++```html+<!-- just the avatar -->+<agent-3d body="ipfs://bafy.../cz.glb"></agent-3d>++<!-- avatar + chat -->+<agent-3d chat body="ipfs://bafy.../cz.glb" instructions="You are a friendly guide."></agent-3d>++<!-- a published agent — chats by default -->+<agent-3d agent-id="42" chain-id="8453"></agent-3d>+```++`chat` may be toggled at runtime; the element rebuilds its chrome in place.+### Body / scene| Attribute | Type | Default | Notes |@@ -93,7 +123,8 @@ All on-chain forms resolve through [`src/erc8004/resolver.js`](../src/erc8004/re### Integrated Avatar Chat-The default `avatar-chat` mode provides a rich, embodied interaction:+When chat is enabled (`chat`, or a bound `agent-id`/`manifest`), the `avatar-chat`+layout provides a rich, embodied interaction:- **Walk Animation**: The avatar walks in place while the LLM is thinking or streaming text, and also when the chat is scrolled.- **Thought Bubble**: A status bubble appears above the avatar's head, showing "Thinking..." or the live stream of tokens.- **Interactive Scene**: Empty space around the avatar remains interactive (orbit/zoom/pan) even while chat is visible.@@ -117,11 +148,15 @@ The canonical embed shape is `<agent-3d chain-id="8453" agent-id="42">` — the### Dev / debug-| Attribute | Notes |-| --------- | ----------------------------------------------------- |-| `kiosk` | hides all UI chrome (validator, controls, chat) |-| `debug` | overlays scene graph, tool-call log, memory inspector |-| `editor` | mounts the embed editor instead of the live agent |+| Attribute | Notes |+| --------- | ------------------------------------------------------------------------------ |+| `kiosk` | forces the bare avatar — hides all chrome (chat, controls, debug GUI, plate) |+| `debug` | overlays scene graph, tool-call log, memory inspector |+| `editor` | mounts the embed editor instead of the live agent |++Note: the debug GUI and axes gizmo are already hidden on every bare avatar (the+default), so `kiosk` is only needed to force bare on an `agent-id`/`manifest`+binding that would otherwise chat. See "Chrome" above.## Modes@@ -173,7 +208,7 @@ Takes over the viewport with a close button. Useful for mobile.## Avatar-in-Chat Mode-By default, `<agent-3d>` uses a vertical chat layout where the 3D avatar is visible as a conversation participant through a transparent window between the message history and the input bar. While the LLM generates a response, the avatar:+In chat mode (`chat`, or a bound `agent-id`/`manifest`), `<agent-3d>` uses a vertical chat layout where the 3D avatar is visible as a conversation participant through a transparent window between the message history and the input bar. While the LLM generates a response, the avatar:- **Walks** in place (synchronized to token streaming)- **Displays a thought bubble** above its head showing the streaming textdiff --git a/src/element.js b/src/element.jsindex 9be29425e..33fc1fcf0 100644--- a/src/element.js+++ b/src/element.js@@ -745,7 +745,10 @@ class Agent3DElement extends HTMLElement {_isChatMode() {if (this.hasAttribute('chat')) return true;if (this.hasAttribute('kiosk') || this.hasAttribute('viewer')) return false;- return this.hasAttribute('agent-id') || this.hasAttribute('manifest');+ if (this.hasAttribute('agent-id') || this.hasAttribute('manifest')) return true;+ // An `src` pointing at a published agent (the `agent://` scheme) is a+ // bound agent too — it chats. A plain GLB/HTTPS/IPFS `src` is just a body.+ return /^agent:\/\//i.test(this.getAttribute('src') || '');}// Reflect the resolved chrome mode onto the host as a read-only `data-bare`