@syntrologie/adapt-chatbot 2.8.0-canary.355 → 2.8.0-canary.357

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -106,6 +106,15 @@ export declare class AdaptiveChatBar extends LitElement {
106
106
  * message lands, so this also closes the empty state in one go.
107
107
  */
108
108
  private _onIntroSuggestion;
109
+ /**
110
+ * Visitor tapped an inline `suggest_replies` chip in the trail. Submit
111
+ * the chip text through the SAME `chat-message-sent` channel a typed
112
+ * message uses, so the reply rides the existing send path (mountable →
113
+ * chatSession.send → transport) — no fabricated AG-UI events. The
114
+ * trail clears the chips on its own once the reply lands and a newer
115
+ * assistant turn becomes the latest.
116
+ */
117
+ private _onSuggestedReply;
109
118
  render(): import("lit-html").TemplateResult<1>;
110
119
  }
111
120
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"AdaptiveChatBar.d.ts","sourceRoot":"","sources":["../src/AdaptiveChatBar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAQ,UAAU,EAAW,MAAM,KAAK,CAAC;AAGhD,OAAO,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,OAAgB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;MASxB;IAEF,QAAQ,EAAE,YAAY,EAAE,CAAM;IAE9B;;;;;;;OAOG;IACH,YAAY,SAAM;IAClB;;;;;OAKG;IACH,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAa;IAE3E;;;uDAGmD;IACnD,aAAa,UAAS;IACtB,WAAW,SAAuB;IAClC;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAa;IACzC;;;;;;OAMG;IACH,QAAQ,UAAS;IACjB,MAA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B;IAEF;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB,CAiBvB;IAEO,MAAM;CAuChB;AA6OD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AdaptiveChatBar
3
- } from "./chunk-QC5THSKS.js";
4
- import "./chunk-IV35WTWA.js";
3
+ } from "./chunk-LY2A6P2P.js";
4
+ import "./chunk-QG3YZCXZ.js";
5
5
  import "./chunk-ONGGPQER.js";
6
6
  import "./chunk-UVKRO5ER.js";
7
7
  export {
@@ -24,6 +24,16 @@ export interface TrailToolCall {
24
24
  id: string;
25
25
  name: string;
26
26
  status: 'args-streaming' | 'pending' | 'running' | 'done' | 'error';
27
+ /**
28
+ * Parsed tool-call arguments, when available. Threaded through from
29
+ * the AG-UI `ToolCall.args` so the trail can render argument-derived
30
+ * affordances WITHOUT a new transport: an activity receipt for a
31
+ * `primary_response_action` mount (derives type + label from
32
+ * `template_id` / `content.title`) and inline reply chips for a
33
+ * `suggest_replies` call (reads the `replies` array). Undefined while
34
+ * args are still streaming or for tools whose args we don't surface.
35
+ */
36
+ args?: Record<string, unknown>;
27
37
  }
28
38
  export interface TrailMessage {
29
39
  /** Stable identity for keyed rendering (must be unique within the trail). */
@@ -128,6 +138,17 @@ export declare class AdaptiveChatTrail extends LitElement {
128
138
  private _shouldShowThinking;
129
139
  updated(changed: Map<string, unknown>): void;
130
140
  private _onIntroSuggestionClick;
141
+ /**
142
+ * Visitor tapped a `suggest_replies` inline chip. Emit
143
+ * `trail-suggested-reply` carrying the chip text — the parent
144
+ * (AdaptiveChatBar) re-dispatches it as `chat-message-sent`, the
145
+ * SAME channel the input row uses, so the reply rides the existing
146
+ * send path (mountable → chatSession.send → transport). No fabricated
147
+ * AG-UI events; this is exactly what typing the text and hitting
148
+ * Enter would do. The chips clear on their own once the reply lands
149
+ * and a newer assistant message becomes the latest.
150
+ */
151
+ private _onSuggestedReplyClick;
131
152
  render(): typeof nothing | import("lit-html").TemplateResult<1>;
132
153
  }
133
154
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"AdaptiveChatTrail.d.ts","sourceRoot":"","sources":["../src/AdaptiveChatTrail.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAa,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAIrD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;CACrE;AAED,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,6GAA6G;IAC7G,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;IAC5C,+EAA+E;IAC/E,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;CAC7B;AAqBD,qBAAa,iBAAkB,SAAQ,UAAU;IAsB/C,OAAgB,MAAM,0BA8FpB;IAEF,OAAgB,UAAU;;;;;;;;;;;;;QAKxB;;;0EAGkE;;;;QAElE;;;;;;;WAOG;;;;QAEH;;;;;;WAMG;;;;QAEH;;;;;;;WAOG;;;;MAEH;IAEF,QAAQ,EAAE,YAAY,EAAE,CAAM;IAC9B,YAAY,SAAmB;IAC/B,QAAQ,UAAS;IACjB,aAAa,UAAS;IACtB,QAAQ,UAAS;IACjB,YAAY,SAAM;IAClB,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAa;IAC3E;;;;;OAKG;IACH,QAAQ,EAAE,MA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AAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;CAAE,CAAC;AA8f7D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF"}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AdaptiveChatTrail
3
- } from "./chunk-IV35WTWA.js";
3
+ } from "./chunk-QG3YZCXZ.js";
4
4
  import "./chunk-ONGGPQER.js";
5
5
  import "./chunk-UVKRO5ER.js";
6
6
  export {
@@ -94,15 +94,15 @@ export declare const SuggestionChipSchema: z.ZodEffects<z.ZodObject<{
94
94
  props?: Record<string, unknown> | undefined;
95
95
  }>;
96
96
  }, "strip", z.ZodTypeAny, {
97
- title: string;
98
97
  id: string;
98
+ title: string;
99
99
  payload: {
100
100
  widget: string;
101
101
  props?: Record<string, unknown> | undefined;
102
102
  };
103
103
  }, {
104
- title: string;
105
104
  id: string;
105
+ title: string;
106
106
  payload: {
107
107
  widget: string;
108
108
  props?: Record<string, unknown> | undefined;
@@ -612,16 +612,16 @@ export declare const SuggestionChipSchema: z.ZodEffects<z.ZodObject<{
612
612
  validation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
613
613
  }, "strip", z.ZodTypeAny, {
614
614
  config: {
615
- title: string;
616
615
  id: string;
616
+ title: string;
617
617
  payload: {
618
618
  widget: string;
619
619
  props?: Record<string, unknown> | undefined;
620
620
  };
621
621
  };
622
622
  kind: "suggestions:chip";
623
- title?: string | undefined;
624
623
  id?: string | undefined;
624
+ title?: string | undefined;
625
625
  validation?: string[] | undefined;
626
626
  triggerWhen?: {
627
627
  type: "rules";
@@ -712,16 +712,16 @@ export declare const SuggestionChipSchema: z.ZodEffects<z.ZodObject<{
712
712
  description?: string | undefined;
713
713
  }, {
714
714
  config: {
715
- title: string;
716
715
  id: string;
716
+ title: string;
717
717
  payload: {
718
718
  widget: string;
719
719
  props?: Record<string, unknown> | undefined;
720
720
  };
721
721
  };
722
722
  kind: "suggestions:chip";
723
- title?: string | undefined;
724
723
  id?: string | undefined;
724
+ title?: string | undefined;
725
725
  validation?: string[] | undefined;
726
726
  triggerWhen?: {
727
727
  type: "rules";
@@ -812,16 +812,16 @@ export declare const SuggestionChipSchema: z.ZodEffects<z.ZodObject<{
812
812
  description?: string | undefined;
813
813
  }>, {
814
814
  config: {
815
- title: string;
816
815
  id: string;
816
+ title: string;
817
817
  payload: {
818
818
  widget: string;
819
819
  props?: Record<string, unknown> | undefined;
820
820
  };
821
821
  };
822
822
  kind: "suggestions:chip";
823
- title?: string | undefined;
824
823
  id?: string | undefined;
824
+ title?: string | undefined;
825
825
  validation?: string[] | undefined;
826
826
  triggerWhen?: {
827
827
  type: "rules";
@@ -912,16 +912,16 @@ export declare const SuggestionChipSchema: z.ZodEffects<z.ZodObject<{
912
912
  description?: string | undefined;
913
913
  }, {
914
914
  config: {
915
- title: string;
916
915
  id: string;
916
+ title: string;
917
917
  payload: {
918
918
  widget: string;
919
919
  props?: Record<string, unknown> | undefined;
920
920
  };
921
921
  };
922
922
  kind: "suggestions:chip";
923
- title?: string | undefined;
924
923
  id?: string | undefined;
924
+ title?: string | undefined;
925
925
  validation?: string[] | undefined;
926
926
  triggerWhen?: {
927
927
  type: "rules";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ChatAssistantLitMountable,
3
3
  renderFallbackHtml
4
- } from "./chunk-33UECBHY.js";
4
+ } from "./chunk-SONKUCGI.js";
5
5
  import "./chunk-ONGGPQER.js";
6
6
  import "./chunk-VLJ3WOEX.js";
7
7
  import "./chunk-UVKRO5ER.js";
@@ -1 +1 @@
1
- {"version":3,"file":"ChatTransport.d.ts","sourceRoot":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eAAsB,CAAC"}
@@ -82,6 +82,7 @@ var AdaptiveChatBar = class extends LitElement {
82
82
  if (!detail?.prompt) return;
83
83
  e.stopPropagation();
84
84
  if (this.inFlight) return;
85
+ this.inFlight = true;
85
86
  this.dispatchEvent(
86
87
  new CustomEvent("chat-message-sent", {
87
88
  detail: { text: detail.prompt },
@@ -90,6 +91,28 @@ var AdaptiveChatBar = class extends LitElement {
90
91
  })
91
92
  );
92
93
  };
94
+ /**
95
+ * Visitor tapped an inline `suggest_replies` chip in the trail. Submit
96
+ * the chip text through the SAME `chat-message-sent` channel a typed
97
+ * message uses, so the reply rides the existing send path (mountable →
98
+ * chatSession.send → transport) — no fabricated AG-UI events. The
99
+ * trail clears the chips on its own once the reply lands and a newer
100
+ * assistant turn becomes the latest.
101
+ */
102
+ this._onSuggestedReply = (e) => {
103
+ const detail = e.detail;
104
+ if (!detail?.text) return;
105
+ e.stopPropagation();
106
+ if (this.inFlight) return;
107
+ this.inFlight = true;
108
+ this.dispatchEvent(
109
+ new CustomEvent("chat-message-sent", {
110
+ detail: { text: detail.text },
111
+ bubbles: true,
112
+ composed: true
113
+ })
114
+ );
115
+ };
93
116
  }
94
117
  createRenderRoot() {
95
118
  return this;
@@ -120,6 +143,7 @@ var AdaptiveChatBar = class extends LitElement {
120
143
  .thinkingText=${this.thinkingText}
121
144
  .introSuggestion=${this.introSuggestion}
122
145
  @trail-intro-suggestion=${this._onIntroSuggestion}
146
+ @trail-suggested-reply=${this._onSuggestedReply}
123
147
  ></adaptive-chat-trail>
124
148
  <div style=${styleMap(rowStyles(this.forceExpanded))} data-chat-row>
125
149
  <span style=${styleMap(avatarStyles())} aria-hidden="true">✦</span>
@@ -358,4 +382,4 @@ if (!customElements.get("adaptive-chat-bar")) {
358
382
  export {
359
383
  AdaptiveChatBar
360
384
  };
361
- //# sourceMappingURL=chunk-QC5THSKS.js.map
385
+ //# sourceMappingURL=chunk-LY2A6P2P.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/AdaptiveChatBar.ts"],
4
+ "sourcesContent": ["/**\n * AdaptiveChatBar \u2014 the canvas lid composition for the chat-canvas\n * experience. Renders the bubble-up trail on top and an always-visible\n * input row below.\n *\n * Wiring contract (events out):\n * - `chat-message-sent` ({ text }): the user submitted text via Enter\n * or the send button. The owning code is responsible for pushing\n * this into the conversation history and producing a reply.\n *\n * Wiring contract (props in):\n * - `messages`: the conversation trail, passed straight through to\n * `<adaptive-chat-trail>`.\n * - `placeholder`: input placeholder copy. Defaults to a generic\n * \"Ask, find, or navigate\u2026\" \u2014 the host (typically the slot's lid\n * widget mount) can override to a context-specific string.\n *\n * Light DOM. Glassmorphism is applied at the input-row level so the\n * trail above floats over the host page without chrome. See PRD \u00A74.4.\n */\n\nimport { html, LitElement, nothing } from 'lit';\nimport { styleMap } from 'lit/directives/style-map.js';\n\nimport './AdaptiveChatTrail.js';\nimport type { TrailMessage } from './AdaptiveChatTrail.js';\n\nconst DEFAULT_PLACEHOLDER = 'Ask, find, or navigate\u2026';\n\nexport class AdaptiveChatBar extends LitElement {\n static override properties = {\n messages: { attribute: false },\n placeholder: { type: String },\n greeting: { type: String },\n inFlight: { type: Boolean, reflect: true },\n thinkingText: { attribute: false },\n introSuggestion: { attribute: false },\n forceExpanded: { type: Boolean, reflect: true },\n _input: { state: true },\n };\n\n messages: TrailMessage[] = [];\n\n /**\n * Live reasoning narration from the model \u2014 streamed in via\n * AG-UI THINKING_TEXT_MESSAGE_CONTENT events and forwarded by\n * the ChatSession subscription on the host (mountable).\n * Forwarded verbatim to the trail, which renders it in place of\n * the silent loading dots between turns. Empty string when no\n * thinking turn is active.\n */\n thinkingText = '';\n /**\n * Pre-conversation suggestion button \u2014 forwarded to the trail's\n * empty-state pane. When the visitor clicks it the trail emits\n * `trail-intro-suggestion`; we catch that here and submit the\n * configured prompt through the normal send path.\n */\n introSuggestion: { label: string; prompt: string } | undefined = undefined;\n\n /** Pass-through to {@link AdaptiveChatTrail}'s ``forceExpanded`` prop.\n * Hosts that mount the chat-bar in a full-screen surface (mobile\n * panel, agent app, etc.) set this to skip the collapse affordance\n * \u2014 there is no smaller state to fall back to. */\n forceExpanded = false;\n placeholder = DEFAULT_PLACEHOLDER;\n /**\n * Initial assistant message shown before any real conversation\n * starts. Renders inside the trail as a phantom assistant chip\n * when messages.length === 0; auto-disappears as soon as the\n * first user message lands. Mirrors ChatAssistantLit's greeting.\n */\n greeting: string | undefined = undefined;\n /**\n * Whether a chat round-trip is in flight (request sent, awaiting\n * reply). The single send/stop button morphs accordingly: \u2191 when\n * ready, \u23F9 when in-flight. Parent owns this state \u2014 set true after\n * `chat-message-sent` fires, false when the reply lands or the\n * request is aborted. Enter is inert while in-flight.\n */\n inFlight = false;\n _input = '';\n\n override createRenderRoot(): HTMLElement {\n return this;\n }\n\n // Host-level styling (display, width, height, flex, etc.) is owned\n // by the container \u2014 SDK shadow root provides default rules, panel\n // overrides via design tokens (--sc-chat-bar-host-*). This adaptive\n // never sets inline styles on itself. See SmartCanvasElementLit's\n // static styles for the rule.\n\n private _onInput = (e: Event): void => {\n this._input = (e.target as HTMLInputElement).value;\n };\n\n private _onKeyDown = (e: KeyboardEvent): void => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n // Enter is the send affordance \u2014 while in-flight there's nothing\n // to send, so it's a no-op. Interrupt requires the explicit\n // \u23F9 click to avoid surprise-aborting on a stray keystroke.\n if (this.inFlight) return;\n this._send();\n }\n };\n\n // Single button. Click delegates to send-or-interrupt based on\n // current state. Same DOM node, different behavior \u2014 discoverability\n // wins from the user not having to scan for which control is active.\n private _onSendOrInterrupt = (): void => {\n if (this.inFlight) {\n this.dispatchEvent(new CustomEvent('chat-interrupt', { bubbles: true, composed: true }));\n return;\n }\n this._send();\n };\n\n private _send(): void {\n const text = this._input.trim();\n if (!text) return;\n this.dispatchEvent(\n new CustomEvent<{ text: string }>('chat-message-sent', {\n detail: { text },\n bubbles: true,\n composed: true,\n })\n );\n this._input = '';\n // Drop the input value too \u2014 the input's bound value is `this._input`\n // via the render, but jsdom's two-way binding via property only takes\n // effect after the next render, so set it imperatively for the test\n // and for browser symmetry (most browsers do the right thing here\n // anyway because Lit re-renders on the state change).\n const input = this.querySelector<HTMLInputElement>('input[data-chat-input]');\n if (input) input.value = '';\n }\n\n /**\n * Visitor tapped the intro suggestion button in the empty-state\n * trail. Submit the configured prompt through the same channel as\n * a typed message so listeners (mountable \u2192 chatSession.send) see\n * a uniform shape \u2014 no need for a parallel \"suggestion-sent\" path.\n * The trail's intro pane auto-disappears the moment the first\n * message lands, so this also closes the empty state in one go.\n */\n private _onIntroSuggestion = (e: Event): void => {\n const detail = (e as CustomEvent<{ prompt: string }>).detail;\n if (!detail?.prompt) return;\n e.stopPropagation();\n if (this.inFlight) return;\n // Latch in-flight optimistically. `inFlight` is owned by the parent\n // mountable and only pushed back down after it handles\n // `chat-message-sent` + a Lit render cycle. Two taps in the same frame\n // both see inFlight===false otherwise, double-dispatching one intended\n // reply (C3). Set it true synchronously here; the parent confirms/owns\n // it from the next render and clears it when the reply lands.\n this.inFlight = true;\n this.dispatchEvent(\n new CustomEvent<{ text: string }>('chat-message-sent', {\n detail: { text: detail.prompt },\n bubbles: true,\n composed: true,\n })\n );\n };\n\n /**\n * Visitor tapped an inline `suggest_replies` chip in the trail. Submit\n * the chip text through the SAME `chat-message-sent` channel a typed\n * message uses, so the reply rides the existing send path (mountable \u2192\n * chatSession.send \u2192 transport) \u2014 no fabricated AG-UI events. The\n * trail clears the chips on its own once the reply lands and a newer\n * assistant turn becomes the latest.\n */\n private _onSuggestedReply = (e: Event): void => {\n const detail = (e as CustomEvent<{ text: string }>).detail;\n if (!detail?.text) return;\n e.stopPropagation();\n if (this.inFlight) return;\n // Latch in-flight optimistically \u2014 same race as `_onIntroSuggestion`\n // (C3). The parent owns `inFlight` and only re-asserts it after a render\n // cycle, so a same-frame double tap would otherwise fire two\n // `chat-message-sent` events for one chip.\n this.inFlight = true;\n this.dispatchEvent(\n new CustomEvent<{ text: string }>('chat-message-sent', {\n detail: { text: detail.text },\n bubbles: true,\n composed: true,\n })\n );\n };\n\n override render() {\n return html`\n <div style=${styleMap(rootStyles(this.forceExpanded))}>\n ${this.forceExpanded ? renderHeader() : nothing}\n <adaptive-chat-trail\n .messages=${this.messages}\n .greeting=${this.greeting}\n .forceExpanded=${this.forceExpanded}\n .inFlight=${this.inFlight}\n .thinkingText=${this.thinkingText}\n .introSuggestion=${this.introSuggestion}\n @trail-intro-suggestion=${this._onIntroSuggestion}\n @trail-suggested-reply=${this._onSuggestedReply}\n ></adaptive-chat-trail>\n <div style=${styleMap(rowStyles(this.forceExpanded))} data-chat-row>\n <span style=${styleMap(avatarStyles())} aria-hidden=\"true\">\u2726</span>\n <input\n data-chat-input\n type=\"text\"\n placeholder=${this.placeholder}\n .value=${this._input}\n @input=${this._onInput}\n @keydown=${this._onKeyDown}\n style=${styleMap(inputStyles())}\n aria-label=\"Chat input\"\n />\n <button\n type=\"button\"\n data-chat-send\n data-state=${this.inFlight ? 'in-flight' : 'ready'}\n @click=${this._onSendOrInterrupt}\n aria-label=${this.inFlight ? 'Stop' : 'Send message'}\n title=${this.inFlight ? 'Interrupt' : 'Send'}\n style=${styleMap(sendStyles(this.inFlight))}\n >${this.inFlight ? '\u25A0' : '\u2191'}</button>\n </div>\n </div>\n `;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Styles \u2014 kept inline (Lit styleMap) so they participate in light-DOM\n// rendering and pick up host CSS variables (e.g. --sc-tile-background).\n// ---------------------------------------------------------------------------\n\nfunction rootStyles(forceExpanded: boolean): Record<string, string> {\n // When the host expects the chat to fill its container (full-screen\n // panel, agent app), we grow vertically AND wrap the whole widget in\n // its own chrome card \u2014 trail + input read as one cohesive surface\n // instead of a naked trail above a chrome'd input. Floating mounts\n // (bottom-right pinned, etc.) stay chrome-less here because their\n // chrome is owned by the host's positioned wrapper.\n if (!forceExpanded) {\n return {\n display: 'flex',\n flexDirection: 'column',\n gap: '6px',\n width: '100%',\n pointerEvents: 'auto',\n };\n }\n // Input is ABSOLUTELY positioned at the bottom of this chrome card\n // (see rowStyles forceExpanded mode). That guarantees the input is\n // always visible \u2014 even when the lid region is tighter than the\n // chat-bar would naturally want. The flex column above holds\n // header + trail; padding-bottom reserves the input's footprint so\n // trail content can never overlap.\n //\n // Priority of \"what disappears when space is tight\":\n // Trail (shrinks to 0 first via flex: 1 1 0)\n // Header (can shrink via default flex: 0 1 auto)\n // Input (NEVER \u2014 it's positioned absolute, always at the bottom)\n return {\n position: 'relative',\n display: 'flex',\n flexDirection: 'column',\n gap: '8px',\n width: '100%',\n height: '100%',\n boxSizing: 'border-box',\n flex: '1 1 auto',\n minHeight: '0',\n overflow: 'hidden',\n pointerEvents: 'auto',\n background: 'var(--sc-tile-background, rgba(255, 255, 255, 0.92))',\n border: 'var(--sc-tile-border, 1px solid rgba(0, 0, 0, 0.06))',\n borderRadius: 'var(--sc-tile-border-radius, 14px)',\n boxShadow: 'var(--sc-tile-shadow, 0 12px 32px -16px rgba(0, 0, 0, 0.18))',\n // Reserves room for the absolute-positioned input pill (36px high\n // + 12px from bottom) plus a 16px visual gap above the input.\n padding: '0.75rem 0.75rem calc(36px + 1.75rem)',\n color: 'var(--sc-tile-title-color, inherit)',\n fontFamily: 'var(--sc-font-family, inherit)',\n // Override the trail's host-layout tokens so the trail (a flex item\n // of this column) shrinks to 0 first when space is tight \u2014 letting\n // the header and absolute-positioned input pill stay pinned. The\n // SDK-level rule in SmartCanvasElementLit consumes these tokens on\n // adaptive-chat-trail's host element. Containers OWN host styling\n // via tokens; the adaptive never sets inline styles on its host.\n ['--sc-chat-trail-host-display']: 'flex',\n ['--sc-chat-trail-host-flex-direction']: 'column',\n ['--sc-chat-trail-host-flex']: '1 1 0',\n ['--sc-chat-trail-host-min-height']: '0',\n ['--sc-chat-trail-host-overflow']: 'hidden',\n };\n}\n\nfunction rowStyles(forceExpanded: boolean): Record<string, string> {\n // forceExpanded \u2014 root container already carries the chrome; row\n // becomes a flat input-pill inside that chrome (subtle border + soft\n // background, no shadow/blur).\n if (forceExpanded) {\n // Absolute-pinned to the chrome card's bottom edge so it never\n // disappears under any container size. The chrome reserves\n // padding-bottom equal to this row's footprint so flex content\n // above (header + trail) can't overlap.\n return {\n position: 'absolute',\n left: '0.75rem',\n right: '0.75rem',\n bottom: '0.75rem',\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '6px 14px',\n borderRadius: '9999px',\n background: 'rgba(0, 0, 0, 0.04)',\n border: '1px solid rgba(0, 0, 0, 0.10)',\n color: 'var(--sc-content-text-color, inherit)',\n fontFamily: 'var(--sc-font-family, inherit)',\n minHeight: '36px',\n };\n }\n // Floating mount \u2014 keeps the original tile-chrome look.\n return {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '10px 12px',\n borderRadius: 'var(--sc-tile-border-radius, 14px)',\n background: 'var(--sc-tile-background, rgba(15, 19, 24, 0.6))',\n backdropFilter: 'var(--sc-chat-bar-blur, blur(24px) saturate(140%))',\n WebkitBackdropFilter: 'var(--sc-chat-bar-blur, blur(24px) saturate(140%))',\n border: 'var(--sc-tile-border, 1px solid rgba(255, 255, 255, 0.08))',\n boxShadow: 'var(--sc-tile-shadow, 0 2px 12px rgba(0, 0, 0, 0.3))',\n color: 'var(--sc-tile-title-color, #fafafa)',\n fontFamily: 'var(--sc-font-family, inherit)',\n };\n}\n\nfunction avatarStyles(): Record<string, string> {\n return {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '24px',\n height: '24px',\n borderRadius: '9999px',\n background: 'hsl(var(--sc-accent-color) / 0.15)',\n border: '1px solid hsl(var(--sc-accent-color) / 0.30)',\n color: 'hsl(var(--sc-accent-color) / 0.95)',\n flexShrink: '0',\n fontSize: '11px',\n };\n}\n\nfunction inputStyles(): Record<string, string> {\n return {\n flex: '1',\n minWidth: '0',\n background: 'transparent',\n border: 'none',\n outline: 'none',\n color: 'inherit',\n fontSize: '13px',\n };\n}\n\nfunction sendStyles(inFlight: boolean): Record<string, string> {\n return {\n width: '28px',\n height: '28px',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: '9999px',\n // Ready: filled accent (send is the affordance). In-flight: hollow\n // ring + accent ring (stop is a one-of-a-kind disruptive action,\n // styled differently so the user reads \"this isn't just send\").\n background: inFlight ? 'transparent' : 'hsl(var(--sc-accent-color) / 0.85)',\n color: inFlight ? 'hsl(var(--sc-accent-color) / 0.95)' : 'var(--sc-accent-foreground, #fff)',\n border: inFlight ? '1px solid hsl(var(--sc-accent-color) / 0.55)' : 'none',\n cursor: 'pointer',\n flexShrink: '0',\n transition: 'background 150ms ease, color 150ms ease, border-color 150ms ease',\n };\n}\n\nfunction renderHeader() {\n const headerStyles: Record<string, string> = {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '4px 4px 12px',\n borderBottom: '1px solid var(--sc-content-divider-color, rgba(0, 0, 0, 0.08))',\n flex: '0 0 auto',\n };\n const avatar: Record<string, string> = {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '28px',\n height: '28px',\n borderRadius: '9999px',\n // Track the workspace brand primary so the avatar matches every\n // other green in the canvas (velvet's chip gradient, the status\n // dot below, the send button). Previously the avatar pinned a\n // hardcoded #5faf7d \u2192 #3d8a5e gradient via the\n // `--sc-tile-icon-background` fallback, so when a workspace\n // overrode --sc-color-primary, every other element shifted to\n // the brand but the avatar stayed the default green \u2014 visibly\n // out of place against the surrounding chrome. Fallback colors\n // unchanged so velvet's default look is identical when no\n // workspace primary is set.\n background:\n 'var(--sc-tile-icon-background, linear-gradient(135deg, var(--sc-color-primary, #5faf7d) 0%, var(--sc-color-primary-hover, #3d8a5e) 100%))',\n color: '#fff',\n flexShrink: '0',\n fontSize: '14px',\n };\n const nameWrap: Record<string, string> = {\n display: 'flex',\n flexDirection: 'column',\n minWidth: '0',\n flex: '1 1 auto',\n };\n const name: Record<string, string> = {\n fontSize: '0.85rem',\n fontWeight: '600',\n color: 'var(--sc-content-text-color, inherit)',\n lineHeight: '1.2',\n };\n const status: Record<string, string> = {\n fontSize: '0.7rem',\n color: 'var(--sc-tile-title-color, #3d8275)',\n display: 'flex',\n alignItems: 'center',\n gap: '4px',\n lineHeight: '1.2',\n };\n const statusDot: Record<string, string> = {\n width: '6px',\n height: '6px',\n borderRadius: '9999px',\n background: 'var(--sc-tile-title-color, #3d8275)',\n display: 'inline-block',\n };\n return html`\n <div style=${styleMap(headerStyles)} data-chat-header>\n <span style=${styleMap(avatar)} aria-hidden=\"true\">\u2726</span>\n <div style=${styleMap(nameWrap)}>\n <span style=${styleMap(name)}>Assistant</span>\n <span style=${styleMap(status)}>\n <span style=${styleMap(statusDot)}></span>\n Online \u00B7 understands your session\n </span>\n </div>\n </div>\n `;\n}\n\nif (!customElements.get('adaptive-chat-bar')) {\n customElements.define('adaptive-chat-bar', AdaptiveChatBar);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'adaptive-chat-bar': AdaptiveChatBar;\n }\n}\n"],
5
+ "mappings": ";AAqBA,SAAS,MAAM,YAAY,eAAe;AAC1C,SAAS,gBAAgB;AAKzB,IAAM,sBAAsB;AAErB,IAAM,kBAAN,cAA8B,WAAW;AAAA,EAAzC;AAAA;AAYL,oBAA2B,CAAC;AAU5B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAe;AAOf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAiE;AAMjE;AAAA;AAAA;AAAA;AAAA,yBAAgB;AAChB,uBAAc;AAOd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA+B;AAQ/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAW;AACX,kBAAS;AAYT;AAAA;AAAA;AAAA;AAAA;AAAA,SAAQ,WAAW,CAAC,MAAmB;AACrC,WAAK,SAAU,EAAE,OAA4B;AAAA,IAC/C;AAEA,SAAQ,aAAa,CAAC,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B;AAAA,IAChB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWd,YACE;AAAA,IACF,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AACA,QAAM,WAAmC;AAAA,IACvC,SAAS;AAAA,IACT,eAAe;AAAA,IACf,UAAU;AAAA,IACV,MAAM;AAAA,EACR;AACA,QAAM,OAA+B;AAAA,IACnC,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,EACd;AACA,QAAM,SAAiC;AAAA,IACrC,UAAU;AAAA,IACV,OAAO;AAAA,IACP,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,YAAY;AAAA,EACd;AACA,QAAM,YAAoC;AAAA,IACxC,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AACA,SAAO;AAAA,iBACQ,SAAS,YAAY,CAAC;AAAA,oBACnB,SAAS,MAAM,CAAC;AAAA,mBACjB,SAAS,QAAQ,CAAC;AAAA,sBACf,SAAS,IAAI,CAAC;AAAA,sBACd,SAAS,MAAM,CAAC;AAAA,wBACd,SAAS,SAAS,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAM3C;AAEA,IAAI,CAAC,eAAe,IAAI,mBAAmB,GAAG;AAC5C,iBAAe,OAAO,qBAAqB,eAAe;AAC5D;",
6
+ "names": []
7
+ }
@@ -69,6 +69,27 @@ var AdaptiveChatTrail = class extends LitElement {
69
69
  })
70
70
  );
71
71
  };
72
+ /**
73
+ * Visitor tapped a `suggest_replies` inline chip. Emit
74
+ * `trail-suggested-reply` carrying the chip text — the parent
75
+ * (AdaptiveChatBar) re-dispatches it as `chat-message-sent`, the
76
+ * SAME channel the input row uses, so the reply rides the existing
77
+ * send path (mountable → chatSession.send → transport). No fabricated
78
+ * AG-UI events; this is exactly what typing the text and hitting
79
+ * Enter would do. The chips clear on their own once the reply lands
80
+ * and a newer assistant message becomes the latest.
81
+ */
82
+ this._onSuggestedReplyClick = (text) => {
83
+ const trimmed = text.trim();
84
+ if (!trimmed) return;
85
+ this.dispatchEvent(
86
+ new CustomEvent("trail-suggested-reply", {
87
+ detail: { text: trimmed },
88
+ bubbles: true,
89
+ composed: true
90
+ })
91
+ );
92
+ };
72
93
  }
73
94
  /**
74
95
  * Whether to render the thinking-dots chip after the last message.
@@ -130,7 +151,9 @@ var AdaptiveChatTrail = class extends LitElement {
130
151
  </div>`;
131
152
  }
132
153
  const renderable = this.messages.filter(
133
- (m) => !(m.role === "assistant" && (m.text ?? "").trim().length === 0 && !(m.toolCalls ?? []).some((tc) => tc.status === "pending"))
154
+ (m) => !(m.role === "assistant" && (m.text ?? "").trim().length === 0 && !(m.toolCalls ?? []).some(
155
+ (tc) => tc.status === "pending" || tc.name === "primary_response_action" || tc.name === "suggest_replies"
156
+ ))
134
157
  );
135
158
  const visible = this.expanded || this.forceExpanded ? renderable : renderable.slice(-this.visibleCount);
136
159
  const hidden = renderable.length - visible.length;
@@ -189,6 +212,13 @@ var AdaptiveChatTrail = class extends LitElement {
189
212
  overflow: "hidden"
190
213
  };
191
214
  const containerStyles = { ...baseStyles, ...modeStyles };
215
+ let latestAssistantId = null;
216
+ for (let i = renderable.length - 1; i >= 0; i--) {
217
+ if (renderable[i].role === "assistant") {
218
+ latestAssistantId = renderable[i].id;
219
+ break;
220
+ }
221
+ }
192
222
  const frameStyles = this.forceExpanded ? {
193
223
  position: "relative",
194
224
  width: "100%",
@@ -231,6 +261,8 @@ var AdaptiveChatTrail = class extends LitElement {
231
261
  const state = chipVisualState(m);
232
262
  const isStreaming = state.kind === "streaming";
233
263
  const toolCalls = (m.toolCalls ?? []).filter((tc) => tc.status === "pending");
264
+ const receipts = (m.toolCalls ?? []).map(deriveActivityReceipt).filter((r) => r !== null);
265
+ const replyChips = m.id === latestAssistantId ? extractSuggestedReplies(m.toolCalls) : [];
234
266
  const renderedText = m.role === "assistant" ? html`${unsafeHTML(renderMarkdown(stripTrailingWhitespace(m.text)))}` : html`${m.text}`;
235
267
  const chipStyle = isStreaming ? {
236
268
  ...chipStyles(state, pos),
@@ -257,6 +289,24 @@ var AdaptiveChatTrail = class extends LitElement {
257
289
  style=${styleMap(toolCallChipStyles(tc.status))}
258
290
  title="${tc.name} · ${tc.status}"
259
291
  >${toolCallIcon(tc.status)} ${tc.name}</button>`
292
+ )}
293
+ </div>` : nothing}${receipts.length > 0 ? html`<div data-trail-receipts style=${styleMap(receiptStripStyles())}>
294
+ ${receipts.map(
295
+ (r) => html`<div
296
+ data-trail-receipt
297
+ data-receipt-type=${r.type}
298
+ style=${styleMap(receiptStyles())}
299
+ ><span aria-hidden="true" style=${styleMap(receiptIconStyles())}>✓</span
300
+ ><span>Added ${r.type} · <strong>${r.label}</strong></span></div>`
301
+ )}
302
+ </div>` : nothing}${replyChips.length > 0 ? html`<div data-trail-reply-chips style=${styleMap(replyChipStripStyles())}>
303
+ ${replyChips.map(
304
+ (reply) => html`<button
305
+ type="button"
306
+ data-trail-reply-chip
307
+ @click=${() => this._onSuggestedReplyClick(reply)}
308
+ style=${styleMap(replyChipStyles())}
309
+ >${reply}</button>`
260
310
  )}
261
311
  </div>` : nothing}</div>`;
262
312
  })}
@@ -592,6 +642,97 @@ function toolCallIcon(status) {
592
642
  return "\xB7";
593
643
  }
594
644
  }
645
+ function deriveActivityReceipt(tc) {
646
+ if (tc.name !== "primary_response_action") return null;
647
+ const args = tc.args;
648
+ if (!args || typeof args !== "object") return null;
649
+ const templateId = typeof args.template_id === "string" ? args.template_id : "";
650
+ const content = args.content ?? null;
651
+ const title = content && typeof content.title === "string" && content.title.trim() ? content.title.trim() : "";
652
+ const id = templateId.toLowerCase();
653
+ let type;
654
+ if (id.includes("faq")) type = "FAQ";
655
+ else if (id.includes("chart") || id.includes("graph")) type = "chart";
656
+ else if (id.includes("card") || id.includes("product")) type = "card";
657
+ else if (id.includes("alert") || id.includes("navigation") || id.includes("nav")) type = "alert";
658
+ else type = "added to your view";
659
+ const label = title || templateId || "something";
660
+ return { type, label };
661
+ }
662
+ function extractSuggestedReplies(toolCalls) {
663
+ if (!toolCalls) return [];
664
+ for (const tc of toolCalls) {
665
+ if (tc.name !== "suggest_replies") continue;
666
+ const replies = tc.args?.replies;
667
+ if (!Array.isArray(replies)) return [];
668
+ return replies.filter((r) => typeof r === "string" && r.trim().length > 0).map((r) => r.trim()).slice(0, 4);
669
+ }
670
+ return [];
671
+ }
672
+ function receiptStripStyles() {
673
+ return {
674
+ display: "flex",
675
+ flexDirection: "column",
676
+ gap: "2px",
677
+ marginTop: "4px"
678
+ };
679
+ }
680
+ function receiptStyles() {
681
+ return {
682
+ display: "inline-flex",
683
+ alignItems: "center",
684
+ gap: "5px",
685
+ alignSelf: "flex-start",
686
+ fontSize: "11px",
687
+ lineHeight: "1.3",
688
+ fontWeight: "500",
689
+ letterSpacing: "0.01em",
690
+ color: "var(--sc-content-muted-color, rgba(255, 255, 255, 0.6))",
691
+ opacity: "0.85"
692
+ };
693
+ }
694
+ function receiptIconStyles() {
695
+ return {
696
+ display: "inline-flex",
697
+ alignItems: "center",
698
+ justifyContent: "center",
699
+ width: "14px",
700
+ height: "14px",
701
+ borderRadius: "50%",
702
+ fontSize: "9px",
703
+ fontWeight: "700",
704
+ color: "#fff",
705
+ background: "hsl(var(--sc-accent-color, 145 40% 45%) / 0.7)"
706
+ };
707
+ }
708
+ function replyChipStripStyles() {
709
+ return {
710
+ display: "flex",
711
+ flexWrap: "wrap",
712
+ gap: "6px",
713
+ marginTop: "6px",
714
+ alignSelf: "flex-start"
715
+ };
716
+ }
717
+ function replyChipStyles() {
718
+ return {
719
+ display: "inline-flex",
720
+ alignItems: "center",
721
+ padding: "5px 12px",
722
+ border: "1px solid hsl(var(--sc-accent-color, 145 40% 45%) / 0.40)",
723
+ borderRadius: "9999px",
724
+ background: "hsl(var(--sc-accent-color, 145 40% 45%) / 0.12)",
725
+ color: "var(--sc-tile-text-color, currentColor)",
726
+ font: "inherit",
727
+ fontSize: "12px",
728
+ fontWeight: "500",
729
+ lineHeight: "1.2",
730
+ cursor: "pointer",
731
+ backdropFilter: "blur(8px)",
732
+ WebkitBackdropFilter: "blur(8px)",
733
+ transition: "background 150ms ease, transform 120ms ease"
734
+ };
735
+ }
595
736
  function caretStyles() {
596
737
  return {
597
738
  display: "inline-block",
@@ -742,4 +883,4 @@ if (!customElements.get("adaptive-chat-trail")) {
742
883
  export {
743
884
  AdaptiveChatTrail
744
885
  };
745
- //# sourceMappingURL=chunk-IV35WTWA.js.map
886
+ //# sourceMappingURL=chunk-QG3YZCXZ.js.map