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.

30.2 KB
Raw Blame
<!doctype html>
<html lang="en">
	<head>
		<script>/* three.ws theme boot, no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<title data-i18n="concierge.meta_title">Concierge, an AI chat widget with a 3D face, for any website · three.ws</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
		<meta name="author" content="nirholas" />
		<meta
			name="description"
			content="Drop an AI concierge on any website with one tag: a rigged 3D avatar that blinks and lipsyncs, streaming answers grounded in your live page, and browser-native voice in and out. Free, open embed by three.ws."
		 data-i18n-attr="content:concierge.meta_description"/>
		<meta name="theme-color" content="#000000" />

		<meta property="og:type" content="website" />
		<meta property="og:site_name" content="three.ws" />
		<meta property="og:url" content="https://three.ws/concierge" />
		<meta property="og:title" content="Concierge, an AI chat widget with a 3D face, for any website"  data-i18n-attr="content:concierge.meta_og_title"/>
		<meta
			property="og:description"
			content="One tag gives your site an AI concierge with a talking 3D avatar: streaming answers grounded in your page, voice in and out, themes, and an avatar picker."
		 data-i18n-attr="content:concierge.meta_og_description"/>
		<meta property="og:image" content="https://three.ws/api/page-og?s=main&amp;t=Concierge%3A+AI+Chat+Widget&amp;d=Give+any+website+an+AI+concierge+with+a+talking+3D+avatar%3A+one-tag+embed%2C+streaming+answers+grounded+in+the+live+page%2C+voice+in+and+out%2C+themes%2C+and+an+avatar&amp;p=%2Fconcierge" />
		<meta property="og:image:width" content="1200" />
		<meta property="og:image:height" content="630" />
		<meta property="og:locale" content="en_US" />

		<meta name="twitter:card" content="summary_large_image" />
		<meta name="twitter:site" content="@trythreews" />
		<meta name="twitter:title" content="Concierge, an AI chat widget with a 3D face, for any website"  data-i18n-attr="content:concierge.meta_twitter_title"/>
		<meta
			name="twitter:description"
			content="One tag gives your site an AI concierge with a talking 3D avatar: streaming answers grounded in your page, voice in and out, themes, and an avatar picker."
		 data-i18n-attr="content:concierge.meta_twitter_description"/>
		<meta name="twitter:image" content="https://three.ws/api/page-og?s=main&amp;t=Concierge%3A+AI+Chat+Widget&amp;d=Give+any+website+an+AI+concierge+with+a+talking+3D+avatar%3A+one-tag+embed%2C+streaming+answers+grounded+in+the+live+page%2C+voice+in+and+out%2C+themes%2C+and+an+avatar&amp;p=%2Fconcierge" />
		<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />

		<link rel="canonical" href="https://three.ws/concierge" />
		<link rel="icon" href="/favicon.ico" sizes="any" />
		<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
		<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
		<link rel="manifest" href="/manifest.webmanifest" />

		<link rel="preconnect" href="https://three.ws" />
		<link rel="stylesheet" href="/style.css" />
		<link rel="stylesheet" href="/nav.css" />
		<link rel="stylesheet" href="/footer.css" />
		<link rel="stylesheet" href="/fonts/fonts.css" />
		<link rel="stylesheet" href="/mobile.css" />
		<script defer src="/footer-newsletter.js"></script>

		<script type="application/ld+json">
			{
				"@context": "https://schema.org",
				"@type": "SoftwareApplication",
				"name": "three.ws Concierge",
				"url": "https://three.ws/concierge",
				"applicationCategory": "DeveloperApplication",
				"operatingSystem": "Any (web browser)",
				"browserRequirements": "Requires a WebGL-capable browser",
				"description": "An embeddable AI concierge for any website: a rigged 3D avatar that blinks and lipsyncs, streaming answers grounded in the live page, and browser-native voice in and out.",
				"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" },
				"isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }
			}
		</script>

		<style>
			/* ────────────────────────────────────────────────────────────────
			   Concierge landing, page-scoped styles. Token vars only; mirrors
			   the marketing rhythm of /walk (eyebrow → display headline → sub
			   → CTAs → proof sections).
			   ──────────────────────────────────────────────────────────────── */
			.cl-main {
				max-width: 1080px;
				margin: 0 auto;
				padding: 0 var(--space-md);
				/* body is display:flex (column) site-wide, so this main is a flex
				   item whose auto width resolves against the min-content of the
				   longest unbreakable line in the install <pre>. That pushed the
				   column to ~609px inside a 320px viewport, and mobile.css clips
				   horizontal overflow, so the copy was cut off with no way to
				   scroll to it. An explicit width makes the cross size definite,
				   which caps the column at the viewport and hands the scrolling
				   back to the <pre>, which is built for it. box-sizing is
				   border-box, so the padding above stays inside the viewport. */
				width: 100%;
			}
			.cl-hero {
				padding: calc(var(--space-xl) * 2) 0 var(--space-xl);
				text-align: center;
			}
			.cl-eyebrow {
				display: inline-flex;
				align-items: center;
				gap: var(--space-2);
				font-family: var(--font-mono);
				font-size: var(--text-sm);
				letter-spacing: 0.08em;
				text-transform: uppercase;
				color: var(--ink-faint);
			}
			.cl-hero h1 {
				font-size: clamp(2rem, 5.5vw, 3.4rem);
				line-height: 1.08;
				letter-spacing: -0.02em;
				margin: var(--space-md) auto var(--space-sm);
				max-width: 17ch;
			}
			.cl-hero .cl-sub {
				color: var(--ink-dim);
				font-size: var(--text-lg);
				max-width: 56ch;
				margin: 0 auto var(--space-lg);
				line-height: 1.6;
			}
			.cl-ctas {
				display: flex;
				gap: var(--space-sm);
				justify-content: center;
				flex-wrap: wrap;
			}
			.cl-btn {
				display: inline-flex;
				align-items: center;
				gap: var(--space-2);
				padding: 0.7rem 1.15rem;
				border-radius: var(--radius-md);
				font-weight: 600;
				font-size: var(--text-base);
				text-decoration: none;
				transition: transform var(--duration-fast) var(--ease-standard), filter var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
			}
			.cl-btn:hover { transform: translateY(-1px); }
			.cl-btn-primary { background: var(--btn-primary-bg, var(--accent)); color: var(--btn-primary-fg, #0a0a0a); }
			.cl-btn-primary:hover { filter: brightness(1.08); }
			.cl-btn-ghost { border: 1px solid var(--stroke); color: var(--ink-bright); }
			.cl-btn-ghost:hover { border-color: var(--accent); }

			.cl-hint {
				margin-top: var(--space-lg);
				font-family: var(--font-mono);
				font-size: var(--text-sm);
				color: var(--ink-faint);
			}
			.cl-hint .cl-arrow { display: inline-block; animation: cl-nudge 1.6s ease-in-out infinite; }
			@keyframes cl-nudge { 50% { transform: translate(4px, 4px); } }
			@media (prefers-reduced-motion: reduce) { .cl-hint .cl-arrow { animation: none; } }

			.cl-section { padding: var(--space-xl) 0; }
			.cl-section h2 {
				font-size: clamp(1.4rem, 3vw, 2rem);
				letter-spacing: -0.01em;
				margin: 0 0 var(--space-xs);
			}
			.cl-section .cl-lede {
				color: var(--ink-dim);
				max-width: 62ch;
				margin: 0 0 var(--space-lg);
				line-height: 1.65;
			}

			.cl-grid {
				display: grid;
				grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
				gap: var(--space-md);
			}
			.cl-card {
				border: 1px solid var(--stroke);
				border-radius: var(--radius-lg);
				padding: var(--space-md);
				background: var(--bg-1);
				transition: border-color var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
			}
			.cl-card:hover { border-color: var(--accent); transform: translateY(-2px); }
			.cl-card h3 { margin: 0 0 var(--space-2); font-size: var(--text-base); }
			.cl-card p { margin: 0; color: var(--ink-dim); font-size: var(--text-sm); line-height: 1.6; }
			.cl-card .cl-k {
				font-family: var(--font-mono);
				font-size: var(--text-xs);
				color: var(--ink-faint);
				display: block;
				margin-bottom: var(--space-2);
			}

			.cl-tabs { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-sm); }
			.cl-tab {
				font-family: var(--font-mono);
				font-size: var(--text-sm);
				padding: 0.4rem 0.85rem;
				border-radius: 999px;
				border: 1px solid var(--stroke);
				background: none;
				color: var(--ink-dim);
				cursor: pointer;
				transition: border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
			}
			.cl-tab:hover { border-color: var(--accent); }
			.cl-tab[aria-selected='true'] { border-color: var(--accent); color: var(--ink-bright); background: var(--bg-1); }
			.cl-code {
				position: relative;
				border: 1px solid var(--stroke);
				border-radius: var(--radius-lg);
				background: var(--bg-1);
				overflow: hidden;
			}
			.cl-code pre {
				margin: 0;
				padding: var(--space-md);
				overflow-x: auto;
				font-family: var(--font-mono);
				font-size: 0.82rem;
				line-height: 1.6;
				color: var(--ink-bright);
			}
			.cl-copy {
				position: absolute;
				top: 10px;
				right: 10px;
				font-family: var(--font-mono);
				font-size: var(--text-xs);
				padding: 0.3rem 0.65rem;
				border-radius: var(--radius-sm);
				border: 1px solid var(--stroke);
				background: var(--bg-0);
				color: var(--ink-dim);
				cursor: pointer;
				transition: color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
			}
			.cl-copy:hover { color: var(--ink-bright); border-color: var(--accent); }
			.cl-panel[hidden] { display: none; }

			.cl-steps { counter-reset: step; display: grid; gap: var(--space-md); }
			.cl-step { display: flex; gap: var(--space-md); align-items: flex-start; }
			.cl-step::before {
				counter-increment: step;
				content: counter(step, decimal-leading-zero);
				font-family: var(--font-mono);
				font-size: var(--text-sm);
				color: var(--accent);
				padding-top: 0.15rem;
			}
			.cl-step h3 { margin: 0 0 var(--space-1); font-size: var(--text-base); }
			.cl-step p { margin: 0; color: var(--ink-dim); font-size: var(--text-sm); line-height: 1.65; max-width: 68ch; }
			.cl-step code { font-family: var(--font-mono); font-size: 0.82em; background: var(--bg-1); padding: 0.1em 0.4em; border-radius: var(--radius-sm); }

			.cl-links { display: flex; gap: var(--space-md); flex-wrap: wrap; }
			.cl-links a { color: var(--accent); text-decoration: none; font-size: var(--text-sm); }
			.cl-links a:hover { text-decoration: underline; }

			/* Site-wide focus tokens rather than the UA default ring, so keyboard
			   focus on this page reads the same as every other surface. */
			.cl-btn:focus-visible,
			.cl-tab:focus-visible,
			.cl-copy:focus-visible,
			.cl-links a:focus-visible,
			.cl-code pre:focus-visible {
				outline: var(--focus-ring-width) solid var(--focus-ring-color);
				outline-offset: var(--focus-ring-offset);
			}
		</style>
	
	<meta property="og:image:alt" content="Concierge: AI Chat Widget — three.ws">
</head>
	<body>
		<header><div id="nav-container"></div></header>
		<script src="/nav.js"></script>

		<main class="cl-main">
			<section class="cl-hero">
				<span class="cl-eyebrow" data-i18n="concierge.concierge">// concierge</span>
				<h1 data-i18n="concierge.an_ai_concierge_with_a_face_for">An AI concierge with a face, for any website.</h1>
				<p class="cl-sub" data-i18n="concierge.one_tag_gives_your_site_a_support">
					One tag gives your site a support chat that visitors actually enjoy: a rigged 3D avatar that
					blinks, talks, and lipsyncs; streaming answers grounded in your live page; and voice in and
					out, straight from the browser. No account, no crawler setup, no per-seat pricing.
				</p>
				<div class="cl-ctas">
					<a class="cl-btn cl-btn-primary" href="#install" data-i18n="concierge.get_the_embed">Get the embed</a>
					<a class="cl-btn cl-btn-ghost" href="/docs/concierge" data-i18n="concierge.read_the_docs">Read the docs</a>
					<a class="cl-btn cl-btn-ghost" href="https://github.com/nirholas/three.ws/tree/main/concierge-sdk" target="_blank" rel="noopener" data-i18n="concierge.source">Source ↗</a>
				</div>
				<p class="cl-hint" data-i18n-html="concierge.this_page_runs_it_live_try_the">This page runs it live, try the bubble in the corner <span class="cl-arrow">↘</span></p>
			</section>

			<section class="cl-section" aria-labelledby="cl-why">
				<h2 id="cl-why" data-i18n="concierge.why_it_beats_a_faceless_chat_bubble">Why it beats a faceless chat bubble</h2>
				<p class="cl-lede" data-i18n-html="concierge.most_site_chatbots_are_a_text_box">
					Most site chatbots are a text box with a logo. This one is a presence: the same rigged-avatar
					engine that powers <a href="/walk">Walk</a> and the
					<a href="https://www.npmjs.com/package/@three-ws/page-agent" target="_blank" rel="noopener">page guide</a>, pointed at support.
				</p>
				<div class="cl-grid">
					<div class="cl-card">
						<span class="cl-k" data-i18n="concierge.presence">// presence</span>
						<h3 data-i18n="concierge.a_real_3d_avatar">A real 3D avatar</h3>
						<p data-i18n="concierge.skeleton_rigged_blinking_idling_viseme_lipsy">Skeleton-rigged, blinking, idling, viseme-lipsyncing while it speaks. Visitors pick their concierge from a diverse catalog, or you supply your own GLB.</p>
					</div>
					<div class="cl-card">
						<span class="cl-k" data-i18n="concierge.grounded">// grounded</span>
						<h3 data-i18n="concierge.answers_from_your_page">Answers from your page</h3>
						<p data-i18n="concierge.at_ask_time_it_reads_the_live">At ask-time it reads the live page (title, headings, nav, content) plus your curated knowledge, and refuses to invent prices or policies it can't see.</p>
					</div>
					<div class="cl-card">
						<span class="cl-k" data-i18n="concierge.streaming">// streaming</span>
						<h3 data-i18n="concierge.tokens_not_spinners">Tokens, not spinners</h3>
						<p data-i18n="concierge.answers_stream_in_over_sse_and_the">Answers stream in over SSE and the avatar starts speaking the first sentence while the rest is still arriving.</p>
					</div>
					<div class="cl-card">
						<span class="cl-k" data-i18n="concierge.voice">// voice</span>
						<h3 data-i18n="concierge.talk_to_it_hear_it">Talk to it, hear it</h3>
						<p data-i18n="concierge.push_to_talk_speech_input_and_browser">Push-to-talk speech input and browser-native speech output, no audio backend and no API key. Mute is one click and remembered.</p>
					</div>
					<div class="cl-card">
						<span class="cl-k" data-i18n="concierge.yours">// yours</span>
						<h3 data-i18n="concierge.your_brand_both_themes">Your brand, both themes</h3>
						<p data-i18n="concierge.one_accent_color_restyles_the_whole_widget">One accent color restyles the whole widget. Light and dark follow the visitor's system, or pin either. Bottom-left or bottom-right.</p>
					</div>
					<div class="cl-card">
						<span class="cl-k" data-i18n="concierge.free">// free</span>
						<h3 data-i18n="concierge.free_and_open">Free and open</h3>
						<p data-i18n="concierge.the_widget_is_open_source_and_the">The widget is open source and the hosted answer engine runs on the three.ws free inference chain. Bring your own endpoint any time, same wire format.</p>
					</div>
				</div>
			</section>

			<section class="cl-section" id="install" aria-labelledby="cl-install">
				<h2 id="cl-install" data-i18n="concierge.install_in_under_a_minute">Install in under a minute</h2>
				<p class="cl-lede" data-i18n="concierge.pick_your_flavor_every_option_ships_the">Pick your flavor. Every option ships the same widget.</p>
				<div class="cl-tabs" role="tablist" aria-label="Install methods">
					<button class="cl-tab" type="button" role="tab" id="cl-tab-cdn" aria-controls="cl-panel-cdn" aria-selected="true" tabindex="0" data-panel="cdn" data-i18n="concierge.one_tag">one tag</button>
					<button class="cl-tab" type="button" role="tab" id="cl-tab-element" aria-controls="cl-panel-element" aria-selected="false" tabindex="-1" data-panel="element" data-i18n="concierge.web_component">web component</button>
					<button class="cl-tab" type="button" role="tab" id="cl-tab-npm" aria-controls="cl-panel-npm" aria-selected="false" tabindex="-1" data-panel="npm" data-i18n="concierge.npm">npm</button>
					<button class="cl-tab" type="button" role="tab" id="cl-tab-js" aria-controls="cl-panel-js" aria-selected="false" tabindex="-1" data-panel="js" data-i18n="concierge.imperative">imperative</button>
				</div>
				<div class="cl-panel" id="cl-panel-cdn" role="tabpanel" aria-labelledby="cl-tab-cdn" data-panel="cdn">
					<div class="cl-code">
						<button class="cl-copy" type="button" data-copy aria-label="Copy the one-tag install snippet" data-i18n="concierge.copy">copy</button>
						<pre tabindex="0"><code>&lt;script src="https://three.ws/concierge/concierge.global.js"
        data-concierge
        data-site-name="Acme"
        data-accent="#f97316"
        data-suggestions="What is Acme?|What does it cost?"&gt;&lt;/script&gt;</code></pre>
					</div>
				</div>
				<div class="cl-panel" id="cl-panel-element" role="tabpanel" aria-labelledby="cl-tab-element" data-panel="element" hidden>
					<div class="cl-code">
						<button class="cl-copy" type="button" data-copy aria-label="Copy the web-component install snippet" data-i18n="concierge.copy_2">copy</button>
						<pre tabindex="0"><code>import '@three-ws/concierge';

&lt;three-concierge
    site-name="Acme"
    accent="#f97316"
    knowledge="Pro plan is $20/month. Support: [email protected]."
    suggestions="What is Acme?|What does it cost?"&gt;
&lt;/three-concierge&gt;</code></pre>
					</div>
				</div>
				<div class="cl-panel" id="cl-panel-npm" role="tabpanel" aria-labelledby="cl-tab-npm" data-panel="npm" hidden>
					<div class="cl-code">
						<button class="cl-copy" type="button" data-copy aria-label="Copy the npm install command" data-i18n="concierge.copy_3">copy</button>
						<pre tabindex="0"><code>npm install @three-ws/concierge three</code></pre>
					</div>
				</div>
				<div class="cl-panel" id="cl-panel-js" role="tabpanel" aria-labelledby="cl-tab-js" data-panel="js" hidden>
					<div class="cl-code">
						<button class="cl-copy" type="button" data-copy aria-label="Copy the imperative API snippet" data-i18n="concierge.copy_4">copy</button>
						<pre tabindex="0"><code>import { Concierge } from '@three-ws/concierge';

const concierge = new Concierge({
	siteName: 'Acme',
	accent: '#f97316',
	knowledge: FAQ_TEXT,        // your curated facts, optional
	persona: 'warm, playful, concise',
});

concierge.on('message', ({ role, content }) =&gt; track(role, content));
concierge.ask('What does the Pro plan cost?');</code></pre>
					</div>
				</div>
			</section>

			<section class="cl-section" aria-labelledby="cl-how">
				<h2 id="cl-how" data-i18n="concierge.how_it_works">How it works</h2>
				<p class="cl-lede" data-i18n="concierge.no_crawler_no_vector_database_no_onboarding">No crawler, no vector database, no onboarding call. Three moving parts.</p>
				<div class="cl-steps">
					<div class="cl-step">
						<div>
							<h3 data-i18n="concierge.harvest_at_ask_time">Harvest at ask-time</h3>
							<p data-i18n-html="concierge.when_a_visitor_asks_something_the_widget">When a visitor asks something, the widget snapshots the live DOM, title, meta description, headings, nav labels, and the main content, capped to a strict budget, and merges in the <code>knowledge</code> you curated. Whatever your page says today is what the concierge knows today.</p>
						</div>
					</div>
					<div class="cl-step">
						<div>
							<h3 data-i18n="concierge.ground_and_stream">Ground and stream</h3>
							<p data-i18n-html="concierge.the_snapshot_the_running_conversation_and_th">The snapshot, the running conversation, and the question go to <code>/api/concierge</code>, which builds a grounded system prompt and streams the answer back over SSE from the three.ws free-first inference chain, with automatic failover across providers, so the widget stays up when any one lane is throttled.</p>
						</div>
					</div>
					<div class="cl-step">
						<div>
							<h3 data-i18n="concierge.speak_while_streaming">Speak while streaming</h3>
							<p data-i18n="concierge.completed_sentences_are_handed_to_the_browse">Completed sentences are handed to the browser's speech engine as they arrive, and a text-to-viseme timeline drives the avatar's mouth morphs in sync. Muted? The captions and lipsync still play, so the answer never stalls.</p>
						</div>
					</div>
				</div>
			</section>

			<section class="cl-section" aria-labelledby="cl-more">
				<h2 id="cl-more" data-i18n="concierge.go_deeper">Go deeper</h2>
				<div class="cl-links">
					<a href="/docs/concierge" data-i18n="concierge.docs_every_attribute_and_event">Docs: every attribute and event</a>
					<a href="/docs/tutorials/build-a-site-concierge" data-i18n="concierge.tutorial_how_we_built_it">Tutorial: how we built it</a>
					<a href="/blog/concierge-3d-chat-widget" data-i18n="concierge.blog_the_launch_post">Blog: the launch post</a>
					<a href="/walk" data-i18n="concierge.walk_the_engine_it_grew_from">Walk, the engine it grew from</a>
				</div>
			</section>
		</main>

		<div id="footer-container"></div>
		<script src="/footer.js"></script>
		<script src="/brand.js" defer></script>

		<script type="module">
			// Install-tab switcher + copy buttons (no framework, matches site style).
			const tabs = [...document.querySelectorAll('.cl-tab')];
			const panels = [...document.querySelectorAll('.cl-panel')];

			// Roving tabindex: the tablist is ONE tab stop, and Left/Right/Home/End
			// move between the tabs inside it, per the WAI-ARIA tabs pattern. Without
			// this the role="tab" markup promises a keyboard behavior the page did
			// not implement, which is worse for a screen-reader user than plain
			// buttons would have been.
			function selectTab(tab, { focus = false } = {}) {
				for (const t of tabs) {
					const on = t === tab;
					t.setAttribute('aria-selected', String(on));
					t.tabIndex = on ? 0 : -1;
				}
				for (const p of panels) p.hidden = p.dataset.panel !== tab.dataset.panel;
				if (focus) tab.focus();
			}

			for (const tab of tabs) {
				tab.addEventListener('click', () => selectTab(tab));
				tab.addEventListener('keydown', (e) => {
					const i = tabs.indexOf(tab);
					let next = null;
					if (e.key === 'ArrowRight') next = tabs[(i + 1) % tabs.length];
					else if (e.key === 'ArrowLeft') next = tabs[(i - 1 + tabs.length) % tabs.length];
					else if (e.key === 'Home') next = tabs[0];
					else if (e.key === 'End') next = tabs[tabs.length - 1];
					if (!next) return;
					e.preventDefault();
					selectTab(next, { focus: true });
				});
			}

			for (const btn of document.querySelectorAll('[data-copy]')) {
				const idle = btn.textContent;
				btn.addEventListener('click', async () => {
					const code = btn.parentElement.querySelector('code')?.textContent || '';
					try {
						await navigator.clipboard.writeText(code);
						btn.textContent = 'copied';
						setTimeout(() => (btn.textContent = idle), 1400);
					} catch {
						// Clipboard is blocked (insecure origin, denied permission).
						// Select the snippet so the visitor can still press Ctrl+C,
						// instead of only being told to do it by hand.
						const el = btn.parentElement.querySelector('code');
						if (el) {
							const range = document.createRange();
							range.selectNodeContents(el);
							const sel = window.getSelection();
							sel.removeAllRanges();
							sel.addRange(range);
						}
						btn.textContent = 'select + copy';
						setTimeout(() => (btn.textContent = idle), 1800);
					}
				});
			}

		</script>

		<!--
			The live demo loads the exact first-party CDN artifact the install
			section hands out (/concierge/concierge.global.js, mirrored from the
			SDK build), so this page proves the real embed rather than a bundled
			copy of the source. It is loaded WITHOUT data-concierge so the auto-init
			stays off.

			The bundle is injected and AWAITED here rather than sat next to this
			module as its own <script src> tag. Document order is not a guarantee
			across the two: Vite extracts an inline module into a built chunk and
			emits it in <head>, above a public-asset script tag left in <body>, so
			the sibling-tag version ran this config BEFORE the bundle had defined
			window.ThreeWsConcierge and the demo died on arrival with a destructure
			error. A module script's load event fires after evaluation, so awaiting
			it is ordering that holds in dev and in the built page alike. (A static
			`import` would express the same dependency, but Vite forbids importing
			files out of the public directory.)
		-->
		<script type="module">
			await new Promise((resolve, reject) => {
				const s = document.createElement('script');
				s.type = 'module';
				s.src = '/concierge/concierge.global.js';
				s.onload = resolve;
				s.onerror = () => reject(new Error('concierge.global.js failed to load'));
				document.head.appendChild(s);
			});

			// The demo eats its own dog food: the widget answers questions about
			// Concierge itself, grounded in this page + the curated facts below.
			const { Concierge } = window.ThreeWsConcierge;
			window.__threeWsConcierge = new Concierge({
				name: 'three.ws Concierge',
				siteName: 'three.ws Concierge',
				greeting: 'Hi! I am the widget this page is about. Ask me anything about installing or customizing me.',
				suggestions: [
					'How do I install you?',
					'How do answers stay accurate?',
					'Can I use my own avatar?',
					'What does it cost?',
				],
				knowledge: [
					'three.ws Concierge is a free, open-source embeddable AI chat widget with a rigged 3D avatar (blinks, idles, viseme lipsync), streaming answers, and browser-native voice in/out.',
					'Install: one CDN tag (https://three.ws/concierge/concierge.global.js with data-concierge), or npm install @three-ws/concierge (peer dependency: three), or the <three-concierge> web component, or new Concierge({...}) imperatively.',
					'Grounding: at ask-time the widget snapshots the live page (title, meta description, headings, nav, main content, capped) plus the host-curated knowledge attribute; the backend builds a grounded system prompt and refuses to invent facts.',
					'Backend: POST /api/concierge on three.ws, anonymous, CORS-open, rate-limited, streams SSE {type:chunk|done|error} from a free-first LLM chain with provider failover. Hosts can point the endpoint attribute at their own server using the same wire format.',
					'Customization: accent (any CSS color), theme auto/dark/light, position bottom-right/bottom-left, name, greeting, suggestions (pipe-separated), persona tone instruction, avatars allow-list, custom-avatar URL for any rigged GLB, no-picker, no-teaser, muted, z-index, lang.',
					'Voice: speech output uses the Web Speech API (no audio backend, no key); push-to-talk input uses SpeechRecognition where the browser supports it (the mic button hides elsewhere).',
					'Docs: https://three.ws/docs/concierge. Tutorial: https://three.ws/docs/tutorials/build-a-site-concierge. Source: https://github.com/nirholas/three.ws/tree/main/concierge-sdk. Related: https://three.ws/walk (the Walk companion the avatar engine grew from).',
					'Pricing: the widget and the hosted answer engine are free. No account required.',
				].join('\n'),
				persona: 'friendly, precise, a little playful',
			});

			// Claim the bottom-right corner in the shared corner-stack, the same way
			// the Walk Companion does. The widget is a host-agnostic embed, so it
			// knows nothing about three.ws internals and cannot join the stack's
			// flex flow; without a reservation the feature-discovery card lands on
			// the same pixel and the passive "Have you tried" prompt renders on top
			// of the live demo. Width is declared as well as height because the
			// stack goes full-width on a phone, where a lift tall enough to clear
			// the widget would strand its cards mid-page instead of at the bottom.
			const CORNER_KEY = 'concierge-demo';
			function syncCornerReserve() {
				const stack = window.twsCornerStack;
				if (!stack?.reserve) return;
				// The launcher is the persistent footprint; the teaser is a
				// transient nudge that sits above it, so the union of the two is
				// what actually occupies the corner at any moment.
				const parts = document.querySelectorAll('.tc-launcher, .tc-teaser');
				let top = Infinity;
				let left = Infinity;
				for (const el of parts) {
					const r = el.getBoundingClientRect();
					if (!r.width || !r.height) continue;
					top = Math.min(top, r.top);
					left = Math.min(left, r.left);
				}
				if (!Number.isFinite(top)) return;
				stack.reserve(CORNER_KEY, {
					height: Math.max(0, window.innerHeight - top),
					width: Math.max(0, window.innerWidth - left),
				});
			}

			// The teaser appears and retracts on its own timers, and the launcher
			// only exists once the widget has built, so re-measure on the events
			// that can change the footprint rather than measuring once. Every
			// measurement forces a layout, and streaming an answer mutates the
			// thread on every token, so coalesce to at most one read per frame.
			let queued = false;
			function queueCornerReserve() {
				if (queued) return;
				queued = true;
				requestAnimationFrame(() => {
					queued = false;
					syncCornerReserve();
				});
			}
			new MutationObserver(queueCornerReserve).observe(document.body, { childList: true, subtree: true });
			window.addEventListener('resize', queueCornerReserve);
			window.addEventListener('tws-corner-stack:ready', queueCornerReserve);
			queueCornerReserve();
		</script>
		<!-- Runtime i18n: detects locale, swaps annotated copy, mounts <lang-switcher>. -->
	<script type="module" src="/i18n.js"></script>
</body>
</html>