agentic-zi-ui-schema 0.0.1

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.
@@ -0,0 +1,1581 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * ui.v1 — a safe, declarative UI schema.
4
+ * - No executable JS
5
+ * - Events map to action descriptors
6
+ * - Client uses allowlists to render
7
+ */
8
+ export declare const UI_LIMITS: {
9
+ readonly MAX_NODES: 500;
10
+ readonly MAX_DEPTH: 30;
11
+ readonly MAX_TEXT_LEN: 10000;
12
+ readonly MAX_CLASSNAME_LEN: 1000;
13
+ readonly MAX_ID_LEN: 200;
14
+ readonly MAX_URL_LEN: 2000;
15
+ readonly MAX_KEY_LEN: 200;
16
+ };
17
+ export declare const UI_ALLOWED_TAGS: readonly ["a", "article", "aside", "blockquote", "br", "button", "code", "div", "em", "figcaption", "figure", "fieldset", "footer", "form", "h1", "h2", "h3", "h4", "header", "hr", "img", "input", "label", "li", "main", "nav", "ol", "option", "p", "path", "pre", "section", "select", "small", "span", "strong", "svg", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "tr", "ul"];
18
+ export declare const UI_ALLOWED_PROPS: readonly ["alt", "aria-label", "aria-controls", "aria-current", "aria-describedby", "aria-disabled", "aria-expanded", "aria-hidden", "aria-invalid", "aria-labelledby", "aria-live", "aria-pressed", "aria-required", "aria-selected", "aria-checked", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext", "aria-busy", "checked", "clipRule", "cols", "cx", "cy", "d", "decoding", "disabled", "fill", "fillRule", "height", "htmlFor", "href", "loading", "max", "maxLength", "min", "minLength", "name", "opacity", "placeholder", "preserveAspectRatio", "rel", "role", "r", "rows", "src", "stroke", "strokeLinecap", "strokeLinejoin", "strokeWidth", "step", "target", "title", "type", "value", "viewBox", "width", "x", "y"];
19
+ export declare const UI_ALLOWED_EVENTS: readonly ["onClick", "onChange", "onSubmit", "onMouseEnter", "onMouseLeave", "onMouseOver", "onMouseOut", "onMouseDown", "onMouseUp", "onMouseMove", "onFocus", "onBlur"];
20
+ export declare const UiActionTypeSchema: z.ZodEnum<["FLOW_EVENT", "OPEN_URL", "COPY", "TOAST", "PATCH_STATE"]>;
21
+ export type UiActionType = z.infer<typeof UiActionTypeSchema>;
22
+ export declare const UiActionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
23
+ type: z.ZodLiteral<"FLOW_EVENT">;
24
+ name: z.ZodString;
25
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ name: string;
28
+ type: "FLOW_EVENT";
29
+ payload?: Record<string, unknown> | undefined;
30
+ }, {
31
+ name: string;
32
+ type: "FLOW_EVENT";
33
+ payload?: Record<string, unknown> | undefined;
34
+ }>, z.ZodObject<{
35
+ type: z.ZodLiteral<"OPEN_URL">;
36
+ url: z.ZodString;
37
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ type: "OPEN_URL";
40
+ url: string;
41
+ target?: "_blank" | "_self" | undefined;
42
+ }, {
43
+ type: "OPEN_URL";
44
+ url: string;
45
+ target?: "_blank" | "_self" | undefined;
46
+ }>, z.ZodObject<{
47
+ type: z.ZodLiteral<"COPY">;
48
+ text: z.ZodString;
49
+ }, "strip", z.ZodTypeAny, {
50
+ type: "COPY";
51
+ text: string;
52
+ }, {
53
+ type: "COPY";
54
+ text: string;
55
+ }>, z.ZodObject<{
56
+ type: z.ZodLiteral<"TOAST">;
57
+ message: z.ZodString;
58
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ type: "TOAST";
61
+ message: string;
62
+ level?: "info" | "success" | "warning" | "error" | undefined;
63
+ }, {
64
+ type: "TOAST";
65
+ message: string;
66
+ level?: "info" | "success" | "warning" | "error" | undefined;
67
+ }>, z.ZodObject<{
68
+ type: z.ZodLiteral<"PATCH_STATE">;
69
+ key: z.ZodString;
70
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
71
+ value: z.ZodOptional<z.ZodUnknown>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ type: "PATCH_STATE";
74
+ key: string;
75
+ value?: unknown;
76
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
77
+ }, {
78
+ type: "PATCH_STATE";
79
+ key: string;
80
+ value?: unknown;
81
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
82
+ }>]>;
83
+ export type UiAction = z.infer<typeof UiActionSchema>;
84
+ export declare const UiEventMapSchema: z.ZodObject<{
85
+ onClick: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
86
+ type: z.ZodLiteral<"FLOW_EVENT">;
87
+ name: z.ZodString;
88
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ name: string;
91
+ type: "FLOW_EVENT";
92
+ payload?: Record<string, unknown> | undefined;
93
+ }, {
94
+ name: string;
95
+ type: "FLOW_EVENT";
96
+ payload?: Record<string, unknown> | undefined;
97
+ }>, z.ZodObject<{
98
+ type: z.ZodLiteral<"OPEN_URL">;
99
+ url: z.ZodString;
100
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ type: "OPEN_URL";
103
+ url: string;
104
+ target?: "_blank" | "_self" | undefined;
105
+ }, {
106
+ type: "OPEN_URL";
107
+ url: string;
108
+ target?: "_blank" | "_self" | undefined;
109
+ }>, z.ZodObject<{
110
+ type: z.ZodLiteral<"COPY">;
111
+ text: z.ZodString;
112
+ }, "strip", z.ZodTypeAny, {
113
+ type: "COPY";
114
+ text: string;
115
+ }, {
116
+ type: "COPY";
117
+ text: string;
118
+ }>, z.ZodObject<{
119
+ type: z.ZodLiteral<"TOAST">;
120
+ message: z.ZodString;
121
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
122
+ }, "strip", z.ZodTypeAny, {
123
+ type: "TOAST";
124
+ message: string;
125
+ level?: "info" | "success" | "warning" | "error" | undefined;
126
+ }, {
127
+ type: "TOAST";
128
+ message: string;
129
+ level?: "info" | "success" | "warning" | "error" | undefined;
130
+ }>, z.ZodObject<{
131
+ type: z.ZodLiteral<"PATCH_STATE">;
132
+ key: z.ZodString;
133
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
134
+ value: z.ZodOptional<z.ZodUnknown>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ type: "PATCH_STATE";
137
+ key: string;
138
+ value?: unknown;
139
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
140
+ }, {
141
+ type: "PATCH_STATE";
142
+ key: string;
143
+ value?: unknown;
144
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
145
+ }>]>>;
146
+ onChange: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
147
+ type: z.ZodLiteral<"FLOW_EVENT">;
148
+ name: z.ZodString;
149
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
150
+ }, "strip", z.ZodTypeAny, {
151
+ name: string;
152
+ type: "FLOW_EVENT";
153
+ payload?: Record<string, unknown> | undefined;
154
+ }, {
155
+ name: string;
156
+ type: "FLOW_EVENT";
157
+ payload?: Record<string, unknown> | undefined;
158
+ }>, z.ZodObject<{
159
+ type: z.ZodLiteral<"OPEN_URL">;
160
+ url: z.ZodString;
161
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
162
+ }, "strip", z.ZodTypeAny, {
163
+ type: "OPEN_URL";
164
+ url: string;
165
+ target?: "_blank" | "_self" | undefined;
166
+ }, {
167
+ type: "OPEN_URL";
168
+ url: string;
169
+ target?: "_blank" | "_self" | undefined;
170
+ }>, z.ZodObject<{
171
+ type: z.ZodLiteral<"COPY">;
172
+ text: z.ZodString;
173
+ }, "strip", z.ZodTypeAny, {
174
+ type: "COPY";
175
+ text: string;
176
+ }, {
177
+ type: "COPY";
178
+ text: string;
179
+ }>, z.ZodObject<{
180
+ type: z.ZodLiteral<"TOAST">;
181
+ message: z.ZodString;
182
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
183
+ }, "strip", z.ZodTypeAny, {
184
+ type: "TOAST";
185
+ message: string;
186
+ level?: "info" | "success" | "warning" | "error" | undefined;
187
+ }, {
188
+ type: "TOAST";
189
+ message: string;
190
+ level?: "info" | "success" | "warning" | "error" | undefined;
191
+ }>, z.ZodObject<{
192
+ type: z.ZodLiteral<"PATCH_STATE">;
193
+ key: z.ZodString;
194
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
195
+ value: z.ZodOptional<z.ZodUnknown>;
196
+ }, "strip", z.ZodTypeAny, {
197
+ type: "PATCH_STATE";
198
+ key: string;
199
+ value?: unknown;
200
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
201
+ }, {
202
+ type: "PATCH_STATE";
203
+ key: string;
204
+ value?: unknown;
205
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
206
+ }>]>>;
207
+ onSubmit: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
208
+ type: z.ZodLiteral<"FLOW_EVENT">;
209
+ name: z.ZodString;
210
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
211
+ }, "strip", z.ZodTypeAny, {
212
+ name: string;
213
+ type: "FLOW_EVENT";
214
+ payload?: Record<string, unknown> | undefined;
215
+ }, {
216
+ name: string;
217
+ type: "FLOW_EVENT";
218
+ payload?: Record<string, unknown> | undefined;
219
+ }>, z.ZodObject<{
220
+ type: z.ZodLiteral<"OPEN_URL">;
221
+ url: z.ZodString;
222
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ type: "OPEN_URL";
225
+ url: string;
226
+ target?: "_blank" | "_self" | undefined;
227
+ }, {
228
+ type: "OPEN_URL";
229
+ url: string;
230
+ target?: "_blank" | "_self" | undefined;
231
+ }>, z.ZodObject<{
232
+ type: z.ZodLiteral<"COPY">;
233
+ text: z.ZodString;
234
+ }, "strip", z.ZodTypeAny, {
235
+ type: "COPY";
236
+ text: string;
237
+ }, {
238
+ type: "COPY";
239
+ text: string;
240
+ }>, z.ZodObject<{
241
+ type: z.ZodLiteral<"TOAST">;
242
+ message: z.ZodString;
243
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
244
+ }, "strip", z.ZodTypeAny, {
245
+ type: "TOAST";
246
+ message: string;
247
+ level?: "info" | "success" | "warning" | "error" | undefined;
248
+ }, {
249
+ type: "TOAST";
250
+ message: string;
251
+ level?: "info" | "success" | "warning" | "error" | undefined;
252
+ }>, z.ZodObject<{
253
+ type: z.ZodLiteral<"PATCH_STATE">;
254
+ key: z.ZodString;
255
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
256
+ value: z.ZodOptional<z.ZodUnknown>;
257
+ }, "strip", z.ZodTypeAny, {
258
+ type: "PATCH_STATE";
259
+ key: string;
260
+ value?: unknown;
261
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
262
+ }, {
263
+ type: "PATCH_STATE";
264
+ key: string;
265
+ value?: unknown;
266
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
267
+ }>]>>;
268
+ onMouseEnter: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
269
+ type: z.ZodLiteral<"FLOW_EVENT">;
270
+ name: z.ZodString;
271
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
272
+ }, "strip", z.ZodTypeAny, {
273
+ name: string;
274
+ type: "FLOW_EVENT";
275
+ payload?: Record<string, unknown> | undefined;
276
+ }, {
277
+ name: string;
278
+ type: "FLOW_EVENT";
279
+ payload?: Record<string, unknown> | undefined;
280
+ }>, z.ZodObject<{
281
+ type: z.ZodLiteral<"OPEN_URL">;
282
+ url: z.ZodString;
283
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
284
+ }, "strip", z.ZodTypeAny, {
285
+ type: "OPEN_URL";
286
+ url: string;
287
+ target?: "_blank" | "_self" | undefined;
288
+ }, {
289
+ type: "OPEN_URL";
290
+ url: string;
291
+ target?: "_blank" | "_self" | undefined;
292
+ }>, z.ZodObject<{
293
+ type: z.ZodLiteral<"COPY">;
294
+ text: z.ZodString;
295
+ }, "strip", z.ZodTypeAny, {
296
+ type: "COPY";
297
+ text: string;
298
+ }, {
299
+ type: "COPY";
300
+ text: string;
301
+ }>, z.ZodObject<{
302
+ type: z.ZodLiteral<"TOAST">;
303
+ message: z.ZodString;
304
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
305
+ }, "strip", z.ZodTypeAny, {
306
+ type: "TOAST";
307
+ message: string;
308
+ level?: "info" | "success" | "warning" | "error" | undefined;
309
+ }, {
310
+ type: "TOAST";
311
+ message: string;
312
+ level?: "info" | "success" | "warning" | "error" | undefined;
313
+ }>, z.ZodObject<{
314
+ type: z.ZodLiteral<"PATCH_STATE">;
315
+ key: z.ZodString;
316
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
317
+ value: z.ZodOptional<z.ZodUnknown>;
318
+ }, "strip", z.ZodTypeAny, {
319
+ type: "PATCH_STATE";
320
+ key: string;
321
+ value?: unknown;
322
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
323
+ }, {
324
+ type: "PATCH_STATE";
325
+ key: string;
326
+ value?: unknown;
327
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
328
+ }>]>>;
329
+ onMouseLeave: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
330
+ type: z.ZodLiteral<"FLOW_EVENT">;
331
+ name: z.ZodString;
332
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
333
+ }, "strip", z.ZodTypeAny, {
334
+ name: string;
335
+ type: "FLOW_EVENT";
336
+ payload?: Record<string, unknown> | undefined;
337
+ }, {
338
+ name: string;
339
+ type: "FLOW_EVENT";
340
+ payload?: Record<string, unknown> | undefined;
341
+ }>, z.ZodObject<{
342
+ type: z.ZodLiteral<"OPEN_URL">;
343
+ url: z.ZodString;
344
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
345
+ }, "strip", z.ZodTypeAny, {
346
+ type: "OPEN_URL";
347
+ url: string;
348
+ target?: "_blank" | "_self" | undefined;
349
+ }, {
350
+ type: "OPEN_URL";
351
+ url: string;
352
+ target?: "_blank" | "_self" | undefined;
353
+ }>, z.ZodObject<{
354
+ type: z.ZodLiteral<"COPY">;
355
+ text: z.ZodString;
356
+ }, "strip", z.ZodTypeAny, {
357
+ type: "COPY";
358
+ text: string;
359
+ }, {
360
+ type: "COPY";
361
+ text: string;
362
+ }>, z.ZodObject<{
363
+ type: z.ZodLiteral<"TOAST">;
364
+ message: z.ZodString;
365
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
366
+ }, "strip", z.ZodTypeAny, {
367
+ type: "TOAST";
368
+ message: string;
369
+ level?: "info" | "success" | "warning" | "error" | undefined;
370
+ }, {
371
+ type: "TOAST";
372
+ message: string;
373
+ level?: "info" | "success" | "warning" | "error" | undefined;
374
+ }>, z.ZodObject<{
375
+ type: z.ZodLiteral<"PATCH_STATE">;
376
+ key: z.ZodString;
377
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
378
+ value: z.ZodOptional<z.ZodUnknown>;
379
+ }, "strip", z.ZodTypeAny, {
380
+ type: "PATCH_STATE";
381
+ key: string;
382
+ value?: unknown;
383
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
384
+ }, {
385
+ type: "PATCH_STATE";
386
+ key: string;
387
+ value?: unknown;
388
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
389
+ }>]>>;
390
+ onMouseOver: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
391
+ type: z.ZodLiteral<"FLOW_EVENT">;
392
+ name: z.ZodString;
393
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
394
+ }, "strip", z.ZodTypeAny, {
395
+ name: string;
396
+ type: "FLOW_EVENT";
397
+ payload?: Record<string, unknown> | undefined;
398
+ }, {
399
+ name: string;
400
+ type: "FLOW_EVENT";
401
+ payload?: Record<string, unknown> | undefined;
402
+ }>, z.ZodObject<{
403
+ type: z.ZodLiteral<"OPEN_URL">;
404
+ url: z.ZodString;
405
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
406
+ }, "strip", z.ZodTypeAny, {
407
+ type: "OPEN_URL";
408
+ url: string;
409
+ target?: "_blank" | "_self" | undefined;
410
+ }, {
411
+ type: "OPEN_URL";
412
+ url: string;
413
+ target?: "_blank" | "_self" | undefined;
414
+ }>, z.ZodObject<{
415
+ type: z.ZodLiteral<"COPY">;
416
+ text: z.ZodString;
417
+ }, "strip", z.ZodTypeAny, {
418
+ type: "COPY";
419
+ text: string;
420
+ }, {
421
+ type: "COPY";
422
+ text: string;
423
+ }>, z.ZodObject<{
424
+ type: z.ZodLiteral<"TOAST">;
425
+ message: z.ZodString;
426
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
427
+ }, "strip", z.ZodTypeAny, {
428
+ type: "TOAST";
429
+ message: string;
430
+ level?: "info" | "success" | "warning" | "error" | undefined;
431
+ }, {
432
+ type: "TOAST";
433
+ message: string;
434
+ level?: "info" | "success" | "warning" | "error" | undefined;
435
+ }>, z.ZodObject<{
436
+ type: z.ZodLiteral<"PATCH_STATE">;
437
+ key: z.ZodString;
438
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
439
+ value: z.ZodOptional<z.ZodUnknown>;
440
+ }, "strip", z.ZodTypeAny, {
441
+ type: "PATCH_STATE";
442
+ key: string;
443
+ value?: unknown;
444
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
445
+ }, {
446
+ type: "PATCH_STATE";
447
+ key: string;
448
+ value?: unknown;
449
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
450
+ }>]>>;
451
+ onMouseOut: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
452
+ type: z.ZodLiteral<"FLOW_EVENT">;
453
+ name: z.ZodString;
454
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
455
+ }, "strip", z.ZodTypeAny, {
456
+ name: string;
457
+ type: "FLOW_EVENT";
458
+ payload?: Record<string, unknown> | undefined;
459
+ }, {
460
+ name: string;
461
+ type: "FLOW_EVENT";
462
+ payload?: Record<string, unknown> | undefined;
463
+ }>, z.ZodObject<{
464
+ type: z.ZodLiteral<"OPEN_URL">;
465
+ url: z.ZodString;
466
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
467
+ }, "strip", z.ZodTypeAny, {
468
+ type: "OPEN_URL";
469
+ url: string;
470
+ target?: "_blank" | "_self" | undefined;
471
+ }, {
472
+ type: "OPEN_URL";
473
+ url: string;
474
+ target?: "_blank" | "_self" | undefined;
475
+ }>, z.ZodObject<{
476
+ type: z.ZodLiteral<"COPY">;
477
+ text: z.ZodString;
478
+ }, "strip", z.ZodTypeAny, {
479
+ type: "COPY";
480
+ text: string;
481
+ }, {
482
+ type: "COPY";
483
+ text: string;
484
+ }>, z.ZodObject<{
485
+ type: z.ZodLiteral<"TOAST">;
486
+ message: z.ZodString;
487
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
488
+ }, "strip", z.ZodTypeAny, {
489
+ type: "TOAST";
490
+ message: string;
491
+ level?: "info" | "success" | "warning" | "error" | undefined;
492
+ }, {
493
+ type: "TOAST";
494
+ message: string;
495
+ level?: "info" | "success" | "warning" | "error" | undefined;
496
+ }>, z.ZodObject<{
497
+ type: z.ZodLiteral<"PATCH_STATE">;
498
+ key: z.ZodString;
499
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
500
+ value: z.ZodOptional<z.ZodUnknown>;
501
+ }, "strip", z.ZodTypeAny, {
502
+ type: "PATCH_STATE";
503
+ key: string;
504
+ value?: unknown;
505
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
506
+ }, {
507
+ type: "PATCH_STATE";
508
+ key: string;
509
+ value?: unknown;
510
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
511
+ }>]>>;
512
+ onMouseDown: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
513
+ type: z.ZodLiteral<"FLOW_EVENT">;
514
+ name: z.ZodString;
515
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
516
+ }, "strip", z.ZodTypeAny, {
517
+ name: string;
518
+ type: "FLOW_EVENT";
519
+ payload?: Record<string, unknown> | undefined;
520
+ }, {
521
+ name: string;
522
+ type: "FLOW_EVENT";
523
+ payload?: Record<string, unknown> | undefined;
524
+ }>, z.ZodObject<{
525
+ type: z.ZodLiteral<"OPEN_URL">;
526
+ url: z.ZodString;
527
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
528
+ }, "strip", z.ZodTypeAny, {
529
+ type: "OPEN_URL";
530
+ url: string;
531
+ target?: "_blank" | "_self" | undefined;
532
+ }, {
533
+ type: "OPEN_URL";
534
+ url: string;
535
+ target?: "_blank" | "_self" | undefined;
536
+ }>, z.ZodObject<{
537
+ type: z.ZodLiteral<"COPY">;
538
+ text: z.ZodString;
539
+ }, "strip", z.ZodTypeAny, {
540
+ type: "COPY";
541
+ text: string;
542
+ }, {
543
+ type: "COPY";
544
+ text: string;
545
+ }>, z.ZodObject<{
546
+ type: z.ZodLiteral<"TOAST">;
547
+ message: z.ZodString;
548
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
549
+ }, "strip", z.ZodTypeAny, {
550
+ type: "TOAST";
551
+ message: string;
552
+ level?: "info" | "success" | "warning" | "error" | undefined;
553
+ }, {
554
+ type: "TOAST";
555
+ message: string;
556
+ level?: "info" | "success" | "warning" | "error" | undefined;
557
+ }>, z.ZodObject<{
558
+ type: z.ZodLiteral<"PATCH_STATE">;
559
+ key: z.ZodString;
560
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
561
+ value: z.ZodOptional<z.ZodUnknown>;
562
+ }, "strip", z.ZodTypeAny, {
563
+ type: "PATCH_STATE";
564
+ key: string;
565
+ value?: unknown;
566
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
567
+ }, {
568
+ type: "PATCH_STATE";
569
+ key: string;
570
+ value?: unknown;
571
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
572
+ }>]>>;
573
+ onMouseUp: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
574
+ type: z.ZodLiteral<"FLOW_EVENT">;
575
+ name: z.ZodString;
576
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
577
+ }, "strip", z.ZodTypeAny, {
578
+ name: string;
579
+ type: "FLOW_EVENT";
580
+ payload?: Record<string, unknown> | undefined;
581
+ }, {
582
+ name: string;
583
+ type: "FLOW_EVENT";
584
+ payload?: Record<string, unknown> | undefined;
585
+ }>, z.ZodObject<{
586
+ type: z.ZodLiteral<"OPEN_URL">;
587
+ url: z.ZodString;
588
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
589
+ }, "strip", z.ZodTypeAny, {
590
+ type: "OPEN_URL";
591
+ url: string;
592
+ target?: "_blank" | "_self" | undefined;
593
+ }, {
594
+ type: "OPEN_URL";
595
+ url: string;
596
+ target?: "_blank" | "_self" | undefined;
597
+ }>, z.ZodObject<{
598
+ type: z.ZodLiteral<"COPY">;
599
+ text: z.ZodString;
600
+ }, "strip", z.ZodTypeAny, {
601
+ type: "COPY";
602
+ text: string;
603
+ }, {
604
+ type: "COPY";
605
+ text: string;
606
+ }>, z.ZodObject<{
607
+ type: z.ZodLiteral<"TOAST">;
608
+ message: z.ZodString;
609
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
610
+ }, "strip", z.ZodTypeAny, {
611
+ type: "TOAST";
612
+ message: string;
613
+ level?: "info" | "success" | "warning" | "error" | undefined;
614
+ }, {
615
+ type: "TOAST";
616
+ message: string;
617
+ level?: "info" | "success" | "warning" | "error" | undefined;
618
+ }>, z.ZodObject<{
619
+ type: z.ZodLiteral<"PATCH_STATE">;
620
+ key: z.ZodString;
621
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
622
+ value: z.ZodOptional<z.ZodUnknown>;
623
+ }, "strip", z.ZodTypeAny, {
624
+ type: "PATCH_STATE";
625
+ key: string;
626
+ value?: unknown;
627
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
628
+ }, {
629
+ type: "PATCH_STATE";
630
+ key: string;
631
+ value?: unknown;
632
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
633
+ }>]>>;
634
+ onMouseMove: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
635
+ type: z.ZodLiteral<"FLOW_EVENT">;
636
+ name: z.ZodString;
637
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
638
+ }, "strip", z.ZodTypeAny, {
639
+ name: string;
640
+ type: "FLOW_EVENT";
641
+ payload?: Record<string, unknown> | undefined;
642
+ }, {
643
+ name: string;
644
+ type: "FLOW_EVENT";
645
+ payload?: Record<string, unknown> | undefined;
646
+ }>, z.ZodObject<{
647
+ type: z.ZodLiteral<"OPEN_URL">;
648
+ url: z.ZodString;
649
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
650
+ }, "strip", z.ZodTypeAny, {
651
+ type: "OPEN_URL";
652
+ url: string;
653
+ target?: "_blank" | "_self" | undefined;
654
+ }, {
655
+ type: "OPEN_URL";
656
+ url: string;
657
+ target?: "_blank" | "_self" | undefined;
658
+ }>, z.ZodObject<{
659
+ type: z.ZodLiteral<"COPY">;
660
+ text: z.ZodString;
661
+ }, "strip", z.ZodTypeAny, {
662
+ type: "COPY";
663
+ text: string;
664
+ }, {
665
+ type: "COPY";
666
+ text: string;
667
+ }>, z.ZodObject<{
668
+ type: z.ZodLiteral<"TOAST">;
669
+ message: z.ZodString;
670
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
671
+ }, "strip", z.ZodTypeAny, {
672
+ type: "TOAST";
673
+ message: string;
674
+ level?: "info" | "success" | "warning" | "error" | undefined;
675
+ }, {
676
+ type: "TOAST";
677
+ message: string;
678
+ level?: "info" | "success" | "warning" | "error" | undefined;
679
+ }>, z.ZodObject<{
680
+ type: z.ZodLiteral<"PATCH_STATE">;
681
+ key: z.ZodString;
682
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
683
+ value: z.ZodOptional<z.ZodUnknown>;
684
+ }, "strip", z.ZodTypeAny, {
685
+ type: "PATCH_STATE";
686
+ key: string;
687
+ value?: unknown;
688
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
689
+ }, {
690
+ type: "PATCH_STATE";
691
+ key: string;
692
+ value?: unknown;
693
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
694
+ }>]>>;
695
+ onFocus: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
696
+ type: z.ZodLiteral<"FLOW_EVENT">;
697
+ name: z.ZodString;
698
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
699
+ }, "strip", z.ZodTypeAny, {
700
+ name: string;
701
+ type: "FLOW_EVENT";
702
+ payload?: Record<string, unknown> | undefined;
703
+ }, {
704
+ name: string;
705
+ type: "FLOW_EVENT";
706
+ payload?: Record<string, unknown> | undefined;
707
+ }>, z.ZodObject<{
708
+ type: z.ZodLiteral<"OPEN_URL">;
709
+ url: z.ZodString;
710
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
711
+ }, "strip", z.ZodTypeAny, {
712
+ type: "OPEN_URL";
713
+ url: string;
714
+ target?: "_blank" | "_self" | undefined;
715
+ }, {
716
+ type: "OPEN_URL";
717
+ url: string;
718
+ target?: "_blank" | "_self" | undefined;
719
+ }>, z.ZodObject<{
720
+ type: z.ZodLiteral<"COPY">;
721
+ text: z.ZodString;
722
+ }, "strip", z.ZodTypeAny, {
723
+ type: "COPY";
724
+ text: string;
725
+ }, {
726
+ type: "COPY";
727
+ text: string;
728
+ }>, z.ZodObject<{
729
+ type: z.ZodLiteral<"TOAST">;
730
+ message: z.ZodString;
731
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
732
+ }, "strip", z.ZodTypeAny, {
733
+ type: "TOAST";
734
+ message: string;
735
+ level?: "info" | "success" | "warning" | "error" | undefined;
736
+ }, {
737
+ type: "TOAST";
738
+ message: string;
739
+ level?: "info" | "success" | "warning" | "error" | undefined;
740
+ }>, z.ZodObject<{
741
+ type: z.ZodLiteral<"PATCH_STATE">;
742
+ key: z.ZodString;
743
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
744
+ value: z.ZodOptional<z.ZodUnknown>;
745
+ }, "strip", z.ZodTypeAny, {
746
+ type: "PATCH_STATE";
747
+ key: string;
748
+ value?: unknown;
749
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
750
+ }, {
751
+ type: "PATCH_STATE";
752
+ key: string;
753
+ value?: unknown;
754
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
755
+ }>]>>;
756
+ onBlur: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
757
+ type: z.ZodLiteral<"FLOW_EVENT">;
758
+ name: z.ZodString;
759
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
760
+ }, "strip", z.ZodTypeAny, {
761
+ name: string;
762
+ type: "FLOW_EVENT";
763
+ payload?: Record<string, unknown> | undefined;
764
+ }, {
765
+ name: string;
766
+ type: "FLOW_EVENT";
767
+ payload?: Record<string, unknown> | undefined;
768
+ }>, z.ZodObject<{
769
+ type: z.ZodLiteral<"OPEN_URL">;
770
+ url: z.ZodString;
771
+ target: z.ZodOptional<z.ZodEnum<["_blank", "_self"]>>;
772
+ }, "strip", z.ZodTypeAny, {
773
+ type: "OPEN_URL";
774
+ url: string;
775
+ target?: "_blank" | "_self" | undefined;
776
+ }, {
777
+ type: "OPEN_URL";
778
+ url: string;
779
+ target?: "_blank" | "_self" | undefined;
780
+ }>, z.ZodObject<{
781
+ type: z.ZodLiteral<"COPY">;
782
+ text: z.ZodString;
783
+ }, "strip", z.ZodTypeAny, {
784
+ type: "COPY";
785
+ text: string;
786
+ }, {
787
+ type: "COPY";
788
+ text: string;
789
+ }>, z.ZodObject<{
790
+ type: z.ZodLiteral<"TOAST">;
791
+ message: z.ZodString;
792
+ level: z.ZodOptional<z.ZodEnum<["info", "success", "warning", "error"]>>;
793
+ }, "strip", z.ZodTypeAny, {
794
+ type: "TOAST";
795
+ message: string;
796
+ level?: "info" | "success" | "warning" | "error" | undefined;
797
+ }, {
798
+ type: "TOAST";
799
+ message: string;
800
+ level?: "info" | "success" | "warning" | "error" | undefined;
801
+ }>, z.ZodObject<{
802
+ type: z.ZodLiteral<"PATCH_STATE">;
803
+ key: z.ZodString;
804
+ valueFrom: z.ZodOptional<z.ZodEnum<["event.target.value", "event.target.checked"]>>;
805
+ value: z.ZodOptional<z.ZodUnknown>;
806
+ }, "strip", z.ZodTypeAny, {
807
+ type: "PATCH_STATE";
808
+ key: string;
809
+ value?: unknown;
810
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
811
+ }, {
812
+ type: "PATCH_STATE";
813
+ key: string;
814
+ value?: unknown;
815
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
816
+ }>]>>;
817
+ }, "strict", z.ZodTypeAny, {
818
+ onClick?: {
819
+ name: string;
820
+ type: "FLOW_EVENT";
821
+ payload?: Record<string, unknown> | undefined;
822
+ } | {
823
+ type: "OPEN_URL";
824
+ url: string;
825
+ target?: "_blank" | "_self" | undefined;
826
+ } | {
827
+ type: "COPY";
828
+ text: string;
829
+ } | {
830
+ type: "TOAST";
831
+ message: string;
832
+ level?: "info" | "success" | "warning" | "error" | undefined;
833
+ } | {
834
+ type: "PATCH_STATE";
835
+ key: string;
836
+ value?: unknown;
837
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
838
+ } | undefined;
839
+ onChange?: {
840
+ name: string;
841
+ type: "FLOW_EVENT";
842
+ payload?: Record<string, unknown> | undefined;
843
+ } | {
844
+ type: "OPEN_URL";
845
+ url: string;
846
+ target?: "_blank" | "_self" | undefined;
847
+ } | {
848
+ type: "COPY";
849
+ text: string;
850
+ } | {
851
+ type: "TOAST";
852
+ message: string;
853
+ level?: "info" | "success" | "warning" | "error" | undefined;
854
+ } | {
855
+ type: "PATCH_STATE";
856
+ key: string;
857
+ value?: unknown;
858
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
859
+ } | undefined;
860
+ onSubmit?: {
861
+ name: string;
862
+ type: "FLOW_EVENT";
863
+ payload?: Record<string, unknown> | undefined;
864
+ } | {
865
+ type: "OPEN_URL";
866
+ url: string;
867
+ target?: "_blank" | "_self" | undefined;
868
+ } | {
869
+ type: "COPY";
870
+ text: string;
871
+ } | {
872
+ type: "TOAST";
873
+ message: string;
874
+ level?: "info" | "success" | "warning" | "error" | undefined;
875
+ } | {
876
+ type: "PATCH_STATE";
877
+ key: string;
878
+ value?: unknown;
879
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
880
+ } | undefined;
881
+ onMouseEnter?: {
882
+ name: string;
883
+ type: "FLOW_EVENT";
884
+ payload?: Record<string, unknown> | undefined;
885
+ } | {
886
+ type: "OPEN_URL";
887
+ url: string;
888
+ target?: "_blank" | "_self" | undefined;
889
+ } | {
890
+ type: "COPY";
891
+ text: string;
892
+ } | {
893
+ type: "TOAST";
894
+ message: string;
895
+ level?: "info" | "success" | "warning" | "error" | undefined;
896
+ } | {
897
+ type: "PATCH_STATE";
898
+ key: string;
899
+ value?: unknown;
900
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
901
+ } | undefined;
902
+ onMouseLeave?: {
903
+ name: string;
904
+ type: "FLOW_EVENT";
905
+ payload?: Record<string, unknown> | undefined;
906
+ } | {
907
+ type: "OPEN_URL";
908
+ url: string;
909
+ target?: "_blank" | "_self" | undefined;
910
+ } | {
911
+ type: "COPY";
912
+ text: string;
913
+ } | {
914
+ type: "TOAST";
915
+ message: string;
916
+ level?: "info" | "success" | "warning" | "error" | undefined;
917
+ } | {
918
+ type: "PATCH_STATE";
919
+ key: string;
920
+ value?: unknown;
921
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
922
+ } | undefined;
923
+ onMouseOver?: {
924
+ name: string;
925
+ type: "FLOW_EVENT";
926
+ payload?: Record<string, unknown> | undefined;
927
+ } | {
928
+ type: "OPEN_URL";
929
+ url: string;
930
+ target?: "_blank" | "_self" | undefined;
931
+ } | {
932
+ type: "COPY";
933
+ text: string;
934
+ } | {
935
+ type: "TOAST";
936
+ message: string;
937
+ level?: "info" | "success" | "warning" | "error" | undefined;
938
+ } | {
939
+ type: "PATCH_STATE";
940
+ key: string;
941
+ value?: unknown;
942
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
943
+ } | undefined;
944
+ onMouseOut?: {
945
+ name: string;
946
+ type: "FLOW_EVENT";
947
+ payload?: Record<string, unknown> | undefined;
948
+ } | {
949
+ type: "OPEN_URL";
950
+ url: string;
951
+ target?: "_blank" | "_self" | undefined;
952
+ } | {
953
+ type: "COPY";
954
+ text: string;
955
+ } | {
956
+ type: "TOAST";
957
+ message: string;
958
+ level?: "info" | "success" | "warning" | "error" | undefined;
959
+ } | {
960
+ type: "PATCH_STATE";
961
+ key: string;
962
+ value?: unknown;
963
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
964
+ } | undefined;
965
+ onMouseDown?: {
966
+ name: string;
967
+ type: "FLOW_EVENT";
968
+ payload?: Record<string, unknown> | undefined;
969
+ } | {
970
+ type: "OPEN_URL";
971
+ url: string;
972
+ target?: "_blank" | "_self" | undefined;
973
+ } | {
974
+ type: "COPY";
975
+ text: string;
976
+ } | {
977
+ type: "TOAST";
978
+ message: string;
979
+ level?: "info" | "success" | "warning" | "error" | undefined;
980
+ } | {
981
+ type: "PATCH_STATE";
982
+ key: string;
983
+ value?: unknown;
984
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
985
+ } | undefined;
986
+ onMouseUp?: {
987
+ name: string;
988
+ type: "FLOW_EVENT";
989
+ payload?: Record<string, unknown> | undefined;
990
+ } | {
991
+ type: "OPEN_URL";
992
+ url: string;
993
+ target?: "_blank" | "_self" | undefined;
994
+ } | {
995
+ type: "COPY";
996
+ text: string;
997
+ } | {
998
+ type: "TOAST";
999
+ message: string;
1000
+ level?: "info" | "success" | "warning" | "error" | undefined;
1001
+ } | {
1002
+ type: "PATCH_STATE";
1003
+ key: string;
1004
+ value?: unknown;
1005
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1006
+ } | undefined;
1007
+ onMouseMove?: {
1008
+ name: string;
1009
+ type: "FLOW_EVENT";
1010
+ payload?: Record<string, unknown> | undefined;
1011
+ } | {
1012
+ type: "OPEN_URL";
1013
+ url: string;
1014
+ target?: "_blank" | "_self" | undefined;
1015
+ } | {
1016
+ type: "COPY";
1017
+ text: string;
1018
+ } | {
1019
+ type: "TOAST";
1020
+ message: string;
1021
+ level?: "info" | "success" | "warning" | "error" | undefined;
1022
+ } | {
1023
+ type: "PATCH_STATE";
1024
+ key: string;
1025
+ value?: unknown;
1026
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1027
+ } | undefined;
1028
+ onFocus?: {
1029
+ name: string;
1030
+ type: "FLOW_EVENT";
1031
+ payload?: Record<string, unknown> | undefined;
1032
+ } | {
1033
+ type: "OPEN_URL";
1034
+ url: string;
1035
+ target?: "_blank" | "_self" | undefined;
1036
+ } | {
1037
+ type: "COPY";
1038
+ text: string;
1039
+ } | {
1040
+ type: "TOAST";
1041
+ message: string;
1042
+ level?: "info" | "success" | "warning" | "error" | undefined;
1043
+ } | {
1044
+ type: "PATCH_STATE";
1045
+ key: string;
1046
+ value?: unknown;
1047
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1048
+ } | undefined;
1049
+ onBlur?: {
1050
+ name: string;
1051
+ type: "FLOW_EVENT";
1052
+ payload?: Record<string, unknown> | undefined;
1053
+ } | {
1054
+ type: "OPEN_URL";
1055
+ url: string;
1056
+ target?: "_blank" | "_self" | undefined;
1057
+ } | {
1058
+ type: "COPY";
1059
+ text: string;
1060
+ } | {
1061
+ type: "TOAST";
1062
+ message: string;
1063
+ level?: "info" | "success" | "warning" | "error" | undefined;
1064
+ } | {
1065
+ type: "PATCH_STATE";
1066
+ key: string;
1067
+ value?: unknown;
1068
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1069
+ } | undefined;
1070
+ }, {
1071
+ onClick?: {
1072
+ name: string;
1073
+ type: "FLOW_EVENT";
1074
+ payload?: Record<string, unknown> | undefined;
1075
+ } | {
1076
+ type: "OPEN_URL";
1077
+ url: string;
1078
+ target?: "_blank" | "_self" | undefined;
1079
+ } | {
1080
+ type: "COPY";
1081
+ text: string;
1082
+ } | {
1083
+ type: "TOAST";
1084
+ message: string;
1085
+ level?: "info" | "success" | "warning" | "error" | undefined;
1086
+ } | {
1087
+ type: "PATCH_STATE";
1088
+ key: string;
1089
+ value?: unknown;
1090
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1091
+ } | undefined;
1092
+ onChange?: {
1093
+ name: string;
1094
+ type: "FLOW_EVENT";
1095
+ payload?: Record<string, unknown> | undefined;
1096
+ } | {
1097
+ type: "OPEN_URL";
1098
+ url: string;
1099
+ target?: "_blank" | "_self" | undefined;
1100
+ } | {
1101
+ type: "COPY";
1102
+ text: string;
1103
+ } | {
1104
+ type: "TOAST";
1105
+ message: string;
1106
+ level?: "info" | "success" | "warning" | "error" | undefined;
1107
+ } | {
1108
+ type: "PATCH_STATE";
1109
+ key: string;
1110
+ value?: unknown;
1111
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1112
+ } | undefined;
1113
+ onSubmit?: {
1114
+ name: string;
1115
+ type: "FLOW_EVENT";
1116
+ payload?: Record<string, unknown> | undefined;
1117
+ } | {
1118
+ type: "OPEN_URL";
1119
+ url: string;
1120
+ target?: "_blank" | "_self" | undefined;
1121
+ } | {
1122
+ type: "COPY";
1123
+ text: string;
1124
+ } | {
1125
+ type: "TOAST";
1126
+ message: string;
1127
+ level?: "info" | "success" | "warning" | "error" | undefined;
1128
+ } | {
1129
+ type: "PATCH_STATE";
1130
+ key: string;
1131
+ value?: unknown;
1132
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1133
+ } | undefined;
1134
+ onMouseEnter?: {
1135
+ name: string;
1136
+ type: "FLOW_EVENT";
1137
+ payload?: Record<string, unknown> | undefined;
1138
+ } | {
1139
+ type: "OPEN_URL";
1140
+ url: string;
1141
+ target?: "_blank" | "_self" | undefined;
1142
+ } | {
1143
+ type: "COPY";
1144
+ text: string;
1145
+ } | {
1146
+ type: "TOAST";
1147
+ message: string;
1148
+ level?: "info" | "success" | "warning" | "error" | undefined;
1149
+ } | {
1150
+ type: "PATCH_STATE";
1151
+ key: string;
1152
+ value?: unknown;
1153
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1154
+ } | undefined;
1155
+ onMouseLeave?: {
1156
+ name: string;
1157
+ type: "FLOW_EVENT";
1158
+ payload?: Record<string, unknown> | undefined;
1159
+ } | {
1160
+ type: "OPEN_URL";
1161
+ url: string;
1162
+ target?: "_blank" | "_self" | undefined;
1163
+ } | {
1164
+ type: "COPY";
1165
+ text: string;
1166
+ } | {
1167
+ type: "TOAST";
1168
+ message: string;
1169
+ level?: "info" | "success" | "warning" | "error" | undefined;
1170
+ } | {
1171
+ type: "PATCH_STATE";
1172
+ key: string;
1173
+ value?: unknown;
1174
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1175
+ } | undefined;
1176
+ onMouseOver?: {
1177
+ name: string;
1178
+ type: "FLOW_EVENT";
1179
+ payload?: Record<string, unknown> | undefined;
1180
+ } | {
1181
+ type: "OPEN_URL";
1182
+ url: string;
1183
+ target?: "_blank" | "_self" | undefined;
1184
+ } | {
1185
+ type: "COPY";
1186
+ text: string;
1187
+ } | {
1188
+ type: "TOAST";
1189
+ message: string;
1190
+ level?: "info" | "success" | "warning" | "error" | undefined;
1191
+ } | {
1192
+ type: "PATCH_STATE";
1193
+ key: string;
1194
+ value?: unknown;
1195
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1196
+ } | undefined;
1197
+ onMouseOut?: {
1198
+ name: string;
1199
+ type: "FLOW_EVENT";
1200
+ payload?: Record<string, unknown> | undefined;
1201
+ } | {
1202
+ type: "OPEN_URL";
1203
+ url: string;
1204
+ target?: "_blank" | "_self" | undefined;
1205
+ } | {
1206
+ type: "COPY";
1207
+ text: string;
1208
+ } | {
1209
+ type: "TOAST";
1210
+ message: string;
1211
+ level?: "info" | "success" | "warning" | "error" | undefined;
1212
+ } | {
1213
+ type: "PATCH_STATE";
1214
+ key: string;
1215
+ value?: unknown;
1216
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1217
+ } | undefined;
1218
+ onMouseDown?: {
1219
+ name: string;
1220
+ type: "FLOW_EVENT";
1221
+ payload?: Record<string, unknown> | undefined;
1222
+ } | {
1223
+ type: "OPEN_URL";
1224
+ url: string;
1225
+ target?: "_blank" | "_self" | undefined;
1226
+ } | {
1227
+ type: "COPY";
1228
+ text: string;
1229
+ } | {
1230
+ type: "TOAST";
1231
+ message: string;
1232
+ level?: "info" | "success" | "warning" | "error" | undefined;
1233
+ } | {
1234
+ type: "PATCH_STATE";
1235
+ key: string;
1236
+ value?: unknown;
1237
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1238
+ } | undefined;
1239
+ onMouseUp?: {
1240
+ name: string;
1241
+ type: "FLOW_EVENT";
1242
+ payload?: Record<string, unknown> | undefined;
1243
+ } | {
1244
+ type: "OPEN_URL";
1245
+ url: string;
1246
+ target?: "_blank" | "_self" | undefined;
1247
+ } | {
1248
+ type: "COPY";
1249
+ text: string;
1250
+ } | {
1251
+ type: "TOAST";
1252
+ message: string;
1253
+ level?: "info" | "success" | "warning" | "error" | undefined;
1254
+ } | {
1255
+ type: "PATCH_STATE";
1256
+ key: string;
1257
+ value?: unknown;
1258
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1259
+ } | undefined;
1260
+ onMouseMove?: {
1261
+ name: string;
1262
+ type: "FLOW_EVENT";
1263
+ payload?: Record<string, unknown> | undefined;
1264
+ } | {
1265
+ type: "OPEN_URL";
1266
+ url: string;
1267
+ target?: "_blank" | "_self" | undefined;
1268
+ } | {
1269
+ type: "COPY";
1270
+ text: string;
1271
+ } | {
1272
+ type: "TOAST";
1273
+ message: string;
1274
+ level?: "info" | "success" | "warning" | "error" | undefined;
1275
+ } | {
1276
+ type: "PATCH_STATE";
1277
+ key: string;
1278
+ value?: unknown;
1279
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1280
+ } | undefined;
1281
+ onFocus?: {
1282
+ name: string;
1283
+ type: "FLOW_EVENT";
1284
+ payload?: Record<string, unknown> | undefined;
1285
+ } | {
1286
+ type: "OPEN_URL";
1287
+ url: string;
1288
+ target?: "_blank" | "_self" | undefined;
1289
+ } | {
1290
+ type: "COPY";
1291
+ text: string;
1292
+ } | {
1293
+ type: "TOAST";
1294
+ message: string;
1295
+ level?: "info" | "success" | "warning" | "error" | undefined;
1296
+ } | {
1297
+ type: "PATCH_STATE";
1298
+ key: string;
1299
+ value?: unknown;
1300
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1301
+ } | undefined;
1302
+ onBlur?: {
1303
+ name: string;
1304
+ type: "FLOW_EVENT";
1305
+ payload?: Record<string, unknown> | undefined;
1306
+ } | {
1307
+ type: "OPEN_URL";
1308
+ url: string;
1309
+ target?: "_blank" | "_self" | undefined;
1310
+ } | {
1311
+ type: "COPY";
1312
+ text: string;
1313
+ } | {
1314
+ type: "TOAST";
1315
+ message: string;
1316
+ level?: "info" | "success" | "warning" | "error" | undefined;
1317
+ } | {
1318
+ type: "PATCH_STATE";
1319
+ key: string;
1320
+ value?: unknown;
1321
+ valueFrom?: "event.target.value" | "event.target.checked" | undefined;
1322
+ } | undefined;
1323
+ }>;
1324
+ export type UiEventMap = z.infer<typeof UiEventMapSchema>;
1325
+ export declare const UiBindSchema: z.ZodOptional<z.ZodObject<{
1326
+ valueKey: z.ZodOptional<z.ZodString>;
1327
+ checkedKey: z.ZodOptional<z.ZodString>;
1328
+ }, "strict", z.ZodTypeAny, {
1329
+ valueKey?: string | undefined;
1330
+ checkedKey?: string | undefined;
1331
+ }, {
1332
+ valueKey?: string | undefined;
1333
+ checkedKey?: string | undefined;
1334
+ }>>;
1335
+ export type UiBind = z.infer<typeof UiBindSchema>;
1336
+ export declare const UiNodeSchema: z.ZodType<any>;
1337
+ export type UiNode = z.infer<typeof UiNodeSchema>;
1338
+ export declare const UiTemplateSchema: z.ZodObject<{
1339
+ schema: z.ZodLiteral<"ui.v1">;
1340
+ root: z.ZodType<any, z.ZodTypeDef, any>;
1341
+ }, "strict", z.ZodTypeAny, {
1342
+ schema: "ui.v1";
1343
+ root?: any;
1344
+ }, {
1345
+ schema: "ui.v1";
1346
+ root?: any;
1347
+ }>;
1348
+ export type UiTemplate = z.infer<typeof UiTemplateSchema>;
1349
+ export declare const WidgetPolicySchema: z.ZodOptional<z.ZodObject<{
1350
+ allowedTags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1351
+ allowedProps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1352
+ allowedActions: z.ZodOptional<z.ZodArray<z.ZodEnum<["FLOW_EVENT", "OPEN_URL", "COPY", "TOAST", "PATCH_STATE"]>, "many">>;
1353
+ maxNodes: z.ZodOptional<z.ZodNumber>;
1354
+ maxDepth: z.ZodOptional<z.ZodNumber>;
1355
+ }, "strict", z.ZodTypeAny, {
1356
+ allowedTags?: string[] | undefined;
1357
+ allowedProps?: string[] | undefined;
1358
+ allowedActions?: ("FLOW_EVENT" | "OPEN_URL" | "COPY" | "TOAST" | "PATCH_STATE")[] | undefined;
1359
+ maxNodes?: number | undefined;
1360
+ maxDepth?: number | undefined;
1361
+ }, {
1362
+ allowedTags?: string[] | undefined;
1363
+ allowedProps?: string[] | undefined;
1364
+ allowedActions?: ("FLOW_EVENT" | "OPEN_URL" | "COPY" | "TOAST" | "PATCH_STATE")[] | undefined;
1365
+ maxNodes?: number | undefined;
1366
+ maxDepth?: number | undefined;
1367
+ }>>;
1368
+ export declare const WidgetDefinitionSchema: z.ZodObject<{
1369
+ schema: z.ZodLiteral<"widget.v1">;
1370
+ widgetId: z.ZodString;
1371
+ version: z.ZodString;
1372
+ template: z.ZodObject<{
1373
+ schema: z.ZodLiteral<"ui.v1">;
1374
+ root: z.ZodType<any, z.ZodTypeDef, any>;
1375
+ }, "strict", z.ZodTypeAny, {
1376
+ schema: "ui.v1";
1377
+ root?: any;
1378
+ }, {
1379
+ schema: "ui.v1";
1380
+ root?: any;
1381
+ }>;
1382
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1383
+ type: z.ZodEnum<["string", "number", "boolean", "json"]>;
1384
+ required: z.ZodOptional<z.ZodBoolean>;
1385
+ default: z.ZodOptional<z.ZodUnknown>;
1386
+ }, "strict", z.ZodTypeAny, {
1387
+ type: "string" | "number" | "boolean" | "json";
1388
+ required?: boolean | undefined;
1389
+ default?: unknown;
1390
+ }, {
1391
+ type: "string" | "number" | "boolean" | "json";
1392
+ required?: boolean | undefined;
1393
+ default?: unknown;
1394
+ }>>>;
1395
+ slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1396
+ required: z.ZodOptional<z.ZodBoolean>;
1397
+ }, "strict", z.ZodTypeAny, {
1398
+ required?: boolean | undefined;
1399
+ }, {
1400
+ required?: boolean | undefined;
1401
+ }>>>;
1402
+ policy: z.ZodOptional<z.ZodObject<{
1403
+ allowedTags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1404
+ allowedProps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1405
+ allowedActions: z.ZodOptional<z.ZodArray<z.ZodEnum<["FLOW_EVENT", "OPEN_URL", "COPY", "TOAST", "PATCH_STATE"]>, "many">>;
1406
+ maxNodes: z.ZodOptional<z.ZodNumber>;
1407
+ maxDepth: z.ZodOptional<z.ZodNumber>;
1408
+ }, "strict", z.ZodTypeAny, {
1409
+ allowedTags?: string[] | undefined;
1410
+ allowedProps?: string[] | undefined;
1411
+ allowedActions?: ("FLOW_EVENT" | "OPEN_URL" | "COPY" | "TOAST" | "PATCH_STATE")[] | undefined;
1412
+ maxNodes?: number | undefined;
1413
+ maxDepth?: number | undefined;
1414
+ }, {
1415
+ allowedTags?: string[] | undefined;
1416
+ allowedProps?: string[] | undefined;
1417
+ allowedActions?: ("FLOW_EVENT" | "OPEN_URL" | "COPY" | "TOAST" | "PATCH_STATE")[] | undefined;
1418
+ maxNodes?: number | undefined;
1419
+ maxDepth?: number | undefined;
1420
+ }>>;
1421
+ }, "strict", z.ZodTypeAny, {
1422
+ widgetId: string;
1423
+ schema: "widget.v1";
1424
+ version: string;
1425
+ template: {
1426
+ schema: "ui.v1";
1427
+ root?: any;
1428
+ };
1429
+ props?: Record<string, {
1430
+ type: "string" | "number" | "boolean" | "json";
1431
+ required?: boolean | undefined;
1432
+ default?: unknown;
1433
+ }> | undefined;
1434
+ slots?: Record<string, {
1435
+ required?: boolean | undefined;
1436
+ }> | undefined;
1437
+ policy?: {
1438
+ allowedTags?: string[] | undefined;
1439
+ allowedProps?: string[] | undefined;
1440
+ allowedActions?: ("FLOW_EVENT" | "OPEN_URL" | "COPY" | "TOAST" | "PATCH_STATE")[] | undefined;
1441
+ maxNodes?: number | undefined;
1442
+ maxDepth?: number | undefined;
1443
+ } | undefined;
1444
+ }, {
1445
+ widgetId: string;
1446
+ schema: "widget.v1";
1447
+ version: string;
1448
+ template: {
1449
+ schema: "ui.v1";
1450
+ root?: any;
1451
+ };
1452
+ props?: Record<string, {
1453
+ type: "string" | "number" | "boolean" | "json";
1454
+ required?: boolean | undefined;
1455
+ default?: unknown;
1456
+ }> | undefined;
1457
+ slots?: Record<string, {
1458
+ required?: boolean | undefined;
1459
+ }> | undefined;
1460
+ policy?: {
1461
+ allowedTags?: string[] | undefined;
1462
+ allowedProps?: string[] | undefined;
1463
+ allowedActions?: ("FLOW_EVENT" | "OPEN_URL" | "COPY" | "TOAST" | "PATCH_STATE")[] | undefined;
1464
+ maxNodes?: number | undefined;
1465
+ maxDepth?: number | undefined;
1466
+ } | undefined;
1467
+ }>;
1468
+ export type WidgetDefinition = z.infer<typeof WidgetDefinitionSchema>;
1469
+ export declare const FlowOutputSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1470
+ kind: z.ZodLiteral<"text">;
1471
+ text: z.ZodString;
1472
+ }, "strip", z.ZodTypeAny, {
1473
+ text: string;
1474
+ kind: "text";
1475
+ }, {
1476
+ text: string;
1477
+ kind: "text";
1478
+ }>, z.ZodObject<{
1479
+ kind: z.ZodLiteral<"markdown">;
1480
+ markdown: z.ZodString;
1481
+ }, "strip", z.ZodTypeAny, {
1482
+ kind: "markdown";
1483
+ markdown: string;
1484
+ }, {
1485
+ kind: "markdown";
1486
+ markdown: string;
1487
+ }>, z.ZodObject<{
1488
+ kind: z.ZodLiteral<"ui">;
1489
+ templateId: z.ZodString;
1490
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1491
+ }, "strip", z.ZodTypeAny, {
1492
+ kind: "ui";
1493
+ templateId: string;
1494
+ data?: Record<string, unknown> | undefined;
1495
+ }, {
1496
+ kind: "ui";
1497
+ templateId: string;
1498
+ data?: Record<string, unknown> | undefined;
1499
+ }>]>;
1500
+ export type FlowOutput = z.infer<typeof FlowOutputSchema>;
1501
+ export declare const WsClientEventSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1502
+ kind: z.ZodLiteral<"ui_event">;
1503
+ name: z.ZodString;
1504
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1505
+ }, "strip", z.ZodTypeAny, {
1506
+ name: string;
1507
+ kind: "ui_event";
1508
+ payload?: Record<string, unknown> | undefined;
1509
+ }, {
1510
+ name: string;
1511
+ kind: "ui_event";
1512
+ payload?: Record<string, unknown> | undefined;
1513
+ }>]>;
1514
+ export type WsClientEvent = z.infer<typeof WsClientEventSchema>;
1515
+ export declare const WsServerMessageSchema: z.ZodObject<{
1516
+ kind: z.ZodLiteral<"flow_output">;
1517
+ output: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1518
+ kind: z.ZodLiteral<"text">;
1519
+ text: z.ZodString;
1520
+ }, "strip", z.ZodTypeAny, {
1521
+ text: string;
1522
+ kind: "text";
1523
+ }, {
1524
+ text: string;
1525
+ kind: "text";
1526
+ }>, z.ZodObject<{
1527
+ kind: z.ZodLiteral<"markdown">;
1528
+ markdown: z.ZodString;
1529
+ }, "strip", z.ZodTypeAny, {
1530
+ kind: "markdown";
1531
+ markdown: string;
1532
+ }, {
1533
+ kind: "markdown";
1534
+ markdown: string;
1535
+ }>, z.ZodObject<{
1536
+ kind: z.ZodLiteral<"ui">;
1537
+ templateId: z.ZodString;
1538
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1539
+ }, "strip", z.ZodTypeAny, {
1540
+ kind: "ui";
1541
+ templateId: string;
1542
+ data?: Record<string, unknown> | undefined;
1543
+ }, {
1544
+ kind: "ui";
1545
+ templateId: string;
1546
+ data?: Record<string, unknown> | undefined;
1547
+ }>]>;
1548
+ }, "strip", z.ZodTypeAny, {
1549
+ kind: "flow_output";
1550
+ output: {
1551
+ text: string;
1552
+ kind: "text";
1553
+ } | {
1554
+ kind: "markdown";
1555
+ markdown: string;
1556
+ } | {
1557
+ kind: "ui";
1558
+ templateId: string;
1559
+ data?: Record<string, unknown> | undefined;
1560
+ };
1561
+ }, {
1562
+ kind: "flow_output";
1563
+ output: {
1564
+ text: string;
1565
+ kind: "text";
1566
+ } | {
1567
+ kind: "markdown";
1568
+ markdown: string;
1569
+ } | {
1570
+ kind: "ui";
1571
+ templateId: string;
1572
+ data?: Record<string, unknown> | undefined;
1573
+ };
1574
+ }>;
1575
+ export type WsServerMessage = z.infer<typeof WsServerMessageSchema>;
1576
+ export declare function countNodes(root: UiNode): {
1577
+ nodes: number;
1578
+ depth: number;
1579
+ };
1580
+ export declare function assertWithinLimits(template: UiTemplate): void;
1581
+ //# sourceMappingURL=index.d.ts.map