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
fix(app): stop double-mount of agent sidebar; add first-time orientation banner
nirholas3bacad1390b7
diff --git a/app.html b/app.htmlindex 4b58e69ef..40a4613de 100644--- a/app.html+++ b/app.html@@ -174,6 +174,49 @@</div></aside>+ <!-- First-time onboarding banner — shown once per agent after creation -->+ <aside+ class="agent-onboarding"+ id="agent-onboarding"+ role="dialog"+ aria-labelledby="agent-onboarding-title"+ hidden+ >+ <div class="agent-onboarding__inner">+ <button+ class="agent-onboarding__close"+ id="agent-onboarding-close"+ type="button"+ aria-label="Dismiss welcome message"+ >+ ×+ </button>+ <h2 class="agent-onboarding__title" id="agent-onboarding-title">+ Your agent is ready 🎉+ </h2>+ <p class="agent-onboarding__desc">+ This is your agent's studio. Try an animation from the strip below, drop+ a new GLB to swap its body, or publish it on-chain so anyone can find+ and embed it.+ </p>+ <div class="agent-onboarding__actions">+ <a+ class="agent-onboarding__btn agent-onboarding__btn--primary"+ href="/deploy"+ id="agent-onboarding-deploy"+ >Deploy on-chain →</a+ >+ <a+ class="agent-onboarding__btn"+ id="agent-onboarding-share"+ target="_blank"+ rel="noopener"+ >View public profile</a+ >+ </div>+ </div>+ </aside>+<!-- 3D Viewer --><div class="viewer-container" id="viewer-container"></div>diff --git a/src/app.js b/src/app.jsindex e8be0072d..3a5bfd3d2 100644--- a/src/app.js+++ b/src/app.js@@ -235,14 +235,16 @@ class App {}// Editing an existing agent: ?agent=<uuid> (authenticated editing surface)+ // _loadAgentForEdit owns its own _initAgentSystem call — early-return to+ // avoid mounting AgentHome twice into the same container.if (options.agentEdit) {this._loadAgentForEdit(options.agentEdit);- } else {- // Resume a stashed editor session (post-login round-trip), else- // load the model named in the URL or fall back to the CZ avatar.- this._maybeResumeOrLoad(options);+ this._initWidgetBridge();+ return;}+ this._maybeResumeOrLoad(options);+// After sign-in redirect, check for a pending_save stash.if (options.pending) {this._maybePendingSave();@@ -372,9 +374,13 @@ class App {agentId: this.identity.id,});- // Render the agent home panel (identity card + timeline)+ // Render the agent home panel (identity card + timeline). Idempotent —+ // if a previous boot already rendered, tear it down before re-mounting+ // so we never stack multiple cards in the sidebar.const homeEl = document.getElementById('agent-home-container');if (homeEl) {+ if (this.agentHome) this.agentHome.destroy();+ homeEl.innerHTML = '';this.agentHome = new AgentHome(homeEl, this.identity, protocol, this.avatar);await this.agentHome.render();}@@ -713,10 +719,49 @@ class App {publicLink.hidden = false;}+ this._maybeShowOnboarding(agentId);+this._initAgentSystem();this._initWidgetBridge();}+ // First-time orientation overlay for a freshly created (or freshly loaded)+ // agent. Localstorage-keyed per agent so it never reappears once dismissed.+ _maybeShowOnboarding(agentId) {+ if (typeof window === 'undefined' || !agentId) return;+ const key = `3dagent:onboarded:${agentId}`;+ try {+ if (localStorage.getItem(key)) return;+ } catch {+ return;+ }++ const banner = document.getElementById('agent-onboarding');+ if (!banner) return;++ const closeBtn = document.getElementById('agent-onboarding-close');+ const deployLink = document.getElementById('agent-onboarding-deploy');+ const shareLink = document.getElementById('agent-onboarding-share');++ if (deployLink) deployLink.href = `/deploy?agent=${agentId}`;+ if (shareLink) shareLink.href = `/agent/${agentId}`;++ const dismiss = () => {+ banner.hidden = true;+ try {+ localStorage.setItem(key, '1');+ } catch {}+ };++ if (closeBtn) closeBtn.addEventListener('click', dismiss);+ // Auto-dismiss when the user clicks any of the CTAs — they've engaged.+ [deployLink, shareLink].forEach((el) => {+ if (el) el.addEventListener('click', dismiss);+ });++ banner.hidden = false;+ }+async _loadWidget(widgetId) {let widget;try {diff --git a/style.css b/style.cssindex 0335fc387..88b0fcea9 100644--- a/style.css+++ b/style.css@@ -4157,6 +4157,140 @@ body[data-viewer-mode='main'][data-authed='false'] .auth-gate {z-index: 50;}+/* ── First-time onboarding banner ─────────────────────────────────────────── */++.agent-onboarding {+ position: fixed;+ right: var(--space-md);+ bottom: calc(var(--space-md) + 80px);+ width: min(360px, calc(100vw - var(--space-md) * 2));+ z-index: 60;+ animation: agent-onboarding-rise 0.32s ease-out;+}++.agent-onboarding[hidden] {+ display: none;+}++@keyframes agent-onboarding-rise {+ from {+ opacity: 0;+ transform: translateY(12px);+ }+ to {+ opacity: 1;+ transform: translateY(0);+ }+}++.agent-onboarding__inner {+ position: relative;+ background: rgba(12, 12, 18, 0.96);+ border: 1px solid rgba(255, 215, 0, 0.28);+ border-radius: 12px;+ padding: var(--space-lg) var(--space-lg) var(--space-md);+ box-shadow:+ 0 12px 36px rgba(0, 0, 0, 0.55),+ 0 0 0 1px rgba(255, 215, 0, 0.06);+ color: rgba(255, 255, 255, 0.92);+}++.agent-onboarding__close {+ position: absolute;+ top: 0.4rem;+ right: 0.55rem;+ background: transparent;+ border: 0;+ color: rgba(255, 255, 255, 0.45);+ font-size: 1.4rem;+ line-height: 1;+ cursor: pointer;+ width: 32px;+ height: 32px;+ border-radius: 6px;+ transition:+ color 0.15s,+ background 0.15s;+}++.agent-onboarding__close:hover {+ color: #fff;+ background: rgba(255, 255, 255, 0.06);+}++.agent-onboarding__close:focus-visible {+ outline: 2px solid rgba(255, 215, 0, 0.7);+ outline-offset: 2px;+}++.agent-onboarding__title {+ margin: 0 0 var(--space-xs);+ font-size: 1.05rem;+ font-weight: 500;+ letter-spacing: -0.01em;+}++.agent-onboarding__desc {+ margin: 0 0 var(--space-md);+ font-size: 0.82rem;+ color: rgba(255, 255, 255, 0.62);+ line-height: 1.55;+}++.agent-onboarding__actions {+ display: flex;+ gap: var(--space-sm);+ flex-wrap: wrap;+}++.agent-onboarding__btn {+ display: inline-flex;+ align-items: center;+ padding: 0.5em 0.95em;+ border-radius: 7px;+ font-size: 0.78rem;+ font-weight: 500;+ font-family: inherit;+ text-decoration: none;+ border: 1px solid rgba(255, 255, 255, 0.16);+ background: transparent;+ color: rgba(255, 255, 255, 0.78);+ cursor: pointer;+ transition: all 0.15s;+}++.agent-onboarding__btn:hover {+ color: #fff;+ border-color: rgba(255, 255, 255, 0.36);+ background: rgba(255, 255, 255, 0.04);+}++.agent-onboarding__btn:focus-visible {+ outline: 2px solid rgba(255, 215, 0, 0.7);+ outline-offset: 2px;+}++.agent-onboarding__btn--primary {+ background: rgba(255, 215, 0, 0.92);+ border-color: rgba(255, 215, 0, 0.92);+ color: #000;+}++.agent-onboarding__btn--primary:hover {+ background: #ffd700;+ color: #000;+ border-color: #ffd700;+}++@media (max-width: 700px) {+ .agent-onboarding {+ left: var(--space-md);+ right: var(--space-md);+ bottom: calc(var(--space-md) + 90px);+ width: auto;+ }+}+.auth-gate__inner {background: linear-gradient(180deg, rgba(18, 18, 26, 0.94) 0%, rgba(10, 10, 16, 0.94) 100%);border: 1px solid rgba(255, 255, 255, 0.1);