/** * AdaptiveChatBarMountable — `MountableWidget` adapter that turns the * standalone `` Lit element into something the * runtime widget registry can mount. * * Registered as widget id `adaptive-chatbot:chat-bar`. Customers * reference it from canvas config — either as a slot's `lid` widget * (replaces the launcher when referenced from `slots.drawer.lid`) or * as a regular tile widget. * * The bar is a VIEW. State lives in the singleton `chatSession` — * whether the bar mounts in the mini-canvas lid, the drawer lid, or * both, they're all views of the same conversation. The mountable: * - subscribes to chatSession.subscribe() and pushes state into * the bar's `messages` + `inFlight` props on every change * - routes the bar's `chat-message-sent` event → chatSession.send() * - routes the bar's `chat-interrupt` event → chatSession.interrupt() * - bubbles the bar's `canvas-close` event → optional onClose * callback (canvas-level concern, not session-level) * * Props (passed via mountConfig): * - `placeholder?: string` — input placeholder copy * - `onClose?: () => void` — fires on ✕ click (canvas-level) * * Note: messages and inFlight are NOT props. They flow from chatSession. * A canvas-config author who wants to pre-seed messages should do so * via the session directly (e.g. via a startup action) — but typical * use is to let the conversation start empty. */ import './AdaptiveChatBar'; import type { ChatbotWidgetRuntime } from './types.js'; /** * Every canvas-settable field this function is responsible for forwarding. * * This list exists because the function above is a hand-written allowlist — * the cherry-pick shape COE-001 is about. A canvas can set a prop on its chat * tile, `sc-mount` will hand it to `mount()`, and if the name is missing from * `applyPlaceholder` it is silently dropped with no type error and no test * failure. That is exactly how velvet-stream's interleave control shipped * dead: the canvas set `chatControl`, nothing forwarded it, the bar kept its * default, and the button never rendered. * * `AdaptiveChatBarMountable.forwarding.test.ts` drives the real mount path and * asserts each of these actually lands on the element, so the next field added * to the config and forgotten here fails rather than vanishing. */ export declare const FORWARDED_BAR_FIELDS: readonly ["placeholder", "assistantName", "personas", "greeting", "voiceInput", "introSuggestion", "forceExpanded", "maximized", "chatControl", "interleaved"]; /** * Test-only: drop the warm store singleton (and its hydration latch) so each * test can wire a fresh store to its own event bus / registry. Without this, * the first test in a file permanently binds the store to ITS bus and the * per-instance version dedup silently drops every later test's re-mounts. * Mirrors `observer/index.ts` `_resetObserverForTests`. */ export declare function _resetElementStoreForTests(): void; /** * Live ``template_id → widget`` map. Re-derived on each ``configure()`` * from the chat-bar's ``uiTemplates`` prop (which mirrors what the admin * declared in canvas-config). Both the TileHandler (live mount path) and * the ElementInstanceStore (rehydrate replay path) read through this map * so the widget id stays consistent regardless of mount provenance. * * Without this, an LLM-authored mount with ``template_id: "product-card"`` * emits ``widget: "product-card"`` to the runtime, which then renders the * tile chrome with a "Widget not available: product-card" body because * the actual widget is registered as ``adaptive-product:card``. */ export declare function resolveTileWidget(templateId: string): string | undefined; export declare function refreshTemplateWidgetMap(templates: Record | undefined): void; export { buildObserverEnrich } from './observer/wire'; /** * Surface reaction to a proactive nudge (FEAT-1783640628). The transport * settles the nudge message into the trail and emits `syntro:nudge`; this * layer owns what the VISITOR notices on top of that: * 1. refresh persisted mounts — the headless turn's mount landed server-side * in `mounted_elements`; re-running the replay fetch applies it live * through the same hydrate path boot uses (no parallel mount wire shape); * 2. a toast via the canvas overlay's notification primitive, so a visitor * with the chat closed learns the agent spoke. * * Exported for direct testing (real DOM listener, fetch-stubbed network). */ export declare function wireNudgeSurface(runtime: ChatbotWidgetRuntime, backendUrl: string): void; /** Test seam: reset the nudge-surface once-guard AND detach the listener. */ export declare function _resetNudgeSurfaceForTests(): void; /** @internal test hook */ export declare function _resetTemplatePublishForTests(): void; export declare function _resetMountableObserverForTests(): void; export declare const AdaptiveChatBarMountable: { mount(container: HTMLElement, mountConfig?: Record): () => void; update(container: HTMLElement, mountConfig?: Record): void; }; //# sourceMappingURL=AdaptiveChatBarMountable.d.ts.map