@syntrologie/adapt-chatbot 2.8.0-canary.43 → 2.8.0-canary.431

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.
Files changed (178) hide show
  1. package/dist/AdaptiveChatBar.d.ts +175 -0
  2. package/dist/AdaptiveChatBar.d.ts.map +1 -0
  3. package/dist/AdaptiveChatBar.js +11 -0
  4. package/dist/AdaptiveChatBar.js.map +7 -0
  5. package/dist/AdaptiveChatBarMountable.d.ts +80 -0
  6. package/dist/AdaptiveChatBarMountable.d.ts.map +1 -0
  7. package/dist/AdaptiveChatTrail.anchor-scroll.test.d.ts +2 -0
  8. package/dist/AdaptiveChatTrail.anchor-scroll.test.d.ts.map +1 -0
  9. package/dist/AdaptiveChatTrail.d.ts +415 -0
  10. package/dist/AdaptiveChatTrail.d.ts.map +1 -0
  11. package/dist/AdaptiveChatTrail.js +11 -0
  12. package/dist/AdaptiveChatTrail.js.map +7 -0
  13. package/dist/AdaptiveChatTrail.test.d.ts +2 -0
  14. package/dist/AdaptiveChatTrail.test.d.ts.map +1 -0
  15. package/dist/AdaptiveChipsStrip.d.ts +1150 -0
  16. package/dist/AdaptiveChipsStrip.d.ts.map +1 -0
  17. package/dist/AdaptiveChipsStrip.js +11 -0
  18. package/dist/AdaptiveChipsStrip.js.map +7 -0
  19. package/dist/AdaptiveChipsStripMountable.d.ts +24 -0
  20. package/dist/AdaptiveChipsStripMountable.d.ts.map +1 -0
  21. package/dist/ChatAssistantLit.d.ts +60 -0
  22. package/dist/ChatAssistantLit.d.ts.map +1 -0
  23. package/dist/ChatAssistantLit.js +13 -0
  24. package/dist/ChatAssistantLit.js.map +7 -0
  25. package/dist/ChatSession.d.ts +230 -0
  26. package/dist/ChatSession.d.ts.map +1 -0
  27. package/dist/ChatTransport.d.ts +360 -0
  28. package/dist/ChatTransport.d.ts.map +1 -0
  29. package/dist/InlineRegistryWidgetMount.test.d.ts +2 -0
  30. package/dist/InlineRegistryWidgetMount.test.d.ts.map +1 -0
  31. package/dist/InlineWidgetLiveMount.test.d.ts +2 -0
  32. package/dist/InlineWidgetLiveMount.test.d.ts.map +1 -0
  33. package/dist/NavLinkMountable.d.ts +25 -0
  34. package/dist/NavLinkMountable.d.ts.map +1 -0
  35. package/dist/NavLinkMountable.test.d.ts +2 -0
  36. package/dist/NavLinkMountable.test.d.ts.map +1 -0
  37. package/dist/TextAnswerMountable.d.ts +17 -0
  38. package/dist/TextAnswerMountable.d.ts.map +1 -0
  39. package/dist/TextAnswerMountable.test.d.ts +2 -0
  40. package/dist/TextAnswerMountable.test.d.ts.map +1 -0
  41. package/dist/Turnstile.d.ts +83 -0
  42. package/dist/Turnstile.d.ts.map +1 -0
  43. package/dist/cdn.d.ts +2 -6
  44. package/dist/cdn.d.ts.map +1 -1
  45. package/dist/chunk-5W75LR6M.js +460 -0
  46. package/dist/chunk-5W75LR6M.js.map +7 -0
  47. package/dist/chunk-7WSMNAKW.js +3824 -0
  48. package/dist/chunk-7WSMNAKW.js.map +7 -0
  49. package/dist/chunk-EWPPVPJ4.js +14 -0
  50. package/dist/chunk-EWPPVPJ4.js.map +7 -0
  51. package/dist/chunk-GP4OSTZT.js +641 -0
  52. package/dist/chunk-GP4OSTZT.js.map +7 -0
  53. package/dist/chunk-HELUC5JI.js +8971 -0
  54. package/dist/chunk-HELUC5JI.js.map +7 -0
  55. package/dist/chunk-HVGQJZMP.js +1520 -0
  56. package/dist/chunk-HVGQJZMP.js.map +7 -0
  57. package/dist/chunk-KPWW7N27.js +235 -0
  58. package/dist/chunk-KPWW7N27.js.map +7 -0
  59. package/dist/chunk-UVKRO5ER.js +13 -0
  60. package/dist/chunk-UVKRO5ER.js.map +7 -0
  61. package/dist/editor-lit.d.ts +37 -0
  62. package/dist/editor-lit.d.ts.map +1 -0
  63. package/dist/editor-lit.js +134 -0
  64. package/dist/editor-lit.js.map +7 -0
  65. package/dist/elements/ActionHandler.d.ts +34 -0
  66. package/dist/elements/ActionHandler.d.ts.map +1 -0
  67. package/dist/elements/ElementInstanceStore.d.ts +207 -0
  68. package/dist/elements/ElementInstanceStore.d.ts.map +1 -0
  69. package/dist/elements/ElementInstanceStore.test.d.ts +2 -0
  70. package/dist/elements/ElementInstanceStore.test.d.ts.map +1 -0
  71. package/dist/elements/ElementTypeHandler.d.ts +77 -0
  72. package/dist/elements/ElementTypeHandler.d.ts.map +1 -0
  73. package/dist/elements/ItemHandler.d.ts +60 -0
  74. package/dist/elements/ItemHandler.d.ts.map +1 -0
  75. package/dist/elements/ItemHandler.test.d.ts +2 -0
  76. package/dist/elements/ItemHandler.test.d.ts.map +1 -0
  77. package/dist/elements/TileHandler.d.ts +52 -0
  78. package/dist/elements/TileHandler.d.ts.map +1 -0
  79. package/dist/elements/TileHandler.test.d.ts +2 -0
  80. package/dist/elements/TileHandler.test.d.ts.map +1 -0
  81. package/dist/elements/__tests__/ElementInstanceStore.recall.test.d.ts +2 -0
  82. package/dist/elements/__tests__/ElementInstanceStore.recall.test.d.ts.map +1 -0
  83. package/dist/elements/blockRenderer.d.ts +46 -0
  84. package/dist/elements/blockRenderer.d.ts.map +1 -0
  85. package/dist/elements/blockRenderer.test.d.ts +13 -0
  86. package/dist/elements/blockRenderer.test.d.ts.map +1 -0
  87. package/dist/elements/blocks.d.ts +58 -0
  88. package/dist/elements/blocks.d.ts.map +1 -0
  89. package/dist/elements/envelope.d.ts +24 -0
  90. package/dist/elements/envelope.d.ts.map +1 -0
  91. package/dist/elements/fetcher.d.ts +40 -0
  92. package/dist/elements/fetcher.d.ts.map +1 -0
  93. package/dist/elements/index.d.ts +33 -0
  94. package/dist/elements/index.d.ts.map +1 -0
  95. package/dist/elements/store-singleton.d.ts +4 -0
  96. package/dist/elements/store-singleton.d.ts.map +1 -0
  97. package/dist/elements/types.d.ts +106 -0
  98. package/dist/elements/types.d.ts.map +1 -0
  99. package/dist/observer/__tests__/allowlist.test.d.ts +9 -0
  100. package/dist/observer/__tests__/allowlist.test.d.ts.map +1 -0
  101. package/dist/observer/__tests__/bus-translate.test.d.ts +16 -0
  102. package/dist/observer/__tests__/bus-translate.test.d.ts.map +1 -0
  103. package/dist/observer/__tests__/lifecycle.test.d.ts +2 -0
  104. package/dist/observer/__tests__/lifecycle.test.d.ts.map +1 -0
  105. package/dist/observer/__tests__/observer-enrich.test.d.ts +10 -0
  106. package/dist/observer/__tests__/observer-enrich.test.d.ts.map +1 -0
  107. package/dist/observer/__tests__/observer-isolation.test.d.ts +13 -0
  108. package/dist/observer/__tests__/observer-isolation.test.d.ts.map +1 -0
  109. package/dist/observer/__tests__/queue.test.d.ts +2 -0
  110. package/dist/observer/__tests__/queue.test.d.ts.map +1 -0
  111. package/dist/observer/__tests__/transport.test.d.ts +2 -0
  112. package/dist/observer/__tests__/transport.test.d.ts.map +1 -0
  113. package/dist/observer/allowlist.d.ts +30 -0
  114. package/dist/observer/allowlist.d.ts.map +1 -0
  115. package/dist/observer/bus-translate.d.ts +33 -0
  116. package/dist/observer/bus-translate.d.ts.map +1 -0
  117. package/dist/observer/index.d.ts +44 -0
  118. package/dist/observer/index.d.ts.map +1 -0
  119. package/dist/observer/queue.d.ts +63 -0
  120. package/dist/observer/queue.d.ts.map +1 -0
  121. package/dist/observer/transport.d.ts +27 -0
  122. package/dist/observer/transport.d.ts.map +1 -0
  123. package/dist/runtime-lit.d.ts +8 -0
  124. package/dist/runtime-lit.d.ts.map +1 -0
  125. package/dist/runtime.d.ts +10 -3
  126. package/dist/runtime.d.ts.map +1 -1
  127. package/dist/runtime.js +2232 -29
  128. package/dist/runtime.js.map +7 -0
  129. package/dist/schema.d.ts +3340 -11
  130. package/dist/schema.d.ts.map +1 -1
  131. package/dist/schema.js +220 -31
  132. package/dist/schema.js.map +7 -0
  133. package/dist/test/setup.d.ts +1 -0
  134. package/dist/test/setup.d.ts.map +1 -0
  135. package/dist/types.d.ts +61 -40
  136. package/dist/types.d.ts.map +1 -1
  137. package/package.json +44 -23
  138. package/dist/ChatAssistant.d.ts +0 -18
  139. package/dist/ChatAssistant.d.ts.map +0 -1
  140. package/dist/ChatAssistant.js +0 -178
  141. package/dist/SyntroChatbot.d.ts +0 -14
  142. package/dist/SyntroChatbot.d.ts.map +0 -1
  143. package/dist/SyntroChatbot.js +0 -56
  144. package/dist/actionParser.d.ts +0 -15
  145. package/dist/actionParser.d.ts.map +0 -1
  146. package/dist/actionParser.js +0 -52
  147. package/dist/apiClient.d.ts +0 -23
  148. package/dist/apiClient.d.ts.map +0 -1
  149. package/dist/apiClient.js +0 -51
  150. package/dist/cdn.js +0 -37
  151. package/dist/editor.d.ts +0 -17
  152. package/dist/editor.d.ts.map +0 -1
  153. package/dist/editor.js +0 -36
  154. package/dist/tools/bridge.d.ts +0 -26
  155. package/dist/tools/bridge.d.ts.map +0 -1
  156. package/dist/tools/bridge.js +0 -25
  157. package/dist/tools/expanders.d.ts +0 -17
  158. package/dist/tools/expanders.d.ts.map +0 -1
  159. package/dist/tools/expanders.js +0 -41
  160. package/dist/tools/index.d.ts +0 -14
  161. package/dist/tools/index.d.ts.map +0 -1
  162. package/dist/tools/index.js +0 -11
  163. package/dist/tools/registrations/GetContextTool.d.ts +0 -7
  164. package/dist/tools/registrations/GetContextTool.d.ts.map +0 -1
  165. package/dist/tools/registrations/GetContextTool.js +0 -18
  166. package/dist/tools/registrations/ScrollToTool.d.ts +0 -7
  167. package/dist/tools/registrations/ScrollToTool.d.ts.map +0 -1
  168. package/dist/tools/registrations/ScrollToTool.js +0 -38
  169. package/dist/tools/registrations/ShowOverlayTool.d.ts +0 -7
  170. package/dist/tools/registrations/ShowOverlayTool.d.ts.map +0 -1
  171. package/dist/tools/registrations/ShowOverlayTool.js +0 -47
  172. package/dist/tools/registrations/index.d.ts +0 -19
  173. package/dist/tools/registrations/index.d.ts.map +0 -1
  174. package/dist/tools/registrations/index.js +0 -7
  175. package/dist/types.js +0 -6
  176. package/dist/useChat.d.ts +0 -25
  177. package/dist/useChat.d.ts.map +0 -1
  178. package/dist/useChat.js +0 -106
@@ -0,0 +1,175 @@
1
+ /**
2
+ * AdaptiveChatBar — the canvas lid composition for the chat-canvas
3
+ * experience. Renders the bubble-up trail on top and an always-visible
4
+ * input row below.
5
+ *
6
+ * Wiring contract (events out):
7
+ * - `chat-message-sent` ({ text }): the user submitted text via Enter
8
+ * or the send button. The owning code is responsible for pushing
9
+ * this into the conversation history and producing a reply.
10
+ *
11
+ * Wiring contract (props in):
12
+ * - `messages`: the conversation trail, passed straight through to
13
+ * `<adaptive-chat-trail>`.
14
+ * - `placeholder`: input placeholder copy. Defaults to a generic
15
+ * "Ask, find, or navigate…" — the host (typically the slot's lid
16
+ * widget mount) can override to a context-specific string.
17
+ *
18
+ * Light DOM. Glassmorphism is applied at the input-row level so the
19
+ * trail above floats over the host page without chrome. See PRD §4.4.
20
+ */
21
+ import { LitElement } from 'lit';
22
+ import './AdaptiveChatTrail.js';
23
+ import type { InlineTrailWidget, InlineWidgetMounter, TileReceipt, TrailMessage } from './AdaptiveChatTrail.js';
24
+ export declare class AdaptiveChatBar extends LitElement {
25
+ static properties: {
26
+ messages: {
27
+ attribute: boolean;
28
+ };
29
+ placeholder: {
30
+ type: StringConstructor;
31
+ };
32
+ assistantName: {
33
+ type: StringConstructor;
34
+ };
35
+ greeting: {
36
+ type: StringConstructor;
37
+ };
38
+ inFlight: {
39
+ type: BooleanConstructor;
40
+ reflect: boolean;
41
+ };
42
+ thinkingText: {
43
+ attribute: boolean;
44
+ };
45
+ introSuggestion: {
46
+ attribute: boolean;
47
+ };
48
+ forceExpanded: {
49
+ type: BooleanConstructor;
50
+ reflect: boolean;
51
+ };
52
+ maximized: {
53
+ type: BooleanConstructor;
54
+ };
55
+ tileReceipts: {
56
+ attribute: boolean;
57
+ };
58
+ inlineWidgets: {
59
+ attribute: boolean;
60
+ };
61
+ mountInlineWidget: {
62
+ attribute: boolean;
63
+ };
64
+ _input: {
65
+ state: boolean;
66
+ };
67
+ };
68
+ messages: TrailMessage[];
69
+ maximized: boolean;
70
+ tileReceipts: TileReceipt[];
71
+ /** Widgets rendered inline in the trail (reco carousel), sourced from
72
+ * the store's `chat-inline` slot mounts. Forwarded to the trail. */
73
+ inlineWidgets: InlineTrailWidget[];
74
+ /** Registry-backed mounter for inline widgets whose id is not their
75
+ * custom-element tag (product card, comparison, FAQ). Set by the
76
+ * mountable from `runtime.widgets`; forwarded to the trail. */
77
+ mountInlineWidget: InlineWidgetMounter | undefined;
78
+ /**
79
+ * Live reasoning narration from the model — streamed in via
80
+ * AG-UI THINKING_TEXT_MESSAGE_CONTENT events and forwarded by
81
+ * the ChatSession subscription on the host (mountable).
82
+ * Forwarded verbatim to the trail, which renders it in place of
83
+ * the silent loading dots between turns. Empty string when no
84
+ * thinking turn is active.
85
+ */
86
+ thinkingText: string;
87
+ /**
88
+ * Pre-conversation suggestion button — forwarded to the trail's
89
+ * empty-state pane. When the visitor clicks it the trail emits
90
+ * `trail-intro-suggestion`; we catch that here and submit the
91
+ * configured prompt through the normal send path.
92
+ */
93
+ introSuggestion: {
94
+ label: string;
95
+ prompt: string;
96
+ } | undefined;
97
+ /** Pass-through to {@link AdaptiveChatTrail}'s ``forceExpanded`` prop.
98
+ * Hosts that mount the chat-bar in a full-screen surface (mobile
99
+ * panel, agent app, etc.) set this to skip the collapse affordance
100
+ * — there is no smaller state to fall back to. */
101
+ forceExpanded: boolean;
102
+ placeholder: string;
103
+ /**
104
+ * Name shown in the (forceExpanded) header. Defaults to a generic
105
+ * "Assistant". Hosts can override per-workspace (e.g. Vela sets
106
+ * "Vela Concierge") without inventing new SDK surface — it threads
107
+ * through the same mount config the placeholder does.
108
+ */
109
+ assistantName: string;
110
+ /**
111
+ * Initial assistant message shown before any real conversation
112
+ * starts. Renders inside the trail as a phantom assistant chip
113
+ * when messages.length === 0; auto-disappears as soon as the
114
+ * first user message lands. Mirrors ChatAssistantLit's greeting.
115
+ */
116
+ greeting: string | undefined;
117
+ /**
118
+ * Whether a chat round-trip is in flight (request sent, awaiting
119
+ * reply). The single send/stop button morphs accordingly: ↑ when
120
+ * ready, ⏹ when in-flight. Parent owns this state — set true after
121
+ * `chat-message-sent` fires, false when the reply lands or the
122
+ * request is aborted. Enter is inert while in-flight.
123
+ */
124
+ inFlight: boolean;
125
+ _input: string;
126
+ createRenderRoot(): HTMLElement;
127
+ connectedCallback(): void;
128
+ disconnectedCallback(): void;
129
+ private _onInput;
130
+ private _onKeyDown;
131
+ private _onSendOrInterrupt;
132
+ private _onTileReceiptActivate;
133
+ private _onAlertReceiptActivate;
134
+ private _onMaximizeToggle;
135
+ private _send;
136
+ /**
137
+ * Visitor tapped the intro suggestion button in the empty-state
138
+ * trail. Submit the configured prompt through the same channel as
139
+ * a typed message so listeners (mountable → chatSession.send) see
140
+ * a uniform shape — no need for a parallel "suggestion-sent" path.
141
+ * The trail's intro pane auto-disappears the moment the first
142
+ * message lands, so this also closes the empty state in one go.
143
+ */
144
+ private _onIntroSuggestion;
145
+ /**
146
+ * Reply-chip tap that arrived during the run TAIL. Chips render the
147
+ * moment the reply text lands, but `inFlight` (which includes
148
+ * `runActive` — typing events, tool tail, RUN_FINISHED) can lag for
149
+ * seconds. The old `if (this.inFlight) return;` guard silently ATE
150
+ * those taps — the visitor's chosen reply never appeared as their
151
+ * message (live repro, deployed vela 2026-07-08). Now the tap queues
152
+ * (latest wins) and dispatches when `inFlight` clears.
153
+ */
154
+ private _queuedSuggestedReply;
155
+ protected willUpdate(changed: Map<string, unknown>): void;
156
+ /**
157
+ * Visitor tapped an inline `suggest_replies` chip in the trail. Submit
158
+ * the chip text through the SAME `chat-message-sent` channel a typed
159
+ * message uses, so the reply rides the existing send path (mountable →
160
+ * chatSession.send → transport) — no fabricated AG-UI events. The
161
+ * trail clears the chips on its own once the reply lands and a newer
162
+ * assistant turn becomes the latest.
163
+ *
164
+ * A tap while the previous run is still closing is QUEUED, never
165
+ * dropped — see `_queuedSuggestedReply`.
166
+ */
167
+ private _onSuggestedReply;
168
+ render(): import("lit-html").TemplateResult<1>;
169
+ }
170
+ declare global {
171
+ interface HTMLElementTagNameMap {
172
+ 'adaptive-chat-bar': AdaptiveChatBar;
173
+ }
174
+ }
175
+ //# sourceMappingURL=AdaptiveChatBar.d.ts.map
@@ -0,0 +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,EACV,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,YAAY,EACb,MAAM,wBAAwB,CAAC;AAMhC,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,OAAgB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcxB;IAEF,QAAQ,EAAE,YAAY,EAAE,CAAM;IAC9B,SAAS,UAAS;IAClB,YAAY,EAAE,WAAW,EAAE,CAAM;IACjC;yEACqE;IACrE,aAAa,EAAE,iBAAiB,EAAE,CAAM;IACxC;;oEAEgE;IAChE,iBAAiB,EAAE,mBAAmB,GAAG,SAAS,CAAa;IAE/D;;;;;;;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,aAAa,SAA0B;IACvC;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAa;IACzC;;;;;;OAMG;IACH,QAAQ,UAAS;IACjB,MAAM,SAAM;IAEH,gBAAgB,IAAI,WAAW;IAI/B,iBAAiB,IAAI,IAAI;IASzB,oBAAoB,IAAI,IAAI;IAYrC,OAAO,CAAC,QAAQ,CAEd;IAEF,OAAO,CAAC,UAAU,CAShB;IAKF,OAAO,CAAC,kBAAkB,CAUxB;IAEF,OAAO,CAAC,sBAAsB,CAM5B;IAEF,OAAO,CAAC,uBAAuB,CAK7B;IAEF,OAAO,CAAC,iBAAiB,CAEvB;IAEF,OAAO,CAAC,KAAK;IAwBb;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB,CAmBxB;IAEF;;;;;;;;OAQG;IACH,OAAO,CAAC,qBAAqB,CAAuB;cAEjC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAsBlE;;;;;;;;;;OAUG;IACH,OAAO,CAAC,iBAAiB,CAoBvB;IAEO,MAAM;CAkDhB;AA8OD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
@@ -0,0 +1,11 @@
1
+ import {
2
+ AdaptiveChatBar
3
+ } from "./chunk-5W75LR6M.js";
4
+ import "./chunk-EWPPVPJ4.js";
5
+ import "./chunk-HVGQJZMP.js";
6
+ import "./chunk-7WSMNAKW.js";
7
+ import "./chunk-UVKRO5ER.js";
8
+ export {
9
+ AdaptiveChatBar
10
+ };
11
+ //# sourceMappingURL=AdaptiveChatBar.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,80 @@
1
+ /**
2
+ * AdaptiveChatBarMountable — `MountableWidget` adapter that turns the
3
+ * standalone `<adaptive-chat-bar>` Lit element into something the
4
+ * runtime widget registry can mount.
5
+ *
6
+ * Registered as widget id `adaptive-chatbot:chat-bar`. Customers
7
+ * reference it from canvas config — either as a slot's `lid` widget
8
+ * (replaces the launcher when referenced from `slots.drawer.lid`) or
9
+ * as a regular tile widget.
10
+ *
11
+ * The bar is a VIEW. State lives in the singleton `chatSession` —
12
+ * whether the bar mounts in the mini-canvas lid, the drawer lid, or
13
+ * both, they're all views of the same conversation. The mountable:
14
+ * - subscribes to chatSession.subscribe() and pushes state into
15
+ * the bar's `messages` + `inFlight` props on every change
16
+ * - routes the bar's `chat-message-sent` event → chatSession.send()
17
+ * - routes the bar's `chat-interrupt` event → chatSession.interrupt()
18
+ * - bubbles the bar's `canvas-close` event → optional onClose
19
+ * callback (canvas-level concern, not session-level)
20
+ *
21
+ * Props (passed via mountConfig):
22
+ * - `placeholder?: string` — input placeholder copy
23
+ * - `onClose?: () => void` — fires on ✕ click (canvas-level)
24
+ *
25
+ * Note: messages and inFlight are NOT props. They flow from chatSession.
26
+ * A canvas-config author who wants to pre-seed messages should do so
27
+ * via the session directly (e.g. via a startup action) — but typical
28
+ * use is to let the conversation start empty.
29
+ */
30
+ import './AdaptiveChatBar';
31
+ import { type ProductIdentityExtractor } from '@syntrologie/sdk-contracts';
32
+ import type { ObservationEvent, RawEvent } from './observer/allowlist';
33
+ import type { ChatbotWidgetRuntime } from './types.js';
34
+ /**
35
+ * Test-only: drop the warm store singleton (and its hydration latch) so each
36
+ * test can wire a fresh store to its own event bus / registry. Without this,
37
+ * the first test in a file permanently binds the store to ITS bus and the
38
+ * per-instance version dedup silently drops every later test's re-mounts.
39
+ * Mirrors `observer/index.ts` `_resetObserverForTests`.
40
+ */
41
+ export declare function _resetElementStoreForTests(): void;
42
+ export declare function resolveTileWidget(templateId: string): string | undefined;
43
+ export declare function refreshTemplateWidgetMap(uiTemplates: Record<string, unknown> | undefined): void;
44
+ /**
45
+ * Observation enrichment (exported for direct testing).
46
+ *
47
+ * Two passes through the SAME platform-adapter extractor:
48
+ * 1. clicks — resolve product identity from the clicked element chain
49
+ * (original behavior, unchanged);
50
+ * 2. page-level signals (view/scroll/idle/hesitation/hover/nav) with no
51
+ * product — resolve the CURRENT page's product by feeding the extractor
52
+ * a synthetic chain element carrying `location.pathname`. Live-verified
53
+ * gap (FEAT-1783640628): a visitor ON a PDP produces section views with
54
+ * no product identity, which starved every product-shaped downstream
55
+ * (nudge ping-pong detection, the agent's "viewed <product>" context).
56
+ */
57
+ export declare function buildObserverEnrich(runtimeRef: {
58
+ getProductIdentity?: ProductIdentityExtractor;
59
+ }): (ev: ObservationEvent, raw: RawEvent) => ObservationEvent;
60
+ /**
61
+ * Surface reaction to a proactive nudge (FEAT-1783640628). The transport
62
+ * settles the nudge message into the trail and emits `syntro:nudge`; this
63
+ * layer owns what the VISITOR notices on top of that:
64
+ * 1. refresh persisted mounts — the headless turn's mount landed server-side
65
+ * in `mounted_elements`; re-running the replay fetch applies it live
66
+ * through the same hydrate path boot uses (no parallel mount wire shape);
67
+ * 2. a toast via the canvas overlay's notification primitive, so a visitor
68
+ * with the chat closed learns the agent spoke.
69
+ *
70
+ * Exported for direct testing (real DOM listener, fetch-stubbed network).
71
+ */
72
+ export declare function wireNudgeSurface(runtime: ChatbotWidgetRuntime, backendUrl: string): void;
73
+ /** Test seam: reset the nudge-surface once-guard AND detach the listener. */
74
+ export declare function _resetNudgeSurfaceForTests(): void;
75
+ export declare function _resetMountableObserverForTests(): void;
76
+ export declare const AdaptiveChatBarMountable: {
77
+ mount(container: HTMLElement, mountConfig?: Record<string, unknown>): () => void;
78
+ update(container: HTMLElement, mountConfig?: Record<string, unknown>): void;
79
+ };
80
+ //# sourceMappingURL=AdaptiveChatBarMountable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdaptiveChatBarMountable.d.ts","sourceRoot":"","sources":["../src/AdaptiveChatBarMountable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAIL,KAAK,wBAAwB,EAG9B,MAAM,4BAA4B,CAAC;AAiBpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,KAAK,EAAmB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAyHxE;;;;;;GAMG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAIjD;AA6BD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAExE;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,CAgB/F;AA+DD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE;IAC9C,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;CAC/C,GAAG,CAAC,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAE,QAAQ,KAAK,gBAAgB,CAkC5D;AAOD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CA0CxF;AAED,6EAA6E;AAC7E,wBAAgB,0BAA0B,IAAI,IAAI,CAMjD;AAiHD,wBAAgB,+BAA+B,IAAI,IAAI,CAUtD;AAsID,eAAO,MAAM,wBAAwB;qBAClB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI;sBA8F9D,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CAQ5E,CAAC"}
@@ -0,0 +1,2 @@
1
+ import './AdaptiveChatTrail';
2
+ //# sourceMappingURL=AdaptiveChatTrail.anchor-scroll.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdaptiveChatTrail.anchor-scroll.test.d.ts","sourceRoot":"","sources":["../src/AdaptiveChatTrail.anchor-scroll.test.ts"],"names":[],"mappings":"AA0BA,OAAO,qBAAqB,CAAC"}