@syntrologie/adapt-chatbot 2.27.0 → 2.29.0

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 (131) hide show
  1. package/dist/AdaptiveChatBar.composer.test.d.ts +2 -0
  2. package/dist/AdaptiveChatBar.composer.test.d.ts.map +1 -0
  3. package/dist/AdaptiveChatBar.d.ts +212 -0
  4. package/dist/AdaptiveChatBar.d.ts.map +1 -0
  5. package/dist/AdaptiveChatBar.js +11 -0
  6. package/dist/AdaptiveChatBar.js.map +7 -0
  7. package/dist/AdaptiveChatBarMountable.d.ts +82 -0
  8. package/dist/AdaptiveChatBarMountable.d.ts.map +1 -0
  9. package/dist/AdaptiveChatTrail.anchor-scroll.test.d.ts +2 -0
  10. package/dist/AdaptiveChatTrail.anchor-scroll.test.d.ts.map +1 -0
  11. package/dist/AdaptiveChatTrail.d.ts +469 -0
  12. package/dist/AdaptiveChatTrail.d.ts.map +1 -0
  13. package/dist/AdaptiveChatTrail.js +11 -0
  14. package/dist/AdaptiveChatTrail.js.map +7 -0
  15. package/dist/AdaptiveChatTrail.test.d.ts +2 -0
  16. package/dist/AdaptiveChatTrail.test.d.ts.map +1 -0
  17. package/dist/AdaptiveChipsStrip.d.ts +1156 -0
  18. package/dist/AdaptiveChipsStrip.d.ts.map +1 -0
  19. package/dist/AdaptiveChipsStrip.js +11 -0
  20. package/dist/AdaptiveChipsStrip.js.map +7 -0
  21. package/dist/AdaptiveChipsStripMountable.d.ts +24 -0
  22. package/dist/AdaptiveChipsStripMountable.d.ts.map +1 -0
  23. package/dist/ChatAssistantLit.d.ts +22 -50
  24. package/dist/ChatAssistantLit.d.ts.map +1 -1
  25. package/dist/ChatAssistantLit.js +6 -3
  26. package/dist/ChatSession.d.ts +239 -0
  27. package/dist/ChatSession.d.ts.map +1 -0
  28. package/dist/ChatTransport.d.ts +390 -0
  29. package/dist/ChatTransport.d.ts.map +1 -0
  30. package/dist/InlineRegistryWidgetMount.test.d.ts +2 -0
  31. package/dist/InlineRegistryWidgetMount.test.d.ts.map +1 -0
  32. package/dist/InlineWidgetLiveMount.test.d.ts +2 -0
  33. package/dist/InlineWidgetLiveMount.test.d.ts.map +1 -0
  34. package/dist/NavLinkMountable.d.ts +25 -0
  35. package/dist/NavLinkMountable.d.ts.map +1 -0
  36. package/dist/NavLinkMountable.test.d.ts +2 -0
  37. package/dist/NavLinkMountable.test.d.ts.map +1 -0
  38. package/dist/TextAnswerMountable.d.ts +17 -0
  39. package/dist/TextAnswerMountable.d.ts.map +1 -0
  40. package/dist/TextAnswerMountable.test.d.ts +2 -0
  41. package/dist/TextAnswerMountable.test.d.ts.map +1 -0
  42. package/dist/Turnstile.d.ts +83 -0
  43. package/dist/Turnstile.d.ts.map +1 -0
  44. package/dist/chunk-A7RBZLIX.js +1678 -0
  45. package/dist/chunk-A7RBZLIX.js.map +7 -0
  46. package/dist/chunk-EACGDSJI.js +237 -0
  47. package/dist/chunk-EACGDSJI.js.map +7 -0
  48. package/dist/chunk-EWPPVPJ4.js +14 -0
  49. package/dist/chunk-EWPPVPJ4.js.map +7 -0
  50. package/dist/chunk-FXHYE6FY.js +632 -0
  51. package/dist/chunk-FXHYE6FY.js.map +7 -0
  52. package/dist/chunk-OIGVZGSX.js +641 -0
  53. package/dist/chunk-OIGVZGSX.js.map +7 -0
  54. package/dist/chunk-VZIUXXAM.js +4015 -0
  55. package/dist/chunk-VZIUXXAM.js.map +7 -0
  56. package/dist/{chunk-W457NMGD.js → chunk-ZXV4GXMO.js} +2149 -4254
  57. package/dist/chunk-ZXV4GXMO.js.map +7 -0
  58. package/dist/elements/ActionHandler.d.ts +34 -0
  59. package/dist/elements/ActionHandler.d.ts.map +1 -0
  60. package/dist/elements/ElementInstanceStore.d.ts +217 -0
  61. package/dist/elements/ElementInstanceStore.d.ts.map +1 -0
  62. package/dist/elements/ElementInstanceStore.test.d.ts +2 -0
  63. package/dist/elements/ElementInstanceStore.test.d.ts.map +1 -0
  64. package/dist/elements/ElementTypeHandler.d.ts +77 -0
  65. package/dist/elements/ElementTypeHandler.d.ts.map +1 -0
  66. package/dist/elements/ItemHandler.d.ts +60 -0
  67. package/dist/elements/ItemHandler.d.ts.map +1 -0
  68. package/dist/elements/ItemHandler.test.d.ts +2 -0
  69. package/dist/elements/ItemHandler.test.d.ts.map +1 -0
  70. package/dist/elements/TileHandler.d.ts +52 -0
  71. package/dist/elements/TileHandler.d.ts.map +1 -0
  72. package/dist/elements/TileHandler.test.d.ts +2 -0
  73. package/dist/elements/TileHandler.test.d.ts.map +1 -0
  74. package/dist/elements/__tests__/ElementInstanceStore.recall.test.d.ts +2 -0
  75. package/dist/elements/__tests__/ElementInstanceStore.recall.test.d.ts.map +1 -0
  76. package/dist/elements/blockRenderer.d.ts +46 -0
  77. package/dist/elements/blockRenderer.d.ts.map +1 -0
  78. package/dist/elements/blockRenderer.test.d.ts +13 -0
  79. package/dist/elements/blockRenderer.test.d.ts.map +1 -0
  80. package/dist/elements/blocks.d.ts +58 -0
  81. package/dist/elements/blocks.d.ts.map +1 -0
  82. package/dist/elements/envelope.d.ts +24 -0
  83. package/dist/elements/envelope.d.ts.map +1 -0
  84. package/dist/elements/fetcher.d.ts +40 -0
  85. package/dist/elements/fetcher.d.ts.map +1 -0
  86. package/dist/elements/index.d.ts +33 -0
  87. package/dist/elements/index.d.ts.map +1 -0
  88. package/dist/elements/store-singleton.d.ts +4 -0
  89. package/dist/elements/store-singleton.d.ts.map +1 -0
  90. package/dist/elements/types.d.ts +110 -0
  91. package/dist/elements/types.d.ts.map +1 -0
  92. package/dist/observer/__tests__/allowlist.test.d.ts +9 -0
  93. package/dist/observer/__tests__/allowlist.test.d.ts.map +1 -0
  94. package/dist/observer/__tests__/bus-translate.test.d.ts +16 -0
  95. package/dist/observer/__tests__/bus-translate.test.d.ts.map +1 -0
  96. package/dist/observer/__tests__/lifecycle.test.d.ts +2 -0
  97. package/dist/observer/__tests__/lifecycle.test.d.ts.map +1 -0
  98. package/dist/observer/__tests__/observer-enrich.test.d.ts +10 -0
  99. package/dist/observer/__tests__/observer-enrich.test.d.ts.map +1 -0
  100. package/dist/observer/__tests__/observer-isolation.test.d.ts +13 -0
  101. package/dist/observer/__tests__/observer-isolation.test.d.ts.map +1 -0
  102. package/dist/observer/__tests__/queue.test.d.ts +2 -0
  103. package/dist/observer/__tests__/queue.test.d.ts.map +1 -0
  104. package/dist/observer/__tests__/transport.test.d.ts +2 -0
  105. package/dist/observer/__tests__/transport.test.d.ts.map +1 -0
  106. package/dist/observer/allowlist.d.ts +30 -0
  107. package/dist/observer/allowlist.d.ts.map +1 -0
  108. package/dist/observer/bus-translate.d.ts +33 -0
  109. package/dist/observer/bus-translate.d.ts.map +1 -0
  110. package/dist/observer/index.d.ts +44 -0
  111. package/dist/observer/index.d.ts.map +1 -0
  112. package/dist/observer/queue.d.ts +63 -0
  113. package/dist/observer/queue.d.ts.map +1 -0
  114. package/dist/observer/transport.d.ts +27 -0
  115. package/dist/observer/transport.d.ts.map +1 -0
  116. package/dist/personas.d.ts +30 -0
  117. package/dist/personas.d.ts.map +1 -0
  118. package/dist/runtime.d.ts +9 -0
  119. package/dist/runtime.d.ts.map +1 -1
  120. package/dist/runtime.js +2345 -3
  121. package/dist/runtime.js.map +4 -4
  122. package/dist/schema.d.ts +3426 -17
  123. package/dist/schema.d.ts.map +1 -1
  124. package/dist/schema.js +213 -0
  125. package/dist/schema.js.map +2 -2
  126. package/dist/test/setup.d.ts +1 -0
  127. package/dist/test/setup.d.ts.map +1 -0
  128. package/dist/types.d.ts +46 -2
  129. package/dist/types.d.ts.map +1 -1
  130. package/package.json +17 -1
  131. package/dist/chunk-W457NMGD.js.map +0 -7
@@ -0,0 +1,1156 @@
1
+ /**
2
+ * AdaptiveChipsStrip — the suggested-chips tile kind.
3
+ *
4
+ * A horizontally scrollable strip of chips. Each chip carries a title
5
+ * and a typed payload. Clicking a chip mounts its payload widget in a
6
+ * chromed drawer directly below the strip; clicking again (or the
7
+ * payload's close button) collapses it. Only one chip is open at a
8
+ * time per strip.
9
+ *
10
+ * Payload rendering goes through the runtime widget registry — the
11
+ * payload is a `{ widget, props? }` reference (same shape as
12
+ * `slots.drawer.lid`). Click → strip looks the widget id up in
13
+ * `runtime.widgets`, mounts it into the drawer body, unmounts on
14
+ * close. No resolver map, no per-customer JS — the same registry
15
+ * that mounts tile widgets handles chip payloads.
16
+ *
17
+ * Built-in payload widgets (registered by this adaptive):
18
+ * - `adaptive-chatbot:text-answer` — single paragraph of text
19
+ *
20
+ * Customers ship their own widgets through the standard adaptive
21
+ * registration path (each adaptive's `runtime.widgets` list). LLM-
22
+ * authored configs reference them by id; the widget owns its props
23
+ * schema. No new vocabulary per chip — same as every other widget
24
+ * in the SDK.
25
+ *
26
+ * Light DOM. The strip itself is chromeless per the PRD; the payload
27
+ * drawer below is *always* chromed (PRD §6.7) — the chromed boundary
28
+ * is what visually links the open chip to its content.
29
+ *
30
+ * See PRD §4.5 (the suggested-chips pattern) for the canonical UX.
31
+ */
32
+ import { LitElement, type TemplateResult } from 'lit';
33
+ import { z } from 'zod';
34
+ /**
35
+ * Structural type for just the runtime surfaces this strip uses.
36
+ * Avoids a hard dependency on @syntrologie/runtime-sdk while staying
37
+ * compatible with the real `SmartCanvasRuntime` shape.
38
+ *
39
+ * `events.subscribe` is optional — present when running inside the full
40
+ * canvas runtime where the chips strip wants to receive LLM-authored
41
+ * chips via `element.compositional_append`. Absent in standalone test
42
+ * harnesses; the strip falls back to hand-authored chips only.
43
+ */
44
+ interface ChipsStripRuntime {
45
+ widgets: {
46
+ has: (id: string) => boolean;
47
+ mount: (id: string, container: HTMLElement, props?: Record<string, unknown>) => {
48
+ unmount: () => void;
49
+ update?: (props?: Record<string, unknown>) => void;
50
+ };
51
+ };
52
+ events?: {
53
+ /** Used to ping the store with a replay request when the chip strip
54
+ * (re)mounts — see `_subscribeCompositional`. */
55
+ publish?: (name: string, props?: Record<string, unknown>) => void;
56
+ subscribe?: (handler: (event: {
57
+ name: string;
58
+ props?: Record<string, unknown>;
59
+ }) => void) => () => void;
60
+ };
61
+ }
62
+ declare const ChipPayloadZ: z.ZodObject<{
63
+ widget: z.ZodString;
64
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
65
+ }, "strict", z.ZodTypeAny, {
66
+ widget: string;
67
+ props?: Record<string, unknown> | undefined;
68
+ }, {
69
+ widget: string;
70
+ props?: Record<string, unknown> | undefined;
71
+ }>;
72
+ /**
73
+ * Schema for a single suggestion chip (compositional action).
74
+ *
75
+ * Mirrors the `faq:question` pattern: discriminated by `kind`, body in
76
+ * `config`, optional `triggerWhen` for per-chip conditional visibility,
77
+ * optional `notify` for a toast when the chip first becomes relevant,
78
+ * plus the standard `AuthoringFieldsZ` (id/title/description/validation —
79
+ * stripped server-side before serving to the runtime).
80
+ */
81
+ export declare const SuggestionChipSchema: z.ZodEffects<z.ZodObject<{
82
+ kind: z.ZodLiteral<"suggestions:chip">;
83
+ config: z.ZodObject<{
84
+ id: z.ZodString;
85
+ title: z.ZodString;
86
+ payload: z.ZodObject<{
87
+ widget: z.ZodString;
88
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
89
+ }, "strict", z.ZodTypeAny, {
90
+ widget: string;
91
+ props?: Record<string, unknown> | undefined;
92
+ }, {
93
+ widget: string;
94
+ props?: Record<string, unknown> | undefined;
95
+ }>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ id: string;
98
+ title: string;
99
+ payload: {
100
+ widget: string;
101
+ props?: Record<string, unknown> | undefined;
102
+ };
103
+ }, {
104
+ id: string;
105
+ title: string;
106
+ payload: {
107
+ widget: string;
108
+ props?: Record<string, unknown> | undefined;
109
+ };
110
+ }>;
111
+ triggerWhen: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
112
+ type: z.ZodLiteral<"rules">;
113
+ rules: z.ZodArray<z.ZodObject<{
114
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
115
+ type: z.ZodLiteral<"page_url">;
116
+ url: z.ZodString;
117
+ }, "strip", z.ZodTypeAny, {
118
+ type: "page_url";
119
+ url: string;
120
+ }, {
121
+ type: "page_url";
122
+ url: string;
123
+ }>, z.ZodObject<{
124
+ type: z.ZodLiteral<"route">;
125
+ routeId: z.ZodString;
126
+ }, "strip", z.ZodTypeAny, {
127
+ type: "route";
128
+ routeId: string;
129
+ }, {
130
+ type: "route";
131
+ routeId: string;
132
+ }>, z.ZodObject<{
133
+ type: z.ZodLiteral<"anchor_visible">;
134
+ anchorId: z.ZodString;
135
+ state: z.ZodEnum<["visible", "present", "absent"]>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ type: "anchor_visible";
138
+ anchorId: string;
139
+ state: "visible" | "present" | "absent";
140
+ }, {
141
+ type: "anchor_visible";
142
+ anchorId: string;
143
+ state: "visible" | "present" | "absent";
144
+ }>, z.ZodObject<{
145
+ type: z.ZodLiteral<"event_occurred">;
146
+ eventName: z.ZodString;
147
+ withinMs: z.ZodOptional<z.ZodNumber>;
148
+ }, "strip", z.ZodTypeAny, {
149
+ type: "event_occurred";
150
+ eventName: string;
151
+ withinMs?: number | undefined;
152
+ }, {
153
+ type: "event_occurred";
154
+ eventName: string;
155
+ withinMs?: number | undefined;
156
+ }>, z.ZodObject<{
157
+ type: z.ZodLiteral<"state_equals">;
158
+ key: z.ZodString;
159
+ value: z.ZodUnknown;
160
+ }, "strip", z.ZodTypeAny, {
161
+ type: "state_equals";
162
+ key: string;
163
+ value?: unknown;
164
+ }, {
165
+ type: "state_equals";
166
+ key: string;
167
+ value?: unknown;
168
+ }>, z.ZodObject<{
169
+ type: z.ZodLiteral<"viewport">;
170
+ minWidth: z.ZodOptional<z.ZodNumber>;
171
+ maxWidth: z.ZodOptional<z.ZodNumber>;
172
+ minHeight: z.ZodOptional<z.ZodNumber>;
173
+ maxHeight: z.ZodOptional<z.ZodNumber>;
174
+ }, "strip", z.ZodTypeAny, {
175
+ type: "viewport";
176
+ minWidth?: number | undefined;
177
+ maxWidth?: number | undefined;
178
+ minHeight?: number | undefined;
179
+ maxHeight?: number | undefined;
180
+ }, {
181
+ type: "viewport";
182
+ minWidth?: number | undefined;
183
+ maxWidth?: number | undefined;
184
+ minHeight?: number | undefined;
185
+ maxHeight?: number | undefined;
186
+ }>, z.ZodObject<{
187
+ type: z.ZodLiteral<"session_metric">;
188
+ key: z.ZodEnum<["time_on_page", "page_views", "scroll_depth"]>;
189
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
190
+ threshold: z.ZodNumber;
191
+ }, "strip", z.ZodTypeAny, {
192
+ type: "session_metric";
193
+ key: "time_on_page" | "page_views" | "scroll_depth";
194
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
195
+ threshold: number;
196
+ }, {
197
+ type: "session_metric";
198
+ key: "time_on_page" | "page_views" | "scroll_depth";
199
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
200
+ threshold: number;
201
+ }>, z.ZodObject<{
202
+ type: z.ZodLiteral<"dismissed">;
203
+ key: z.ZodString;
204
+ inverted: z.ZodOptional<z.ZodBoolean>;
205
+ }, "strip", z.ZodTypeAny, {
206
+ type: "dismissed";
207
+ key: string;
208
+ inverted?: boolean | undefined;
209
+ }, {
210
+ type: "dismissed";
211
+ key: string;
212
+ inverted?: boolean | undefined;
213
+ }>, z.ZodObject<{
214
+ type: z.ZodLiteral<"cooldown_active">;
215
+ key: z.ZodString;
216
+ inverted: z.ZodOptional<z.ZodBoolean>;
217
+ }, "strip", z.ZodTypeAny, {
218
+ type: "cooldown_active";
219
+ key: string;
220
+ inverted?: boolean | undefined;
221
+ }, {
222
+ type: "cooldown_active";
223
+ key: string;
224
+ inverted?: boolean | undefined;
225
+ }>, z.ZodObject<{
226
+ type: z.ZodLiteral<"frequency_limit">;
227
+ key: z.ZodString;
228
+ limit: z.ZodNumber;
229
+ inverted: z.ZodOptional<z.ZodBoolean>;
230
+ }, "strip", z.ZodTypeAny, {
231
+ type: "frequency_limit";
232
+ key: string;
233
+ limit: number;
234
+ inverted?: boolean | undefined;
235
+ }, {
236
+ type: "frequency_limit";
237
+ key: string;
238
+ limit: number;
239
+ inverted?: boolean | undefined;
240
+ }>, z.ZodObject<{
241
+ type: z.ZodLiteral<"event_count">;
242
+ key: z.ZodString;
243
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
244
+ count: z.ZodNumber;
245
+ withinMs: z.ZodOptional<z.ZodNumber>;
246
+ counter: z.ZodOptional<z.ZodObject<{
247
+ events: z.ZodArray<z.ZodEnum<["ui.click", "ui.scroll", "ui.input", "ui.change", "ui.submit", "ui.hover", "ui.idle", "ui.scroll_thrash", "ui.focus_bounce", "ui.hesitate", "ui.rage_click", "nav.page_view", "nav.page_leave"]>, "many">;
248
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
249
+ equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
250
+ contains: z.ZodOptional<z.ZodString>;
251
+ }, "strip", z.ZodTypeAny, {
252
+ equals?: string | number | boolean | undefined;
253
+ contains?: string | undefined;
254
+ }, {
255
+ equals?: string | number | boolean | undefined;
256
+ contains?: string | undefined;
257
+ }>, {
258
+ equals?: string | number | boolean | undefined;
259
+ contains?: string | undefined;
260
+ }, {
261
+ equals?: string | number | boolean | undefined;
262
+ contains?: string | undefined;
263
+ }>>>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
266
+ match?: Record<string, {
267
+ equals?: string | number | boolean | undefined;
268
+ contains?: string | undefined;
269
+ }> | undefined;
270
+ }, {
271
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
272
+ match?: Record<string, {
273
+ equals?: string | number | boolean | undefined;
274
+ contains?: string | undefined;
275
+ }> | undefined;
276
+ }>>;
277
+ }, "strip", z.ZodTypeAny, {
278
+ type: "event_count";
279
+ key: string;
280
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
281
+ count: number;
282
+ withinMs?: number | undefined;
283
+ counter?: {
284
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
285
+ match?: Record<string, {
286
+ equals?: string | number | boolean | undefined;
287
+ contains?: string | undefined;
288
+ }> | undefined;
289
+ } | undefined;
290
+ }, {
291
+ type: "event_count";
292
+ key: string;
293
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
294
+ count: number;
295
+ withinMs?: number | undefined;
296
+ counter?: {
297
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
298
+ match?: Record<string, {
299
+ equals?: string | number | boolean | undefined;
300
+ contains?: string | undefined;
301
+ }> | undefined;
302
+ } | undefined;
303
+ }>]>, "many">;
304
+ value: z.ZodUnknown;
305
+ }, "strip", z.ZodTypeAny, {
306
+ conditions: ({
307
+ type: "page_url";
308
+ url: string;
309
+ } | {
310
+ type: "route";
311
+ routeId: string;
312
+ } | {
313
+ type: "anchor_visible";
314
+ anchorId: string;
315
+ state: "visible" | "present" | "absent";
316
+ } | {
317
+ type: "event_occurred";
318
+ eventName: string;
319
+ withinMs?: number | undefined;
320
+ } | {
321
+ type: "state_equals";
322
+ key: string;
323
+ value?: unknown;
324
+ } | {
325
+ type: "viewport";
326
+ minWidth?: number | undefined;
327
+ maxWidth?: number | undefined;
328
+ minHeight?: number | undefined;
329
+ maxHeight?: number | undefined;
330
+ } | {
331
+ type: "session_metric";
332
+ key: "time_on_page" | "page_views" | "scroll_depth";
333
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
334
+ threshold: number;
335
+ } | {
336
+ type: "dismissed";
337
+ key: string;
338
+ inverted?: boolean | undefined;
339
+ } | {
340
+ type: "cooldown_active";
341
+ key: string;
342
+ inverted?: boolean | undefined;
343
+ } | {
344
+ type: "frequency_limit";
345
+ key: string;
346
+ limit: number;
347
+ inverted?: boolean | undefined;
348
+ } | {
349
+ type: "event_count";
350
+ key: string;
351
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
352
+ count: number;
353
+ withinMs?: number | undefined;
354
+ counter?: {
355
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
356
+ match?: Record<string, {
357
+ equals?: string | number | boolean | undefined;
358
+ contains?: string | undefined;
359
+ }> | undefined;
360
+ } | undefined;
361
+ })[];
362
+ value?: unknown;
363
+ }, {
364
+ conditions: ({
365
+ type: "page_url";
366
+ url: string;
367
+ } | {
368
+ type: "route";
369
+ routeId: string;
370
+ } | {
371
+ type: "anchor_visible";
372
+ anchorId: string;
373
+ state: "visible" | "present" | "absent";
374
+ } | {
375
+ type: "event_occurred";
376
+ eventName: string;
377
+ withinMs?: number | undefined;
378
+ } | {
379
+ type: "state_equals";
380
+ key: string;
381
+ value?: unknown;
382
+ } | {
383
+ type: "viewport";
384
+ minWidth?: number | undefined;
385
+ maxWidth?: number | undefined;
386
+ minHeight?: number | undefined;
387
+ maxHeight?: number | undefined;
388
+ } | {
389
+ type: "session_metric";
390
+ key: "time_on_page" | "page_views" | "scroll_depth";
391
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
392
+ threshold: number;
393
+ } | {
394
+ type: "dismissed";
395
+ key: string;
396
+ inverted?: boolean | undefined;
397
+ } | {
398
+ type: "cooldown_active";
399
+ key: string;
400
+ inverted?: boolean | undefined;
401
+ } | {
402
+ type: "frequency_limit";
403
+ key: string;
404
+ limit: number;
405
+ inverted?: boolean | undefined;
406
+ } | {
407
+ type: "event_count";
408
+ key: string;
409
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
410
+ count: number;
411
+ withinMs?: number | undefined;
412
+ counter?: {
413
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
414
+ match?: Record<string, {
415
+ equals?: string | number | boolean | undefined;
416
+ contains?: string | undefined;
417
+ }> | undefined;
418
+ } | undefined;
419
+ })[];
420
+ value?: unknown;
421
+ }>, "many">;
422
+ default: z.ZodUnknown;
423
+ }, "strip", z.ZodTypeAny, {
424
+ type: "rules";
425
+ rules: {
426
+ conditions: ({
427
+ type: "page_url";
428
+ url: string;
429
+ } | {
430
+ type: "route";
431
+ routeId: string;
432
+ } | {
433
+ type: "anchor_visible";
434
+ anchorId: string;
435
+ state: "visible" | "present" | "absent";
436
+ } | {
437
+ type: "event_occurred";
438
+ eventName: string;
439
+ withinMs?: number | undefined;
440
+ } | {
441
+ type: "state_equals";
442
+ key: string;
443
+ value?: unknown;
444
+ } | {
445
+ type: "viewport";
446
+ minWidth?: number | undefined;
447
+ maxWidth?: number | undefined;
448
+ minHeight?: number | undefined;
449
+ maxHeight?: number | undefined;
450
+ } | {
451
+ type: "session_metric";
452
+ key: "time_on_page" | "page_views" | "scroll_depth";
453
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
454
+ threshold: number;
455
+ } | {
456
+ type: "dismissed";
457
+ key: string;
458
+ inverted?: boolean | undefined;
459
+ } | {
460
+ type: "cooldown_active";
461
+ key: string;
462
+ inverted?: boolean | undefined;
463
+ } | {
464
+ type: "frequency_limit";
465
+ key: string;
466
+ limit: number;
467
+ inverted?: boolean | undefined;
468
+ } | {
469
+ type: "event_count";
470
+ key: string;
471
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
472
+ count: number;
473
+ withinMs?: number | undefined;
474
+ counter?: {
475
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
476
+ match?: Record<string, {
477
+ equals?: string | number | boolean | undefined;
478
+ contains?: string | undefined;
479
+ }> | undefined;
480
+ } | undefined;
481
+ })[];
482
+ value?: unknown;
483
+ }[];
484
+ default?: unknown;
485
+ }, {
486
+ type: "rules";
487
+ rules: {
488
+ conditions: ({
489
+ type: "page_url";
490
+ url: string;
491
+ } | {
492
+ type: "route";
493
+ routeId: string;
494
+ } | {
495
+ type: "anchor_visible";
496
+ anchorId: string;
497
+ state: "visible" | "present" | "absent";
498
+ } | {
499
+ type: "event_occurred";
500
+ eventName: string;
501
+ withinMs?: number | undefined;
502
+ } | {
503
+ type: "state_equals";
504
+ key: string;
505
+ value?: unknown;
506
+ } | {
507
+ type: "viewport";
508
+ minWidth?: number | undefined;
509
+ maxWidth?: number | undefined;
510
+ minHeight?: number | undefined;
511
+ maxHeight?: number | undefined;
512
+ } | {
513
+ type: "session_metric";
514
+ key: "time_on_page" | "page_views" | "scroll_depth";
515
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
516
+ threshold: number;
517
+ } | {
518
+ type: "dismissed";
519
+ key: string;
520
+ inverted?: boolean | undefined;
521
+ } | {
522
+ type: "cooldown_active";
523
+ key: string;
524
+ inverted?: boolean | undefined;
525
+ } | {
526
+ type: "frequency_limit";
527
+ key: string;
528
+ limit: number;
529
+ inverted?: boolean | undefined;
530
+ } | {
531
+ type: "event_count";
532
+ key: string;
533
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
534
+ count: number;
535
+ withinMs?: number | undefined;
536
+ counter?: {
537
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
538
+ match?: Record<string, {
539
+ equals?: string | number | boolean | undefined;
540
+ contains?: string | undefined;
541
+ }> | undefined;
542
+ } | undefined;
543
+ })[];
544
+ value?: unknown;
545
+ }[];
546
+ default?: unknown;
547
+ }>, z.ZodObject<{
548
+ type: z.ZodLiteral<"score">;
549
+ field: z.ZodString;
550
+ threshold: z.ZodNumber;
551
+ above: z.ZodUnknown;
552
+ below: z.ZodUnknown;
553
+ }, "strip", z.ZodTypeAny, {
554
+ type: "score";
555
+ threshold: number;
556
+ field: string;
557
+ above?: unknown;
558
+ below?: unknown;
559
+ }, {
560
+ type: "score";
561
+ threshold: number;
562
+ field: string;
563
+ above?: unknown;
564
+ below?: unknown;
565
+ }>, z.ZodObject<{
566
+ type: z.ZodLiteral<"model">;
567
+ modelId: z.ZodString;
568
+ inputs: z.ZodArray<z.ZodString, "many">;
569
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
570
+ default: z.ZodUnknown;
571
+ }, "strip", z.ZodTypeAny, {
572
+ type: "model";
573
+ modelId: string;
574
+ inputs: string[];
575
+ outputMapping: Record<string, unknown>;
576
+ default?: unknown;
577
+ }, {
578
+ type: "model";
579
+ modelId: string;
580
+ inputs: string[];
581
+ outputMapping: Record<string, unknown>;
582
+ default?: unknown;
583
+ }>, z.ZodObject<{
584
+ type: z.ZodLiteral<"external">;
585
+ endpoint: z.ZodString;
586
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
587
+ default: z.ZodUnknown;
588
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
589
+ }, "strip", z.ZodTypeAny, {
590
+ type: "external";
591
+ endpoint: string;
592
+ default?: unknown;
593
+ method?: "GET" | "POST" | undefined;
594
+ timeoutMs?: number | undefined;
595
+ }, {
596
+ type: "external";
597
+ endpoint: string;
598
+ default?: unknown;
599
+ method?: "GET" | "POST" | undefined;
600
+ timeoutMs?: number | undefined;
601
+ }>]>>>;
602
+ notify: z.ZodOptional<z.ZodNullable<z.ZodObject<{
603
+ title: z.ZodOptional<z.ZodString>;
604
+ body: z.ZodOptional<z.ZodString>;
605
+ icon: z.ZodOptional<z.ZodString>;
606
+ }, "strip", z.ZodTypeAny, {
607
+ title?: string | undefined;
608
+ body?: string | undefined;
609
+ icon?: string | undefined;
610
+ }, {
611
+ title?: string | undefined;
612
+ body?: string | undefined;
613
+ icon?: string | undefined;
614
+ }>>>;
615
+ id: z.ZodOptional<z.ZodString>;
616
+ title: z.ZodOptional<z.ZodString>;
617
+ description: z.ZodOptional<z.ZodString>;
618
+ validation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
619
+ }, "strip", z.ZodTypeAny, {
620
+ config: {
621
+ id: string;
622
+ title: string;
623
+ payload: {
624
+ widget: string;
625
+ props?: Record<string, unknown> | undefined;
626
+ };
627
+ };
628
+ kind: "suggestions:chip";
629
+ id?: string | undefined;
630
+ title?: string | undefined;
631
+ validation?: string[] | undefined;
632
+ triggerWhen?: {
633
+ type: "rules";
634
+ rules: {
635
+ conditions: ({
636
+ type: "page_url";
637
+ url: string;
638
+ } | {
639
+ type: "route";
640
+ routeId: string;
641
+ } | {
642
+ type: "anchor_visible";
643
+ anchorId: string;
644
+ state: "visible" | "present" | "absent";
645
+ } | {
646
+ type: "event_occurred";
647
+ eventName: string;
648
+ withinMs?: number | undefined;
649
+ } | {
650
+ type: "state_equals";
651
+ key: string;
652
+ value?: unknown;
653
+ } | {
654
+ type: "viewport";
655
+ minWidth?: number | undefined;
656
+ maxWidth?: number | undefined;
657
+ minHeight?: number | undefined;
658
+ maxHeight?: number | undefined;
659
+ } | {
660
+ type: "session_metric";
661
+ key: "time_on_page" | "page_views" | "scroll_depth";
662
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
663
+ threshold: number;
664
+ } | {
665
+ type: "dismissed";
666
+ key: string;
667
+ inverted?: boolean | undefined;
668
+ } | {
669
+ type: "cooldown_active";
670
+ key: string;
671
+ inverted?: boolean | undefined;
672
+ } | {
673
+ type: "frequency_limit";
674
+ key: string;
675
+ limit: number;
676
+ inverted?: boolean | undefined;
677
+ } | {
678
+ type: "event_count";
679
+ key: string;
680
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
681
+ count: number;
682
+ withinMs?: number | undefined;
683
+ counter?: {
684
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
685
+ match?: Record<string, {
686
+ equals?: string | number | boolean | undefined;
687
+ contains?: string | undefined;
688
+ }> | undefined;
689
+ } | undefined;
690
+ })[];
691
+ value?: unknown;
692
+ }[];
693
+ default?: unknown;
694
+ } | {
695
+ type: "score";
696
+ threshold: number;
697
+ field: string;
698
+ above?: unknown;
699
+ below?: unknown;
700
+ } | {
701
+ type: "model";
702
+ modelId: string;
703
+ inputs: string[];
704
+ outputMapping: Record<string, unknown>;
705
+ default?: unknown;
706
+ } | {
707
+ type: "external";
708
+ endpoint: string;
709
+ default?: unknown;
710
+ method?: "GET" | "POST" | undefined;
711
+ timeoutMs?: number | undefined;
712
+ } | null | undefined;
713
+ notify?: {
714
+ title?: string | undefined;
715
+ body?: string | undefined;
716
+ icon?: string | undefined;
717
+ } | null | undefined;
718
+ description?: string | undefined;
719
+ }, {
720
+ config: {
721
+ id: string;
722
+ title: string;
723
+ payload: {
724
+ widget: string;
725
+ props?: Record<string, unknown> | undefined;
726
+ };
727
+ };
728
+ kind: "suggestions:chip";
729
+ id?: string | undefined;
730
+ title?: string | undefined;
731
+ validation?: string[] | undefined;
732
+ triggerWhen?: {
733
+ type: "rules";
734
+ rules: {
735
+ conditions: ({
736
+ type: "page_url";
737
+ url: string;
738
+ } | {
739
+ type: "route";
740
+ routeId: string;
741
+ } | {
742
+ type: "anchor_visible";
743
+ anchorId: string;
744
+ state: "visible" | "present" | "absent";
745
+ } | {
746
+ type: "event_occurred";
747
+ eventName: string;
748
+ withinMs?: number | undefined;
749
+ } | {
750
+ type: "state_equals";
751
+ key: string;
752
+ value?: unknown;
753
+ } | {
754
+ type: "viewport";
755
+ minWidth?: number | undefined;
756
+ maxWidth?: number | undefined;
757
+ minHeight?: number | undefined;
758
+ maxHeight?: number | undefined;
759
+ } | {
760
+ type: "session_metric";
761
+ key: "time_on_page" | "page_views" | "scroll_depth";
762
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
763
+ threshold: number;
764
+ } | {
765
+ type: "dismissed";
766
+ key: string;
767
+ inverted?: boolean | undefined;
768
+ } | {
769
+ type: "cooldown_active";
770
+ key: string;
771
+ inverted?: boolean | undefined;
772
+ } | {
773
+ type: "frequency_limit";
774
+ key: string;
775
+ limit: number;
776
+ inverted?: boolean | undefined;
777
+ } | {
778
+ type: "event_count";
779
+ key: string;
780
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
781
+ count: number;
782
+ withinMs?: number | undefined;
783
+ counter?: {
784
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
785
+ match?: Record<string, {
786
+ equals?: string | number | boolean | undefined;
787
+ contains?: string | undefined;
788
+ }> | undefined;
789
+ } | undefined;
790
+ })[];
791
+ value?: unknown;
792
+ }[];
793
+ default?: unknown;
794
+ } | {
795
+ type: "score";
796
+ threshold: number;
797
+ field: string;
798
+ above?: unknown;
799
+ below?: unknown;
800
+ } | {
801
+ type: "model";
802
+ modelId: string;
803
+ inputs: string[];
804
+ outputMapping: Record<string, unknown>;
805
+ default?: unknown;
806
+ } | {
807
+ type: "external";
808
+ endpoint: string;
809
+ default?: unknown;
810
+ method?: "GET" | "POST" | undefined;
811
+ timeoutMs?: number | undefined;
812
+ } | null | undefined;
813
+ notify?: {
814
+ title?: string | undefined;
815
+ body?: string | undefined;
816
+ icon?: string | undefined;
817
+ } | null | undefined;
818
+ description?: string | undefined;
819
+ }>, {
820
+ config: {
821
+ id: string;
822
+ title: string;
823
+ payload: {
824
+ widget: string;
825
+ props?: Record<string, unknown> | undefined;
826
+ };
827
+ };
828
+ kind: "suggestions:chip";
829
+ id?: string | undefined;
830
+ title?: string | undefined;
831
+ validation?: string[] | undefined;
832
+ triggerWhen?: {
833
+ type: "rules";
834
+ rules: {
835
+ conditions: ({
836
+ type: "page_url";
837
+ url: string;
838
+ } | {
839
+ type: "route";
840
+ routeId: string;
841
+ } | {
842
+ type: "anchor_visible";
843
+ anchorId: string;
844
+ state: "visible" | "present" | "absent";
845
+ } | {
846
+ type: "event_occurred";
847
+ eventName: string;
848
+ withinMs?: number | undefined;
849
+ } | {
850
+ type: "state_equals";
851
+ key: string;
852
+ value?: unknown;
853
+ } | {
854
+ type: "viewport";
855
+ minWidth?: number | undefined;
856
+ maxWidth?: number | undefined;
857
+ minHeight?: number | undefined;
858
+ maxHeight?: number | undefined;
859
+ } | {
860
+ type: "session_metric";
861
+ key: "time_on_page" | "page_views" | "scroll_depth";
862
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
863
+ threshold: number;
864
+ } | {
865
+ type: "dismissed";
866
+ key: string;
867
+ inverted?: boolean | undefined;
868
+ } | {
869
+ type: "cooldown_active";
870
+ key: string;
871
+ inverted?: boolean | undefined;
872
+ } | {
873
+ type: "frequency_limit";
874
+ key: string;
875
+ limit: number;
876
+ inverted?: boolean | undefined;
877
+ } | {
878
+ type: "event_count";
879
+ key: string;
880
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
881
+ count: number;
882
+ withinMs?: number | undefined;
883
+ counter?: {
884
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
885
+ match?: Record<string, {
886
+ equals?: string | number | boolean | undefined;
887
+ contains?: string | undefined;
888
+ }> | undefined;
889
+ } | undefined;
890
+ })[];
891
+ value?: unknown;
892
+ }[];
893
+ default?: unknown;
894
+ } | {
895
+ type: "score";
896
+ threshold: number;
897
+ field: string;
898
+ above?: unknown;
899
+ below?: unknown;
900
+ } | {
901
+ type: "model";
902
+ modelId: string;
903
+ inputs: string[];
904
+ outputMapping: Record<string, unknown>;
905
+ default?: unknown;
906
+ } | {
907
+ type: "external";
908
+ endpoint: string;
909
+ default?: unknown;
910
+ method?: "GET" | "POST" | undefined;
911
+ timeoutMs?: number | undefined;
912
+ } | null | undefined;
913
+ notify?: {
914
+ title?: string | undefined;
915
+ body?: string | undefined;
916
+ icon?: string | undefined;
917
+ } | null | undefined;
918
+ description?: string | undefined;
919
+ }, {
920
+ config: {
921
+ id: string;
922
+ title: string;
923
+ payload: {
924
+ widget: string;
925
+ props?: Record<string, unknown> | undefined;
926
+ };
927
+ };
928
+ kind: "suggestions:chip";
929
+ id?: string | undefined;
930
+ title?: string | undefined;
931
+ validation?: string[] | undefined;
932
+ triggerWhen?: {
933
+ type: "rules";
934
+ rules: {
935
+ conditions: ({
936
+ type: "page_url";
937
+ url: string;
938
+ } | {
939
+ type: "route";
940
+ routeId: string;
941
+ } | {
942
+ type: "anchor_visible";
943
+ anchorId: string;
944
+ state: "visible" | "present" | "absent";
945
+ } | {
946
+ type: "event_occurred";
947
+ eventName: string;
948
+ withinMs?: number | undefined;
949
+ } | {
950
+ type: "state_equals";
951
+ key: string;
952
+ value?: unknown;
953
+ } | {
954
+ type: "viewport";
955
+ minWidth?: number | undefined;
956
+ maxWidth?: number | undefined;
957
+ minHeight?: number | undefined;
958
+ maxHeight?: number | undefined;
959
+ } | {
960
+ type: "session_metric";
961
+ key: "time_on_page" | "page_views" | "scroll_depth";
962
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
963
+ threshold: number;
964
+ } | {
965
+ type: "dismissed";
966
+ key: string;
967
+ inverted?: boolean | undefined;
968
+ } | {
969
+ type: "cooldown_active";
970
+ key: string;
971
+ inverted?: boolean | undefined;
972
+ } | {
973
+ type: "frequency_limit";
974
+ key: string;
975
+ limit: number;
976
+ inverted?: boolean | undefined;
977
+ } | {
978
+ type: "event_count";
979
+ key: string;
980
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
981
+ count: number;
982
+ withinMs?: number | undefined;
983
+ counter?: {
984
+ events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
985
+ match?: Record<string, {
986
+ equals?: string | number | boolean | undefined;
987
+ contains?: string | undefined;
988
+ }> | undefined;
989
+ } | undefined;
990
+ })[];
991
+ value?: unknown;
992
+ }[];
993
+ default?: unknown;
994
+ } | {
995
+ type: "score";
996
+ threshold: number;
997
+ field: string;
998
+ above?: unknown;
999
+ below?: unknown;
1000
+ } | {
1001
+ type: "model";
1002
+ modelId: string;
1003
+ inputs: string[];
1004
+ outputMapping: Record<string, unknown>;
1005
+ default?: unknown;
1006
+ } | {
1007
+ type: "external";
1008
+ endpoint: string;
1009
+ default?: unknown;
1010
+ method?: "GET" | "POST" | undefined;
1011
+ timeoutMs?: number | undefined;
1012
+ } | null | undefined;
1013
+ notify?: {
1014
+ title?: string | undefined;
1015
+ body?: string | undefined;
1016
+ icon?: string | undefined;
1017
+ } | null | undefined;
1018
+ description?: string | undefined;
1019
+ }>;
1020
+ /** A widget-reference payload that mounts in the drawer when its chip is opened. */
1021
+ export type ChipPayload = z.infer<typeof ChipPayloadZ>;
1022
+ /** Declarative chip data. Inferred from `SuggestionChipSchema`. */
1023
+ export type SuggestionChip = z.infer<typeof SuggestionChipSchema>;
1024
+ export declare class AdaptiveChipsStrip extends LitElement {
1025
+ static properties: {
1026
+ chips: {
1027
+ attribute: boolean;
1028
+ };
1029
+ runtimeRef: {
1030
+ attribute: boolean;
1031
+ };
1032
+ chromeless: {
1033
+ type: BooleanConstructor;
1034
+ reflect: boolean;
1035
+ };
1036
+ _openId: {
1037
+ state: boolean;
1038
+ };
1039
+ _canScrollLeft: {
1040
+ state: boolean;
1041
+ };
1042
+ _canScrollRight: {
1043
+ state: boolean;
1044
+ };
1045
+ };
1046
+ chips: SuggestionChip[];
1047
+ /**
1048
+ * Runtime reference — provides `widgets.has(id)` and
1049
+ * `widgets.mount(id, container, props)` so the strip can render
1050
+ * chip payloads through the same registry that mounts tile widgets.
1051
+ * Null until the host wires it (the AdaptiveChipsStripMountable
1052
+ * passes it in from the runtime).
1053
+ */
1054
+ runtimeRef: ChipsStripRuntime | null;
1055
+ /**
1056
+ * Strip-level chrome toggle — applies uniformly to all chips +
1057
+ * the payload drawer. Resolved upstream from `tile.chromeless`
1058
+ * (which itself defaults from `slot.theme.chromeless`). Per-chip
1059
+ * inconsistency would break the mini-canvas visual rhythm so
1060
+ * there's no per-chip flag — one strip, one style.
1061
+ */
1062
+ chromeless: boolean;
1063
+ _openId: string | null;
1064
+ /**
1065
+ * Horizontal-scroll affordance state. The strip is a single row that
1066
+ * overflows horizontally when there are more chips than the panel
1067
+ * width can hold; the left/right chevron buttons are visible only
1068
+ * when the user can actually scroll in that direction. ResizeObserver
1069
+ * + scroll listener keep these in sync.
1070
+ */
1071
+ _canScrollLeft: boolean;
1072
+ _canScrollRight: boolean;
1073
+ private _stripResizeObserver;
1074
+ /** Unsubscribe handle for the compositional-append/patch/remove event
1075
+ * subscription on `runtime.events`. Null when the strip hasn't yet
1076
+ * resolved its tile id (no parent container yet) or the runtime
1077
+ * doesn't expose an event bus. */
1078
+ private _compositionalUnsub;
1079
+ /** Tile id this strip occupies. Resolved on first `updated()` pass by
1080
+ * walking the DOM ancestor chain for `data-tile-id`. Cached because
1081
+ * the lookup is stable for the lifetime of the mount. Null while
1082
+ * unresolved (or when not running inside a SyntroTileCard, e.g.
1083
+ * in standalone test fixtures). */
1084
+ private _tileId;
1085
+ /** Instance ids of chips appended by LLM mounts (vs. authored chip
1086
+ * configs from `props.chips`). Tracked so `removeItem(instance_id)`
1087
+ * can find and prune by id. */
1088
+ private _llmAppendedIds;
1089
+ /**
1090
+ * Tracks the currently-mounted payload widget so we can swap on chip
1091
+ * change + unmount on close. Same lifecycle pattern as
1092
+ * `SyntroCanvasOverlay._lidMountHandle`.
1093
+ */
1094
+ private _payloadMount;
1095
+ createRenderRoot(): HTMLElement;
1096
+ disconnectedCallback(): void;
1097
+ updated(changed: Map<string, unknown>): void;
1098
+ private _resolveTileId;
1099
+ /**
1100
+ * Subscribe to the runtime's event bus for compositional-item events
1101
+ * targeting this strip's tile id. The subscription survives until
1102
+ * disconnect; when an event arrives with a non-matching tile_id, it's
1103
+ * a no-op (the same subscription handles all strips on the page —
1104
+ * filter is just per-event check).
1105
+ */
1106
+ private _subscribeCompositional;
1107
+ /** Append (or prepend) a new chip authored by the LLM. */
1108
+ insertItem(instanceId: string, item: Record<string, unknown>, position: 'append' | 'prepend'): void;
1109
+ /** Replace the existing chip's content. v1: full replacement (no
1110
+ * in-place merge); the chip widget already re-renders on chip data
1111
+ * changes. */
1112
+ patchItem(instanceId: string, item: Record<string, unknown>): void;
1113
+ /** Remove a chip by instance id. Closes the payload drawer if the
1114
+ * removed chip was the open one. */
1115
+ removeItem(instanceId: string): void;
1116
+ /**
1117
+ * Attach a ResizeObserver to the scroll container so we recompute
1118
+ * left/right arrow visibility when chips are added/removed or the
1119
+ * panel width changes. The scroll listener on the strip element
1120
+ * handles user-driven scrolls.
1121
+ */
1122
+ private _syncStripObserver;
1123
+ /**
1124
+ * Recompute whether the left/right scroll arrows should be visible.
1125
+ * Left arrow ⇐ scrollLeft > 0. Right arrow ⇐ there are more chips
1126
+ * to the right (scrollLeft + clientWidth < scrollWidth). Threshold
1127
+ * of 1px tolerance handles sub-pixel rounding on scaled displays.
1128
+ */
1129
+ private _updateScrollAffordances;
1130
+ private _onStripScroll;
1131
+ /**
1132
+ * Scroll the strip by ~80% of its visible width, so each arrow click
1133
+ * advances the user past most-but-not-all of the current chips
1134
+ * (a small overlap helps the user keep their place in the row).
1135
+ */
1136
+ private _scrollBy;
1137
+ private _unmountPayload;
1138
+ /**
1139
+ * Reconcile the payload mount with the current `_openId`:
1140
+ * - drawer closed / no runtime / widget id unknown → tear down
1141
+ * - same chip + same widget id → no-op (or props update)
1142
+ * - different chip → unmount old, mount new
1143
+ */
1144
+ private _syncPayloadMount;
1145
+ private _onChipClick;
1146
+ private _onChipDismiss;
1147
+ private _onPayloadClose;
1148
+ render(): TemplateResult;
1149
+ }
1150
+ declare global {
1151
+ interface HTMLElementTagNameMap {
1152
+ 'adaptive-chips-strip': AdaptiveChipsStrip;
1153
+ }
1154
+ }
1155
+ export {};
1156
+ //# sourceMappingURL=AdaptiveChipsStrip.d.ts.map