@copilotkit/shared 1.84.2-canary.1793809041 → 1.85.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 (248) hide show
  1. package/README.md +1 -1
  2. package/dist/a2ui-catalog-schema.cjs +14 -5
  3. package/dist/a2ui-catalog-schema.cjs.map +1 -1
  4. package/dist/a2ui-catalog-schema.d.cts +4 -2
  5. package/dist/a2ui-catalog-schema.d.cts.map +1 -1
  6. package/dist/a2ui-catalog-schema.d.mts +4 -2
  7. package/dist/a2ui-catalog-schema.d.mts.map +1 -1
  8. package/dist/a2ui-catalog-schema.mjs +14 -5
  9. package/dist/a2ui-catalog-schema.mjs.map +1 -1
  10. package/dist/event-transforms/open-generative-ui-middleware.cjs +7 -6
  11. package/dist/event-transforms/open-generative-ui-middleware.cjs.map +1 -1
  12. package/dist/event-transforms/open-generative-ui-middleware.d.cts.map +1 -1
  13. package/dist/event-transforms/open-generative-ui-middleware.d.mts.map +1 -1
  14. package/dist/event-transforms/open-generative-ui-middleware.mjs +7 -6
  15. package/dist/event-transforms/open-generative-ui-middleware.mjs.map +1 -1
  16. package/dist/generative-ui/catalog/catalog-export.cjs +329 -0
  17. package/dist/generative-ui/catalog/catalog-export.cjs.map +1 -0
  18. package/dist/generative-ui/catalog/catalog-export.d.cts +92 -0
  19. package/dist/generative-ui/catalog/catalog-export.d.cts.map +1 -0
  20. package/dist/generative-ui/catalog/catalog-export.d.mts +92 -0
  21. package/dist/generative-ui/catalog/catalog-export.d.mts.map +1 -0
  22. package/dist/generative-ui/catalog/catalog-export.mjs +328 -0
  23. package/dist/generative-ui/catalog/catalog-export.mjs.map +1 -0
  24. package/dist/generative-ui/catalog/catalog.cjs +314 -0
  25. package/dist/generative-ui/catalog/catalog.cjs.map +1 -0
  26. package/dist/generative-ui/catalog/catalog.d.cts +407 -0
  27. package/dist/generative-ui/catalog/catalog.d.cts.map +1 -0
  28. package/dist/generative-ui/catalog/catalog.d.mts +407 -0
  29. package/dist/generative-ui/catalog/catalog.d.mts.map +1 -0
  30. package/dist/generative-ui/catalog/catalog.mjs +311 -0
  31. package/dist/generative-ui/catalog/catalog.mjs.map +1 -0
  32. package/dist/generative-ui/catalog/errors.cjs +13 -0
  33. package/dist/generative-ui/catalog/errors.cjs.map +1 -0
  34. package/dist/generative-ui/catalog/errors.d.cts +46 -0
  35. package/dist/generative-ui/catalog/errors.d.cts.map +1 -0
  36. package/dist/generative-ui/catalog/errors.d.mts +46 -0
  37. package/dist/generative-ui/catalog/errors.d.mts.map +1 -0
  38. package/dist/generative-ui/catalog/errors.mjs +12 -0
  39. package/dist/generative-ui/catalog/errors.mjs.map +1 -0
  40. package/dist/generative-ui/catalog/index.d.mts +6 -0
  41. package/dist/generative-ui/catalog/json-schema.cjs +19 -0
  42. package/dist/generative-ui/catalog/json-schema.cjs.map +1 -0
  43. package/dist/generative-ui/catalog/json-schema.d.cts +13 -0
  44. package/dist/generative-ui/catalog/json-schema.d.cts.map +1 -0
  45. package/dist/generative-ui/catalog/json-schema.d.mts +13 -0
  46. package/dist/generative-ui/catalog/json-schema.d.mts.map +1 -0
  47. package/dist/generative-ui/catalog/json-schema.mjs +18 -0
  48. package/dist/generative-ui/catalog/json-schema.mjs.map +1 -0
  49. package/dist/generative-ui/catalog/refs.cjs +20 -0
  50. package/dist/generative-ui/catalog/refs.cjs.map +1 -0
  51. package/dist/generative-ui/catalog/refs.d.cts +54 -0
  52. package/dist/generative-ui/catalog/refs.d.cts.map +1 -0
  53. package/dist/generative-ui/catalog/refs.d.mts +54 -0
  54. package/dist/generative-ui/catalog/refs.d.mts.map +1 -0
  55. package/dist/generative-ui/catalog/refs.mjs +18 -0
  56. package/dist/generative-ui/catalog/refs.mjs.map +1 -0
  57. package/dist/generative-ui/catalog/schema.cjs +74 -0
  58. package/dist/generative-ui/catalog/schema.cjs.map +1 -0
  59. package/dist/generative-ui/catalog/schema.d.cts +43 -0
  60. package/dist/generative-ui/catalog/schema.d.cts.map +1 -0
  61. package/dist/generative-ui/catalog/schema.d.mts +43 -0
  62. package/dist/generative-ui/catalog/schema.d.mts.map +1 -0
  63. package/dist/generative-ui/catalog/schema.mjs +68 -0
  64. package/dist/generative-ui/catalog/schema.mjs.map +1 -0
  65. package/dist/generative-ui/index.cjs +247 -0
  66. package/dist/generative-ui/index.d.cts +33 -0
  67. package/dist/generative-ui/index.d.mts +35 -0
  68. package/dist/generative-ui/index.mjs +34 -0
  69. package/dist/generative-ui/is-record.cjs +6 -1
  70. package/dist/generative-ui/is-record.cjs.map +1 -1
  71. package/dist/generative-ui/is-record.d.cts +6 -0
  72. package/dist/generative-ui/is-record.d.cts.map +1 -0
  73. package/dist/generative-ui/is-record.d.mts +6 -0
  74. package/dist/generative-ui/is-record.d.mts.map +1 -0
  75. package/dist/generative-ui/is-record.mjs +6 -2
  76. package/dist/generative-ui/is-record.mjs.map +1 -1
  77. package/dist/generative-ui/standard/chart.cjs +56 -0
  78. package/dist/generative-ui/standard/chart.cjs.map +1 -0
  79. package/dist/generative-ui/standard/chart.d.cts +142 -0
  80. package/dist/generative-ui/standard/chart.d.cts.map +1 -0
  81. package/dist/generative-ui/standard/chart.d.mts +142 -0
  82. package/dist/generative-ui/standard/chart.d.mts.map +1 -0
  83. package/dist/generative-ui/standard/chart.mjs +54 -0
  84. package/dist/generative-ui/standard/chart.mjs.map +1 -0
  85. package/dist/generative-ui/standard/checks.cjs +74 -0
  86. package/dist/generative-ui/standard/checks.cjs.map +1 -0
  87. package/dist/generative-ui/standard/checks.d.cts +74 -0
  88. package/dist/generative-ui/standard/checks.d.cts.map +1 -0
  89. package/dist/generative-ui/standard/checks.d.mts +74 -0
  90. package/dist/generative-ui/standard/checks.d.mts.map +1 -0
  91. package/dist/generative-ui/standard/checks.mjs +71 -0
  92. package/dist/generative-ui/standard/checks.mjs.map +1 -0
  93. package/dist/generative-ui/standard/components.cjs +23 -0
  94. package/dist/generative-ui/standard/components.cjs.map +1 -0
  95. package/dist/generative-ui/standard/components.d.cts +24 -0
  96. package/dist/generative-ui/standard/components.d.cts.map +1 -0
  97. package/dist/generative-ui/standard/components.d.mts +24 -0
  98. package/dist/generative-ui/standard/components.d.mts.map +1 -0
  99. package/dist/generative-ui/standard/components.mjs +22 -0
  100. package/dist/generative-ui/standard/components.mjs.map +1 -0
  101. package/dist/generative-ui/standard/composites.cjs +143 -0
  102. package/dist/generative-ui/standard/composites.cjs.map +1 -0
  103. package/dist/generative-ui/standard/composites.d.cts +500 -0
  104. package/dist/generative-ui/standard/composites.d.cts.map +1 -0
  105. package/dist/generative-ui/standard/composites.d.mts +500 -0
  106. package/dist/generative-ui/standard/composites.d.mts.map +1 -0
  107. package/dist/generative-ui/standard/composites.mjs +132 -0
  108. package/dist/generative-ui/standard/composites.mjs.map +1 -0
  109. package/dist/generative-ui/standard/data.cjs +176 -0
  110. package/dist/generative-ui/standard/data.cjs.map +1 -0
  111. package/dist/generative-ui/standard/data.d.cts +745 -0
  112. package/dist/generative-ui/standard/data.d.cts.map +1 -0
  113. package/dist/generative-ui/standard/data.d.mts +745 -0
  114. package/dist/generative-ui/standard/data.d.mts.map +1 -0
  115. package/dist/generative-ui/standard/data.mjs +167 -0
  116. package/dist/generative-ui/standard/data.mjs.map +1 -0
  117. package/dist/generative-ui/standard/declarations.cjs +40 -0
  118. package/dist/generative-ui/standard/declarations.cjs.map +1 -0
  119. package/dist/generative-ui/standard/declarations.d.cts +4604 -0
  120. package/dist/generative-ui/standard/declarations.d.cts.map +1 -0
  121. package/dist/generative-ui/standard/declarations.d.mts +4605 -0
  122. package/dist/generative-ui/standard/declarations.d.mts.map +1 -0
  123. package/dist/generative-ui/standard/declarations.mjs +39 -0
  124. package/dist/generative-ui/standard/declarations.mjs.map +1 -0
  125. package/dist/generative-ui/standard/feedback.cjs +97 -0
  126. package/dist/generative-ui/standard/feedback.cjs.map +1 -0
  127. package/dist/generative-ui/standard/feedback.d.cts +227 -0
  128. package/dist/generative-ui/standard/feedback.d.cts.map +1 -0
  129. package/dist/generative-ui/standard/feedback.d.mts +227 -0
  130. package/dist/generative-ui/standard/feedback.d.mts.map +1 -0
  131. package/dist/generative-ui/standard/feedback.mjs +90 -0
  132. package/dist/generative-ui/standard/feedback.mjs.map +1 -0
  133. package/dist/generative-ui/standard/index.d.mts +16 -0
  134. package/dist/generative-ui/standard/inputs.cjs +333 -0
  135. package/dist/generative-ui/standard/inputs.cjs.map +1 -0
  136. package/dist/generative-ui/standard/inputs.d.cts +2658 -0
  137. package/dist/generative-ui/standard/inputs.d.cts.map +1 -0
  138. package/dist/generative-ui/standard/inputs.d.mts +2658 -0
  139. package/dist/generative-ui/standard/inputs.d.mts.map +1 -0
  140. package/dist/generative-ui/standard/inputs.mjs +318 -0
  141. package/dist/generative-ui/standard/inputs.mjs.map +1 -0
  142. package/dist/generative-ui/standard/layout.cjs +289 -0
  143. package/dist/generative-ui/standard/layout.cjs.map +1 -0
  144. package/dist/generative-ui/standard/layout.d.cts +2854 -0
  145. package/dist/generative-ui/standard/layout.d.cts.map +1 -0
  146. package/dist/generative-ui/standard/layout.d.mts +2854 -0
  147. package/dist/generative-ui/standard/layout.d.mts.map +1 -0
  148. package/dist/generative-ui/standard/layout.mjs +269 -0
  149. package/dist/generative-ui/standard/layout.mjs.map +1 -0
  150. package/dist/generative-ui/standard/map.cjs +27 -0
  151. package/dist/generative-ui/standard/map.cjs.map +1 -0
  152. package/dist/generative-ui/standard/map.d.cts +93 -0
  153. package/dist/generative-ui/standard/map.d.cts.map +1 -0
  154. package/dist/generative-ui/standard/map.d.mts +93 -0
  155. package/dist/generative-ui/standard/map.d.mts.map +1 -0
  156. package/dist/generative-ui/standard/map.mjs +25 -0
  157. package/dist/generative-ui/standard/map.mjs.map +1 -0
  158. package/dist/generative-ui/standard/media.cjs +215 -0
  159. package/dist/generative-ui/standard/media.cjs.map +1 -0
  160. package/dist/generative-ui/standard/media.d.cts +968 -0
  161. package/dist/generative-ui/standard/media.d.cts.map +1 -0
  162. package/dist/generative-ui/standard/media.d.mts +968 -0
  163. package/dist/generative-ui/standard/media.d.mts.map +1 -0
  164. package/dist/generative-ui/standard/media.mjs +205 -0
  165. package/dist/generative-ui/standard/media.mjs.map +1 -0
  166. package/dist/generative-ui/standard/parameter-order.cjs +231 -0
  167. package/dist/generative-ui/standard/parameter-order.cjs.map +1 -0
  168. package/dist/generative-ui/standard/parameter-order.d.cts +84 -0
  169. package/dist/generative-ui/standard/parameter-order.d.cts.map +1 -0
  170. package/dist/generative-ui/standard/parameter-order.d.mts +84 -0
  171. package/dist/generative-ui/standard/parameter-order.d.mts.map +1 -0
  172. package/dist/generative-ui/standard/parameter-order.mjs +230 -0
  173. package/dist/generative-ui/standard/parameter-order.mjs.map +1 -0
  174. package/dist/generative-ui/standard/styles.cjs +62 -0
  175. package/dist/generative-ui/standard/styles.cjs.map +1 -0
  176. package/dist/generative-ui/standard/styles.d.cts +17 -0
  177. package/dist/generative-ui/standard/styles.d.cts.map +1 -0
  178. package/dist/generative-ui/standard/styles.d.mts +17 -0
  179. package/dist/generative-ui/standard/styles.d.mts.map +1 -0
  180. package/dist/generative-ui/standard/styles.mjs +60 -0
  181. package/dist/generative-ui/standard/styles.mjs.map +1 -0
  182. package/dist/generative-ui/standard/text.cjs +226 -0
  183. package/dist/generative-ui/standard/text.cjs.map +1 -0
  184. package/dist/generative-ui/standard/text.d.cts +687 -0
  185. package/dist/generative-ui/standard/text.d.cts.map +1 -0
  186. package/dist/generative-ui/standard/text.d.mts +687 -0
  187. package/dist/generative-ui/standard/text.d.mts.map +1 -0
  188. package/dist/generative-ui/standard/text.mjs +209 -0
  189. package/dist/generative-ui/standard/text.mjs.map +1 -0
  190. package/dist/generative-ui/standard/theme.cjs +115 -0
  191. package/dist/generative-ui/standard/theme.cjs.map +1 -0
  192. package/dist/generative-ui/standard/theme.d.cts +60 -0
  193. package/dist/generative-ui/standard/theme.d.cts.map +1 -0
  194. package/dist/generative-ui/standard/theme.d.mts +60 -0
  195. package/dist/generative-ui/standard/theme.d.mts.map +1 -0
  196. package/dist/generative-ui/standard/theme.mjs +112 -0
  197. package/dist/generative-ui/standard/theme.mjs.map +1 -0
  198. package/dist/generative-ui/standard/tokens.cjs +336 -0
  199. package/dist/generative-ui/standard/tokens.cjs.map +1 -0
  200. package/dist/generative-ui/standard/tokens.d.cts +76 -0
  201. package/dist/generative-ui/standard/tokens.d.cts.map +1 -0
  202. package/dist/generative-ui/standard/tokens.d.mts +76 -0
  203. package/dist/generative-ui/standard/tokens.d.mts.map +1 -0
  204. package/dist/generative-ui/standard/tokens.mjs +305 -0
  205. package/dist/generative-ui/standard/tokens.mjs.map +1 -0
  206. package/dist/index.cjs.map +1 -1
  207. package/dist/index.d.cts +10 -10
  208. package/dist/index.d.mts +10 -10
  209. package/dist/index.mjs.map +1 -1
  210. package/dist/index.umd.js +16 -7
  211. package/dist/index.umd.js.map +1 -1
  212. package/dist/package.cjs +1 -1
  213. package/dist/package.mjs +1 -1
  214. package/package.json +7 -3
  215. package/src/__tests__/a2ui-catalog-schema.test.ts +26 -0
  216. package/src/a2ui-catalog-schema.ts +14 -5
  217. package/src/event-transforms/open-generative-ui-middleware.ts +19 -10
  218. package/src/generative-ui/base.ts +9 -0
  219. package/src/generative-ui/catalog/catalog-export.ts +478 -0
  220. package/src/generative-ui/catalog/catalog.ts +1166 -0
  221. package/src/generative-ui/catalog/errors.ts +102 -0
  222. package/src/generative-ui/catalog/index.ts +6 -0
  223. package/src/generative-ui/catalog/json-schema.ts +23 -0
  224. package/src/generative-ui/catalog/refs.ts +86 -0
  225. package/src/generative-ui/catalog/schema.ts +107 -0
  226. package/src/generative-ui/index.ts +7 -0
  227. package/src/generative-ui/is-record.ts +6 -1
  228. package/src/generative-ui/standard/__tests__/theme.test.ts +61 -0
  229. package/src/generative-ui/standard/__tests__/tokens.test.ts +139 -0
  230. package/src/generative-ui/standard/chart.ts +79 -0
  231. package/src/generative-ui/standard/checks.ts +98 -0
  232. package/src/generative-ui/standard/components.ts +35 -0
  233. package/src/generative-ui/standard/composites.ts +158 -0
  234. package/src/generative-ui/standard/data.ts +213 -0
  235. package/src/generative-ui/standard/declarations.ts +57 -0
  236. package/src/generative-ui/standard/feedback.ts +105 -0
  237. package/src/generative-ui/standard/index.ts +19 -0
  238. package/src/generative-ui/standard/inputs.ts +423 -0
  239. package/src/generative-ui/standard/layout.ts +312 -0
  240. package/src/generative-ui/standard/map.ts +32 -0
  241. package/src/generative-ui/standard/media.ts +265 -0
  242. package/src/generative-ui/standard/parameter-order.ts +155 -0
  243. package/src/generative-ui/standard/styles.ts +79 -0
  244. package/src/generative-ui/standard/text.ts +210 -0
  245. package/src/generative-ui/standard/theme.ts +198 -0
  246. package/src/generative-ui/standard/tokens.ts +317 -0
  247. package/src/index.ts +1 -1
  248. package/tsdown.config.ts +1 -0
@@ -0,0 +1,500 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/generative-ui/standard/composites.d.ts
4
+ declare const linkCardSchema: z.ZodObject<{
5
+ href: z.ZodString;
6
+ title: z.ZodString;
7
+ description: z.ZodOptional<z.ZodString>;
8
+ image: z.ZodOptional<z.ZodString>;
9
+ domain: z.ZodOptional<z.ZodString>;
10
+ favicon: z.ZodOptional<z.ZodBoolean>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ title: string;
13
+ href: string;
14
+ description?: string | undefined;
15
+ image?: string | undefined;
16
+ domain?: string | undefined;
17
+ favicon?: boolean | undefined;
18
+ }, {
19
+ title: string;
20
+ href: string;
21
+ description?: string | undefined;
22
+ image?: string | undefined;
23
+ domain?: string | undefined;
24
+ favicon?: boolean | undefined;
25
+ }>;
26
+ declare const citationSchema: z.ZodObject<{
27
+ index: z.ZodOptional<z.ZodNumber>;
28
+ label: z.ZodOptional<z.ZodString>;
29
+ title: z.ZodOptional<z.ZodString>;
30
+ url: z.ZodOptional<z.ZodString>;
31
+ snippet: z.ZodOptional<z.ZodString>;
32
+ source: z.ZodOptional<z.ZodString>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ label?: string | undefined;
35
+ title?: string | undefined;
36
+ url?: string | undefined;
37
+ index?: number | undefined;
38
+ snippet?: string | undefined;
39
+ source?: string | undefined;
40
+ }, {
41
+ label?: string | undefined;
42
+ title?: string | undefined;
43
+ url?: string | undefined;
44
+ index?: number | undefined;
45
+ snippet?: string | undefined;
46
+ source?: string | undefined;
47
+ }>;
48
+ declare const followUpItem: z.ZodUnion<[z.ZodString, z.ZodObject<{
49
+ label: z.ZodString;
50
+ message: z.ZodOptional<z.ZodString>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ label: string;
53
+ message?: string | undefined;
54
+ }, {
55
+ label: string;
56
+ message?: string | undefined;
57
+ }>]>;
58
+ declare const followUpSchema: z.ZodObject<{
59
+ items: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
60
+ label: z.ZodString;
61
+ message: z.ZodOptional<z.ZodString>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ label: string;
64
+ message?: string | undefined;
65
+ }, {
66
+ label: string;
67
+ message?: string | undefined;
68
+ }>]>, "many">>;
69
+ title: z.ZodOptional<z.ZodString>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ title?: string | undefined;
72
+ items?: (string | {
73
+ label: string;
74
+ message?: string | undefined;
75
+ })[] | undefined;
76
+ }, {
77
+ title?: string | undefined;
78
+ items?: (string | {
79
+ label: string;
80
+ message?: string | undefined;
81
+ })[] | undefined;
82
+ }>;
83
+ declare const followUpArgs: z.ZodObject<{
84
+ message: z.ZodString;
85
+ }, "strip", z.ZodTypeAny, {
86
+ message: string;
87
+ }, {
88
+ message: string;
89
+ }>;
90
+ declare const cardAction: z.ZodObject<{
91
+ label: z.ZodString;
92
+ href: z.ZodOptional<z.ZodString>;
93
+ variant: z.ZodOptional<z.ZodEnum<["solid", "soft", "outline", "ghost"]>>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ label: string;
96
+ variant?: "outline" | "soft" | "solid" | "ghost" | undefined;
97
+ href?: string | undefined;
98
+ }, {
99
+ label: string;
100
+ variant?: "outline" | "soft" | "solid" | "ghost" | undefined;
101
+ href?: string | undefined;
102
+ }>;
103
+ declare const entityCardSchema: z.ZodObject<{
104
+ title: z.ZodString;
105
+ subtitle: z.ZodOptional<z.ZodString>;
106
+ description: z.ZodOptional<z.ZodString>;
107
+ image: z.ZodOptional<z.ZodString>;
108
+ imageAspectRatio: z.ZodOptional<z.ZodString>;
109
+ meta: z.ZodOptional<z.ZodString>;
110
+ badge: z.ZodOptional<z.ZodObject<{
111
+ label: z.ZodString;
112
+ color: z.ZodOptional<z.ZodEnum<["secondary", "success", "danger", "warning", "info", "discovery"]>>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ label: string;
115
+ color?: "info" | "warning" | "success" | "danger" | "discovery" | "secondary" | undefined;
116
+ }, {
117
+ label: string;
118
+ color?: "info" | "warning" | "success" | "danger" | "discovery" | "secondary" | undefined;
119
+ }>>;
120
+ rating: z.ZodOptional<z.ZodNumber>;
121
+ ratingCount: z.ZodOptional<z.ZodNumber>;
122
+ href: z.ZodOptional<z.ZodString>;
123
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
124
+ label: z.ZodString;
125
+ href: z.ZodOptional<z.ZodString>;
126
+ variant: z.ZodOptional<z.ZodEnum<["solid", "soft", "outline", "ghost"]>>;
127
+ }, "strip", z.ZodTypeAny, {
128
+ label: string;
129
+ variant?: "outline" | "soft" | "solid" | "ghost" | undefined;
130
+ href?: string | undefined;
131
+ }, {
132
+ label: string;
133
+ variant?: "outline" | "soft" | "solid" | "ghost" | undefined;
134
+ href?: string | undefined;
135
+ }>, "many">>;
136
+ layout: z.ZodOptional<z.ZodEnum<["vertical", "horizontal"]>>;
137
+ width: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
138
+ }, "strip", z.ZodTypeAny, {
139
+ title: string;
140
+ description?: string | undefined;
141
+ width?: string | number | undefined;
142
+ layout?: "horizontal" | "vertical" | undefined;
143
+ href?: string | undefined;
144
+ image?: string | undefined;
145
+ subtitle?: string | undefined;
146
+ imageAspectRatio?: string | undefined;
147
+ meta?: string | undefined;
148
+ badge?: {
149
+ label: string;
150
+ color?: "info" | "warning" | "success" | "danger" | "discovery" | "secondary" | undefined;
151
+ } | undefined;
152
+ rating?: number | undefined;
153
+ ratingCount?: number | undefined;
154
+ actions?: {
155
+ label: string;
156
+ variant?: "outline" | "soft" | "solid" | "ghost" | undefined;
157
+ href?: string | undefined;
158
+ }[] | undefined;
159
+ }, {
160
+ title: string;
161
+ description?: string | undefined;
162
+ width?: string | number | undefined;
163
+ layout?: "horizontal" | "vertical" | undefined;
164
+ href?: string | undefined;
165
+ image?: string | undefined;
166
+ subtitle?: string | undefined;
167
+ imageAspectRatio?: string | undefined;
168
+ meta?: string | undefined;
169
+ badge?: {
170
+ label: string;
171
+ color?: "info" | "warning" | "success" | "danger" | "discovery" | "secondary" | undefined;
172
+ } | undefined;
173
+ rating?: number | undefined;
174
+ ratingCount?: number | undefined;
175
+ actions?: {
176
+ label: string;
177
+ variant?: "outline" | "soft" | "solid" | "ghost" | undefined;
178
+ href?: string | undefined;
179
+ }[] | undefined;
180
+ }>;
181
+ declare const entityActionArgs: z.ZodObject<{
182
+ label: z.ZodString;
183
+ }, "strip", z.ZodTypeAny, {
184
+ label: string;
185
+ }, {
186
+ label: string;
187
+ }>;
188
+ declare const gridImage: z.ZodObject<{
189
+ url: z.ZodString;
190
+ description: z.ZodOptional<z.ZodString>;
191
+ caption: z.ZodOptional<z.ZodString>;
192
+ href: z.ZodOptional<z.ZodString>;
193
+ }, "strip", z.ZodTypeAny, {
194
+ url: string;
195
+ description?: string | undefined;
196
+ href?: string | undefined;
197
+ caption?: string | undefined;
198
+ }, {
199
+ url: string;
200
+ description?: string | undefined;
201
+ href?: string | undefined;
202
+ caption?: string | undefined;
203
+ }>;
204
+ declare const imageGridSchema: z.ZodObject<{
205
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
206
+ url: z.ZodString;
207
+ description: z.ZodOptional<z.ZodString>;
208
+ caption: z.ZodOptional<z.ZodString>;
209
+ href: z.ZodOptional<z.ZodString>;
210
+ }, "strip", z.ZodTypeAny, {
211
+ url: string;
212
+ description?: string | undefined;
213
+ href?: string | undefined;
214
+ caption?: string | undefined;
215
+ }, {
216
+ url: string;
217
+ description?: string | undefined;
218
+ href?: string | undefined;
219
+ caption?: string | undefined;
220
+ }>, "many">>;
221
+ columns: z.ZodOptional<z.ZodNumber>;
222
+ aspectRatio: z.ZodOptional<z.ZodString>;
223
+ gap: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
224
+ layout: z.ZodOptional<z.ZodEnum<["grid", "bento"]>>;
225
+ }, "strip", z.ZodTypeAny, {
226
+ gap?: string | number | undefined;
227
+ aspectRatio?: string | undefined;
228
+ columns?: number | undefined;
229
+ layout?: "grid" | "bento" | undefined;
230
+ images?: {
231
+ url: string;
232
+ description?: string | undefined;
233
+ href?: string | undefined;
234
+ caption?: string | undefined;
235
+ }[] | undefined;
236
+ }, {
237
+ gap?: string | number | undefined;
238
+ aspectRatio?: string | undefined;
239
+ columns?: number | undefined;
240
+ layout?: "grid" | "bento" | undefined;
241
+ images?: {
242
+ url: string;
243
+ description?: string | undefined;
244
+ href?: string | undefined;
245
+ caption?: string | undefined;
246
+ }[] | undefined;
247
+ }>;
248
+ /**
249
+ * The standard composite components, without their framework components.
250
+ *
251
+ * - LinkCard and EntityCard open `href`, or send `onClick` when it is bound.
252
+ * - FollowUp sends `onFollowUp` with the message of the pill. Unbound, the
253
+ * engine turns it into a visible user message with that text.
254
+ * - EntityCard buttons without href send `onAction` with their label.
255
+ */
256
+ declare const compositeDeclarations: {
257
+ LinkCard: {
258
+ description: string;
259
+ props: z.ZodObject<{
260
+ href: z.ZodString;
261
+ title: z.ZodString;
262
+ description: z.ZodOptional<z.ZodString>;
263
+ image: z.ZodOptional<z.ZodString>;
264
+ domain: z.ZodOptional<z.ZodString>;
265
+ favicon: z.ZodOptional<z.ZodBoolean>;
266
+ }, "strip", z.ZodTypeAny, {
267
+ title: string;
268
+ href: string;
269
+ description?: string | undefined;
270
+ image?: string | undefined;
271
+ domain?: string | undefined;
272
+ favicon?: boolean | undefined;
273
+ }, {
274
+ title: string;
275
+ href: string;
276
+ description?: string | undefined;
277
+ image?: string | undefined;
278
+ domain?: string | undefined;
279
+ favicon?: boolean | undefined;
280
+ }>;
281
+ events: {
282
+ onClick: {
283
+ description: string;
284
+ parameters: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
285
+ };
286
+ };
287
+ };
288
+ Citation: {
289
+ description: string;
290
+ props: z.ZodObject<{
291
+ index: z.ZodOptional<z.ZodNumber>;
292
+ label: z.ZodOptional<z.ZodString>;
293
+ title: z.ZodOptional<z.ZodString>;
294
+ url: z.ZodOptional<z.ZodString>;
295
+ snippet: z.ZodOptional<z.ZodString>;
296
+ source: z.ZodOptional<z.ZodString>;
297
+ }, "strip", z.ZodTypeAny, {
298
+ label?: string | undefined;
299
+ title?: string | undefined;
300
+ url?: string | undefined;
301
+ index?: number | undefined;
302
+ snippet?: string | undefined;
303
+ source?: string | undefined;
304
+ }, {
305
+ label?: string | undefined;
306
+ title?: string | undefined;
307
+ url?: string | undefined;
308
+ index?: number | undefined;
309
+ snippet?: string | undefined;
310
+ source?: string | undefined;
311
+ }>;
312
+ };
313
+ FollowUp: {
314
+ description: string;
315
+ props: z.ZodObject<{
316
+ items: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
317
+ label: z.ZodString;
318
+ message: z.ZodOptional<z.ZodString>;
319
+ }, "strip", z.ZodTypeAny, {
320
+ label: string;
321
+ message?: string | undefined;
322
+ }, {
323
+ label: string;
324
+ message?: string | undefined;
325
+ }>]>, "many">>;
326
+ title: z.ZodOptional<z.ZodString>;
327
+ }, "strip", z.ZodTypeAny, {
328
+ title?: string | undefined;
329
+ items?: (string | {
330
+ label: string;
331
+ message?: string | undefined;
332
+ })[] | undefined;
333
+ }, {
334
+ title?: string | undefined;
335
+ items?: (string | {
336
+ label: string;
337
+ message?: string | undefined;
338
+ })[] | undefined;
339
+ }>;
340
+ events: {
341
+ onFollowUp: {
342
+ description: string;
343
+ parameters: z.ZodObject<{
344
+ message: z.ZodString;
345
+ }, "strip", z.ZodTypeAny, {
346
+ message: string;
347
+ }, {
348
+ message: string;
349
+ }>;
350
+ };
351
+ };
352
+ };
353
+ EntityCard: {
354
+ description: string;
355
+ props: z.ZodObject<{
356
+ title: z.ZodString;
357
+ subtitle: z.ZodOptional<z.ZodString>;
358
+ description: z.ZodOptional<z.ZodString>;
359
+ image: z.ZodOptional<z.ZodString>;
360
+ imageAspectRatio: z.ZodOptional<z.ZodString>;
361
+ meta: z.ZodOptional<z.ZodString>;
362
+ badge: z.ZodOptional<z.ZodObject<{
363
+ label: z.ZodString;
364
+ color: z.ZodOptional<z.ZodEnum<["secondary", "success", "danger", "warning", "info", "discovery"]>>;
365
+ }, "strip", z.ZodTypeAny, {
366
+ label: string;
367
+ color?: "info" | "warning" | "success" | "danger" | "discovery" | "secondary" | undefined;
368
+ }, {
369
+ label: string;
370
+ color?: "info" | "warning" | "success" | "danger" | "discovery" | "secondary" | undefined;
371
+ }>>;
372
+ rating: z.ZodOptional<z.ZodNumber>;
373
+ ratingCount: z.ZodOptional<z.ZodNumber>;
374
+ href: z.ZodOptional<z.ZodString>;
375
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
376
+ label: z.ZodString;
377
+ href: z.ZodOptional<z.ZodString>;
378
+ variant: z.ZodOptional<z.ZodEnum<["solid", "soft", "outline", "ghost"]>>;
379
+ }, "strip", z.ZodTypeAny, {
380
+ label: string;
381
+ variant?: "outline" | "soft" | "solid" | "ghost" | undefined;
382
+ href?: string | undefined;
383
+ }, {
384
+ label: string;
385
+ variant?: "outline" | "soft" | "solid" | "ghost" | undefined;
386
+ href?: string | undefined;
387
+ }>, "many">>;
388
+ layout: z.ZodOptional<z.ZodEnum<["vertical", "horizontal"]>>;
389
+ width: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
390
+ }, "strip", z.ZodTypeAny, {
391
+ title: string;
392
+ description?: string | undefined;
393
+ width?: string | number | undefined;
394
+ layout?: "horizontal" | "vertical" | undefined;
395
+ href?: string | undefined;
396
+ image?: string | undefined;
397
+ subtitle?: string | undefined;
398
+ imageAspectRatio?: string | undefined;
399
+ meta?: string | undefined;
400
+ badge?: {
401
+ label: string;
402
+ color?: "info" | "warning" | "success" | "danger" | "discovery" | "secondary" | undefined;
403
+ } | undefined;
404
+ rating?: number | undefined;
405
+ ratingCount?: number | undefined;
406
+ actions?: {
407
+ label: string;
408
+ variant?: "outline" | "soft" | "solid" | "ghost" | undefined;
409
+ href?: string | undefined;
410
+ }[] | undefined;
411
+ }, {
412
+ title: string;
413
+ description?: string | undefined;
414
+ width?: string | number | undefined;
415
+ layout?: "horizontal" | "vertical" | undefined;
416
+ href?: string | undefined;
417
+ image?: string | undefined;
418
+ subtitle?: string | undefined;
419
+ imageAspectRatio?: string | undefined;
420
+ meta?: string | undefined;
421
+ badge?: {
422
+ label: string;
423
+ color?: "info" | "warning" | "success" | "danger" | "discovery" | "secondary" | undefined;
424
+ } | undefined;
425
+ rating?: number | undefined;
426
+ ratingCount?: number | undefined;
427
+ actions?: {
428
+ label: string;
429
+ variant?: "outline" | "soft" | "solid" | "ghost" | undefined;
430
+ href?: string | undefined;
431
+ }[] | undefined;
432
+ }>;
433
+ events: {
434
+ onClick: {
435
+ description: string;
436
+ parameters: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
437
+ };
438
+ onAction: {
439
+ description: string;
440
+ parameters: z.ZodObject<{
441
+ label: z.ZodString;
442
+ }, "strip", z.ZodTypeAny, {
443
+ label: string;
444
+ }, {
445
+ label: string;
446
+ }>;
447
+ };
448
+ };
449
+ };
450
+ ImageGrid: {
451
+ description: string;
452
+ props: z.ZodObject<{
453
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
454
+ url: z.ZodString;
455
+ description: z.ZodOptional<z.ZodString>;
456
+ caption: z.ZodOptional<z.ZodString>;
457
+ href: z.ZodOptional<z.ZodString>;
458
+ }, "strip", z.ZodTypeAny, {
459
+ url: string;
460
+ description?: string | undefined;
461
+ href?: string | undefined;
462
+ caption?: string | undefined;
463
+ }, {
464
+ url: string;
465
+ description?: string | undefined;
466
+ href?: string | undefined;
467
+ caption?: string | undefined;
468
+ }>, "many">>;
469
+ columns: z.ZodOptional<z.ZodNumber>;
470
+ aspectRatio: z.ZodOptional<z.ZodString>;
471
+ gap: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
472
+ layout: z.ZodOptional<z.ZodEnum<["grid", "bento"]>>;
473
+ }, "strip", z.ZodTypeAny, {
474
+ gap?: string | number | undefined;
475
+ aspectRatio?: string | undefined;
476
+ columns?: number | undefined;
477
+ layout?: "grid" | "bento" | undefined;
478
+ images?: {
479
+ url: string;
480
+ description?: string | undefined;
481
+ href?: string | undefined;
482
+ caption?: string | undefined;
483
+ }[] | undefined;
484
+ }, {
485
+ gap?: string | number | undefined;
486
+ aspectRatio?: string | undefined;
487
+ columns?: number | undefined;
488
+ layout?: "grid" | "bento" | undefined;
489
+ images?: {
490
+ url: string;
491
+ description?: string | undefined;
492
+ href?: string | undefined;
493
+ caption?: string | undefined;
494
+ }[] | undefined;
495
+ }>;
496
+ };
497
+ };
498
+ //#endregion
499
+ export { cardAction, citationSchema, compositeDeclarations, entityActionArgs, entityCardSchema, followUpArgs, followUpItem, followUpSchema, gridImage, imageGridSchema, linkCardSchema };
500
+ //# sourceMappingURL=composites.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composites.d.mts","names":[],"sources":["../../../src/generative-ui/standard/composites.ts"],"mappings":";;;cAQa,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;cAQd,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;cAQd,YAAA,EAAY,CAAA,CAAA,QAAA,EAAA,CAAA,CAAA,SAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;cAOZ,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;cAId,YAAA,EAAY,CAAA,CAAA,SAAA;;;;;;;cAWZ,UAAA,EAAU,CAAA,CAAA,SAAA;;;;;;;;;;;;;cAKV,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4BhB,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;;;cAGhB,SAAA,EAAS,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;cAMT,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA1C5B;;;;;;;cA6Da,qBAAA"}
@@ -0,0 +1,132 @@
1
+ import { NO_ARGS, sizeValue } from "./layout.mjs";
2
+ import { z } from "zod";
3
+
4
+ //#region src/generative-ui/standard/composites.ts
5
+ const text = (description) => z.string().optional().describe(description);
6
+ const linkCardSchema = z.object({
7
+ href: z.string().describe("The URL (http, https)"),
8
+ title: z.string().describe("The page title"),
9
+ description: text("One or two lines"),
10
+ image: text("A thumbnail URL"),
11
+ domain: text("Shown next to the favicon. Default: the host of href"),
12
+ favicon: z.boolean().optional().describe("Default true")
13
+ });
14
+ const citationSchema = z.object({
15
+ index: z.number().optional().describe("The marker number. Default 1"),
16
+ label: text("Marker text instead of the number, for example a domain"),
17
+ title: text("The source title"),
18
+ url: text("The source URL (http, https)"),
19
+ snippet: text("The quoted passage, one or two lines"),
20
+ source: text("The publisher or domain. Default: the host of url")
21
+ });
22
+ const followUpItem = z.union([z.string(), z.object({
23
+ label: z.string(),
24
+ message: text("The text sent when the user clicks. Default: label")
25
+ })]);
26
+ const followUpSchema = z.object({
27
+ items: z.array(followUpItem).optional(),
28
+ title: text("A caption above the pills")
29
+ });
30
+ const followUpArgs = z.object({ message: z.string().describe("The message of the clicked pill") });
31
+ const BADGE_COLORS = [
32
+ "secondary",
33
+ "success",
34
+ "danger",
35
+ "warning",
36
+ "info",
37
+ "discovery"
38
+ ];
39
+ const cardAction = z.object({
40
+ label: z.string(),
41
+ href: text("Opens this URL in a new tab"),
42
+ variant: z.enum([
43
+ "solid",
44
+ "soft",
45
+ "outline",
46
+ "ghost"
47
+ ]).optional()
48
+ });
49
+ const entityCardSchema = z.object({
50
+ title: z.string().describe("The name"),
51
+ subtitle: text("A second line, for example the brand or category"),
52
+ description: text("Up to three lines"),
53
+ image: text("An image URL"),
54
+ imageAspectRatio: z.string().optional().describe("Default \"4 / 3\""),
55
+ meta: text("A short fact line, for example \"$29 / month\" or \"Open until 22:00\""),
56
+ badge: z.object({
57
+ label: z.string(),
58
+ color: z.enum(BADGE_COLORS).optional()
59
+ }).optional(),
60
+ rating: z.number().optional().describe("0 to 5, shown as stars"),
61
+ ratingCount: z.number().optional().describe("The number of ratings"),
62
+ href: text("Opens this URL in a new tab when the user clicks the card"),
63
+ actions: z.array(cardAction).max(3).optional().describe("Up to three buttons. A button without href sends onAction with its label"),
64
+ layout: z.enum(["vertical", "horizontal"]).optional().describe("Default \"vertical\". \"horizontal\" puts the image on the left"),
65
+ width: sizeValue.optional()
66
+ });
67
+ const entityActionArgs = z.object({ label: z.string().describe("The label of the clicked button") });
68
+ const gridImage = z.object({
69
+ url: z.string(),
70
+ description: z.string().optional().describe("What the image shows"),
71
+ caption: z.string().optional(),
72
+ href: text("Opens this URL instead of the full-screen view")
73
+ });
74
+ const imageGridSchema = z.object({
75
+ images: z.array(gridImage).optional(),
76
+ columns: z.number().optional().describe("Default 3"),
77
+ aspectRatio: z.string().optional().describe("Default \"1 / 1\""),
78
+ gap: sizeValue.optional().describe("Default 2"),
79
+ layout: z.enum(["grid", "bento"]).optional().describe("Default \"grid\". \"bento\" makes the first image twice as large")
80
+ });
81
+ /**
82
+ * The standard composite components, without their framework components.
83
+ *
84
+ * - LinkCard and EntityCard open `href`, or send `onClick` when it is bound.
85
+ * - FollowUp sends `onFollowUp` with the message of the pill. Unbound, the
86
+ * engine turns it into a visible user message with that text.
87
+ * - EntityCard buttons without href send `onAction` with their label.
88
+ */
89
+ const compositeDeclarations = {
90
+ LinkCard: {
91
+ description: "A preview of a URL: favicon and domain, title, description, thumbnail. A click opens it in a new tab, or sends onClick when bound. For sources, articles and products with a page.",
92
+ props: linkCardSchema,
93
+ events: { onClick: {
94
+ description: "Sent when the user clicks the card, instead of the link.",
95
+ parameters: NO_ARGS
96
+ } }
97
+ },
98
+ Citation: {
99
+ description: "An inline source marker ([1]) showing title, snippet and link on hover or click. Put it right after the sentence it supports, as a child of a Text or in a Row.",
100
+ props: citationSchema
101
+ },
102
+ FollowUp: {
103
+ description: "Suggested next prompts as pills; a click sends the pill's message as the user's next turn, no event needed. At the end of a surface, two to four short items.",
104
+ props: followUpSchema,
105
+ events: { onFollowUp: {
106
+ description: "Sent when the user clicks a pill. The args carry the message of the pill.",
107
+ parameters: followUpArgs
108
+ } }
109
+ },
110
+ EntityCard: {
111
+ description: "A card for one product, place, person or listing: image, title, subtitle, description, a price or meta line, badge, rating and up to three buttons. href opens a page; onClick is sent when bound. Use a Grid of them for several things.",
112
+ props: entityCardSchema,
113
+ events: {
114
+ onClick: {
115
+ description: "Sent when the user clicks the card and it has no href.",
116
+ parameters: NO_ARGS
117
+ },
118
+ onAction: {
119
+ description: "Sent when the user clicks a button without href. The args carry the label of the button.",
120
+ parameters: entityActionArgs
121
+ }
122
+ }
123
+ },
124
+ ImageGrid: {
125
+ description: "A gallery of images in a grid. A click opens the image full-screen, with arrows to the other images. layout \"bento\" makes the first image twice as large.",
126
+ props: imageGridSchema
127
+ }
128
+ };
129
+
130
+ //#endregion
131
+ export { cardAction, citationSchema, compositeDeclarations, entityActionArgs, entityCardSchema, followUpArgs, followUpItem, followUpSchema, gridImage, imageGridSchema, linkCardSchema };
132
+ //# sourceMappingURL=composites.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composites.mjs","names":[],"sources":["../../../src/generative-ui/standard/composites.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { NO_ARGS, sizeValue } from \"./layout\";\n\n// ---- Schemas ----\n\nconst text = (description: string) =>\n z.string().optional().describe(description);\n\nexport const linkCardSchema = z.object({\n href: z.string().describe(\"The URL (http, https)\"),\n title: z.string().describe(\"The page title\"),\n description: text(\"One or two lines\"),\n image: text(\"A thumbnail URL\"),\n domain: text(\"Shown next to the favicon. Default: the host of href\"),\n favicon: z.boolean().optional().describe(\"Default true\"),\n});\nexport const citationSchema = z.object({\n index: z.number().optional().describe(\"The marker number. Default 1\"),\n label: text(\"Marker text instead of the number, for example a domain\"),\n title: text(\"The source title\"),\n url: text(\"The source URL (http, https)\"),\n snippet: text(\"The quoted passage, one or two lines\"),\n source: text(\"The publisher or domain. Default: the host of url\"),\n});\nexport const followUpItem = z.union([\n z.string(),\n z.object({\n label: z.string(),\n message: text(\"The text sent when the user clicks. Default: label\"),\n }),\n]);\nexport const followUpSchema = z.object({\n items: z.array(followUpItem).optional(),\n title: text(\"A caption above the pills\"),\n});\nexport const followUpArgs = z.object({\n message: z.string().describe(\"The message of the clicked pill\"),\n});\nconst BADGE_COLORS = [\n \"secondary\",\n \"success\",\n \"danger\",\n \"warning\",\n \"info\",\n \"discovery\",\n] as const;\nexport const cardAction = z.object({\n label: z.string(),\n href: text(\"Opens this URL in a new tab\"),\n variant: z.enum([\"solid\", \"soft\", \"outline\", \"ghost\"]).optional(),\n});\nexport const entityCardSchema = z.object({\n title: z.string().describe(\"The name\"),\n subtitle: text(\"A second line, for example the brand or category\"),\n description: text(\"Up to three lines\"),\n image: text(\"An image URL\"),\n imageAspectRatio: z.string().optional().describe('Default \"4 / 3\"'),\n meta: text(\n 'A short fact line, for example \"$29 / month\" or \"Open until 22:00\"',\n ),\n badge: z\n .object({ label: z.string(), color: z.enum(BADGE_COLORS).optional() })\n .optional(),\n rating: z.number().optional().describe(\"0 to 5, shown as stars\"),\n ratingCount: z.number().optional().describe(\"The number of ratings\"),\n href: text(\"Opens this URL in a new tab when the user clicks the card\"),\n actions: z\n .array(cardAction)\n .max(3)\n .optional()\n .describe(\n \"Up to three buttons. A button without href sends onAction with its label\",\n ),\n layout: z\n .enum([\"vertical\", \"horizontal\"])\n .optional()\n .describe('Default \"vertical\". \"horizontal\" puts the image on the left'),\n width: sizeValue.optional(),\n});\nexport const entityActionArgs = z.object({\n label: z.string().describe(\"The label of the clicked button\"),\n});\nexport const gridImage = z.object({\n url: z.string(),\n description: z.string().optional().describe(\"What the image shows\"),\n caption: z.string().optional(),\n href: text(\"Opens this URL instead of the full-screen view\"),\n});\nexport const imageGridSchema = z.object({\n images: z.array(gridImage).optional(),\n columns: z.number().optional().describe(\"Default 3\"),\n aspectRatio: z.string().optional().describe('Default \"1 / 1\"'),\n gap: sizeValue.optional().describe(\"Default 2\"),\n layout: z\n .enum([\"grid\", \"bento\"])\n .optional()\n .describe('Default \"grid\". \"bento\" makes the first image twice as large'),\n});\n\n/**\n * The standard composite components, without their framework components.\n *\n * - LinkCard and EntityCard open `href`, or send `onClick` when it is bound.\n * - FollowUp sends `onFollowUp` with the message of the pill. Unbound, the\n * engine turns it into a visible user message with that text.\n * - EntityCard buttons without href send `onAction` with their label.\n */\nexport const compositeDeclarations = {\n LinkCard: {\n description:\n \"A preview of a URL: favicon and domain, title, description, thumbnail. A click opens it in a new tab, or sends onClick when bound. For sources, articles and products with a page.\",\n props: linkCardSchema,\n events: {\n onClick: {\n description: \"Sent when the user clicks the card, instead of the link.\",\n parameters: NO_ARGS,\n },\n },\n },\n Citation: {\n description:\n \"An inline source marker ([1]) showing title, snippet and link on hover or click. Put it right after the sentence it supports, as a child of a Text or in a Row.\",\n props: citationSchema,\n },\n FollowUp: {\n description:\n \"Suggested next prompts as pills; a click sends the pill's message as the user's next turn, no event needed. At the end of a surface, two to four short items.\",\n props: followUpSchema,\n events: {\n onFollowUp: {\n description:\n \"Sent when the user clicks a pill. The args carry the message of the pill.\",\n parameters: followUpArgs,\n },\n },\n },\n EntityCard: {\n description:\n \"A card for one product, place, person or listing: image, title, subtitle, description, a price or meta line, badge, rating and up to three buttons. href opens a page; onClick is sent when bound. Use a Grid of them for several things.\",\n props: entityCardSchema,\n events: {\n onClick: {\n description: \"Sent when the user clicks the card and it has no href.\",\n parameters: NO_ARGS,\n },\n onAction: {\n description:\n \"Sent when the user clicks a button without href. The args carry the label of the button.\",\n parameters: entityActionArgs,\n },\n },\n },\n ImageGrid: {\n description:\n 'A gallery of images in a grid. A click opens the image full-screen, with arrows to the other images. layout \"bento\" makes the first image twice as large.',\n props: imageGridSchema,\n },\n};\n"],"mappings":"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"}