/** * AdaptiveChatBar — the canvas lid composition for the chat-canvas * experience. Renders the bubble-up trail on top and an always-visible * input row below. * * Wiring contract (events out): * - `chat-message-sent` ({ text, via, turn }): the user submitted text * via Enter, the send button, an intro suggestion, or a reply pill. * The owning code is responsible for pushing this into the * conversation history and producing a reply. * * Wiring contract (props in): * - `messages`: the conversation trail, passed straight through to * ``. * - `placeholder`: input placeholder copy. Defaults to a generic * "Ask, find, or navigate…" — the host (typically the slot's lid * widget mount) can override to a context-specific string. * * Light DOM. Glassmorphism is applied at the input-row level so the * trail above floats over the host page without chrome. See PRD §4.4. */ import { LitElement } from 'lit'; import { type ChatPersona } from './personas.js'; import './AdaptiveChatTrail.js'; import type { InlineTrailWidget, InlineWidgetMounter, TileReceipt, TrailMessage } from './AdaptiveChatTrail.js'; export declare class AdaptiveChatBar extends LitElement { #private; static properties: { personas: { attribute: boolean; }; _persona: { state: boolean; }; messages: { attribute: boolean; }; placeholder: { type: StringConstructor; }; assistantName: { type: StringConstructor; }; greeting: { type: StringConstructor; }; inFlight: { type: BooleanConstructor; reflect: boolean; }; turn: { type: NumberConstructor; }; thinkingText: { attribute: boolean; }; introSuggestion: { attribute: boolean; }; forceExpanded: { type: BooleanConstructor; reflect: boolean; }; maximized: { type: BooleanConstructor; }; readOnly: { type: BooleanConstructor; attribute: string; }; chatControl: { type: StringConstructor; }; interleaved: { type: BooleanConstructor; }; tileReceipts: { attribute: boolean; }; inlineWidgets: { attribute: boolean; }; mountInlineWidget: { attribute: boolean; }; voiceInput: { type: BooleanConstructor; }; _input: { state: boolean; }; _composerFocused: { state: boolean; }; _micListening: { state: boolean; }; _micDisabled: { state: boolean; }; }; messages: TrailMessage[]; /** * Mirrored from the chat session by the mountable. The bar keeps no * counter of its own — this is the number of sends already committed; * a send this bar makes opens turn `this.turn + 1`. */ turn: number; maximized: boolean; /** Preview frames: shows the given messages, accepts no input. */ readOnly: boolean; /** * Which trailing control the bar renders. * * An explicit literal, never inferred from the presence of a prop: a canvas * that forgot to inject it would otherwise silently get the wrong control. * Default keeps velvet's behaviour untouched. */ chatControl: 'maximize' | 'interleave'; /** Reflected state for the interleave control. Owned by the canvas. */ interleaved: boolean; tileReceipts: TileReceipt[]; /** Widgets rendered inline in the trail (reco carousel), sourced from * the store's `chat-inline` slot mounts. Forwarded to the trail. */ inlineWidgets: InlineTrailWidget[]; /** Registry-backed mounter for inline widgets whose id is not their * custom-element tag (product card, comparison, FAQ). Set by the * mountable from `runtime.widgets`; forwarded to the trail. */ mountInlineWidget: InlineWidgetMounter | undefined; /** * Live reasoning narration from the model — streamed in via * AG-UI THINKING_TEXT_MESSAGE_CONTENT events and forwarded by * the ChatSession subscription on the host (mountable). * Forwarded verbatim to the trail, which renders it in place of * the silent loading dots between turns. Empty string when no * thinking turn is active. */ thinkingText: string; /** * Pre-conversation suggestion button — forwarded to the trail's * empty-state pane. When the visitor clicks it the trail emits * `trail-intro-suggestion`; we catch that here and submit the * configured prompt through the normal send path. */ introSuggestion: { label: string; prompt: string; } | undefined; /** Pass-through to {@link AdaptiveChatTrail}'s ``forceExpanded`` prop. * Hosts that mount the chat-bar in a full-screen surface (mobile * panel, agent app, etc.) set this to skip the collapse affordance * — there is no smaller state to fall back to. */ forceExpanded: boolean; placeholder: string; /** * Name shown in the (forceExpanded) header. Defaults to a generic * "Assistant". Hosts can override per-workspace (e.g. Vela sets * "Vela Concierge") without inventing new SDK surface — it threads * through the same mount config the placeholder does. */ assistantName: string; /** Persona roster from config (FEAT-1784917430); one is sticky-assigned. */ personas: ChatPersona[] | null; /** @internal — the visitor's sticky persona, resolved from the roster. */ _persona: ChatPersona | null; /** * Initial assistant message shown before any real conversation * starts. Renders inside the trail as a phantom assistant chip * when messages.length === 0; auto-disappears as soon as the * first user message lands. Mirrors ChatAssistantLit's greeting. */ greeting: string | undefined; /** * Whether a chat round-trip is in flight (request sent, awaiting * reply). The single send/stop button morphs accordingly: ↑ when * ready, ⏹ when in-flight. Parent owns this state — set true after * `chat-message-sent` fires, false when the reply lands or the * request is aborted. Enter is inert while in-flight. */ inFlight: boolean; /** Show a dictation mic when the Web Speech API is available. Config-gated, default off. */ voiceInput: boolean; _input: string; _micListening: boolean; _micDisabled: boolean; private _micBase; private _micNetworkErrors; private _dictation; /** True while focus is inside the composer row — drives the accent * focus ring so the active text-entry surface is unmistakable on any * theme (the idle pill is deliberately subtle). */ _composerFocused: boolean; createRenderRoot(): HTMLElement; connectedCallback(): void; disconnectedCallback(): void; private _onInput; private _onMicClick; private _onKeyDown; private _onSendOrInterrupt; private _onTileReceiptActivate; private _onAlertReceiptActivate; private _onComposerFocusIn; private _onComposerFocusOut; private _onMaximizeToggle; private _onInterleaveToggle; /** The one channel every send path uses; `turn` is the turn this send opens. */ private _dispatchSent; private _send; /** * Visitor tapped the intro suggestion button in the empty-state * trail. Submit the configured prompt through the same channel as * a typed message so listeners (mountable → chatSession.send) see * a uniform shape — no need for a parallel "suggestion-sent" path. * The trail's intro pane auto-disappears the moment the first * message lands, so this also closes the empty state in one go. */ private _onIntroSuggestion; /** * Reply-chip tap that arrived during the run TAIL. Chips render the * moment the reply text lands, but `inFlight` (which includes * `runActive` — typing events, tool tail, RUN_FINISHED) can lag for * seconds. The old `if (this.inFlight) return;` guard silently ATE * those taps — the visitor's chosen reply never appeared as their * message (live repro, deployed vela 2026-07-08). Now the tap queues * (latest wins) and dispatches when `inFlight` clears. */ private _queuedSuggestedReply; protected willUpdate(changed: Map): void; /** * Visitor tapped an inline `suggest_replies` chip in the trail. Submit * the chip text through the SAME `chat-message-sent` channel a typed * message uses, so the reply rides the existing send path (mountable → * chatSession.send → transport) — no fabricated AG-UI events. The * trail clears the chips on its own once the reply lands and a newer * assistant turn becomes the latest. * * A tap while the previous run is still closing is QUEUED, never * dropped — see `_queuedSuggestedReply`. */ private _onSuggestedReply; render(): import("lit-html").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'adaptive-chat-bar': AdaptiveChatBar; } } //# sourceMappingURL=AdaptiveChatBar.d.ts.map