experimental-ash 0.8.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/dist/docs/public/channels/slack.md +53 -25
  3. package/dist/src/compiled/.vendor-stamp.json +14 -14
  4. package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
  5. package/dist/src/compiled/@ai-sdk/google/index.js +4 -4
  6. package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
  7. package/dist/src/compiled/@ai-sdk/openai/index.js +6 -6
  8. package/dist/src/compiled/@ai-sdk/otel/index.js +1 -1
  9. package/dist/src/compiled/@ai-sdk/provider/_json-schema.d.ts +5 -0
  10. package/dist/src/compiled/@ai-sdk/provider/index.d.ts +6632 -1
  11. package/dist/src/compiled/@chat-adapter/slack/_chat-adapter-shared.d.ts +9 -0
  12. package/dist/src/compiled/@chat-adapter/slack/index.d.ts +632 -54
  13. package/dist/src/compiled/@chat-adapter/slack/index.js +25 -29
  14. package/dist/src/compiled/@chat-adapter/slack/package.json +1 -1
  15. package/dist/src/compiled/@chat-adapter/state-memory/index.d.ts +41 -25
  16. package/dist/src/compiled/@chat-adapter/state-memory/package.json +1 -1
  17. package/dist/src/compiled/@standard-schema/spec/index.d.ts +115 -62
  18. package/dist/src/compiled/@vercel/sandbox/index.d.ts +4 -1
  19. package/dist/src/compiled/@vercel/sandbox/index.js +5 -5
  20. package/dist/src/compiled/@workflow/core/index.js +1 -1
  21. package/dist/src/compiled/@workflow/core/runtime.d.ts +6 -2
  22. package/dist/src/compiled/@workflow/core/runtime.js +4 -4
  23. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  24. package/dist/src/compiled/@workflow/errors/_ms.d.ts +4 -0
  25. package/dist/src/compiled/@workflow/errors/error-codes.d.ts +17 -0
  26. package/dist/src/compiled/@workflow/errors/index.d.ts +438 -56
  27. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  28. package/dist/src/compiled/_chunks/node/{auth-CdwuOxMs.js → auth-vbe4XEEK.js} +2 -2
  29. package/dist/src/compiled/_chunks/node/{dist-B6IOtzm1.js → dist-BdWHjlRQ.js} +12 -12
  30. package/dist/src/compiled/_chunks/node/retry-BOcy5BbJ.js +1 -0
  31. package/dist/src/compiled/_chunks/workflow/{context-errors-CXifqq6a.js → context-errors-zbKocOyk.js} +1 -1
  32. package/dist/src/compiled/_chunks/workflow/{dist-BuELZxm6.js → dist-Ci2brnHh.js} +3 -3
  33. package/dist/src/compiled/_chunks/workflow/{resume-hook-CgfgCU87.js → resume-hook-CL8Ed91K.js} +2 -2
  34. package/dist/src/compiled/_chunks/workflow/sleep-Dn3i9nxI.js +1 -0
  35. package/dist/src/compiled/chat/_mdast.d.ts +24 -0
  36. package/dist/src/compiled/chat/_workflow-serde.d.ts +5 -0
  37. package/dist/src/compiled/chat/index.d.ts +3851 -72
  38. package/dist/src/compiled/chat/index.js +1 -1
  39. package/dist/src/compiled/chat/jsx-runtime-DxGwoLu2.d.ts +782 -0
  40. package/dist/src/compiled/chat/package.json +1 -1
  41. package/dist/src/compiled/just-bash/index.js +1 -1
  42. package/dist/src/execution/authorization-challenge-defaults.d.ts +1 -1
  43. package/dist/src/execution/authorization-challenge-defaults.js +1 -1
  44. package/dist/src/internal/application/package.js +1 -1
  45. package/dist/src/public/channels/slack/index.d.ts +1 -1
  46. package/dist/src/public/channels/slack/slack.js +4 -1
  47. package/dist/src/public/channels/slack/slackChannel.d.ts +64 -1
  48. package/dist/src/public/channels/slack/slackChannel.js +50 -7
  49. package/dist/src/runtime/connections/authorization-tokens.d.ts +1 -1
  50. package/dist/src/runtime/connections/authorization-tokens.js +1 -1
  51. package/package.json +16 -16
  52. package/dist/src/compiled/_chunks/node/ms-B2k_qBoq.js +0 -1
  53. package/dist/src/compiled/_chunks/workflow/sleep-BzS_cSYx.js +0 -1
  54. /package/dist/src/compiled/_chunks/workflow/{dist-C9DdsXoK.js → dist-0iNBqPYp.js} +0 -0
  55. /package/dist/src/compiled/_chunks/workflow/{dist-BHbmiLmM.js → dist-D774SUM4.js} +0 -0
  56. /package/dist/src/compiled/_chunks/workflow/{src-CidBwKAD.js → src-ClRYdO4-.js} +0 -0
  57. /package/dist/src/compiled/_chunks/workflow/{symbols-BC0BVTM7.js → symbols-D-4tVV8x.js} +0 -0
@@ -0,0 +1,782 @@
1
+ /**
2
+ * Card elements for cross-platform rich messaging.
3
+ *
4
+ * Provides a builder API for creating rich cards that automatically
5
+ * convert to platform-specific formats:
6
+ * - Slack: Block Kit
7
+ * - Teams: Adaptive Cards
8
+ * - Google Chat: Card v2
9
+ *
10
+ * Supports both function-call and JSX syntax:
11
+ *
12
+ * @example Function API
13
+ * ```ts
14
+ * import { Card, Text, Actions, Button } from "chat";
15
+ *
16
+ * await thread.post(
17
+ * Card({
18
+ * title: "Order #1234",
19
+ * children: [
20
+ * Text("Total: $50.00"),
21
+ * Actions([
22
+ * Button({ id: "approve", label: "Approve", style: "primary" }),
23
+ * Button({ id: "reject", label: "Reject", style: "danger" }),
24
+ * ]),
25
+ * ],
26
+ * })
27
+ * );
28
+ * ```
29
+ *
30
+ * @example JSX API (requires jsxImportSource: "chat" in tsconfig)
31
+ * ```tsx
32
+ * /** @jsxImportSource chat *\/
33
+ * import { Card, Text, Actions, Button } from "chat";
34
+ *
35
+ * await thread.post(
36
+ * <Card title="Order #1234">
37
+ * <Text>Total: $50.00</Text>
38
+ * <Actions>
39
+ * <Button id="approve" style="primary">Approve</Button>
40
+ * <Button id="reject" style="danger">Reject</Button>
41
+ * </Actions>
42
+ * </Card>
43
+ * );
44
+ * ```
45
+ */
46
+
47
+ /** Button style options */
48
+ type ButtonStyle = "primary" | "danger" | "default";
49
+ /** Text style options */
50
+ type TextStyle = "plain" | "bold" | "muted";
51
+ /** Button element for interactive actions */
52
+ interface ButtonElement {
53
+ /** Whether this button triggers a regular action or opens a modal dialog. Default: "action" */
54
+ actionType?: "action" | "modal";
55
+ /** URL to POST action data to when this button is clicked */
56
+ callbackUrl?: string;
57
+ /** If true, the button is displayed in an inactive state and doesn't respond to user actions */
58
+ disabled?: boolean;
59
+ /** Unique action ID for callback routing */
60
+ id: string;
61
+ /** Button label text */
62
+ label: string;
63
+ /** Visual style */
64
+ style?: ButtonStyle;
65
+ type: "button";
66
+ /** Optional payload value sent with action callback */
67
+ value?: string;
68
+ }
69
+ /** Link button element that opens a URL */
70
+ interface LinkButtonElement {
71
+ /** Button label text */
72
+ label: string;
73
+ /** Visual style */
74
+ style?: ButtonStyle;
75
+ type: "link-button";
76
+ /** URL to open when clicked */
77
+ url: string;
78
+ }
79
+ /** Text content element */
80
+ interface TextElement {
81
+ /** Text content (supports markdown in some platforms) */
82
+ content: string;
83
+ /** Text style */
84
+ style?: TextStyle;
85
+ type: "text";
86
+ }
87
+ /** Image element */
88
+ interface ImageElement {
89
+ /** Alt text for accessibility */
90
+ alt?: string;
91
+ type: "image";
92
+ /** Image URL */
93
+ url: string;
94
+ }
95
+ /** Visual divider/separator */
96
+ interface DividerElement {
97
+ type: "divider";
98
+ }
99
+ /** Container for action buttons and selects */
100
+ interface ActionsElement {
101
+ /** Button, link button, select, and radio select elements */
102
+ children: (ButtonElement | LinkButtonElement | SelectElement | RadioSelectElement)[];
103
+ type: "actions";
104
+ }
105
+ /** Section container for grouping elements */
106
+ interface SectionElement {
107
+ /** Section children */
108
+ children: CardChild[];
109
+ type: "section";
110
+ }
111
+ /** Inline hyperlink element */
112
+ interface LinkElement {
113
+ /** Link label text */
114
+ label: string;
115
+ type: "link";
116
+ /** URL to link to */
117
+ url: string;
118
+ }
119
+ /** Field for key-value display */
120
+ interface FieldElement {
121
+ /** Field label */
122
+ label: string;
123
+ type: "field";
124
+ /** Field value */
125
+ value: string;
126
+ }
127
+ /** Fields container for multi-column layout */
128
+ interface FieldsElement {
129
+ /** Field elements */
130
+ children: FieldElement[];
131
+ type: "fields";
132
+ }
133
+ /** Column alignment for table elements */
134
+ type TableAlignment = "left" | "center" | "right";
135
+ /** Table element for structured data display */
136
+ interface TableElement {
137
+ /** Column alignment */
138
+ align?: TableAlignment[];
139
+ /** Column header labels */
140
+ headers: string[];
141
+ /** Data rows (each row is an array of cell strings) */
142
+ rows: string[][];
143
+ type: "table";
144
+ }
145
+ /** Union of all card child element types */
146
+ type CardChild = TextElement | ImageElement | DividerElement | ActionsElement | SectionElement | FieldsElement | LinkElement | TableElement;
147
+ /** Union of all element types (including nested children) */
148
+ type AnyCardElement = CardChild | CardElement | ButtonElement | LinkButtonElement | LinkElement | FieldElement | SelectElement | RadioSelectElement;
149
+ /** Root card element */
150
+ interface CardElement {
151
+ /** Card content */
152
+ children: CardChild[];
153
+ /** Header image URL */
154
+ imageUrl?: string;
155
+ /** Card subtitle */
156
+ subtitle?: string;
157
+ /** Card title */
158
+ title?: string;
159
+ type: "card";
160
+ }
161
+ /** Type guard for CardElement */
162
+ declare function isCardElement(value: unknown): value is CardElement;
163
+ /** Options for Card */
164
+ interface CardOptions {
165
+ children?: CardChild[];
166
+ imageUrl?: string;
167
+ subtitle?: string;
168
+ title?: string;
169
+ }
170
+ /**
171
+ * Create a Card element.
172
+ *
173
+ * @example
174
+ * ```ts
175
+ * Card({
176
+ * title: "Welcome",
177
+ * children: [Text("Hello!")],
178
+ * })
179
+ * ```
180
+ */
181
+ declare function Card(options?: CardOptions): CardElement;
182
+ /**
183
+ * Create a Text element.
184
+ *
185
+ * @example
186
+ * ```ts
187
+ * Text("Hello, world!")
188
+ * Text("Important", { style: "bold" })
189
+ * ```
190
+ */
191
+ declare function Text(content: string, options?: {
192
+ style?: TextStyle;
193
+ }): TextElement;
194
+ /**
195
+ * Create an Image element.
196
+ *
197
+ * @example
198
+ * ```ts
199
+ * Image({ url: "https://example.com/image.png", alt: "Description" })
200
+ * ```
201
+ */
202
+ declare function Image(options: {
203
+ url: string;
204
+ alt?: string;
205
+ }): ImageElement;
206
+ /**
207
+ * Create a Divider element.
208
+ *
209
+ * @example
210
+ * ```ts
211
+ * Divider()
212
+ * ```
213
+ */
214
+ declare function Divider(): DividerElement;
215
+ /**
216
+ * Create a Section container.
217
+ *
218
+ * @example
219
+ * ```ts
220
+ * Section([
221
+ * Text("Grouped content"),
222
+ * Image({ url: "..." }),
223
+ * ])
224
+ * ```
225
+ */
226
+ declare function Section(children: CardChild[]): SectionElement;
227
+ /**
228
+ * Create an Actions container for buttons and selects.
229
+ *
230
+ * @example
231
+ * ```ts
232
+ * Actions([
233
+ * Button({ id: "ok", label: "OK" }),
234
+ * Button({ id: "cancel", label: "Cancel" }),
235
+ * LinkButton({ url: "https://example.com", label: "Learn More" }),
236
+ * Select({ id: "priority", label: "Priority", options: [...] }),
237
+ * RadioSelect({ id: "status", label: "Status", options: [...] }),
238
+ * ])
239
+ * ```
240
+ */
241
+ declare function Actions(children: (ButtonElement | LinkButtonElement | SelectElement | RadioSelectElement)[]): ActionsElement;
242
+ /** Options for Button */
243
+ interface ButtonOptions {
244
+ /** Whether this button triggers a regular action or opens a modal dialog. Default: "action" */
245
+ actionType?: "action" | "modal";
246
+ /** URL to POST action data to when this button is clicked */
247
+ callbackUrl?: string;
248
+ /** If true, the button is displayed in an inactive state and doesn't respond to user actions */
249
+ disabled?: boolean;
250
+ /** Unique action ID for callback routing */
251
+ id: string;
252
+ /** Button label text */
253
+ label: string;
254
+ /** Visual style */
255
+ style?: ButtonStyle;
256
+ /** Optional payload value sent with action callback */
257
+ value?: string;
258
+ }
259
+ /**
260
+ * Create a Button element.
261
+ *
262
+ * @example
263
+ * ```ts
264
+ * Button({ id: "submit", label: "Submit", style: "primary" })
265
+ * Button({ id: "delete", label: "Delete", style: "danger", value: "item-123" })
266
+ * ```
267
+ */
268
+ declare function Button(options: ButtonOptions): ButtonElement;
269
+ /** Options for LinkButton */
270
+ interface LinkButtonOptions {
271
+ /** Button label text */
272
+ label: string;
273
+ /** Visual style */
274
+ style?: ButtonStyle;
275
+ /** URL to open when clicked */
276
+ url: string;
277
+ }
278
+ /**
279
+ * Create a LinkButton element that opens a URL when clicked.
280
+ *
281
+ * @example
282
+ * ```ts
283
+ * LinkButton({ url: "https://example.com", label: "View Docs" })
284
+ * LinkButton({ url: "https://example.com", label: "Learn More", style: "primary" })
285
+ * ```
286
+ */
287
+ declare function LinkButton(options: LinkButtonOptions): LinkButtonElement;
288
+ /**
289
+ * Create a Field element for key-value display.
290
+ *
291
+ * @example
292
+ * ```ts
293
+ * Field({ label: "Status", value: "Active" })
294
+ * ```
295
+ */
296
+ declare function Field(options: {
297
+ label: string;
298
+ value: string;
299
+ }): FieldElement;
300
+ /**
301
+ * Create a Fields container for multi-column layout.
302
+ *
303
+ * @example
304
+ * ```ts
305
+ * Fields([
306
+ * Field({ label: "Name", value: "John" }),
307
+ * Field({ label: "Email", value: "john@example.com" }),
308
+ * ])
309
+ * ```
310
+ */
311
+ declare function Fields(children: FieldElement[]): FieldsElement;
312
+ /** Options for Table */
313
+ interface TableOptions {
314
+ /** Column alignment */
315
+ align?: TableAlignment[];
316
+ /** Column header labels */
317
+ headers: string[];
318
+ /** Data rows */
319
+ rows: string[][];
320
+ }
321
+ /**
322
+ * Create a Table element for structured data display.
323
+ *
324
+ * @example
325
+ * ```ts
326
+ * Table({
327
+ * headers: ["Name", "Age", "Role"],
328
+ * rows: [
329
+ * ["Alice", "30", "Engineer"],
330
+ * ["Bob", "25", "Designer"],
331
+ * ],
332
+ * })
333
+ * ```
334
+ */
335
+ declare function Table(options: TableOptions): TableElement;
336
+ /**
337
+ * Create a CardLink element for inline hyperlinks.
338
+ *
339
+ * @example
340
+ * ```ts
341
+ * CardLink({ url: "https://example.com", label: "Visit Site" })
342
+ * ```
343
+ */
344
+ declare function CardLink(options: {
345
+ url: string;
346
+ label: string;
347
+ }): LinkElement;
348
+ /**
349
+ * Convert a React element tree to a CardElement tree.
350
+ * This allows using React's JSX with our card components.
351
+ *
352
+ * @example
353
+ * ```tsx
354
+ * import React from "react";
355
+ * import { Card, Text, fromReactElement } from "chat";
356
+ *
357
+ * const element = (
358
+ * <Card title="Hello">
359
+ * <Text>World</Text>
360
+ * </Card>
361
+ * );
362
+ *
363
+ * const card = fromReactElement(element);
364
+ * await thread.post(card);
365
+ * ```
366
+ */
367
+ declare function fromReactElement(element: unknown): AnyCardElement | null;
368
+ /**
369
+ * Generate fallback text from a card child element.
370
+ * Exported so adapter card converters can call it for unknown types.
371
+ */
372
+ declare function cardChildToFallbackText(child: CardChild): string | null;
373
+
374
+ /**
375
+ * Modal elements for form dialogs.
376
+ */
377
+
378
+ type ModalChild = TextInputElement | SelectElement | ExternalSelectElement | RadioSelectElement | TextElement | FieldsElement;
379
+ interface ModalElement {
380
+ callbackId: string;
381
+ /** URL to POST form values to when this modal is submitted */
382
+ callbackUrl?: string;
383
+ children: ModalChild[];
384
+ closeLabel?: string;
385
+ notifyOnClose?: boolean;
386
+ /** Arbitrary string passed through the modal lifecycle (e.g., JSON context). */
387
+ privateMetadata?: string;
388
+ submitLabel?: string;
389
+ title: string;
390
+ type: "modal";
391
+ }
392
+ interface TextInputElement {
393
+ id: string;
394
+ initialValue?: string;
395
+ label: string;
396
+ maxLength?: number;
397
+ multiline?: boolean;
398
+ optional?: boolean;
399
+ placeholder?: string;
400
+ type: "text_input";
401
+ }
402
+ interface SelectElement {
403
+ id: string;
404
+ initialOption?: string;
405
+ label: string;
406
+ optional?: boolean;
407
+ options: SelectOptionElement[];
408
+ placeholder?: string;
409
+ type: "select";
410
+ }
411
+ interface ExternalSelectElement {
412
+ id: string;
413
+ initialOption?: SelectOptionElement;
414
+ label: string;
415
+ minQueryLength?: number;
416
+ optional?: boolean;
417
+ placeholder?: string;
418
+ type: "external_select";
419
+ }
420
+ interface SelectOptionElement {
421
+ description?: string;
422
+ label: string;
423
+ value: string;
424
+ }
425
+ interface RadioSelectElement {
426
+ id: string;
427
+ initialOption?: string;
428
+ label: string;
429
+ optional?: boolean;
430
+ options: SelectOptionElement[];
431
+ type: "radio_select";
432
+ }
433
+ declare function isModalElement(value: unknown): value is ModalElement;
434
+ interface ModalOptions {
435
+ callbackId: string;
436
+ /** URL to POST form values to when this modal is submitted */
437
+ callbackUrl?: string;
438
+ children?: ModalChild[];
439
+ closeLabel?: string;
440
+ notifyOnClose?: boolean;
441
+ /** Arbitrary string passed through the modal lifecycle (e.g., JSON context). */
442
+ privateMetadata?: string;
443
+ submitLabel?: string;
444
+ title: string;
445
+ }
446
+ declare function Modal(options: ModalOptions): ModalElement;
447
+ interface TextInputOptions {
448
+ id: string;
449
+ initialValue?: string;
450
+ label: string;
451
+ maxLength?: number;
452
+ multiline?: boolean;
453
+ optional?: boolean;
454
+ placeholder?: string;
455
+ }
456
+ declare function TextInput(options: TextInputOptions): TextInputElement;
457
+ interface SelectOptions {
458
+ id: string;
459
+ initialOption?: string;
460
+ label: string;
461
+ optional?: boolean;
462
+ options: SelectOptionElement[];
463
+ placeholder?: string;
464
+ }
465
+ declare function Select(options: SelectOptions): SelectElement;
466
+ interface ExternalSelectOptions {
467
+ id: string;
468
+ initialOption?: SelectOptionElement;
469
+ label: string;
470
+ minQueryLength?: number;
471
+ optional?: boolean;
472
+ placeholder?: string;
473
+ }
474
+ declare function ExternalSelect(options: ExternalSelectOptions): ExternalSelectElement;
475
+ declare function SelectOption(options: {
476
+ label: string;
477
+ value: string;
478
+ description?: string;
479
+ }): SelectOptionElement;
480
+ interface RadioSelectOptions {
481
+ id: string;
482
+ initialOption?: string;
483
+ label: string;
484
+ optional?: boolean;
485
+ options: SelectOptionElement[];
486
+ }
487
+ declare function RadioSelect(options: RadioSelectOptions): RadioSelectElement;
488
+ type AnyModalElement = ModalElement | ModalChild | SelectOptionElement;
489
+ declare function fromReactModalElement(element: unknown): AnyModalElement | null;
490
+
491
+ /**
492
+ * Custom JSX runtime for chat cards.
493
+ *
494
+ * This allows using JSX syntax without React. Configure your bundler:
495
+ *
496
+ * tsconfig.json:
497
+ * {
498
+ * "compilerOptions": {
499
+ * "jsx": "react-jsx",
500
+ * "jsxImportSource": "chat"
501
+ * }
502
+ * }
503
+ *
504
+ * Or per-file:
505
+ * /** @jsxImportSource chat *\/
506
+ *
507
+ * Usage:
508
+ * ```tsx
509
+ * import { Card, Text, Button, Actions } from "chat";
510
+ *
511
+ * const card = (
512
+ * <Card title="Order #1234">
513
+ * <Text>Your order is ready!</Text>
514
+ * <Actions>
515
+ * <Button id="pickup" style="primary">Schedule Pickup</Button>
516
+ * </Actions>
517
+ * </Card>
518
+ * );
519
+ * ```
520
+ */
521
+
522
+ declare const JSX_ELEMENT: unique symbol;
523
+ /** Props for Card component in JSX */
524
+ interface CardProps {
525
+ children?: unknown;
526
+ imageUrl?: string;
527
+ subtitle?: string;
528
+ title?: string;
529
+ }
530
+ /** Props for Text component in JSX */
531
+ interface TextProps {
532
+ children?: string | number | (string | number | undefined)[];
533
+ style?: TextStyle;
534
+ }
535
+ /** Props for Button component in JSX */
536
+ interface ButtonProps {
537
+ actionType?: "action" | "modal";
538
+ callbackUrl?: string;
539
+ children?: string | number | (string | number | undefined)[];
540
+ disabled?: boolean;
541
+ id: string;
542
+ label?: string;
543
+ style?: ButtonStyle;
544
+ value?: string;
545
+ }
546
+ /** Props for LinkButton component in JSX */
547
+ interface LinkButtonProps {
548
+ children?: string | number | (string | number | undefined)[];
549
+ label?: string;
550
+ style?: ButtonStyle;
551
+ url: string;
552
+ }
553
+ /** Props for CardLink component in JSX */
554
+ interface CardLinkProps {
555
+ children?: string | number | (string | number | undefined)[];
556
+ label?: string;
557
+ url: string;
558
+ }
559
+ /** Props for Image component in JSX */
560
+ interface ImageProps {
561
+ alt?: string;
562
+ url: string;
563
+ }
564
+ /** Props for Field component in JSX */
565
+ interface FieldProps {
566
+ label: string;
567
+ value: string;
568
+ }
569
+ /** Props for container components (Section, Actions, Fields) */
570
+ interface ContainerProps {
571
+ children?: unknown;
572
+ }
573
+ /** Props for Divider component (no props) */
574
+ type DividerProps = Record<string, never>;
575
+ /** Props for Modal component in JSX */
576
+ interface ModalProps {
577
+ callbackId: string;
578
+ callbackUrl?: string;
579
+ children?: unknown;
580
+ closeLabel?: string;
581
+ notifyOnClose?: boolean;
582
+ privateMetadata?: string;
583
+ submitLabel?: string;
584
+ title: string;
585
+ }
586
+ /** Props for TextInput component in JSX */
587
+ interface TextInputProps {
588
+ id: string;
589
+ initialValue?: string;
590
+ label: string;
591
+ maxLength?: number;
592
+ multiline?: boolean;
593
+ optional?: boolean;
594
+ placeholder?: string;
595
+ }
596
+ /** Props for Select component in JSX */
597
+ interface SelectProps {
598
+ children?: unknown;
599
+ id: string;
600
+ initialOption?: string;
601
+ label: string;
602
+ optional?: boolean;
603
+ placeholder?: string;
604
+ }
605
+ /** Props for ExternalSelect component in JSX */
606
+ interface ExternalSelectProps {
607
+ id: string;
608
+ initialOption?: {
609
+ label: string;
610
+ value: string;
611
+ };
612
+ label: string;
613
+ minQueryLength?: number;
614
+ optional?: boolean;
615
+ placeholder?: string;
616
+ }
617
+ /** Props for SelectOption component in JSX */
618
+ interface SelectOptionProps {
619
+ description?: string;
620
+ label: string;
621
+ value: string;
622
+ }
623
+ /** Props for Table component in JSX */
624
+ interface TableProps {
625
+ headers: string[];
626
+ rows: string[][];
627
+ }
628
+ /** Union of all valid JSX props */
629
+ type CardJSXProps = CardProps | TextProps | ButtonProps | LinkButtonProps | CardLinkProps | ImageProps | FieldProps | ContainerProps | DividerProps | ModalProps | TextInputProps | SelectProps | ExternalSelectProps | SelectOptionProps | TableProps;
630
+ /** Component function type with proper overloads */
631
+ type CardComponentFunction = typeof Card | typeof Text | typeof Button | typeof LinkButton | typeof CardLink | typeof Image | typeof Field | typeof Divider | typeof Section | typeof Actions | typeof Fields | typeof Modal | typeof TextInput | typeof Select | typeof ExternalSelect | typeof RadioSelect | typeof SelectOption | typeof Table;
632
+ /**
633
+ * Represents a JSX element from the chat JSX runtime.
634
+ * This is the type returned when using JSX syntax with chat components.
635
+ */
636
+ interface CardJSXElement<P extends CardJSXProps = CardJSXProps> {
637
+ $$typeof: typeof JSX_ELEMENT;
638
+ children: unknown[];
639
+ props: P;
640
+ type: CardComponentFunction;
641
+ }
642
+ /** Union of all element types that can be produced by chat components */
643
+ type ChatElement = CardJSXElement | CardElement | TextElement | ButtonElement | LinkButtonElement | LinkElement | ImageElement | DividerElement | ActionsElement | SectionElement | FieldsElement | FieldElement | ModalElement | TextInputElement | SelectElement | ExternalSelectElement | SelectOptionElement | RadioSelectElement | TableElement;
644
+ interface CardComponent {
645
+ (options?: CardOptions): CardElement;
646
+ (props: CardProps): ChatElement;
647
+ }
648
+ interface TextComponent {
649
+ (content: string, options?: {
650
+ style?: TextStyle;
651
+ }): TextElement;
652
+ (props: TextProps): ChatElement;
653
+ }
654
+ interface ButtonComponent {
655
+ (options: ButtonOptions): ButtonElement;
656
+ (props: ButtonProps): ChatElement;
657
+ }
658
+ interface LinkButtonComponent {
659
+ (options: LinkButtonOptions): LinkButtonElement;
660
+ (props: LinkButtonProps): ChatElement;
661
+ }
662
+ interface CardLinkComponent {
663
+ (options: {
664
+ url: string;
665
+ label: string;
666
+ }): LinkElement;
667
+ (props: CardLinkProps): ChatElement;
668
+ }
669
+ interface ImageComponent {
670
+ (options: {
671
+ url: string;
672
+ alt?: string;
673
+ }): ImageElement;
674
+ (props: ImageProps): ChatElement;
675
+ }
676
+ interface FieldComponent {
677
+ (options: {
678
+ label: string;
679
+ value: string;
680
+ }): FieldElement;
681
+ (props: FieldProps): ChatElement;
682
+ }
683
+ interface DividerComponent {
684
+ (): DividerElement;
685
+ (props: DividerProps): ChatElement;
686
+ }
687
+ interface SectionComponent {
688
+ (children: CardChild[]): SectionElement;
689
+ (props: ContainerProps): ChatElement;
690
+ }
691
+ interface ActionsComponent {
692
+ (children: (ButtonElement | LinkButtonElement | SelectElement | RadioSelectElement)[]): ActionsElement;
693
+ (props: ContainerProps): ChatElement;
694
+ }
695
+ interface FieldsComponent {
696
+ (children: FieldElement[]): FieldsElement;
697
+ (props: ContainerProps): ChatElement;
698
+ }
699
+ interface ModalComponent {
700
+ (options: ModalOptions): ModalElement;
701
+ (props: ModalProps): ChatElement;
702
+ }
703
+ interface TextInputComponent {
704
+ (options: TextInputOptions): TextInputElement;
705
+ (props: TextInputProps): ChatElement;
706
+ }
707
+ interface SelectComponent {
708
+ (options: SelectOptions): SelectElement;
709
+ (props: SelectProps): ChatElement;
710
+ }
711
+ interface ExternalSelectComponent {
712
+ (options: ExternalSelectOptions): ExternalSelectElement;
713
+ (props: ExternalSelectProps): ChatElement;
714
+ }
715
+ interface SelectOptionComponent {
716
+ (options: {
717
+ label: string;
718
+ value: string;
719
+ description?: string;
720
+ }): SelectOptionElement;
721
+ (props: SelectOptionProps): ChatElement;
722
+ }
723
+ interface RadioSelectComponent {
724
+ (options: RadioSelectOptions): RadioSelectElement;
725
+ (props: SelectProps): ChatElement;
726
+ }
727
+ interface TableComponent {
728
+ (options: {
729
+ headers: string[];
730
+ rows: string[][];
731
+ }): TableElement;
732
+ (props: TableProps): ChatElement;
733
+ }
734
+ /**
735
+ * Type guard to check if props match CardLinkProps
736
+ */
737
+ declare function isCardLinkProps(props: CardJSXProps): props is CardLinkProps;
738
+ /**
739
+ * JSX factory function (used by the JSX transform).
740
+ * Creates a lazy JSX element that will be resolved when needed.
741
+ */
742
+ declare function jsx<P extends CardJSXProps>(type: CardComponentFunction, props: P & {
743
+ children?: unknown;
744
+ }, _key?: string): CardJSXElement<P>;
745
+ /**
746
+ * JSX factory for elements with multiple children.
747
+ */
748
+ declare function jsxs<P extends CardJSXProps>(type: CardComponentFunction, props: P & {
749
+ children?: unknown;
750
+ }, _key?: string): CardJSXElement<P>;
751
+ /**
752
+ * Development JSX factory (same as jsx, but called in dev mode).
753
+ */
754
+ declare const jsxDEV: typeof jsx;
755
+ /**
756
+ * Fragment support (flattens children).
757
+ */
758
+ declare function Fragment(props: {
759
+ children?: unknown;
760
+ }): CardChild[];
761
+ /**
762
+ * Convert a JSX element tree to a CardElement.
763
+ * Call this on the root JSX element to get a usable CardElement.
764
+ */
765
+ declare function toCardElement(jsxElement: unknown): CardElement | null;
766
+ declare function toModalElement(jsxElement: unknown): ModalElement | null;
767
+ /**
768
+ * Check if a value is a JSX element (from our runtime or React).
769
+ */
770
+ declare function isJSX(value: unknown): boolean;
771
+ declare namespace JSX {
772
+ type Element = ChatElement;
773
+ type IntrinsicElements = {};
774
+ interface IntrinsicAttributes {
775
+ key?: string | number;
776
+ }
777
+ interface ElementChildrenAttribute {
778
+ children: {};
779
+ }
780
+ }
781
+
782
+ export { type CardProps as $, type ActionsComponent as A, type ButtonComponent as B, type ChatElement as C, type DividerComponent as D, type ExternalSelectComponent as E, type FieldComponent as F, type FieldsElement as G, type ImageElement as H, type ImageComponent as I, type LinkButtonElement as J, type LinkButtonOptions as K, type LinkButtonComponent as L, type ModalElement as M, type LinkElement as N, type SectionElement as O, type TableAlignment as P, type TableElement as Q, type RadioSelectComponent as R, type SelectOptionElement as S, type TextComponent as T, type TableOptions as U, type TextElement as V, type TextStyle as W, type ButtonProps as X, type CardJSXElement as Y, type CardJSXProps as Z, type CardLinkProps as _, type CardElement as a, type ContainerProps as a0, type DividerProps as a1, type ExternalSelectProps as a2, type FieldProps as a3, type ImageProps as a4, type LinkButtonProps as a5, type ModalProps as a6, type SelectOptionProps as a7, type SelectProps as a8, type TextInputProps as a9, type TextProps as aa, type ExternalSelectElement as ab, type ExternalSelectOptions as ac, type ModalChild as ad, type ModalOptions as ae, type RadioSelectElement as af, type RadioSelectOptions as ag, type SelectElement as ah, type SelectOptions as ai, type TextInputElement as aj, type TextInputOptions as ak, type TableProps as al, type TableComponent as am, isCardLinkProps as an, jsx as ao, jsxs as ap, jsxDEV as aq, Fragment as ar, JSX as as, type CardChild as b, type CardComponent as c, cardChildToFallbackText as d, type CardLinkComponent as e, type FieldsComponent as f, fromReactElement as g, isJSX as h, isCardElement as i, type SectionComponent as j, Table as k, toModalElement as l, fromReactModalElement as m, isModalElement as n, type ModalComponent as o, type SelectComponent as p, type SelectOptionComponent as q, type TextInputComponent as r, type ActionsElement as s, toCardElement as t, type ButtonElement as u, type ButtonOptions as v, type ButtonStyle as w, type CardOptions as x, type DividerElement as y, type FieldElement as z };