@syntrologie/adapt-chatbot 2.8.0-canary.31 → 2.8.0-canary.310

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 (126) hide show
  1. package/dist/AdaptiveChatBar.d.ts +85 -0
  2. package/dist/AdaptiveChatBar.d.ts.map +1 -0
  3. package/dist/AdaptiveChatBar.js +10 -0
  4. package/dist/AdaptiveChatBar.js.map +7 -0
  5. package/dist/AdaptiveChatBarMountable.d.ts +35 -0
  6. package/dist/AdaptiveChatBarMountable.d.ts.map +1 -0
  7. package/dist/AdaptiveChatTrail.d.ts +85 -0
  8. package/dist/AdaptiveChatTrail.d.ts.map +1 -0
  9. package/dist/AdaptiveChatTrail.js +9 -0
  10. package/dist/AdaptiveChatTrail.js.map +7 -0
  11. package/dist/AdaptiveChipsStrip.d.ts +1150 -0
  12. package/dist/AdaptiveChipsStrip.d.ts.map +1 -0
  13. package/dist/AdaptiveChipsStrip.js +11 -0
  14. package/dist/AdaptiveChipsStrip.js.map +7 -0
  15. package/dist/AdaptiveChipsStripMountable.d.ts +24 -0
  16. package/dist/AdaptiveChipsStripMountable.d.ts.map +1 -0
  17. package/dist/ChatAssistantLit.d.ts +60 -0
  18. package/dist/ChatAssistantLit.d.ts.map +1 -0
  19. package/dist/ChatAssistantLit.js +12 -0
  20. package/dist/ChatAssistantLit.js.map +7 -0
  21. package/dist/ChatSession.d.ts +178 -0
  22. package/dist/ChatSession.d.ts.map +1 -0
  23. package/dist/ChatTransport.d.ts +283 -0
  24. package/dist/ChatTransport.d.ts.map +1 -0
  25. package/dist/NavLinkMountable.d.ts +25 -0
  26. package/dist/NavLinkMountable.d.ts.map +1 -0
  27. package/dist/NavLinkMountable.test.d.ts +2 -0
  28. package/dist/NavLinkMountable.test.d.ts.map +1 -0
  29. package/dist/TextAnswerMountable.d.ts +17 -0
  30. package/dist/TextAnswerMountable.d.ts.map +1 -0
  31. package/dist/Turnstile.d.ts +83 -0
  32. package/dist/Turnstile.d.ts.map +1 -0
  33. package/dist/cdn.d.ts +2 -6
  34. package/dist/cdn.d.ts.map +1 -1
  35. package/dist/chunk-2ZUJ7DZI.js +8770 -0
  36. package/dist/chunk-2ZUJ7DZI.js.map +7 -0
  37. package/dist/chunk-BNN5YLN3.js +417 -0
  38. package/dist/chunk-BNN5YLN3.js.map +7 -0
  39. package/dist/chunk-FVNSOP7B.js +634 -0
  40. package/dist/chunk-FVNSOP7B.js.map +7 -0
  41. package/dist/chunk-ONGGPQER.js +3722 -0
  42. package/dist/chunk-ONGGPQER.js.map +7 -0
  43. package/dist/chunk-SCVTTLFJ.js +334 -0
  44. package/dist/chunk-SCVTTLFJ.js.map +7 -0
  45. package/dist/chunk-UVKRO5ER.js +13 -0
  46. package/dist/chunk-UVKRO5ER.js.map +7 -0
  47. package/dist/chunk-VLJ3WOEX.js +231 -0
  48. package/dist/chunk-VLJ3WOEX.js.map +7 -0
  49. package/dist/editor-lit.d.ts +37 -0
  50. package/dist/editor-lit.d.ts.map +1 -0
  51. package/dist/editor-lit.js +134 -0
  52. package/dist/editor-lit.js.map +7 -0
  53. package/dist/elements/ActionHandler.d.ts +34 -0
  54. package/dist/elements/ActionHandler.d.ts.map +1 -0
  55. package/dist/elements/ElementInstanceStore.d.ts +155 -0
  56. package/dist/elements/ElementInstanceStore.d.ts.map +1 -0
  57. package/dist/elements/ElementInstanceStore.test.d.ts +2 -0
  58. package/dist/elements/ElementInstanceStore.test.d.ts.map +1 -0
  59. package/dist/elements/ElementTypeHandler.d.ts +77 -0
  60. package/dist/elements/ElementTypeHandler.d.ts.map +1 -0
  61. package/dist/elements/ItemHandler.d.ts +60 -0
  62. package/dist/elements/ItemHandler.d.ts.map +1 -0
  63. package/dist/elements/ItemHandler.test.d.ts +2 -0
  64. package/dist/elements/ItemHandler.test.d.ts.map +1 -0
  65. package/dist/elements/TileHandler.d.ts +52 -0
  66. package/dist/elements/TileHandler.d.ts.map +1 -0
  67. package/dist/elements/blockRenderer.d.ts +46 -0
  68. package/dist/elements/blockRenderer.d.ts.map +1 -0
  69. package/dist/elements/blockRenderer.test.d.ts +13 -0
  70. package/dist/elements/blockRenderer.test.d.ts.map +1 -0
  71. package/dist/elements/blocks.d.ts +58 -0
  72. package/dist/elements/blocks.d.ts.map +1 -0
  73. package/dist/elements/envelope.d.ts +24 -0
  74. package/dist/elements/envelope.d.ts.map +1 -0
  75. package/dist/elements/fetcher.d.ts +40 -0
  76. package/dist/elements/fetcher.d.ts.map +1 -0
  77. package/dist/elements/index.d.ts +32 -0
  78. package/dist/elements/index.d.ts.map +1 -0
  79. package/dist/elements/types.d.ts +106 -0
  80. package/dist/elements/types.d.ts.map +1 -0
  81. package/dist/observer/__tests__/allowlist.test.d.ts +9 -0
  82. package/dist/observer/__tests__/allowlist.test.d.ts.map +1 -0
  83. package/dist/observer/__tests__/observer-isolation.test.d.ts +13 -0
  84. package/dist/observer/__tests__/observer-isolation.test.d.ts.map +1 -0
  85. package/dist/observer/__tests__/queue.test.d.ts +2 -0
  86. package/dist/observer/__tests__/queue.test.d.ts.map +1 -0
  87. package/dist/observer/__tests__/transport.test.d.ts +2 -0
  88. package/dist/observer/__tests__/transport.test.d.ts.map +1 -0
  89. package/dist/observer/allowlist.d.ts +32 -0
  90. package/dist/observer/allowlist.d.ts.map +1 -0
  91. package/dist/observer/index.d.ts +35 -0
  92. package/dist/observer/index.d.ts.map +1 -0
  93. package/dist/observer/queue.d.ts +57 -0
  94. package/dist/observer/queue.d.ts.map +1 -0
  95. package/dist/observer/transport.d.ts +26 -0
  96. package/dist/observer/transport.d.ts.map +1 -0
  97. package/dist/runtime-lit.d.ts +8 -0
  98. package/dist/runtime-lit.d.ts.map +1 -0
  99. package/dist/runtime.d.ts +8 -3
  100. package/dist/runtime.d.ts.map +1 -1
  101. package/dist/runtime.js +1649 -29
  102. package/dist/runtime.js.map +7 -0
  103. package/dist/schema.d.ts +3298 -11
  104. package/dist/schema.d.ts.map +1 -1
  105. package/dist/schema.js +126 -31
  106. package/dist/schema.js.map +7 -0
  107. package/dist/types.d.ts +47 -31
  108. package/dist/types.d.ts.map +1 -1
  109. package/package.json +50 -19
  110. package/dist/ChatAssistant.d.ts +0 -18
  111. package/dist/ChatAssistant.d.ts.map +0 -1
  112. package/dist/ChatAssistant.js +0 -178
  113. package/dist/actionParser.d.ts +0 -15
  114. package/dist/actionParser.d.ts.map +0 -1
  115. package/dist/actionParser.js +0 -52
  116. package/dist/apiClient.d.ts +0 -23
  117. package/dist/apiClient.d.ts.map +0 -1
  118. package/dist/apiClient.js +0 -51
  119. package/dist/cdn.js +0 -37
  120. package/dist/editor.d.ts +0 -17
  121. package/dist/editor.d.ts.map +0 -1
  122. package/dist/editor.js +0 -36
  123. package/dist/types.js +0 -6
  124. package/dist/useChat.d.ts +0 -25
  125. package/dist/useChat.d.ts.map +0 -1
  126. package/dist/useChat.js +0 -106
package/dist/schema.d.ts CHANGED
@@ -5,64 +5,3351 @@
5
5
  */
6
6
  import { z } from 'zod';
7
7
  export declare const configSchema: z.ZodObject<{
8
- /** Backend URL for the chat API endpoint */
9
- backendUrl: z.ZodString;
8
+ /** Backend URL for the chat API endpoint. "" for same-origin, or an absolute http(s):// URL. */
9
+ backendUrl: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
10
10
  /** MLflow run ID for experiment tracking */
11
11
  mlflowRunId: z.ZodOptional<z.ZodString>;
12
12
  /** Greeting message shown when the chat opens */
13
13
  greeting: z.ZodDefault<z.ZodString>;
14
14
  /** Maximum number of history messages sent to the backend */
15
15
  maxHistory: z.ZodDefault<z.ZodNumber>;
16
+ /** Quick-reply suggestions shown in the empty state */
17
+ suggestions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18
+ /**
19
+ * Per-customer fallback card rendered when chat can't open (Turnstile
20
+ * failure, network error, etc.). The end-user is redirected to the
21
+ * customer's normal support path — no Cloudflare-branded challenge is
22
+ * ever shown.
23
+ */
24
+ fallback: z.ZodOptional<z.ZodObject<{
25
+ /** Header shown on the fallback card. Defaults to a generic "unavailable" copy. */
26
+ title: z.ZodOptional<z.ZodString>;
27
+ /** Body copy explaining the situation in the customer's voice. */
28
+ message: z.ZodOptional<z.ZodString>;
29
+ /** Label for the call-to-action link. If `ctaHref` is set this should be too. */
30
+ ctaLabel: z.ZodOptional<z.ZodString>;
31
+ /** Target of the CTA link — typically the customer's existing support path. */
32
+ ctaHref: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
33
+ }, "strict", z.ZodTypeAny, {
34
+ title?: string | undefined;
35
+ message?: string | undefined;
36
+ ctaLabel?: string | undefined;
37
+ ctaHref?: string | undefined;
38
+ }, {
39
+ title?: string | undefined;
40
+ message?: string | undefined;
41
+ ctaLabel?: string | undefined;
42
+ ctaHref?: string | undefined;
43
+ }>>;
16
44
  }, "strip", z.ZodTypeAny, {
17
- backendUrl: string;
18
45
  greeting: string;
46
+ backendUrl: string;
19
47
  maxHistory: number;
20
48
  mlflowRunId?: string | undefined;
49
+ suggestions?: string[] | undefined;
50
+ fallback?: {
51
+ title?: string | undefined;
52
+ message?: string | undefined;
53
+ ctaLabel?: string | undefined;
54
+ ctaHref?: string | undefined;
55
+ } | undefined;
21
56
  }, {
22
57
  backendUrl: string;
23
58
  greeting?: string | undefined;
24
- maxHistory?: number | undefined;
25
59
  mlflowRunId?: string | undefined;
60
+ maxHistory?: number | undefined;
61
+ suggestions?: string[] | undefined;
62
+ fallback?: {
63
+ title?: string | undefined;
64
+ message?: string | undefined;
65
+ ctaLabel?: string | undefined;
66
+ ctaHref?: string | undefined;
67
+ } | undefined;
26
68
  }>;
27
69
  export type ChatbotConfigSchema = z.infer<typeof configSchema>;
28
70
  export declare function validateChatbotConfig(data: unknown): z.SafeParseReturnType<{
29
71
  backendUrl: string;
30
72
  greeting?: string | undefined;
31
- maxHistory?: number | undefined;
32
73
  mlflowRunId?: string | undefined;
74
+ maxHistory?: number | undefined;
75
+ suggestions?: string[] | undefined;
76
+ fallback?: {
77
+ title?: string | undefined;
78
+ message?: string | undefined;
79
+ ctaLabel?: string | undefined;
80
+ ctaHref?: string | undefined;
81
+ } | undefined;
33
82
  }, {
34
- backendUrl: string;
35
83
  greeting: string;
84
+ backendUrl: string;
36
85
  maxHistory: number;
37
86
  mlflowRunId?: string | undefined;
87
+ suggestions?: string[] | undefined;
88
+ fallback?: {
89
+ title?: string | undefined;
90
+ message?: string | undefined;
91
+ ctaLabel?: string | undefined;
92
+ ctaHref?: string | undefined;
93
+ } | undefined;
94
+ }>;
95
+ /**
96
+ * Props schema for the `adaptive-chatbot:chat-bar` widget. This is the
97
+ * headless chat-input shell — no transport, no message persistence.
98
+ * Customers wire `chat-message-sent` / `chat-interrupt` / `canvas-close`
99
+ * to their own pipeline.
100
+ *
101
+ * All fields are optional: the bar renders an empty trail + send-only
102
+ * placeholder if nothing is passed. Authors who want a stateful chat
103
+ * use `adaptive-chatbot:assistant` instead.
104
+ */
105
+ export declare const chatBarPropsSchema: z.ZodObject<{
106
+ placeholder: z.ZodOptional<z.ZodString>;
107
+ messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
108
+ id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
109
+ role: z.ZodEnum<["user", "assistant"]>;
110
+ text: z.ZodString;
111
+ }, "strip", z.ZodTypeAny, {
112
+ role: "user" | "assistant";
113
+ text: string;
114
+ id: string | number;
115
+ }, {
116
+ role: "user" | "assistant";
117
+ text: string;
118
+ id: string | number;
119
+ }>, "many">>;
120
+ inFlight: z.ZodOptional<z.ZodBoolean>;
121
+ forceExpanded: z.ZodOptional<z.ZodBoolean>;
122
+ backendUrl: z.ZodOptional<z.ZodString>;
123
+ greeting: z.ZodOptional<z.ZodString>;
124
+ fallback: z.ZodOptional<z.ZodObject<{
125
+ title: z.ZodOptional<z.ZodString>;
126
+ message: z.ZodOptional<z.ZodString>;
127
+ ctaLabel: z.ZodOptional<z.ZodString>;
128
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
129
+ title: z.ZodOptional<z.ZodString>;
130
+ message: z.ZodOptional<z.ZodString>;
131
+ ctaLabel: z.ZodOptional<z.ZodString>;
132
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
133
+ title: z.ZodOptional<z.ZodString>;
134
+ message: z.ZodOptional<z.ZodString>;
135
+ ctaLabel: z.ZodOptional<z.ZodString>;
136
+ }, z.ZodTypeAny, "passthrough">>>;
137
+ elementsEnabled: z.ZodOptional<z.ZodBoolean>;
138
+ uiTemplates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
139
+ }, "strict", z.ZodTypeAny, {
140
+ messages?: {
141
+ role: "user" | "assistant";
142
+ text: string;
143
+ id: string | number;
144
+ }[] | undefined;
145
+ greeting?: string | undefined;
146
+ forceExpanded?: boolean | undefined;
147
+ placeholder?: string | undefined;
148
+ inFlight?: boolean | undefined;
149
+ backendUrl?: string | undefined;
150
+ fallback?: z.objectOutputType<{
151
+ title: z.ZodOptional<z.ZodString>;
152
+ message: z.ZodOptional<z.ZodString>;
153
+ ctaLabel: z.ZodOptional<z.ZodString>;
154
+ }, z.ZodTypeAny, "passthrough"> | undefined;
155
+ elementsEnabled?: boolean | undefined;
156
+ uiTemplates?: Record<string, unknown> | undefined;
157
+ }, {
158
+ messages?: {
159
+ role: "user" | "assistant";
160
+ text: string;
161
+ id: string | number;
162
+ }[] | undefined;
163
+ greeting?: string | undefined;
164
+ forceExpanded?: boolean | undefined;
165
+ placeholder?: string | undefined;
166
+ inFlight?: boolean | undefined;
167
+ backendUrl?: string | undefined;
168
+ fallback?: z.objectInputType<{
169
+ title: z.ZodOptional<z.ZodString>;
170
+ message: z.ZodOptional<z.ZodString>;
171
+ ctaLabel: z.ZodOptional<z.ZodString>;
172
+ }, z.ZodTypeAny, "passthrough"> | undefined;
173
+ elementsEnabled?: boolean | undefined;
174
+ uiTemplates?: Record<string, unknown> | undefined;
175
+ }>;
176
+ export type ChatBarProps = z.infer<typeof chatBarPropsSchema>;
177
+ /**
178
+ * Props schema for the `adaptive-chatbot:chips-strip` widget. Chips
179
+ * follow the compositional-action shape (see SuggestionChipSchema in
180
+ * AdaptiveChipsStrip.ts) — same pattern as faq:question.
181
+ */
182
+ export declare const chipsStripPropsSchema: z.ZodObject<{
183
+ chips: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
184
+ kind: z.ZodLiteral<"suggestions:chip">;
185
+ config: z.ZodObject<{
186
+ id: z.ZodString;
187
+ title: z.ZodString;
188
+ payload: z.ZodObject<{
189
+ widget: z.ZodString;
190
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
191
+ }, "strict", z.ZodTypeAny, {
192
+ widget: string;
193
+ props?: Record<string, unknown> | undefined;
194
+ }, {
195
+ widget: string;
196
+ props?: Record<string, unknown> | undefined;
197
+ }>;
198
+ }, "strip", z.ZodTypeAny, {
199
+ title: string;
200
+ id: string;
201
+ payload: {
202
+ widget: string;
203
+ props?: Record<string, unknown> | undefined;
204
+ };
205
+ }, {
206
+ title: string;
207
+ id: string;
208
+ payload: {
209
+ widget: string;
210
+ props?: Record<string, unknown> | undefined;
211
+ };
212
+ }>;
213
+ triggerWhen: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
214
+ type: z.ZodLiteral<"rules">;
215
+ rules: z.ZodArray<z.ZodObject<{
216
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
217
+ type: z.ZodLiteral<"page_url">;
218
+ url: z.ZodString;
219
+ }, "strip", z.ZodTypeAny, {
220
+ type: "page_url";
221
+ url: string;
222
+ }, {
223
+ type: "page_url";
224
+ url: string;
225
+ }>, z.ZodObject<{
226
+ type: z.ZodLiteral<"route">;
227
+ routeId: z.ZodString;
228
+ }, "strip", z.ZodTypeAny, {
229
+ type: "route";
230
+ routeId: string;
231
+ }, {
232
+ type: "route";
233
+ routeId: string;
234
+ }>, z.ZodObject<{
235
+ type: z.ZodLiteral<"anchor_visible">;
236
+ anchorId: z.ZodString;
237
+ state: z.ZodEnum<["visible", "present", "absent"]>;
238
+ }, "strip", z.ZodTypeAny, {
239
+ type: "anchor_visible";
240
+ anchorId: string;
241
+ state: "visible" | "present" | "absent";
242
+ }, {
243
+ type: "anchor_visible";
244
+ anchorId: string;
245
+ state: "visible" | "present" | "absent";
246
+ }>, z.ZodObject<{
247
+ type: z.ZodLiteral<"event_occurred">;
248
+ eventName: z.ZodString;
249
+ withinMs: z.ZodOptional<z.ZodNumber>;
250
+ }, "strip", z.ZodTypeAny, {
251
+ type: "event_occurred";
252
+ eventName: string;
253
+ withinMs?: number | undefined;
254
+ }, {
255
+ type: "event_occurred";
256
+ eventName: string;
257
+ withinMs?: number | undefined;
258
+ }>, z.ZodObject<{
259
+ type: z.ZodLiteral<"state_equals">;
260
+ key: z.ZodString;
261
+ value: z.ZodUnknown;
262
+ }, "strip", z.ZodTypeAny, {
263
+ type: "state_equals";
264
+ key: string;
265
+ value?: unknown;
266
+ }, {
267
+ type: "state_equals";
268
+ key: string;
269
+ value?: unknown;
270
+ }>, z.ZodObject<{
271
+ type: z.ZodLiteral<"viewport">;
272
+ minWidth: z.ZodOptional<z.ZodNumber>;
273
+ maxWidth: z.ZodOptional<z.ZodNumber>;
274
+ minHeight: z.ZodOptional<z.ZodNumber>;
275
+ maxHeight: z.ZodOptional<z.ZodNumber>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ type: "viewport";
278
+ minWidth?: number | undefined;
279
+ maxWidth?: number | undefined;
280
+ minHeight?: number | undefined;
281
+ maxHeight?: number | undefined;
282
+ }, {
283
+ type: "viewport";
284
+ minWidth?: number | undefined;
285
+ maxWidth?: number | undefined;
286
+ minHeight?: number | undefined;
287
+ maxHeight?: number | undefined;
288
+ }>, z.ZodObject<{
289
+ type: z.ZodLiteral<"session_metric">;
290
+ key: z.ZodEnum<["time_on_page", "page_views", "scroll_depth"]>;
291
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
292
+ threshold: z.ZodNumber;
293
+ }, "strip", z.ZodTypeAny, {
294
+ type: "session_metric";
295
+ key: "time_on_page" | "page_views" | "scroll_depth";
296
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
297
+ threshold: number;
298
+ }, {
299
+ type: "session_metric";
300
+ key: "time_on_page" | "page_views" | "scroll_depth";
301
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
302
+ threshold: number;
303
+ }>, z.ZodObject<{
304
+ type: z.ZodLiteral<"dismissed">;
305
+ key: z.ZodString;
306
+ inverted: z.ZodOptional<z.ZodBoolean>;
307
+ }, "strip", z.ZodTypeAny, {
308
+ type: "dismissed";
309
+ key: string;
310
+ inverted?: boolean | undefined;
311
+ }, {
312
+ type: "dismissed";
313
+ key: string;
314
+ inverted?: boolean | undefined;
315
+ }>, z.ZodObject<{
316
+ type: z.ZodLiteral<"cooldown_active">;
317
+ key: z.ZodString;
318
+ inverted: z.ZodOptional<z.ZodBoolean>;
319
+ }, "strip", z.ZodTypeAny, {
320
+ type: "cooldown_active";
321
+ key: string;
322
+ inverted?: boolean | undefined;
323
+ }, {
324
+ type: "cooldown_active";
325
+ key: string;
326
+ inverted?: boolean | undefined;
327
+ }>, z.ZodObject<{
328
+ type: z.ZodLiteral<"frequency_limit">;
329
+ key: z.ZodString;
330
+ limit: z.ZodNumber;
331
+ inverted: z.ZodOptional<z.ZodBoolean>;
332
+ }, "strip", z.ZodTypeAny, {
333
+ type: "frequency_limit";
334
+ key: string;
335
+ limit: number;
336
+ inverted?: boolean | undefined;
337
+ }, {
338
+ type: "frequency_limit";
339
+ key: string;
340
+ limit: number;
341
+ inverted?: boolean | undefined;
342
+ }>, z.ZodObject<{
343
+ type: z.ZodLiteral<"event_count">;
344
+ key: z.ZodString;
345
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
346
+ count: z.ZodNumber;
347
+ withinMs: z.ZodOptional<z.ZodNumber>;
348
+ counter: z.ZodOptional<z.ZodObject<{
349
+ 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">;
350
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
351
+ equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
352
+ contains: z.ZodOptional<z.ZodString>;
353
+ }, "strip", z.ZodTypeAny, {
354
+ equals?: string | number | boolean | undefined;
355
+ contains?: string | undefined;
356
+ }, {
357
+ equals?: string | number | boolean | undefined;
358
+ contains?: string | undefined;
359
+ }>>>;
360
+ }, "strip", z.ZodTypeAny, {
361
+ 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")[];
362
+ match?: Record<string, {
363
+ equals?: string | number | boolean | undefined;
364
+ contains?: string | undefined;
365
+ }> | undefined;
366
+ }, {
367
+ 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")[];
368
+ match?: Record<string, {
369
+ equals?: string | number | boolean | undefined;
370
+ contains?: string | undefined;
371
+ }> | undefined;
372
+ }>>;
373
+ }, "strip", z.ZodTypeAny, {
374
+ type: "event_count";
375
+ key: string;
376
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
377
+ count: number;
378
+ withinMs?: number | undefined;
379
+ counter?: {
380
+ 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")[];
381
+ match?: Record<string, {
382
+ equals?: string | number | boolean | undefined;
383
+ contains?: string | undefined;
384
+ }> | undefined;
385
+ } | undefined;
386
+ }, {
387
+ type: "event_count";
388
+ key: string;
389
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
390
+ count: number;
391
+ withinMs?: number | undefined;
392
+ counter?: {
393
+ 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")[];
394
+ match?: Record<string, {
395
+ equals?: string | number | boolean | undefined;
396
+ contains?: string | undefined;
397
+ }> | undefined;
398
+ } | undefined;
399
+ }>]>, "many">;
400
+ value: z.ZodUnknown;
401
+ }, "strip", z.ZodTypeAny, {
402
+ conditions: ({
403
+ type: "page_url";
404
+ url: string;
405
+ } | {
406
+ type: "route";
407
+ routeId: string;
408
+ } | {
409
+ type: "anchor_visible";
410
+ anchorId: string;
411
+ state: "visible" | "present" | "absent";
412
+ } | {
413
+ type: "event_occurred";
414
+ eventName: string;
415
+ withinMs?: number | undefined;
416
+ } | {
417
+ type: "state_equals";
418
+ key: string;
419
+ value?: unknown;
420
+ } | {
421
+ type: "viewport";
422
+ minWidth?: number | undefined;
423
+ maxWidth?: number | undefined;
424
+ minHeight?: number | undefined;
425
+ maxHeight?: number | undefined;
426
+ } | {
427
+ type: "session_metric";
428
+ key: "time_on_page" | "page_views" | "scroll_depth";
429
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
430
+ threshold: number;
431
+ } | {
432
+ type: "dismissed";
433
+ key: string;
434
+ inverted?: boolean | undefined;
435
+ } | {
436
+ type: "cooldown_active";
437
+ key: string;
438
+ inverted?: boolean | undefined;
439
+ } | {
440
+ type: "frequency_limit";
441
+ key: string;
442
+ limit: number;
443
+ inverted?: boolean | undefined;
444
+ } | {
445
+ type: "event_count";
446
+ key: string;
447
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
448
+ count: number;
449
+ withinMs?: number | undefined;
450
+ counter?: {
451
+ 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")[];
452
+ match?: Record<string, {
453
+ equals?: string | number | boolean | undefined;
454
+ contains?: string | undefined;
455
+ }> | undefined;
456
+ } | undefined;
457
+ })[];
458
+ value?: unknown;
459
+ }, {
460
+ conditions: ({
461
+ type: "page_url";
462
+ url: string;
463
+ } | {
464
+ type: "route";
465
+ routeId: string;
466
+ } | {
467
+ type: "anchor_visible";
468
+ anchorId: string;
469
+ state: "visible" | "present" | "absent";
470
+ } | {
471
+ type: "event_occurred";
472
+ eventName: string;
473
+ withinMs?: number | undefined;
474
+ } | {
475
+ type: "state_equals";
476
+ key: string;
477
+ value?: unknown;
478
+ } | {
479
+ type: "viewport";
480
+ minWidth?: number | undefined;
481
+ maxWidth?: number | undefined;
482
+ minHeight?: number | undefined;
483
+ maxHeight?: number | undefined;
484
+ } | {
485
+ type: "session_metric";
486
+ key: "time_on_page" | "page_views" | "scroll_depth";
487
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
488
+ threshold: number;
489
+ } | {
490
+ type: "dismissed";
491
+ key: string;
492
+ inverted?: boolean | undefined;
493
+ } | {
494
+ type: "cooldown_active";
495
+ key: string;
496
+ inverted?: boolean | undefined;
497
+ } | {
498
+ type: "frequency_limit";
499
+ key: string;
500
+ limit: number;
501
+ inverted?: boolean | undefined;
502
+ } | {
503
+ type: "event_count";
504
+ key: string;
505
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
506
+ count: number;
507
+ withinMs?: number | undefined;
508
+ counter?: {
509
+ 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")[];
510
+ match?: Record<string, {
511
+ equals?: string | number | boolean | undefined;
512
+ contains?: string | undefined;
513
+ }> | undefined;
514
+ } | undefined;
515
+ })[];
516
+ value?: unknown;
517
+ }>, "many">;
518
+ default: z.ZodUnknown;
519
+ }, "strip", z.ZodTypeAny, {
520
+ type: "rules";
521
+ rules: {
522
+ conditions: ({
523
+ type: "page_url";
524
+ url: string;
525
+ } | {
526
+ type: "route";
527
+ routeId: string;
528
+ } | {
529
+ type: "anchor_visible";
530
+ anchorId: string;
531
+ state: "visible" | "present" | "absent";
532
+ } | {
533
+ type: "event_occurred";
534
+ eventName: string;
535
+ withinMs?: number | undefined;
536
+ } | {
537
+ type: "state_equals";
538
+ key: string;
539
+ value?: unknown;
540
+ } | {
541
+ type: "viewport";
542
+ minWidth?: number | undefined;
543
+ maxWidth?: number | undefined;
544
+ minHeight?: number | undefined;
545
+ maxHeight?: number | undefined;
546
+ } | {
547
+ type: "session_metric";
548
+ key: "time_on_page" | "page_views" | "scroll_depth";
549
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
550
+ threshold: number;
551
+ } | {
552
+ type: "dismissed";
553
+ key: string;
554
+ inverted?: boolean | undefined;
555
+ } | {
556
+ type: "cooldown_active";
557
+ key: string;
558
+ inverted?: boolean | undefined;
559
+ } | {
560
+ type: "frequency_limit";
561
+ key: string;
562
+ limit: number;
563
+ inverted?: boolean | undefined;
564
+ } | {
565
+ type: "event_count";
566
+ key: string;
567
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
568
+ count: number;
569
+ withinMs?: number | undefined;
570
+ counter?: {
571
+ 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")[];
572
+ match?: Record<string, {
573
+ equals?: string | number | boolean | undefined;
574
+ contains?: string | undefined;
575
+ }> | undefined;
576
+ } | undefined;
577
+ })[];
578
+ value?: unknown;
579
+ }[];
580
+ default?: unknown;
581
+ }, {
582
+ type: "rules";
583
+ rules: {
584
+ conditions: ({
585
+ type: "page_url";
586
+ url: string;
587
+ } | {
588
+ type: "route";
589
+ routeId: string;
590
+ } | {
591
+ type: "anchor_visible";
592
+ anchorId: string;
593
+ state: "visible" | "present" | "absent";
594
+ } | {
595
+ type: "event_occurred";
596
+ eventName: string;
597
+ withinMs?: number | undefined;
598
+ } | {
599
+ type: "state_equals";
600
+ key: string;
601
+ value?: unknown;
602
+ } | {
603
+ type: "viewport";
604
+ minWidth?: number | undefined;
605
+ maxWidth?: number | undefined;
606
+ minHeight?: number | undefined;
607
+ maxHeight?: number | undefined;
608
+ } | {
609
+ type: "session_metric";
610
+ key: "time_on_page" | "page_views" | "scroll_depth";
611
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
612
+ threshold: number;
613
+ } | {
614
+ type: "dismissed";
615
+ key: string;
616
+ inverted?: boolean | undefined;
617
+ } | {
618
+ type: "cooldown_active";
619
+ key: string;
620
+ inverted?: boolean | undefined;
621
+ } | {
622
+ type: "frequency_limit";
623
+ key: string;
624
+ limit: number;
625
+ inverted?: boolean | undefined;
626
+ } | {
627
+ type: "event_count";
628
+ key: string;
629
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
630
+ count: number;
631
+ withinMs?: number | undefined;
632
+ counter?: {
633
+ 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")[];
634
+ match?: Record<string, {
635
+ equals?: string | number | boolean | undefined;
636
+ contains?: string | undefined;
637
+ }> | undefined;
638
+ } | undefined;
639
+ })[];
640
+ value?: unknown;
641
+ }[];
642
+ default?: unknown;
643
+ }>, z.ZodObject<{
644
+ type: z.ZodLiteral<"score">;
645
+ field: z.ZodString;
646
+ threshold: z.ZodNumber;
647
+ above: z.ZodUnknown;
648
+ below: z.ZodUnknown;
649
+ }, "strip", z.ZodTypeAny, {
650
+ type: "score";
651
+ threshold: number;
652
+ field: string;
653
+ above?: unknown;
654
+ below?: unknown;
655
+ }, {
656
+ type: "score";
657
+ threshold: number;
658
+ field: string;
659
+ above?: unknown;
660
+ below?: unknown;
661
+ }>, z.ZodObject<{
662
+ type: z.ZodLiteral<"model">;
663
+ modelId: z.ZodString;
664
+ inputs: z.ZodArray<z.ZodString, "many">;
665
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
666
+ default: z.ZodUnknown;
667
+ }, "strip", z.ZodTypeAny, {
668
+ type: "model";
669
+ modelId: string;
670
+ inputs: string[];
671
+ outputMapping: Record<string, unknown>;
672
+ default?: unknown;
673
+ }, {
674
+ type: "model";
675
+ modelId: string;
676
+ inputs: string[];
677
+ outputMapping: Record<string, unknown>;
678
+ default?: unknown;
679
+ }>, z.ZodObject<{
680
+ type: z.ZodLiteral<"external">;
681
+ endpoint: z.ZodString;
682
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
683
+ default: z.ZodUnknown;
684
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
685
+ }, "strip", z.ZodTypeAny, {
686
+ type: "external";
687
+ endpoint: string;
688
+ default?: unknown;
689
+ method?: "GET" | "POST" | undefined;
690
+ timeoutMs?: number | undefined;
691
+ }, {
692
+ type: "external";
693
+ endpoint: string;
694
+ default?: unknown;
695
+ method?: "GET" | "POST" | undefined;
696
+ timeoutMs?: number | undefined;
697
+ }>]>>>;
698
+ notify: z.ZodOptional<z.ZodNullable<z.ZodObject<{
699
+ title: z.ZodOptional<z.ZodString>;
700
+ body: z.ZodOptional<z.ZodString>;
701
+ icon: z.ZodOptional<z.ZodString>;
702
+ }, "strip", z.ZodTypeAny, {
703
+ title?: string | undefined;
704
+ body?: string | undefined;
705
+ icon?: string | undefined;
706
+ }, {
707
+ title?: string | undefined;
708
+ body?: string | undefined;
709
+ icon?: string | undefined;
710
+ }>>>;
711
+ id: z.ZodOptional<z.ZodString>;
712
+ title: z.ZodOptional<z.ZodString>;
713
+ description: z.ZodOptional<z.ZodString>;
714
+ validation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
715
+ }, "strip", z.ZodTypeAny, {
716
+ config: {
717
+ title: string;
718
+ id: string;
719
+ payload: {
720
+ widget: string;
721
+ props?: Record<string, unknown> | undefined;
722
+ };
723
+ };
724
+ kind: "suggestions:chip";
725
+ title?: string | undefined;
726
+ id?: string | undefined;
727
+ validation?: string[] | undefined;
728
+ triggerWhen?: {
729
+ type: "rules";
730
+ rules: {
731
+ conditions: ({
732
+ type: "page_url";
733
+ url: string;
734
+ } | {
735
+ type: "route";
736
+ routeId: string;
737
+ } | {
738
+ type: "anchor_visible";
739
+ anchorId: string;
740
+ state: "visible" | "present" | "absent";
741
+ } | {
742
+ type: "event_occurred";
743
+ eventName: string;
744
+ withinMs?: number | undefined;
745
+ } | {
746
+ type: "state_equals";
747
+ key: string;
748
+ value?: unknown;
749
+ } | {
750
+ type: "viewport";
751
+ minWidth?: number | undefined;
752
+ maxWidth?: number | undefined;
753
+ minHeight?: number | undefined;
754
+ maxHeight?: number | undefined;
755
+ } | {
756
+ type: "session_metric";
757
+ key: "time_on_page" | "page_views" | "scroll_depth";
758
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
759
+ threshold: number;
760
+ } | {
761
+ type: "dismissed";
762
+ key: string;
763
+ inverted?: boolean | undefined;
764
+ } | {
765
+ type: "cooldown_active";
766
+ key: string;
767
+ inverted?: boolean | undefined;
768
+ } | {
769
+ type: "frequency_limit";
770
+ key: string;
771
+ limit: number;
772
+ inverted?: boolean | undefined;
773
+ } | {
774
+ type: "event_count";
775
+ key: string;
776
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
777
+ count: number;
778
+ withinMs?: number | undefined;
779
+ counter?: {
780
+ 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")[];
781
+ match?: Record<string, {
782
+ equals?: string | number | boolean | undefined;
783
+ contains?: string | undefined;
784
+ }> | undefined;
785
+ } | undefined;
786
+ })[];
787
+ value?: unknown;
788
+ }[];
789
+ default?: unknown;
790
+ } | {
791
+ type: "score";
792
+ threshold: number;
793
+ field: string;
794
+ above?: unknown;
795
+ below?: unknown;
796
+ } | {
797
+ type: "model";
798
+ modelId: string;
799
+ inputs: string[];
800
+ outputMapping: Record<string, unknown>;
801
+ default?: unknown;
802
+ } | {
803
+ type: "external";
804
+ endpoint: string;
805
+ default?: unknown;
806
+ method?: "GET" | "POST" | undefined;
807
+ timeoutMs?: number | undefined;
808
+ } | null | undefined;
809
+ notify?: {
810
+ title?: string | undefined;
811
+ body?: string | undefined;
812
+ icon?: string | undefined;
813
+ } | null | undefined;
814
+ description?: string | undefined;
815
+ }, {
816
+ config: {
817
+ title: string;
818
+ id: string;
819
+ payload: {
820
+ widget: string;
821
+ props?: Record<string, unknown> | undefined;
822
+ };
823
+ };
824
+ kind: "suggestions:chip";
825
+ title?: string | undefined;
826
+ id?: string | undefined;
827
+ validation?: string[] | undefined;
828
+ triggerWhen?: {
829
+ type: "rules";
830
+ rules: {
831
+ conditions: ({
832
+ type: "page_url";
833
+ url: string;
834
+ } | {
835
+ type: "route";
836
+ routeId: string;
837
+ } | {
838
+ type: "anchor_visible";
839
+ anchorId: string;
840
+ state: "visible" | "present" | "absent";
841
+ } | {
842
+ type: "event_occurred";
843
+ eventName: string;
844
+ withinMs?: number | undefined;
845
+ } | {
846
+ type: "state_equals";
847
+ key: string;
848
+ value?: unknown;
849
+ } | {
850
+ type: "viewport";
851
+ minWidth?: number | undefined;
852
+ maxWidth?: number | undefined;
853
+ minHeight?: number | undefined;
854
+ maxHeight?: number | undefined;
855
+ } | {
856
+ type: "session_metric";
857
+ key: "time_on_page" | "page_views" | "scroll_depth";
858
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
859
+ threshold: number;
860
+ } | {
861
+ type: "dismissed";
862
+ key: string;
863
+ inverted?: boolean | undefined;
864
+ } | {
865
+ type: "cooldown_active";
866
+ key: string;
867
+ inverted?: boolean | undefined;
868
+ } | {
869
+ type: "frequency_limit";
870
+ key: string;
871
+ limit: number;
872
+ inverted?: boolean | undefined;
873
+ } | {
874
+ type: "event_count";
875
+ key: string;
876
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
877
+ count: number;
878
+ withinMs?: number | undefined;
879
+ counter?: {
880
+ 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")[];
881
+ match?: Record<string, {
882
+ equals?: string | number | boolean | undefined;
883
+ contains?: string | undefined;
884
+ }> | undefined;
885
+ } | undefined;
886
+ })[];
887
+ value?: unknown;
888
+ }[];
889
+ default?: unknown;
890
+ } | {
891
+ type: "score";
892
+ threshold: number;
893
+ field: string;
894
+ above?: unknown;
895
+ below?: unknown;
896
+ } | {
897
+ type: "model";
898
+ modelId: string;
899
+ inputs: string[];
900
+ outputMapping: Record<string, unknown>;
901
+ default?: unknown;
902
+ } | {
903
+ type: "external";
904
+ endpoint: string;
905
+ default?: unknown;
906
+ method?: "GET" | "POST" | undefined;
907
+ timeoutMs?: number | undefined;
908
+ } | null | undefined;
909
+ notify?: {
910
+ title?: string | undefined;
911
+ body?: string | undefined;
912
+ icon?: string | undefined;
913
+ } | null | undefined;
914
+ description?: string | undefined;
915
+ }>, {
916
+ config: {
917
+ title: string;
918
+ id: string;
919
+ payload: {
920
+ widget: string;
921
+ props?: Record<string, unknown> | undefined;
922
+ };
923
+ };
924
+ kind: "suggestions:chip";
925
+ title?: string | undefined;
926
+ id?: string | undefined;
927
+ validation?: string[] | undefined;
928
+ triggerWhen?: {
929
+ type: "rules";
930
+ rules: {
931
+ conditions: ({
932
+ type: "page_url";
933
+ url: string;
934
+ } | {
935
+ type: "route";
936
+ routeId: string;
937
+ } | {
938
+ type: "anchor_visible";
939
+ anchorId: string;
940
+ state: "visible" | "present" | "absent";
941
+ } | {
942
+ type: "event_occurred";
943
+ eventName: string;
944
+ withinMs?: number | undefined;
945
+ } | {
946
+ type: "state_equals";
947
+ key: string;
948
+ value?: unknown;
949
+ } | {
950
+ type: "viewport";
951
+ minWidth?: number | undefined;
952
+ maxWidth?: number | undefined;
953
+ minHeight?: number | undefined;
954
+ maxHeight?: number | undefined;
955
+ } | {
956
+ type: "session_metric";
957
+ key: "time_on_page" | "page_views" | "scroll_depth";
958
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
959
+ threshold: number;
960
+ } | {
961
+ type: "dismissed";
962
+ key: string;
963
+ inverted?: boolean | undefined;
964
+ } | {
965
+ type: "cooldown_active";
966
+ key: string;
967
+ inverted?: boolean | undefined;
968
+ } | {
969
+ type: "frequency_limit";
970
+ key: string;
971
+ limit: number;
972
+ inverted?: boolean | undefined;
973
+ } | {
974
+ type: "event_count";
975
+ key: string;
976
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
977
+ count: number;
978
+ withinMs?: number | undefined;
979
+ counter?: {
980
+ 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")[];
981
+ match?: Record<string, {
982
+ equals?: string | number | boolean | undefined;
983
+ contains?: string | undefined;
984
+ }> | undefined;
985
+ } | undefined;
986
+ })[];
987
+ value?: unknown;
988
+ }[];
989
+ default?: unknown;
990
+ } | {
991
+ type: "score";
992
+ threshold: number;
993
+ field: string;
994
+ above?: unknown;
995
+ below?: unknown;
996
+ } | {
997
+ type: "model";
998
+ modelId: string;
999
+ inputs: string[];
1000
+ outputMapping: Record<string, unknown>;
1001
+ default?: unknown;
1002
+ } | {
1003
+ type: "external";
1004
+ endpoint: string;
1005
+ default?: unknown;
1006
+ method?: "GET" | "POST" | undefined;
1007
+ timeoutMs?: number | undefined;
1008
+ } | null | undefined;
1009
+ notify?: {
1010
+ title?: string | undefined;
1011
+ body?: string | undefined;
1012
+ icon?: string | undefined;
1013
+ } | null | undefined;
1014
+ description?: string | undefined;
1015
+ }, {
1016
+ config: {
1017
+ title: string;
1018
+ id: string;
1019
+ payload: {
1020
+ widget: string;
1021
+ props?: Record<string, unknown> | undefined;
1022
+ };
1023
+ };
1024
+ kind: "suggestions:chip";
1025
+ title?: string | undefined;
1026
+ id?: string | undefined;
1027
+ validation?: string[] | undefined;
1028
+ triggerWhen?: {
1029
+ type: "rules";
1030
+ rules: {
1031
+ conditions: ({
1032
+ type: "page_url";
1033
+ url: string;
1034
+ } | {
1035
+ type: "route";
1036
+ routeId: string;
1037
+ } | {
1038
+ type: "anchor_visible";
1039
+ anchorId: string;
1040
+ state: "visible" | "present" | "absent";
1041
+ } | {
1042
+ type: "event_occurred";
1043
+ eventName: string;
1044
+ withinMs?: number | undefined;
1045
+ } | {
1046
+ type: "state_equals";
1047
+ key: string;
1048
+ value?: unknown;
1049
+ } | {
1050
+ type: "viewport";
1051
+ minWidth?: number | undefined;
1052
+ maxWidth?: number | undefined;
1053
+ minHeight?: number | undefined;
1054
+ maxHeight?: number | undefined;
1055
+ } | {
1056
+ type: "session_metric";
1057
+ key: "time_on_page" | "page_views" | "scroll_depth";
1058
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1059
+ threshold: number;
1060
+ } | {
1061
+ type: "dismissed";
1062
+ key: string;
1063
+ inverted?: boolean | undefined;
1064
+ } | {
1065
+ type: "cooldown_active";
1066
+ key: string;
1067
+ inverted?: boolean | undefined;
1068
+ } | {
1069
+ type: "frequency_limit";
1070
+ key: string;
1071
+ limit: number;
1072
+ inverted?: boolean | undefined;
1073
+ } | {
1074
+ type: "event_count";
1075
+ key: string;
1076
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1077
+ count: number;
1078
+ withinMs?: number | undefined;
1079
+ counter?: {
1080
+ 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")[];
1081
+ match?: Record<string, {
1082
+ equals?: string | number | boolean | undefined;
1083
+ contains?: string | undefined;
1084
+ }> | undefined;
1085
+ } | undefined;
1086
+ })[];
1087
+ value?: unknown;
1088
+ }[];
1089
+ default?: unknown;
1090
+ } | {
1091
+ type: "score";
1092
+ threshold: number;
1093
+ field: string;
1094
+ above?: unknown;
1095
+ below?: unknown;
1096
+ } | {
1097
+ type: "model";
1098
+ modelId: string;
1099
+ inputs: string[];
1100
+ outputMapping: Record<string, unknown>;
1101
+ default?: unknown;
1102
+ } | {
1103
+ type: "external";
1104
+ endpoint: string;
1105
+ default?: unknown;
1106
+ method?: "GET" | "POST" | undefined;
1107
+ timeoutMs?: number | undefined;
1108
+ } | null | undefined;
1109
+ notify?: {
1110
+ title?: string | undefined;
1111
+ body?: string | undefined;
1112
+ icon?: string | undefined;
1113
+ } | null | undefined;
1114
+ description?: string | undefined;
1115
+ }>, "many">>;
1116
+ }, "strict", z.ZodTypeAny, {
1117
+ chips: {
1118
+ config: {
1119
+ title: string;
1120
+ id: string;
1121
+ payload: {
1122
+ widget: string;
1123
+ props?: Record<string, unknown> | undefined;
1124
+ };
1125
+ };
1126
+ kind: "suggestions:chip";
1127
+ title?: string | undefined;
1128
+ id?: string | undefined;
1129
+ validation?: string[] | undefined;
1130
+ triggerWhen?: {
1131
+ type: "rules";
1132
+ rules: {
1133
+ conditions: ({
1134
+ type: "page_url";
1135
+ url: string;
1136
+ } | {
1137
+ type: "route";
1138
+ routeId: string;
1139
+ } | {
1140
+ type: "anchor_visible";
1141
+ anchorId: string;
1142
+ state: "visible" | "present" | "absent";
1143
+ } | {
1144
+ type: "event_occurred";
1145
+ eventName: string;
1146
+ withinMs?: number | undefined;
1147
+ } | {
1148
+ type: "state_equals";
1149
+ key: string;
1150
+ value?: unknown;
1151
+ } | {
1152
+ type: "viewport";
1153
+ minWidth?: number | undefined;
1154
+ maxWidth?: number | undefined;
1155
+ minHeight?: number | undefined;
1156
+ maxHeight?: number | undefined;
1157
+ } | {
1158
+ type: "session_metric";
1159
+ key: "time_on_page" | "page_views" | "scroll_depth";
1160
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1161
+ threshold: number;
1162
+ } | {
1163
+ type: "dismissed";
1164
+ key: string;
1165
+ inverted?: boolean | undefined;
1166
+ } | {
1167
+ type: "cooldown_active";
1168
+ key: string;
1169
+ inverted?: boolean | undefined;
1170
+ } | {
1171
+ type: "frequency_limit";
1172
+ key: string;
1173
+ limit: number;
1174
+ inverted?: boolean | undefined;
1175
+ } | {
1176
+ type: "event_count";
1177
+ key: string;
1178
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1179
+ count: number;
1180
+ withinMs?: number | undefined;
1181
+ counter?: {
1182
+ 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")[];
1183
+ match?: Record<string, {
1184
+ equals?: string | number | boolean | undefined;
1185
+ contains?: string | undefined;
1186
+ }> | undefined;
1187
+ } | undefined;
1188
+ })[];
1189
+ value?: unknown;
1190
+ }[];
1191
+ default?: unknown;
1192
+ } | {
1193
+ type: "score";
1194
+ threshold: number;
1195
+ field: string;
1196
+ above?: unknown;
1197
+ below?: unknown;
1198
+ } | {
1199
+ type: "model";
1200
+ modelId: string;
1201
+ inputs: string[];
1202
+ outputMapping: Record<string, unknown>;
1203
+ default?: unknown;
1204
+ } | {
1205
+ type: "external";
1206
+ endpoint: string;
1207
+ default?: unknown;
1208
+ method?: "GET" | "POST" | undefined;
1209
+ timeoutMs?: number | undefined;
1210
+ } | null | undefined;
1211
+ notify?: {
1212
+ title?: string | undefined;
1213
+ body?: string | undefined;
1214
+ icon?: string | undefined;
1215
+ } | null | undefined;
1216
+ description?: string | undefined;
1217
+ }[];
1218
+ }, {
1219
+ chips?: {
1220
+ config: {
1221
+ title: string;
1222
+ id: string;
1223
+ payload: {
1224
+ widget: string;
1225
+ props?: Record<string, unknown> | undefined;
1226
+ };
1227
+ };
1228
+ kind: "suggestions:chip";
1229
+ title?: string | undefined;
1230
+ id?: string | undefined;
1231
+ validation?: string[] | undefined;
1232
+ triggerWhen?: {
1233
+ type: "rules";
1234
+ rules: {
1235
+ conditions: ({
1236
+ type: "page_url";
1237
+ url: string;
1238
+ } | {
1239
+ type: "route";
1240
+ routeId: string;
1241
+ } | {
1242
+ type: "anchor_visible";
1243
+ anchorId: string;
1244
+ state: "visible" | "present" | "absent";
1245
+ } | {
1246
+ type: "event_occurred";
1247
+ eventName: string;
1248
+ withinMs?: number | undefined;
1249
+ } | {
1250
+ type: "state_equals";
1251
+ key: string;
1252
+ value?: unknown;
1253
+ } | {
1254
+ type: "viewport";
1255
+ minWidth?: number | undefined;
1256
+ maxWidth?: number | undefined;
1257
+ minHeight?: number | undefined;
1258
+ maxHeight?: number | undefined;
1259
+ } | {
1260
+ type: "session_metric";
1261
+ key: "time_on_page" | "page_views" | "scroll_depth";
1262
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1263
+ threshold: number;
1264
+ } | {
1265
+ type: "dismissed";
1266
+ key: string;
1267
+ inverted?: boolean | undefined;
1268
+ } | {
1269
+ type: "cooldown_active";
1270
+ key: string;
1271
+ inverted?: boolean | undefined;
1272
+ } | {
1273
+ type: "frequency_limit";
1274
+ key: string;
1275
+ limit: number;
1276
+ inverted?: boolean | undefined;
1277
+ } | {
1278
+ type: "event_count";
1279
+ key: string;
1280
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1281
+ count: number;
1282
+ withinMs?: number | undefined;
1283
+ counter?: {
1284
+ 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")[];
1285
+ match?: Record<string, {
1286
+ equals?: string | number | boolean | undefined;
1287
+ contains?: string | undefined;
1288
+ }> | undefined;
1289
+ } | undefined;
1290
+ })[];
1291
+ value?: unknown;
1292
+ }[];
1293
+ default?: unknown;
1294
+ } | {
1295
+ type: "score";
1296
+ threshold: number;
1297
+ field: string;
1298
+ above?: unknown;
1299
+ below?: unknown;
1300
+ } | {
1301
+ type: "model";
1302
+ modelId: string;
1303
+ inputs: string[];
1304
+ outputMapping: Record<string, unknown>;
1305
+ default?: unknown;
1306
+ } | {
1307
+ type: "external";
1308
+ endpoint: string;
1309
+ default?: unknown;
1310
+ method?: "GET" | "POST" | undefined;
1311
+ timeoutMs?: number | undefined;
1312
+ } | null | undefined;
1313
+ notify?: {
1314
+ title?: string | undefined;
1315
+ body?: string | undefined;
1316
+ icon?: string | undefined;
1317
+ } | null | undefined;
1318
+ description?: string | undefined;
1319
+ }[] | undefined;
38
1320
  }>;
1321
+ export type ChipsStripProps = z.infer<typeof chipsStripPropsSchema>;
39
1322
  /**
40
1323
  * Tile widget definitions for unified JSON Schema generation.
41
1324
  * Maps widget IDs to their props validation schema so the build script
42
1325
  * can inject if/then constraints on tile.props.
43
1326
  */
44
- export declare const tileWidgets: {
1327
+ export declare const tileWidgets: ({
45
1328
  widget: string;
46
1329
  defName: string;
47
1330
  propsSchema: z.ZodObject<{
48
- /** Backend URL for the chat API endpoint */
49
- backendUrl: z.ZodString;
1331
+ /** Backend URL for the chat API endpoint. "" for same-origin, or an absolute http(s):// URL. */
1332
+ backendUrl: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
50
1333
  /** MLflow run ID for experiment tracking */
51
1334
  mlflowRunId: z.ZodOptional<z.ZodString>;
52
1335
  /** Greeting message shown when the chat opens */
53
1336
  greeting: z.ZodDefault<z.ZodString>;
54
1337
  /** Maximum number of history messages sent to the backend */
55
1338
  maxHistory: z.ZodDefault<z.ZodNumber>;
1339
+ /** Quick-reply suggestions shown in the empty state */
1340
+ suggestions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1341
+ /**
1342
+ * Per-customer fallback card rendered when chat can't open (Turnstile
1343
+ * failure, network error, etc.). The end-user is redirected to the
1344
+ * customer's normal support path — no Cloudflare-branded challenge is
1345
+ * ever shown.
1346
+ */
1347
+ fallback: z.ZodOptional<z.ZodObject<{
1348
+ /** Header shown on the fallback card. Defaults to a generic "unavailable" copy. */
1349
+ title: z.ZodOptional<z.ZodString>;
1350
+ /** Body copy explaining the situation in the customer's voice. */
1351
+ message: z.ZodOptional<z.ZodString>;
1352
+ /** Label for the call-to-action link. If `ctaHref` is set this should be too. */
1353
+ ctaLabel: z.ZodOptional<z.ZodString>;
1354
+ /** Target of the CTA link — typically the customer's existing support path. */
1355
+ ctaHref: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
1356
+ }, "strict", z.ZodTypeAny, {
1357
+ title?: string | undefined;
1358
+ message?: string | undefined;
1359
+ ctaLabel?: string | undefined;
1360
+ ctaHref?: string | undefined;
1361
+ }, {
1362
+ title?: string | undefined;
1363
+ message?: string | undefined;
1364
+ ctaLabel?: string | undefined;
1365
+ ctaHref?: string | undefined;
1366
+ }>>;
56
1367
  }, "strip", z.ZodTypeAny, {
57
- backendUrl: string;
58
1368
  greeting: string;
1369
+ backendUrl: string;
59
1370
  maxHistory: number;
60
1371
  mlflowRunId?: string | undefined;
1372
+ suggestions?: string[] | undefined;
1373
+ fallback?: {
1374
+ title?: string | undefined;
1375
+ message?: string | undefined;
1376
+ ctaLabel?: string | undefined;
1377
+ ctaHref?: string | undefined;
1378
+ } | undefined;
61
1379
  }, {
62
1380
  backendUrl: string;
63
1381
  greeting?: string | undefined;
64
- maxHistory?: number | undefined;
65
1382
  mlflowRunId?: string | undefined;
1383
+ maxHistory?: number | undefined;
1384
+ suggestions?: string[] | undefined;
1385
+ fallback?: {
1386
+ title?: string | undefined;
1387
+ message?: string | undefined;
1388
+ ctaLabel?: string | undefined;
1389
+ ctaHref?: string | undefined;
1390
+ } | undefined;
1391
+ }>;
1392
+ } | {
1393
+ widget: string;
1394
+ defName: string;
1395
+ propsSchema: z.ZodObject<{
1396
+ placeholder: z.ZodOptional<z.ZodString>;
1397
+ messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
1398
+ id: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
1399
+ role: z.ZodEnum<["user", "assistant"]>;
1400
+ text: z.ZodString;
1401
+ }, "strip", z.ZodTypeAny, {
1402
+ role: "user" | "assistant";
1403
+ text: string;
1404
+ id: string | number;
1405
+ }, {
1406
+ role: "user" | "assistant";
1407
+ text: string;
1408
+ id: string | number;
1409
+ }>, "many">>;
1410
+ inFlight: z.ZodOptional<z.ZodBoolean>;
1411
+ forceExpanded: z.ZodOptional<z.ZodBoolean>;
1412
+ backendUrl: z.ZodOptional<z.ZodString>;
1413
+ greeting: z.ZodOptional<z.ZodString>;
1414
+ fallback: z.ZodOptional<z.ZodObject<{
1415
+ title: z.ZodOptional<z.ZodString>;
1416
+ message: z.ZodOptional<z.ZodString>;
1417
+ ctaLabel: z.ZodOptional<z.ZodString>;
1418
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1419
+ title: z.ZodOptional<z.ZodString>;
1420
+ message: z.ZodOptional<z.ZodString>;
1421
+ ctaLabel: z.ZodOptional<z.ZodString>;
1422
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1423
+ title: z.ZodOptional<z.ZodString>;
1424
+ message: z.ZodOptional<z.ZodString>;
1425
+ ctaLabel: z.ZodOptional<z.ZodString>;
1426
+ }, z.ZodTypeAny, "passthrough">>>;
1427
+ elementsEnabled: z.ZodOptional<z.ZodBoolean>;
1428
+ uiTemplates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1429
+ }, "strict", z.ZodTypeAny, {
1430
+ messages?: {
1431
+ role: "user" | "assistant";
1432
+ text: string;
1433
+ id: string | number;
1434
+ }[] | undefined;
1435
+ greeting?: string | undefined;
1436
+ forceExpanded?: boolean | undefined;
1437
+ placeholder?: string | undefined;
1438
+ inFlight?: boolean | undefined;
1439
+ backendUrl?: string | undefined;
1440
+ fallback?: z.objectOutputType<{
1441
+ title: z.ZodOptional<z.ZodString>;
1442
+ message: z.ZodOptional<z.ZodString>;
1443
+ ctaLabel: z.ZodOptional<z.ZodString>;
1444
+ }, z.ZodTypeAny, "passthrough"> | undefined;
1445
+ elementsEnabled?: boolean | undefined;
1446
+ uiTemplates?: Record<string, unknown> | undefined;
1447
+ }, {
1448
+ messages?: {
1449
+ role: "user" | "assistant";
1450
+ text: string;
1451
+ id: string | number;
1452
+ }[] | undefined;
1453
+ greeting?: string | undefined;
1454
+ forceExpanded?: boolean | undefined;
1455
+ placeholder?: string | undefined;
1456
+ inFlight?: boolean | undefined;
1457
+ backendUrl?: string | undefined;
1458
+ fallback?: z.objectInputType<{
1459
+ title: z.ZodOptional<z.ZodString>;
1460
+ message: z.ZodOptional<z.ZodString>;
1461
+ ctaLabel: z.ZodOptional<z.ZodString>;
1462
+ }, z.ZodTypeAny, "passthrough"> | undefined;
1463
+ elementsEnabled?: boolean | undefined;
1464
+ uiTemplates?: Record<string, unknown> | undefined;
1465
+ }>;
1466
+ } | {
1467
+ widget: string;
1468
+ defName: string;
1469
+ propsSchema: z.ZodObject<{
1470
+ chips: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
1471
+ kind: z.ZodLiteral<"suggestions:chip">;
1472
+ config: z.ZodObject<{
1473
+ id: z.ZodString;
1474
+ title: z.ZodString;
1475
+ payload: z.ZodObject<{
1476
+ widget: z.ZodString;
1477
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1478
+ }, "strict", z.ZodTypeAny, {
1479
+ widget: string;
1480
+ props?: Record<string, unknown> | undefined;
1481
+ }, {
1482
+ widget: string;
1483
+ props?: Record<string, unknown> | undefined;
1484
+ }>;
1485
+ }, "strip", z.ZodTypeAny, {
1486
+ title: string;
1487
+ id: string;
1488
+ payload: {
1489
+ widget: string;
1490
+ props?: Record<string, unknown> | undefined;
1491
+ };
1492
+ }, {
1493
+ title: string;
1494
+ id: string;
1495
+ payload: {
1496
+ widget: string;
1497
+ props?: Record<string, unknown> | undefined;
1498
+ };
1499
+ }>;
1500
+ triggerWhen: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1501
+ type: z.ZodLiteral<"rules">;
1502
+ rules: z.ZodArray<z.ZodObject<{
1503
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1504
+ type: z.ZodLiteral<"page_url">;
1505
+ url: z.ZodString;
1506
+ }, "strip", z.ZodTypeAny, {
1507
+ type: "page_url";
1508
+ url: string;
1509
+ }, {
1510
+ type: "page_url";
1511
+ url: string;
1512
+ }>, z.ZodObject<{
1513
+ type: z.ZodLiteral<"route">;
1514
+ routeId: z.ZodString;
1515
+ }, "strip", z.ZodTypeAny, {
1516
+ type: "route";
1517
+ routeId: string;
1518
+ }, {
1519
+ type: "route";
1520
+ routeId: string;
1521
+ }>, z.ZodObject<{
1522
+ type: z.ZodLiteral<"anchor_visible">;
1523
+ anchorId: z.ZodString;
1524
+ state: z.ZodEnum<["visible", "present", "absent"]>;
1525
+ }, "strip", z.ZodTypeAny, {
1526
+ type: "anchor_visible";
1527
+ anchorId: string;
1528
+ state: "visible" | "present" | "absent";
1529
+ }, {
1530
+ type: "anchor_visible";
1531
+ anchorId: string;
1532
+ state: "visible" | "present" | "absent";
1533
+ }>, z.ZodObject<{
1534
+ type: z.ZodLiteral<"event_occurred">;
1535
+ eventName: z.ZodString;
1536
+ withinMs: z.ZodOptional<z.ZodNumber>;
1537
+ }, "strip", z.ZodTypeAny, {
1538
+ type: "event_occurred";
1539
+ eventName: string;
1540
+ withinMs?: number | undefined;
1541
+ }, {
1542
+ type: "event_occurred";
1543
+ eventName: string;
1544
+ withinMs?: number | undefined;
1545
+ }>, z.ZodObject<{
1546
+ type: z.ZodLiteral<"state_equals">;
1547
+ key: z.ZodString;
1548
+ value: z.ZodUnknown;
1549
+ }, "strip", z.ZodTypeAny, {
1550
+ type: "state_equals";
1551
+ key: string;
1552
+ value?: unknown;
1553
+ }, {
1554
+ type: "state_equals";
1555
+ key: string;
1556
+ value?: unknown;
1557
+ }>, z.ZodObject<{
1558
+ type: z.ZodLiteral<"viewport">;
1559
+ minWidth: z.ZodOptional<z.ZodNumber>;
1560
+ maxWidth: z.ZodOptional<z.ZodNumber>;
1561
+ minHeight: z.ZodOptional<z.ZodNumber>;
1562
+ maxHeight: z.ZodOptional<z.ZodNumber>;
1563
+ }, "strip", z.ZodTypeAny, {
1564
+ type: "viewport";
1565
+ minWidth?: number | undefined;
1566
+ maxWidth?: number | undefined;
1567
+ minHeight?: number | undefined;
1568
+ maxHeight?: number | undefined;
1569
+ }, {
1570
+ type: "viewport";
1571
+ minWidth?: number | undefined;
1572
+ maxWidth?: number | undefined;
1573
+ minHeight?: number | undefined;
1574
+ maxHeight?: number | undefined;
1575
+ }>, z.ZodObject<{
1576
+ type: z.ZodLiteral<"session_metric">;
1577
+ key: z.ZodEnum<["time_on_page", "page_views", "scroll_depth"]>;
1578
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1579
+ threshold: z.ZodNumber;
1580
+ }, "strip", z.ZodTypeAny, {
1581
+ type: "session_metric";
1582
+ key: "time_on_page" | "page_views" | "scroll_depth";
1583
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1584
+ threshold: number;
1585
+ }, {
1586
+ type: "session_metric";
1587
+ key: "time_on_page" | "page_views" | "scroll_depth";
1588
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1589
+ threshold: number;
1590
+ }>, z.ZodObject<{
1591
+ type: z.ZodLiteral<"dismissed">;
1592
+ key: z.ZodString;
1593
+ inverted: z.ZodOptional<z.ZodBoolean>;
1594
+ }, "strip", z.ZodTypeAny, {
1595
+ type: "dismissed";
1596
+ key: string;
1597
+ inverted?: boolean | undefined;
1598
+ }, {
1599
+ type: "dismissed";
1600
+ key: string;
1601
+ inverted?: boolean | undefined;
1602
+ }>, z.ZodObject<{
1603
+ type: z.ZodLiteral<"cooldown_active">;
1604
+ key: z.ZodString;
1605
+ inverted: z.ZodOptional<z.ZodBoolean>;
1606
+ }, "strip", z.ZodTypeAny, {
1607
+ type: "cooldown_active";
1608
+ key: string;
1609
+ inverted?: boolean | undefined;
1610
+ }, {
1611
+ type: "cooldown_active";
1612
+ key: string;
1613
+ inverted?: boolean | undefined;
1614
+ }>, z.ZodObject<{
1615
+ type: z.ZodLiteral<"frequency_limit">;
1616
+ key: z.ZodString;
1617
+ limit: z.ZodNumber;
1618
+ inverted: z.ZodOptional<z.ZodBoolean>;
1619
+ }, "strip", z.ZodTypeAny, {
1620
+ type: "frequency_limit";
1621
+ key: string;
1622
+ limit: number;
1623
+ inverted?: boolean | undefined;
1624
+ }, {
1625
+ type: "frequency_limit";
1626
+ key: string;
1627
+ limit: number;
1628
+ inverted?: boolean | undefined;
1629
+ }>, z.ZodObject<{
1630
+ type: z.ZodLiteral<"event_count">;
1631
+ key: z.ZodString;
1632
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1633
+ count: z.ZodNumber;
1634
+ withinMs: z.ZodOptional<z.ZodNumber>;
1635
+ counter: z.ZodOptional<z.ZodObject<{
1636
+ 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">;
1637
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1638
+ equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
1639
+ contains: z.ZodOptional<z.ZodString>;
1640
+ }, "strip", z.ZodTypeAny, {
1641
+ equals?: string | number | boolean | undefined;
1642
+ contains?: string | undefined;
1643
+ }, {
1644
+ equals?: string | number | boolean | undefined;
1645
+ contains?: string | undefined;
1646
+ }>>>;
1647
+ }, "strip", z.ZodTypeAny, {
1648
+ 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")[];
1649
+ match?: Record<string, {
1650
+ equals?: string | number | boolean | undefined;
1651
+ contains?: string | undefined;
1652
+ }> | undefined;
1653
+ }, {
1654
+ 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")[];
1655
+ match?: Record<string, {
1656
+ equals?: string | number | boolean | undefined;
1657
+ contains?: string | undefined;
1658
+ }> | undefined;
1659
+ }>>;
1660
+ }, "strip", z.ZodTypeAny, {
1661
+ type: "event_count";
1662
+ key: string;
1663
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1664
+ count: number;
1665
+ withinMs?: number | undefined;
1666
+ counter?: {
1667
+ 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")[];
1668
+ match?: Record<string, {
1669
+ equals?: string | number | boolean | undefined;
1670
+ contains?: string | undefined;
1671
+ }> | undefined;
1672
+ } | undefined;
1673
+ }, {
1674
+ type: "event_count";
1675
+ key: string;
1676
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1677
+ count: number;
1678
+ withinMs?: number | undefined;
1679
+ counter?: {
1680
+ 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")[];
1681
+ match?: Record<string, {
1682
+ equals?: string | number | boolean | undefined;
1683
+ contains?: string | undefined;
1684
+ }> | undefined;
1685
+ } | undefined;
1686
+ }>]>, "many">;
1687
+ value: z.ZodUnknown;
1688
+ }, "strip", z.ZodTypeAny, {
1689
+ conditions: ({
1690
+ type: "page_url";
1691
+ url: string;
1692
+ } | {
1693
+ type: "route";
1694
+ routeId: string;
1695
+ } | {
1696
+ type: "anchor_visible";
1697
+ anchorId: string;
1698
+ state: "visible" | "present" | "absent";
1699
+ } | {
1700
+ type: "event_occurred";
1701
+ eventName: string;
1702
+ withinMs?: number | undefined;
1703
+ } | {
1704
+ type: "state_equals";
1705
+ key: string;
1706
+ value?: unknown;
1707
+ } | {
1708
+ type: "viewport";
1709
+ minWidth?: number | undefined;
1710
+ maxWidth?: number | undefined;
1711
+ minHeight?: number | undefined;
1712
+ maxHeight?: number | undefined;
1713
+ } | {
1714
+ type: "session_metric";
1715
+ key: "time_on_page" | "page_views" | "scroll_depth";
1716
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1717
+ threshold: number;
1718
+ } | {
1719
+ type: "dismissed";
1720
+ key: string;
1721
+ inverted?: boolean | undefined;
1722
+ } | {
1723
+ type: "cooldown_active";
1724
+ key: string;
1725
+ inverted?: boolean | undefined;
1726
+ } | {
1727
+ type: "frequency_limit";
1728
+ key: string;
1729
+ limit: number;
1730
+ inverted?: boolean | undefined;
1731
+ } | {
1732
+ type: "event_count";
1733
+ key: string;
1734
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1735
+ count: number;
1736
+ withinMs?: number | undefined;
1737
+ counter?: {
1738
+ 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")[];
1739
+ match?: Record<string, {
1740
+ equals?: string | number | boolean | undefined;
1741
+ contains?: string | undefined;
1742
+ }> | undefined;
1743
+ } | undefined;
1744
+ })[];
1745
+ value?: unknown;
1746
+ }, {
1747
+ conditions: ({
1748
+ type: "page_url";
1749
+ url: string;
1750
+ } | {
1751
+ type: "route";
1752
+ routeId: string;
1753
+ } | {
1754
+ type: "anchor_visible";
1755
+ anchorId: string;
1756
+ state: "visible" | "present" | "absent";
1757
+ } | {
1758
+ type: "event_occurred";
1759
+ eventName: string;
1760
+ withinMs?: number | undefined;
1761
+ } | {
1762
+ type: "state_equals";
1763
+ key: string;
1764
+ value?: unknown;
1765
+ } | {
1766
+ type: "viewport";
1767
+ minWidth?: number | undefined;
1768
+ maxWidth?: number | undefined;
1769
+ minHeight?: number | undefined;
1770
+ maxHeight?: number | undefined;
1771
+ } | {
1772
+ type: "session_metric";
1773
+ key: "time_on_page" | "page_views" | "scroll_depth";
1774
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1775
+ threshold: number;
1776
+ } | {
1777
+ type: "dismissed";
1778
+ key: string;
1779
+ inverted?: boolean | undefined;
1780
+ } | {
1781
+ type: "cooldown_active";
1782
+ key: string;
1783
+ inverted?: boolean | undefined;
1784
+ } | {
1785
+ type: "frequency_limit";
1786
+ key: string;
1787
+ limit: number;
1788
+ inverted?: boolean | undefined;
1789
+ } | {
1790
+ type: "event_count";
1791
+ key: string;
1792
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1793
+ count: number;
1794
+ withinMs?: number | undefined;
1795
+ counter?: {
1796
+ 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")[];
1797
+ match?: Record<string, {
1798
+ equals?: string | number | boolean | undefined;
1799
+ contains?: string | undefined;
1800
+ }> | undefined;
1801
+ } | undefined;
1802
+ })[];
1803
+ value?: unknown;
1804
+ }>, "many">;
1805
+ default: z.ZodUnknown;
1806
+ }, "strip", z.ZodTypeAny, {
1807
+ type: "rules";
1808
+ rules: {
1809
+ conditions: ({
1810
+ type: "page_url";
1811
+ url: string;
1812
+ } | {
1813
+ type: "route";
1814
+ routeId: string;
1815
+ } | {
1816
+ type: "anchor_visible";
1817
+ anchorId: string;
1818
+ state: "visible" | "present" | "absent";
1819
+ } | {
1820
+ type: "event_occurred";
1821
+ eventName: string;
1822
+ withinMs?: number | undefined;
1823
+ } | {
1824
+ type: "state_equals";
1825
+ key: string;
1826
+ value?: unknown;
1827
+ } | {
1828
+ type: "viewport";
1829
+ minWidth?: number | undefined;
1830
+ maxWidth?: number | undefined;
1831
+ minHeight?: number | undefined;
1832
+ maxHeight?: number | undefined;
1833
+ } | {
1834
+ type: "session_metric";
1835
+ key: "time_on_page" | "page_views" | "scroll_depth";
1836
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1837
+ threshold: number;
1838
+ } | {
1839
+ type: "dismissed";
1840
+ key: string;
1841
+ inverted?: boolean | undefined;
1842
+ } | {
1843
+ type: "cooldown_active";
1844
+ key: string;
1845
+ inverted?: boolean | undefined;
1846
+ } | {
1847
+ type: "frequency_limit";
1848
+ key: string;
1849
+ limit: number;
1850
+ inverted?: boolean | undefined;
1851
+ } | {
1852
+ type: "event_count";
1853
+ key: string;
1854
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1855
+ count: number;
1856
+ withinMs?: number | undefined;
1857
+ counter?: {
1858
+ 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")[];
1859
+ match?: Record<string, {
1860
+ equals?: string | number | boolean | undefined;
1861
+ contains?: string | undefined;
1862
+ }> | undefined;
1863
+ } | undefined;
1864
+ })[];
1865
+ value?: unknown;
1866
+ }[];
1867
+ default?: unknown;
1868
+ }, {
1869
+ type: "rules";
1870
+ rules: {
1871
+ conditions: ({
1872
+ type: "page_url";
1873
+ url: string;
1874
+ } | {
1875
+ type: "route";
1876
+ routeId: string;
1877
+ } | {
1878
+ type: "anchor_visible";
1879
+ anchorId: string;
1880
+ state: "visible" | "present" | "absent";
1881
+ } | {
1882
+ type: "event_occurred";
1883
+ eventName: string;
1884
+ withinMs?: number | undefined;
1885
+ } | {
1886
+ type: "state_equals";
1887
+ key: string;
1888
+ value?: unknown;
1889
+ } | {
1890
+ type: "viewport";
1891
+ minWidth?: number | undefined;
1892
+ maxWidth?: number | undefined;
1893
+ minHeight?: number | undefined;
1894
+ maxHeight?: number | undefined;
1895
+ } | {
1896
+ type: "session_metric";
1897
+ key: "time_on_page" | "page_views" | "scroll_depth";
1898
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1899
+ threshold: number;
1900
+ } | {
1901
+ type: "dismissed";
1902
+ key: string;
1903
+ inverted?: boolean | undefined;
1904
+ } | {
1905
+ type: "cooldown_active";
1906
+ key: string;
1907
+ inverted?: boolean | undefined;
1908
+ } | {
1909
+ type: "frequency_limit";
1910
+ key: string;
1911
+ limit: number;
1912
+ inverted?: boolean | undefined;
1913
+ } | {
1914
+ type: "event_count";
1915
+ key: string;
1916
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1917
+ count: number;
1918
+ withinMs?: number | undefined;
1919
+ counter?: {
1920
+ 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")[];
1921
+ match?: Record<string, {
1922
+ equals?: string | number | boolean | undefined;
1923
+ contains?: string | undefined;
1924
+ }> | undefined;
1925
+ } | undefined;
1926
+ })[];
1927
+ value?: unknown;
1928
+ }[];
1929
+ default?: unknown;
1930
+ }>, z.ZodObject<{
1931
+ type: z.ZodLiteral<"score">;
1932
+ field: z.ZodString;
1933
+ threshold: z.ZodNumber;
1934
+ above: z.ZodUnknown;
1935
+ below: z.ZodUnknown;
1936
+ }, "strip", z.ZodTypeAny, {
1937
+ type: "score";
1938
+ threshold: number;
1939
+ field: string;
1940
+ above?: unknown;
1941
+ below?: unknown;
1942
+ }, {
1943
+ type: "score";
1944
+ threshold: number;
1945
+ field: string;
1946
+ above?: unknown;
1947
+ below?: unknown;
1948
+ }>, z.ZodObject<{
1949
+ type: z.ZodLiteral<"model">;
1950
+ modelId: z.ZodString;
1951
+ inputs: z.ZodArray<z.ZodString, "many">;
1952
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1953
+ default: z.ZodUnknown;
1954
+ }, "strip", z.ZodTypeAny, {
1955
+ type: "model";
1956
+ modelId: string;
1957
+ inputs: string[];
1958
+ outputMapping: Record<string, unknown>;
1959
+ default?: unknown;
1960
+ }, {
1961
+ type: "model";
1962
+ modelId: string;
1963
+ inputs: string[];
1964
+ outputMapping: Record<string, unknown>;
1965
+ default?: unknown;
1966
+ }>, z.ZodObject<{
1967
+ type: z.ZodLiteral<"external">;
1968
+ endpoint: z.ZodString;
1969
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
1970
+ default: z.ZodUnknown;
1971
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1972
+ }, "strip", z.ZodTypeAny, {
1973
+ type: "external";
1974
+ endpoint: string;
1975
+ default?: unknown;
1976
+ method?: "GET" | "POST" | undefined;
1977
+ timeoutMs?: number | undefined;
1978
+ }, {
1979
+ type: "external";
1980
+ endpoint: string;
1981
+ default?: unknown;
1982
+ method?: "GET" | "POST" | undefined;
1983
+ timeoutMs?: number | undefined;
1984
+ }>]>>>;
1985
+ notify: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1986
+ title: z.ZodOptional<z.ZodString>;
1987
+ body: z.ZodOptional<z.ZodString>;
1988
+ icon: z.ZodOptional<z.ZodString>;
1989
+ }, "strip", z.ZodTypeAny, {
1990
+ title?: string | undefined;
1991
+ body?: string | undefined;
1992
+ icon?: string | undefined;
1993
+ }, {
1994
+ title?: string | undefined;
1995
+ body?: string | undefined;
1996
+ icon?: string | undefined;
1997
+ }>>>;
1998
+ id: z.ZodOptional<z.ZodString>;
1999
+ title: z.ZodOptional<z.ZodString>;
2000
+ description: z.ZodOptional<z.ZodString>;
2001
+ validation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2002
+ }, "strip", z.ZodTypeAny, {
2003
+ config: {
2004
+ title: string;
2005
+ id: string;
2006
+ payload: {
2007
+ widget: string;
2008
+ props?: Record<string, unknown> | undefined;
2009
+ };
2010
+ };
2011
+ kind: "suggestions:chip";
2012
+ title?: string | undefined;
2013
+ id?: string | undefined;
2014
+ validation?: string[] | undefined;
2015
+ triggerWhen?: {
2016
+ type: "rules";
2017
+ rules: {
2018
+ conditions: ({
2019
+ type: "page_url";
2020
+ url: string;
2021
+ } | {
2022
+ type: "route";
2023
+ routeId: string;
2024
+ } | {
2025
+ type: "anchor_visible";
2026
+ anchorId: string;
2027
+ state: "visible" | "present" | "absent";
2028
+ } | {
2029
+ type: "event_occurred";
2030
+ eventName: string;
2031
+ withinMs?: number | undefined;
2032
+ } | {
2033
+ type: "state_equals";
2034
+ key: string;
2035
+ value?: unknown;
2036
+ } | {
2037
+ type: "viewport";
2038
+ minWidth?: number | undefined;
2039
+ maxWidth?: number | undefined;
2040
+ minHeight?: number | undefined;
2041
+ maxHeight?: number | undefined;
2042
+ } | {
2043
+ type: "session_metric";
2044
+ key: "time_on_page" | "page_views" | "scroll_depth";
2045
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2046
+ threshold: number;
2047
+ } | {
2048
+ type: "dismissed";
2049
+ key: string;
2050
+ inverted?: boolean | undefined;
2051
+ } | {
2052
+ type: "cooldown_active";
2053
+ key: string;
2054
+ inverted?: boolean | undefined;
2055
+ } | {
2056
+ type: "frequency_limit";
2057
+ key: string;
2058
+ limit: number;
2059
+ inverted?: boolean | undefined;
2060
+ } | {
2061
+ type: "event_count";
2062
+ key: string;
2063
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2064
+ count: number;
2065
+ withinMs?: number | undefined;
2066
+ counter?: {
2067
+ 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")[];
2068
+ match?: Record<string, {
2069
+ equals?: string | number | boolean | undefined;
2070
+ contains?: string | undefined;
2071
+ }> | undefined;
2072
+ } | undefined;
2073
+ })[];
2074
+ value?: unknown;
2075
+ }[];
2076
+ default?: unknown;
2077
+ } | {
2078
+ type: "score";
2079
+ threshold: number;
2080
+ field: string;
2081
+ above?: unknown;
2082
+ below?: unknown;
2083
+ } | {
2084
+ type: "model";
2085
+ modelId: string;
2086
+ inputs: string[];
2087
+ outputMapping: Record<string, unknown>;
2088
+ default?: unknown;
2089
+ } | {
2090
+ type: "external";
2091
+ endpoint: string;
2092
+ default?: unknown;
2093
+ method?: "GET" | "POST" | undefined;
2094
+ timeoutMs?: number | undefined;
2095
+ } | null | undefined;
2096
+ notify?: {
2097
+ title?: string | undefined;
2098
+ body?: string | undefined;
2099
+ icon?: string | undefined;
2100
+ } | null | undefined;
2101
+ description?: string | undefined;
2102
+ }, {
2103
+ config: {
2104
+ title: string;
2105
+ id: string;
2106
+ payload: {
2107
+ widget: string;
2108
+ props?: Record<string, unknown> | undefined;
2109
+ };
2110
+ };
2111
+ kind: "suggestions:chip";
2112
+ title?: string | undefined;
2113
+ id?: string | undefined;
2114
+ validation?: string[] | undefined;
2115
+ triggerWhen?: {
2116
+ type: "rules";
2117
+ rules: {
2118
+ conditions: ({
2119
+ type: "page_url";
2120
+ url: string;
2121
+ } | {
2122
+ type: "route";
2123
+ routeId: string;
2124
+ } | {
2125
+ type: "anchor_visible";
2126
+ anchorId: string;
2127
+ state: "visible" | "present" | "absent";
2128
+ } | {
2129
+ type: "event_occurred";
2130
+ eventName: string;
2131
+ withinMs?: number | undefined;
2132
+ } | {
2133
+ type: "state_equals";
2134
+ key: string;
2135
+ value?: unknown;
2136
+ } | {
2137
+ type: "viewport";
2138
+ minWidth?: number | undefined;
2139
+ maxWidth?: number | undefined;
2140
+ minHeight?: number | undefined;
2141
+ maxHeight?: number | undefined;
2142
+ } | {
2143
+ type: "session_metric";
2144
+ key: "time_on_page" | "page_views" | "scroll_depth";
2145
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2146
+ threshold: number;
2147
+ } | {
2148
+ type: "dismissed";
2149
+ key: string;
2150
+ inverted?: boolean | undefined;
2151
+ } | {
2152
+ type: "cooldown_active";
2153
+ key: string;
2154
+ inverted?: boolean | undefined;
2155
+ } | {
2156
+ type: "frequency_limit";
2157
+ key: string;
2158
+ limit: number;
2159
+ inverted?: boolean | undefined;
2160
+ } | {
2161
+ type: "event_count";
2162
+ key: string;
2163
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2164
+ count: number;
2165
+ withinMs?: number | undefined;
2166
+ counter?: {
2167
+ 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")[];
2168
+ match?: Record<string, {
2169
+ equals?: string | number | boolean | undefined;
2170
+ contains?: string | undefined;
2171
+ }> | undefined;
2172
+ } | undefined;
2173
+ })[];
2174
+ value?: unknown;
2175
+ }[];
2176
+ default?: unknown;
2177
+ } | {
2178
+ type: "score";
2179
+ threshold: number;
2180
+ field: string;
2181
+ above?: unknown;
2182
+ below?: unknown;
2183
+ } | {
2184
+ type: "model";
2185
+ modelId: string;
2186
+ inputs: string[];
2187
+ outputMapping: Record<string, unknown>;
2188
+ default?: unknown;
2189
+ } | {
2190
+ type: "external";
2191
+ endpoint: string;
2192
+ default?: unknown;
2193
+ method?: "GET" | "POST" | undefined;
2194
+ timeoutMs?: number | undefined;
2195
+ } | null | undefined;
2196
+ notify?: {
2197
+ title?: string | undefined;
2198
+ body?: string | undefined;
2199
+ icon?: string | undefined;
2200
+ } | null | undefined;
2201
+ description?: string | undefined;
2202
+ }>, {
2203
+ config: {
2204
+ title: string;
2205
+ id: string;
2206
+ payload: {
2207
+ widget: string;
2208
+ props?: Record<string, unknown> | undefined;
2209
+ };
2210
+ };
2211
+ kind: "suggestions:chip";
2212
+ title?: string | undefined;
2213
+ id?: string | undefined;
2214
+ validation?: string[] | undefined;
2215
+ triggerWhen?: {
2216
+ type: "rules";
2217
+ rules: {
2218
+ conditions: ({
2219
+ type: "page_url";
2220
+ url: string;
2221
+ } | {
2222
+ type: "route";
2223
+ routeId: string;
2224
+ } | {
2225
+ type: "anchor_visible";
2226
+ anchorId: string;
2227
+ state: "visible" | "present" | "absent";
2228
+ } | {
2229
+ type: "event_occurred";
2230
+ eventName: string;
2231
+ withinMs?: number | undefined;
2232
+ } | {
2233
+ type: "state_equals";
2234
+ key: string;
2235
+ value?: unknown;
2236
+ } | {
2237
+ type: "viewport";
2238
+ minWidth?: number | undefined;
2239
+ maxWidth?: number | undefined;
2240
+ minHeight?: number | undefined;
2241
+ maxHeight?: number | undefined;
2242
+ } | {
2243
+ type: "session_metric";
2244
+ key: "time_on_page" | "page_views" | "scroll_depth";
2245
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2246
+ threshold: number;
2247
+ } | {
2248
+ type: "dismissed";
2249
+ key: string;
2250
+ inverted?: boolean | undefined;
2251
+ } | {
2252
+ type: "cooldown_active";
2253
+ key: string;
2254
+ inverted?: boolean | undefined;
2255
+ } | {
2256
+ type: "frequency_limit";
2257
+ key: string;
2258
+ limit: number;
2259
+ inverted?: boolean | undefined;
2260
+ } | {
2261
+ type: "event_count";
2262
+ key: string;
2263
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2264
+ count: number;
2265
+ withinMs?: number | undefined;
2266
+ counter?: {
2267
+ 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")[];
2268
+ match?: Record<string, {
2269
+ equals?: string | number | boolean | undefined;
2270
+ contains?: string | undefined;
2271
+ }> | undefined;
2272
+ } | undefined;
2273
+ })[];
2274
+ value?: unknown;
2275
+ }[];
2276
+ default?: unknown;
2277
+ } | {
2278
+ type: "score";
2279
+ threshold: number;
2280
+ field: string;
2281
+ above?: unknown;
2282
+ below?: unknown;
2283
+ } | {
2284
+ type: "model";
2285
+ modelId: string;
2286
+ inputs: string[];
2287
+ outputMapping: Record<string, unknown>;
2288
+ default?: unknown;
2289
+ } | {
2290
+ type: "external";
2291
+ endpoint: string;
2292
+ default?: unknown;
2293
+ method?: "GET" | "POST" | undefined;
2294
+ timeoutMs?: number | undefined;
2295
+ } | null | undefined;
2296
+ notify?: {
2297
+ title?: string | undefined;
2298
+ body?: string | undefined;
2299
+ icon?: string | undefined;
2300
+ } | null | undefined;
2301
+ description?: string | undefined;
2302
+ }, {
2303
+ config: {
2304
+ title: string;
2305
+ id: string;
2306
+ payload: {
2307
+ widget: string;
2308
+ props?: Record<string, unknown> | undefined;
2309
+ };
2310
+ };
2311
+ kind: "suggestions:chip";
2312
+ title?: string | undefined;
2313
+ id?: string | undefined;
2314
+ validation?: string[] | undefined;
2315
+ triggerWhen?: {
2316
+ type: "rules";
2317
+ rules: {
2318
+ conditions: ({
2319
+ type: "page_url";
2320
+ url: string;
2321
+ } | {
2322
+ type: "route";
2323
+ routeId: string;
2324
+ } | {
2325
+ type: "anchor_visible";
2326
+ anchorId: string;
2327
+ state: "visible" | "present" | "absent";
2328
+ } | {
2329
+ type: "event_occurred";
2330
+ eventName: string;
2331
+ withinMs?: number | undefined;
2332
+ } | {
2333
+ type: "state_equals";
2334
+ key: string;
2335
+ value?: unknown;
2336
+ } | {
2337
+ type: "viewport";
2338
+ minWidth?: number | undefined;
2339
+ maxWidth?: number | undefined;
2340
+ minHeight?: number | undefined;
2341
+ maxHeight?: number | undefined;
2342
+ } | {
2343
+ type: "session_metric";
2344
+ key: "time_on_page" | "page_views" | "scroll_depth";
2345
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2346
+ threshold: number;
2347
+ } | {
2348
+ type: "dismissed";
2349
+ key: string;
2350
+ inverted?: boolean | undefined;
2351
+ } | {
2352
+ type: "cooldown_active";
2353
+ key: string;
2354
+ inverted?: boolean | undefined;
2355
+ } | {
2356
+ type: "frequency_limit";
2357
+ key: string;
2358
+ limit: number;
2359
+ inverted?: boolean | undefined;
2360
+ } | {
2361
+ type: "event_count";
2362
+ key: string;
2363
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2364
+ count: number;
2365
+ withinMs?: number | undefined;
2366
+ counter?: {
2367
+ 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")[];
2368
+ match?: Record<string, {
2369
+ equals?: string | number | boolean | undefined;
2370
+ contains?: string | undefined;
2371
+ }> | undefined;
2372
+ } | undefined;
2373
+ })[];
2374
+ value?: unknown;
2375
+ }[];
2376
+ default?: unknown;
2377
+ } | {
2378
+ type: "score";
2379
+ threshold: number;
2380
+ field: string;
2381
+ above?: unknown;
2382
+ below?: unknown;
2383
+ } | {
2384
+ type: "model";
2385
+ modelId: string;
2386
+ inputs: string[];
2387
+ outputMapping: Record<string, unknown>;
2388
+ default?: unknown;
2389
+ } | {
2390
+ type: "external";
2391
+ endpoint: string;
2392
+ default?: unknown;
2393
+ method?: "GET" | "POST" | undefined;
2394
+ timeoutMs?: number | undefined;
2395
+ } | null | undefined;
2396
+ notify?: {
2397
+ title?: string | undefined;
2398
+ body?: string | undefined;
2399
+ icon?: string | undefined;
2400
+ } | null | undefined;
2401
+ description?: string | undefined;
2402
+ }>, "many">>;
2403
+ }, "strict", z.ZodTypeAny, {
2404
+ chips: {
2405
+ config: {
2406
+ title: string;
2407
+ id: string;
2408
+ payload: {
2409
+ widget: string;
2410
+ props?: Record<string, unknown> | undefined;
2411
+ };
2412
+ };
2413
+ kind: "suggestions:chip";
2414
+ title?: string | undefined;
2415
+ id?: string | undefined;
2416
+ validation?: string[] | undefined;
2417
+ triggerWhen?: {
2418
+ type: "rules";
2419
+ rules: {
2420
+ conditions: ({
2421
+ type: "page_url";
2422
+ url: string;
2423
+ } | {
2424
+ type: "route";
2425
+ routeId: string;
2426
+ } | {
2427
+ type: "anchor_visible";
2428
+ anchorId: string;
2429
+ state: "visible" | "present" | "absent";
2430
+ } | {
2431
+ type: "event_occurred";
2432
+ eventName: string;
2433
+ withinMs?: number | undefined;
2434
+ } | {
2435
+ type: "state_equals";
2436
+ key: string;
2437
+ value?: unknown;
2438
+ } | {
2439
+ type: "viewport";
2440
+ minWidth?: number | undefined;
2441
+ maxWidth?: number | undefined;
2442
+ minHeight?: number | undefined;
2443
+ maxHeight?: number | undefined;
2444
+ } | {
2445
+ type: "session_metric";
2446
+ key: "time_on_page" | "page_views" | "scroll_depth";
2447
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2448
+ threshold: number;
2449
+ } | {
2450
+ type: "dismissed";
2451
+ key: string;
2452
+ inverted?: boolean | undefined;
2453
+ } | {
2454
+ type: "cooldown_active";
2455
+ key: string;
2456
+ inverted?: boolean | undefined;
2457
+ } | {
2458
+ type: "frequency_limit";
2459
+ key: string;
2460
+ limit: number;
2461
+ inverted?: boolean | undefined;
2462
+ } | {
2463
+ type: "event_count";
2464
+ key: string;
2465
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2466
+ count: number;
2467
+ withinMs?: number | undefined;
2468
+ counter?: {
2469
+ 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")[];
2470
+ match?: Record<string, {
2471
+ equals?: string | number | boolean | undefined;
2472
+ contains?: string | undefined;
2473
+ }> | undefined;
2474
+ } | undefined;
2475
+ })[];
2476
+ value?: unknown;
2477
+ }[];
2478
+ default?: unknown;
2479
+ } | {
2480
+ type: "score";
2481
+ threshold: number;
2482
+ field: string;
2483
+ above?: unknown;
2484
+ below?: unknown;
2485
+ } | {
2486
+ type: "model";
2487
+ modelId: string;
2488
+ inputs: string[];
2489
+ outputMapping: Record<string, unknown>;
2490
+ default?: unknown;
2491
+ } | {
2492
+ type: "external";
2493
+ endpoint: string;
2494
+ default?: unknown;
2495
+ method?: "GET" | "POST" | undefined;
2496
+ timeoutMs?: number | undefined;
2497
+ } | null | undefined;
2498
+ notify?: {
2499
+ title?: string | undefined;
2500
+ body?: string | undefined;
2501
+ icon?: string | undefined;
2502
+ } | null | undefined;
2503
+ description?: string | undefined;
2504
+ }[];
2505
+ }, {
2506
+ chips?: {
2507
+ config: {
2508
+ title: string;
2509
+ id: string;
2510
+ payload: {
2511
+ widget: string;
2512
+ props?: Record<string, unknown> | undefined;
2513
+ };
2514
+ };
2515
+ kind: "suggestions:chip";
2516
+ title?: string | undefined;
2517
+ id?: string | undefined;
2518
+ validation?: string[] | undefined;
2519
+ triggerWhen?: {
2520
+ type: "rules";
2521
+ rules: {
2522
+ conditions: ({
2523
+ type: "page_url";
2524
+ url: string;
2525
+ } | {
2526
+ type: "route";
2527
+ routeId: string;
2528
+ } | {
2529
+ type: "anchor_visible";
2530
+ anchorId: string;
2531
+ state: "visible" | "present" | "absent";
2532
+ } | {
2533
+ type: "event_occurred";
2534
+ eventName: string;
2535
+ withinMs?: number | undefined;
2536
+ } | {
2537
+ type: "state_equals";
2538
+ key: string;
2539
+ value?: unknown;
2540
+ } | {
2541
+ type: "viewport";
2542
+ minWidth?: number | undefined;
2543
+ maxWidth?: number | undefined;
2544
+ minHeight?: number | undefined;
2545
+ maxHeight?: number | undefined;
2546
+ } | {
2547
+ type: "session_metric";
2548
+ key: "time_on_page" | "page_views" | "scroll_depth";
2549
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2550
+ threshold: number;
2551
+ } | {
2552
+ type: "dismissed";
2553
+ key: string;
2554
+ inverted?: boolean | undefined;
2555
+ } | {
2556
+ type: "cooldown_active";
2557
+ key: string;
2558
+ inverted?: boolean | undefined;
2559
+ } | {
2560
+ type: "frequency_limit";
2561
+ key: string;
2562
+ limit: number;
2563
+ inverted?: boolean | undefined;
2564
+ } | {
2565
+ type: "event_count";
2566
+ key: string;
2567
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2568
+ count: number;
2569
+ withinMs?: number | undefined;
2570
+ counter?: {
2571
+ 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")[];
2572
+ match?: Record<string, {
2573
+ equals?: string | number | boolean | undefined;
2574
+ contains?: string | undefined;
2575
+ }> | undefined;
2576
+ } | undefined;
2577
+ })[];
2578
+ value?: unknown;
2579
+ }[];
2580
+ default?: unknown;
2581
+ } | {
2582
+ type: "score";
2583
+ threshold: number;
2584
+ field: string;
2585
+ above?: unknown;
2586
+ below?: unknown;
2587
+ } | {
2588
+ type: "model";
2589
+ modelId: string;
2590
+ inputs: string[];
2591
+ outputMapping: Record<string, unknown>;
2592
+ default?: unknown;
2593
+ } | {
2594
+ type: "external";
2595
+ endpoint: string;
2596
+ default?: unknown;
2597
+ method?: "GET" | "POST" | undefined;
2598
+ timeoutMs?: number | undefined;
2599
+ } | null | undefined;
2600
+ notify?: {
2601
+ title?: string | undefined;
2602
+ body?: string | undefined;
2603
+ icon?: string | undefined;
2604
+ } | null | undefined;
2605
+ description?: string | undefined;
2606
+ }[] | undefined;
2607
+ }>;
2608
+ })[];
2609
+ /**
2610
+ * Action step schemas — registered into the unified canvas-config
2611
+ * JSON Schema's action-step union so authors (and the tactician LLM)
2612
+ * can emit `suggestions:chip` items inside a chips-strip tile's
2613
+ * `props.chips` array with full validation.
2614
+ *
2615
+ * `.innerType()` strips the `.refine()` wrapper (cross-field
2616
+ * refinements don't translate to JSON Schema); runtime Zod still
2617
+ * enforces them.
2618
+ */
2619
+ export declare const actionStepSchemas: {
2620
+ defName: string;
2621
+ schema: z.ZodObject<{
2622
+ kind: z.ZodLiteral<"suggestions:chip">;
2623
+ config: z.ZodObject<{
2624
+ id: z.ZodString;
2625
+ title: z.ZodString;
2626
+ payload: z.ZodObject<{
2627
+ widget: z.ZodString;
2628
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2629
+ }, "strict", z.ZodTypeAny, {
2630
+ widget: string;
2631
+ props?: Record<string, unknown> | undefined;
2632
+ }, {
2633
+ widget: string;
2634
+ props?: Record<string, unknown> | undefined;
2635
+ }>;
2636
+ }, "strip", z.ZodTypeAny, {
2637
+ title: string;
2638
+ id: string;
2639
+ payload: {
2640
+ widget: string;
2641
+ props?: Record<string, unknown> | undefined;
2642
+ };
2643
+ }, {
2644
+ title: string;
2645
+ id: string;
2646
+ payload: {
2647
+ widget: string;
2648
+ props?: Record<string, unknown> | undefined;
2649
+ };
2650
+ }>;
2651
+ triggerWhen: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2652
+ type: z.ZodLiteral<"rules">;
2653
+ rules: z.ZodArray<z.ZodObject<{
2654
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2655
+ type: z.ZodLiteral<"page_url">;
2656
+ url: z.ZodString;
2657
+ }, "strip", z.ZodTypeAny, {
2658
+ type: "page_url";
2659
+ url: string;
2660
+ }, {
2661
+ type: "page_url";
2662
+ url: string;
2663
+ }>, z.ZodObject<{
2664
+ type: z.ZodLiteral<"route">;
2665
+ routeId: z.ZodString;
2666
+ }, "strip", z.ZodTypeAny, {
2667
+ type: "route";
2668
+ routeId: string;
2669
+ }, {
2670
+ type: "route";
2671
+ routeId: string;
2672
+ }>, z.ZodObject<{
2673
+ type: z.ZodLiteral<"anchor_visible">;
2674
+ anchorId: z.ZodString;
2675
+ state: z.ZodEnum<["visible", "present", "absent"]>;
2676
+ }, "strip", z.ZodTypeAny, {
2677
+ type: "anchor_visible";
2678
+ anchorId: string;
2679
+ state: "visible" | "present" | "absent";
2680
+ }, {
2681
+ type: "anchor_visible";
2682
+ anchorId: string;
2683
+ state: "visible" | "present" | "absent";
2684
+ }>, z.ZodObject<{
2685
+ type: z.ZodLiteral<"event_occurred">;
2686
+ eventName: z.ZodString;
2687
+ withinMs: z.ZodOptional<z.ZodNumber>;
2688
+ }, "strip", z.ZodTypeAny, {
2689
+ type: "event_occurred";
2690
+ eventName: string;
2691
+ withinMs?: number | undefined;
2692
+ }, {
2693
+ type: "event_occurred";
2694
+ eventName: string;
2695
+ withinMs?: number | undefined;
2696
+ }>, z.ZodObject<{
2697
+ type: z.ZodLiteral<"state_equals">;
2698
+ key: z.ZodString;
2699
+ value: z.ZodUnknown;
2700
+ }, "strip", z.ZodTypeAny, {
2701
+ type: "state_equals";
2702
+ key: string;
2703
+ value?: unknown;
2704
+ }, {
2705
+ type: "state_equals";
2706
+ key: string;
2707
+ value?: unknown;
2708
+ }>, z.ZodObject<{
2709
+ type: z.ZodLiteral<"viewport">;
2710
+ minWidth: z.ZodOptional<z.ZodNumber>;
2711
+ maxWidth: z.ZodOptional<z.ZodNumber>;
2712
+ minHeight: z.ZodOptional<z.ZodNumber>;
2713
+ maxHeight: z.ZodOptional<z.ZodNumber>;
2714
+ }, "strip", z.ZodTypeAny, {
2715
+ type: "viewport";
2716
+ minWidth?: number | undefined;
2717
+ maxWidth?: number | undefined;
2718
+ minHeight?: number | undefined;
2719
+ maxHeight?: number | undefined;
2720
+ }, {
2721
+ type: "viewport";
2722
+ minWidth?: number | undefined;
2723
+ maxWidth?: number | undefined;
2724
+ minHeight?: number | undefined;
2725
+ maxHeight?: number | undefined;
2726
+ }>, z.ZodObject<{
2727
+ type: z.ZodLiteral<"session_metric">;
2728
+ key: z.ZodEnum<["time_on_page", "page_views", "scroll_depth"]>;
2729
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
2730
+ threshold: z.ZodNumber;
2731
+ }, "strip", z.ZodTypeAny, {
2732
+ type: "session_metric";
2733
+ key: "time_on_page" | "page_views" | "scroll_depth";
2734
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2735
+ threshold: number;
2736
+ }, {
2737
+ type: "session_metric";
2738
+ key: "time_on_page" | "page_views" | "scroll_depth";
2739
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2740
+ threshold: number;
2741
+ }>, z.ZodObject<{
2742
+ type: z.ZodLiteral<"dismissed">;
2743
+ key: z.ZodString;
2744
+ inverted: z.ZodOptional<z.ZodBoolean>;
2745
+ }, "strip", z.ZodTypeAny, {
2746
+ type: "dismissed";
2747
+ key: string;
2748
+ inverted?: boolean | undefined;
2749
+ }, {
2750
+ type: "dismissed";
2751
+ key: string;
2752
+ inverted?: boolean | undefined;
2753
+ }>, z.ZodObject<{
2754
+ type: z.ZodLiteral<"cooldown_active">;
2755
+ key: z.ZodString;
2756
+ inverted: z.ZodOptional<z.ZodBoolean>;
2757
+ }, "strip", z.ZodTypeAny, {
2758
+ type: "cooldown_active";
2759
+ key: string;
2760
+ inverted?: boolean | undefined;
2761
+ }, {
2762
+ type: "cooldown_active";
2763
+ key: string;
2764
+ inverted?: boolean | undefined;
2765
+ }>, z.ZodObject<{
2766
+ type: z.ZodLiteral<"frequency_limit">;
2767
+ key: z.ZodString;
2768
+ limit: z.ZodNumber;
2769
+ inverted: z.ZodOptional<z.ZodBoolean>;
2770
+ }, "strip", z.ZodTypeAny, {
2771
+ type: "frequency_limit";
2772
+ key: string;
2773
+ limit: number;
2774
+ inverted?: boolean | undefined;
2775
+ }, {
2776
+ type: "frequency_limit";
2777
+ key: string;
2778
+ limit: number;
2779
+ inverted?: boolean | undefined;
2780
+ }>, z.ZodObject<{
2781
+ type: z.ZodLiteral<"event_count">;
2782
+ key: z.ZodString;
2783
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
2784
+ count: z.ZodNumber;
2785
+ withinMs: z.ZodOptional<z.ZodNumber>;
2786
+ counter: z.ZodOptional<z.ZodObject<{
2787
+ 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">;
2788
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2789
+ equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
2790
+ contains: z.ZodOptional<z.ZodString>;
2791
+ }, "strip", z.ZodTypeAny, {
2792
+ equals?: string | number | boolean | undefined;
2793
+ contains?: string | undefined;
2794
+ }, {
2795
+ equals?: string | number | boolean | undefined;
2796
+ contains?: string | undefined;
2797
+ }>>>;
2798
+ }, "strip", z.ZodTypeAny, {
2799
+ 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")[];
2800
+ match?: Record<string, {
2801
+ equals?: string | number | boolean | undefined;
2802
+ contains?: string | undefined;
2803
+ }> | undefined;
2804
+ }, {
2805
+ 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")[];
2806
+ match?: Record<string, {
2807
+ equals?: string | number | boolean | undefined;
2808
+ contains?: string | undefined;
2809
+ }> | undefined;
2810
+ }>>;
2811
+ }, "strip", z.ZodTypeAny, {
2812
+ type: "event_count";
2813
+ key: string;
2814
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2815
+ count: number;
2816
+ withinMs?: number | undefined;
2817
+ counter?: {
2818
+ 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")[];
2819
+ match?: Record<string, {
2820
+ equals?: string | number | boolean | undefined;
2821
+ contains?: string | undefined;
2822
+ }> | undefined;
2823
+ } | undefined;
2824
+ }, {
2825
+ type: "event_count";
2826
+ key: string;
2827
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2828
+ count: number;
2829
+ withinMs?: number | undefined;
2830
+ counter?: {
2831
+ 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")[];
2832
+ match?: Record<string, {
2833
+ equals?: string | number | boolean | undefined;
2834
+ contains?: string | undefined;
2835
+ }> | undefined;
2836
+ } | undefined;
2837
+ }>]>, "many">;
2838
+ value: z.ZodUnknown;
2839
+ }, "strip", z.ZodTypeAny, {
2840
+ conditions: ({
2841
+ type: "page_url";
2842
+ url: string;
2843
+ } | {
2844
+ type: "route";
2845
+ routeId: string;
2846
+ } | {
2847
+ type: "anchor_visible";
2848
+ anchorId: string;
2849
+ state: "visible" | "present" | "absent";
2850
+ } | {
2851
+ type: "event_occurred";
2852
+ eventName: string;
2853
+ withinMs?: number | undefined;
2854
+ } | {
2855
+ type: "state_equals";
2856
+ key: string;
2857
+ value?: unknown;
2858
+ } | {
2859
+ type: "viewport";
2860
+ minWidth?: number | undefined;
2861
+ maxWidth?: number | undefined;
2862
+ minHeight?: number | undefined;
2863
+ maxHeight?: number | undefined;
2864
+ } | {
2865
+ type: "session_metric";
2866
+ key: "time_on_page" | "page_views" | "scroll_depth";
2867
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2868
+ threshold: number;
2869
+ } | {
2870
+ type: "dismissed";
2871
+ key: string;
2872
+ inverted?: boolean | undefined;
2873
+ } | {
2874
+ type: "cooldown_active";
2875
+ key: string;
2876
+ inverted?: boolean | undefined;
2877
+ } | {
2878
+ type: "frequency_limit";
2879
+ key: string;
2880
+ limit: number;
2881
+ inverted?: boolean | undefined;
2882
+ } | {
2883
+ type: "event_count";
2884
+ key: string;
2885
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2886
+ count: number;
2887
+ withinMs?: number | undefined;
2888
+ counter?: {
2889
+ 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")[];
2890
+ match?: Record<string, {
2891
+ equals?: string | number | boolean | undefined;
2892
+ contains?: string | undefined;
2893
+ }> | undefined;
2894
+ } | undefined;
2895
+ })[];
2896
+ value?: unknown;
2897
+ }, {
2898
+ conditions: ({
2899
+ type: "page_url";
2900
+ url: string;
2901
+ } | {
2902
+ type: "route";
2903
+ routeId: string;
2904
+ } | {
2905
+ type: "anchor_visible";
2906
+ anchorId: string;
2907
+ state: "visible" | "present" | "absent";
2908
+ } | {
2909
+ type: "event_occurred";
2910
+ eventName: string;
2911
+ withinMs?: number | undefined;
2912
+ } | {
2913
+ type: "state_equals";
2914
+ key: string;
2915
+ value?: unknown;
2916
+ } | {
2917
+ type: "viewport";
2918
+ minWidth?: number | undefined;
2919
+ maxWidth?: number | undefined;
2920
+ minHeight?: number | undefined;
2921
+ maxHeight?: number | undefined;
2922
+ } | {
2923
+ type: "session_metric";
2924
+ key: "time_on_page" | "page_views" | "scroll_depth";
2925
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2926
+ threshold: number;
2927
+ } | {
2928
+ type: "dismissed";
2929
+ key: string;
2930
+ inverted?: boolean | undefined;
2931
+ } | {
2932
+ type: "cooldown_active";
2933
+ key: string;
2934
+ inverted?: boolean | undefined;
2935
+ } | {
2936
+ type: "frequency_limit";
2937
+ key: string;
2938
+ limit: number;
2939
+ inverted?: boolean | undefined;
2940
+ } | {
2941
+ type: "event_count";
2942
+ key: string;
2943
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2944
+ count: number;
2945
+ withinMs?: number | undefined;
2946
+ counter?: {
2947
+ 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")[];
2948
+ match?: Record<string, {
2949
+ equals?: string | number | boolean | undefined;
2950
+ contains?: string | undefined;
2951
+ }> | undefined;
2952
+ } | undefined;
2953
+ })[];
2954
+ value?: unknown;
2955
+ }>, "many">;
2956
+ default: z.ZodUnknown;
2957
+ }, "strip", z.ZodTypeAny, {
2958
+ type: "rules";
2959
+ rules: {
2960
+ conditions: ({
2961
+ type: "page_url";
2962
+ url: string;
2963
+ } | {
2964
+ type: "route";
2965
+ routeId: string;
2966
+ } | {
2967
+ type: "anchor_visible";
2968
+ anchorId: string;
2969
+ state: "visible" | "present" | "absent";
2970
+ } | {
2971
+ type: "event_occurred";
2972
+ eventName: string;
2973
+ withinMs?: number | undefined;
2974
+ } | {
2975
+ type: "state_equals";
2976
+ key: string;
2977
+ value?: unknown;
2978
+ } | {
2979
+ type: "viewport";
2980
+ minWidth?: number | undefined;
2981
+ maxWidth?: number | undefined;
2982
+ minHeight?: number | undefined;
2983
+ maxHeight?: number | undefined;
2984
+ } | {
2985
+ type: "session_metric";
2986
+ key: "time_on_page" | "page_views" | "scroll_depth";
2987
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2988
+ threshold: number;
2989
+ } | {
2990
+ type: "dismissed";
2991
+ key: string;
2992
+ inverted?: boolean | undefined;
2993
+ } | {
2994
+ type: "cooldown_active";
2995
+ key: string;
2996
+ inverted?: boolean | undefined;
2997
+ } | {
2998
+ type: "frequency_limit";
2999
+ key: string;
3000
+ limit: number;
3001
+ inverted?: boolean | undefined;
3002
+ } | {
3003
+ type: "event_count";
3004
+ key: string;
3005
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
3006
+ count: number;
3007
+ withinMs?: number | undefined;
3008
+ counter?: {
3009
+ 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")[];
3010
+ match?: Record<string, {
3011
+ equals?: string | number | boolean | undefined;
3012
+ contains?: string | undefined;
3013
+ }> | undefined;
3014
+ } | undefined;
3015
+ })[];
3016
+ value?: unknown;
3017
+ }[];
3018
+ default?: unknown;
3019
+ }, {
3020
+ type: "rules";
3021
+ rules: {
3022
+ conditions: ({
3023
+ type: "page_url";
3024
+ url: string;
3025
+ } | {
3026
+ type: "route";
3027
+ routeId: string;
3028
+ } | {
3029
+ type: "anchor_visible";
3030
+ anchorId: string;
3031
+ state: "visible" | "present" | "absent";
3032
+ } | {
3033
+ type: "event_occurred";
3034
+ eventName: string;
3035
+ withinMs?: number | undefined;
3036
+ } | {
3037
+ type: "state_equals";
3038
+ key: string;
3039
+ value?: unknown;
3040
+ } | {
3041
+ type: "viewport";
3042
+ minWidth?: number | undefined;
3043
+ maxWidth?: number | undefined;
3044
+ minHeight?: number | undefined;
3045
+ maxHeight?: number | undefined;
3046
+ } | {
3047
+ type: "session_metric";
3048
+ key: "time_on_page" | "page_views" | "scroll_depth";
3049
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
3050
+ threshold: number;
3051
+ } | {
3052
+ type: "dismissed";
3053
+ key: string;
3054
+ inverted?: boolean | undefined;
3055
+ } | {
3056
+ type: "cooldown_active";
3057
+ key: string;
3058
+ inverted?: boolean | undefined;
3059
+ } | {
3060
+ type: "frequency_limit";
3061
+ key: string;
3062
+ limit: number;
3063
+ inverted?: boolean | undefined;
3064
+ } | {
3065
+ type: "event_count";
3066
+ key: string;
3067
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
3068
+ count: number;
3069
+ withinMs?: number | undefined;
3070
+ counter?: {
3071
+ 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")[];
3072
+ match?: Record<string, {
3073
+ equals?: string | number | boolean | undefined;
3074
+ contains?: string | undefined;
3075
+ }> | undefined;
3076
+ } | undefined;
3077
+ })[];
3078
+ value?: unknown;
3079
+ }[];
3080
+ default?: unknown;
3081
+ }>, z.ZodObject<{
3082
+ type: z.ZodLiteral<"score">;
3083
+ field: z.ZodString;
3084
+ threshold: z.ZodNumber;
3085
+ above: z.ZodUnknown;
3086
+ below: z.ZodUnknown;
3087
+ }, "strip", z.ZodTypeAny, {
3088
+ type: "score";
3089
+ threshold: number;
3090
+ field: string;
3091
+ above?: unknown;
3092
+ below?: unknown;
3093
+ }, {
3094
+ type: "score";
3095
+ threshold: number;
3096
+ field: string;
3097
+ above?: unknown;
3098
+ below?: unknown;
3099
+ }>, z.ZodObject<{
3100
+ type: z.ZodLiteral<"model">;
3101
+ modelId: z.ZodString;
3102
+ inputs: z.ZodArray<z.ZodString, "many">;
3103
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3104
+ default: z.ZodUnknown;
3105
+ }, "strip", z.ZodTypeAny, {
3106
+ type: "model";
3107
+ modelId: string;
3108
+ inputs: string[];
3109
+ outputMapping: Record<string, unknown>;
3110
+ default?: unknown;
3111
+ }, {
3112
+ type: "model";
3113
+ modelId: string;
3114
+ inputs: string[];
3115
+ outputMapping: Record<string, unknown>;
3116
+ default?: unknown;
3117
+ }>, z.ZodObject<{
3118
+ type: z.ZodLiteral<"external">;
3119
+ endpoint: z.ZodString;
3120
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
3121
+ default: z.ZodUnknown;
3122
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
3123
+ }, "strip", z.ZodTypeAny, {
3124
+ type: "external";
3125
+ endpoint: string;
3126
+ default?: unknown;
3127
+ method?: "GET" | "POST" | undefined;
3128
+ timeoutMs?: number | undefined;
3129
+ }, {
3130
+ type: "external";
3131
+ endpoint: string;
3132
+ default?: unknown;
3133
+ method?: "GET" | "POST" | undefined;
3134
+ timeoutMs?: number | undefined;
3135
+ }>]>>>;
3136
+ notify: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3137
+ title: z.ZodOptional<z.ZodString>;
3138
+ body: z.ZodOptional<z.ZodString>;
3139
+ icon: z.ZodOptional<z.ZodString>;
3140
+ }, "strip", z.ZodTypeAny, {
3141
+ title?: string | undefined;
3142
+ body?: string | undefined;
3143
+ icon?: string | undefined;
3144
+ }, {
3145
+ title?: string | undefined;
3146
+ body?: string | undefined;
3147
+ icon?: string | undefined;
3148
+ }>>>;
3149
+ id: z.ZodOptional<z.ZodString>;
3150
+ title: z.ZodOptional<z.ZodString>;
3151
+ description: z.ZodOptional<z.ZodString>;
3152
+ validation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3153
+ }, "strip", z.ZodTypeAny, {
3154
+ config: {
3155
+ title: string;
3156
+ id: string;
3157
+ payload: {
3158
+ widget: string;
3159
+ props?: Record<string, unknown> | undefined;
3160
+ };
3161
+ };
3162
+ kind: "suggestions:chip";
3163
+ title?: string | undefined;
3164
+ id?: string | undefined;
3165
+ validation?: string[] | undefined;
3166
+ triggerWhen?: {
3167
+ type: "rules";
3168
+ rules: {
3169
+ conditions: ({
3170
+ type: "page_url";
3171
+ url: string;
3172
+ } | {
3173
+ type: "route";
3174
+ routeId: string;
3175
+ } | {
3176
+ type: "anchor_visible";
3177
+ anchorId: string;
3178
+ state: "visible" | "present" | "absent";
3179
+ } | {
3180
+ type: "event_occurred";
3181
+ eventName: string;
3182
+ withinMs?: number | undefined;
3183
+ } | {
3184
+ type: "state_equals";
3185
+ key: string;
3186
+ value?: unknown;
3187
+ } | {
3188
+ type: "viewport";
3189
+ minWidth?: number | undefined;
3190
+ maxWidth?: number | undefined;
3191
+ minHeight?: number | undefined;
3192
+ maxHeight?: number | undefined;
3193
+ } | {
3194
+ type: "session_metric";
3195
+ key: "time_on_page" | "page_views" | "scroll_depth";
3196
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
3197
+ threshold: number;
3198
+ } | {
3199
+ type: "dismissed";
3200
+ key: string;
3201
+ inverted?: boolean | undefined;
3202
+ } | {
3203
+ type: "cooldown_active";
3204
+ key: string;
3205
+ inverted?: boolean | undefined;
3206
+ } | {
3207
+ type: "frequency_limit";
3208
+ key: string;
3209
+ limit: number;
3210
+ inverted?: boolean | undefined;
3211
+ } | {
3212
+ type: "event_count";
3213
+ key: string;
3214
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
3215
+ count: number;
3216
+ withinMs?: number | undefined;
3217
+ counter?: {
3218
+ 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")[];
3219
+ match?: Record<string, {
3220
+ equals?: string | number | boolean | undefined;
3221
+ contains?: string | undefined;
3222
+ }> | undefined;
3223
+ } | undefined;
3224
+ })[];
3225
+ value?: unknown;
3226
+ }[];
3227
+ default?: unknown;
3228
+ } | {
3229
+ type: "score";
3230
+ threshold: number;
3231
+ field: string;
3232
+ above?: unknown;
3233
+ below?: unknown;
3234
+ } | {
3235
+ type: "model";
3236
+ modelId: string;
3237
+ inputs: string[];
3238
+ outputMapping: Record<string, unknown>;
3239
+ default?: unknown;
3240
+ } | {
3241
+ type: "external";
3242
+ endpoint: string;
3243
+ default?: unknown;
3244
+ method?: "GET" | "POST" | undefined;
3245
+ timeoutMs?: number | undefined;
3246
+ } | null | undefined;
3247
+ notify?: {
3248
+ title?: string | undefined;
3249
+ body?: string | undefined;
3250
+ icon?: string | undefined;
3251
+ } | null | undefined;
3252
+ description?: string | undefined;
3253
+ }, {
3254
+ config: {
3255
+ title: string;
3256
+ id: string;
3257
+ payload: {
3258
+ widget: string;
3259
+ props?: Record<string, unknown> | undefined;
3260
+ };
3261
+ };
3262
+ kind: "suggestions:chip";
3263
+ title?: string | undefined;
3264
+ id?: string | undefined;
3265
+ validation?: string[] | undefined;
3266
+ triggerWhen?: {
3267
+ type: "rules";
3268
+ rules: {
3269
+ conditions: ({
3270
+ type: "page_url";
3271
+ url: string;
3272
+ } | {
3273
+ type: "route";
3274
+ routeId: string;
3275
+ } | {
3276
+ type: "anchor_visible";
3277
+ anchorId: string;
3278
+ state: "visible" | "present" | "absent";
3279
+ } | {
3280
+ type: "event_occurred";
3281
+ eventName: string;
3282
+ withinMs?: number | undefined;
3283
+ } | {
3284
+ type: "state_equals";
3285
+ key: string;
3286
+ value?: unknown;
3287
+ } | {
3288
+ type: "viewport";
3289
+ minWidth?: number | undefined;
3290
+ maxWidth?: number | undefined;
3291
+ minHeight?: number | undefined;
3292
+ maxHeight?: number | undefined;
3293
+ } | {
3294
+ type: "session_metric";
3295
+ key: "time_on_page" | "page_views" | "scroll_depth";
3296
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
3297
+ threshold: number;
3298
+ } | {
3299
+ type: "dismissed";
3300
+ key: string;
3301
+ inverted?: boolean | undefined;
3302
+ } | {
3303
+ type: "cooldown_active";
3304
+ key: string;
3305
+ inverted?: boolean | undefined;
3306
+ } | {
3307
+ type: "frequency_limit";
3308
+ key: string;
3309
+ limit: number;
3310
+ inverted?: boolean | undefined;
3311
+ } | {
3312
+ type: "event_count";
3313
+ key: string;
3314
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
3315
+ count: number;
3316
+ withinMs?: number | undefined;
3317
+ counter?: {
3318
+ 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")[];
3319
+ match?: Record<string, {
3320
+ equals?: string | number | boolean | undefined;
3321
+ contains?: string | undefined;
3322
+ }> | undefined;
3323
+ } | undefined;
3324
+ })[];
3325
+ value?: unknown;
3326
+ }[];
3327
+ default?: unknown;
3328
+ } | {
3329
+ type: "score";
3330
+ threshold: number;
3331
+ field: string;
3332
+ above?: unknown;
3333
+ below?: unknown;
3334
+ } | {
3335
+ type: "model";
3336
+ modelId: string;
3337
+ inputs: string[];
3338
+ outputMapping: Record<string, unknown>;
3339
+ default?: unknown;
3340
+ } | {
3341
+ type: "external";
3342
+ endpoint: string;
3343
+ default?: unknown;
3344
+ method?: "GET" | "POST" | undefined;
3345
+ timeoutMs?: number | undefined;
3346
+ } | null | undefined;
3347
+ notify?: {
3348
+ title?: string | undefined;
3349
+ body?: string | undefined;
3350
+ icon?: string | undefined;
3351
+ } | null | undefined;
3352
+ description?: string | undefined;
66
3353
  }>;
67
3354
  }[];
68
3355
  //# sourceMappingURL=schema.d.ts.map