@assistant-ui/react-generative-ui 0.0.23 → 0.1.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 (338) hide show
  1. package/README.md +2 -0
  2. package/dist/a2ui.d.ts +1 -4
  3. package/dist/a2ui.d.ts.map +1 -1
  4. package/dist/a2ui.js +1 -4
  5. package/dist/index.d.ts +1 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -10
  8. package/dist/index.server.d.ts +1 -2
  9. package/dist/index.server.d.ts.map +1 -1
  10. package/dist/index.server.js +1 -10
  11. package/dist/ir.d.ts +1 -111
  12. package/dist/ir.d.ts.map +1 -1
  13. package/dist/ir.js +1 -175
  14. package/dist/slack.d.ts +1 -4
  15. package/dist/slack.d.ts.map +1 -1
  16. package/dist/slack.js +1 -4
  17. package/dist/teams.d.ts +1 -4
  18. package/dist/teams.d.ts.map +1 -1
  19. package/dist/teams.js +1 -4
  20. package/package.json +5 -5
  21. package/src/a2ui.ts +1 -22
  22. package/src/index.server.ts +1 -2
  23. package/src/index.test.ts +75 -0
  24. package/src/index.ts +1 -2
  25. package/src/ir.ts +1 -279
  26. package/src/slack.ts +1 -39
  27. package/src/teams.ts +1 -35
  28. package/dist/JSONGenerativeUI.client.d.ts +0 -28
  29. package/dist/JSONGenerativeUI.client.d.ts.map +0 -1
  30. package/dist/JSONGenerativeUI.client.js +0 -101
  31. package/dist/JSONGenerativeUI.client.js.map +0 -1
  32. package/dist/JSONGenerativeUI.server.d.ts +0 -21
  33. package/dist/JSONGenerativeUI.server.d.ts.map +0 -1
  34. package/dist/JSONGenerativeUI.server.js +0 -32
  35. package/dist/JSONGenerativeUI.server.js.map +0 -1
  36. package/dist/JSONGenerativeUI.shared.d.ts +0 -63
  37. package/dist/JSONGenerativeUI.shared.d.ts.map +0 -1
  38. package/dist/JSONGenerativeUI.shared.js +0 -31
  39. package/dist/JSONGenerativeUI.shared.js.map +0 -1
  40. package/dist/RadioGroupScope.d.ts +0 -6
  41. package/dist/RadioGroupScope.d.ts.map +0 -1
  42. package/dist/RadioGroupScope.js +0 -25
  43. package/dist/RadioGroupScope.js.map +0 -1
  44. package/dist/a2ui/BindingContext.d.ts +0 -11
  45. package/dist/a2ui/BindingContext.d.ts.map +0 -1
  46. package/dist/a2ui/BindingContext.js +0 -12
  47. package/dist/a2ui/BindingContext.js.map +0 -1
  48. package/dist/a2ui/PresentRenderer.d.ts +0 -11
  49. package/dist/a2ui/PresentRenderer.d.ts.map +0 -1
  50. package/dist/a2ui/PresentRenderer.js +0 -39
  51. package/dist/a2ui/PresentRenderer.js.map +0 -1
  52. package/dist/a2ui/convert.d.ts +0 -15
  53. package/dist/a2ui/convert.d.ts.map +0 -1
  54. package/dist/a2ui/convert.js +0 -728
  55. package/dist/a2ui/convert.js.map +0 -1
  56. package/dist/a2ui/dataModel.d.ts +0 -9
  57. package/dist/a2ui/dataModel.d.ts.map +0 -1
  58. package/dist/a2ui/dataModel.js +0 -44
  59. package/dist/a2ui/dataModel.js.map +0 -1
  60. package/dist/a2ui/reducer.d.ts +0 -8
  61. package/dist/a2ui/reducer.d.ts.map +0 -1
  62. package/dist/a2ui/reducer.js +0 -242
  63. package/dist/a2ui/reducer.js.map +0 -1
  64. package/dist/a2ui/snapshot.d.ts +0 -3
  65. package/dist/a2ui/snapshot.d.ts.map +0 -1
  66. package/dist/a2ui/snapshot.js +0 -33
  67. package/dist/a2ui/snapshot.js.map +0 -1
  68. package/dist/a2ui/types.d.ts +0 -88
  69. package/dist/a2ui/types.d.ts.map +0 -1
  70. package/dist/a2ui/types.js +0 -6
  71. package/dist/a2ui/types.js.map +0 -1
  72. package/dist/a2ui/valueFunctions.d.ts +0 -16
  73. package/dist/a2ui/valueFunctions.d.ts.map +0 -1
  74. package/dist/a2ui/valueFunctions.js +0 -332
  75. package/dist/a2ui/valueFunctions.js.map +0 -1
  76. package/dist/actionRegistry.d.ts +0 -29
  77. package/dist/actionRegistry.d.ts.map +0 -1
  78. package/dist/actionRegistry.js +0 -41
  79. package/dist/actionRegistry.js.map +0 -1
  80. package/dist/answeredValues.d.ts +0 -16
  81. package/dist/answeredValues.d.ts.map +0 -1
  82. package/dist/answeredValues.js +0 -37
  83. package/dist/answeredValues.js.map +0 -1
  84. package/dist/buildPresentParameters.d.ts +0 -21
  85. package/dist/buildPresentParameters.d.ts.map +0 -1
  86. package/dist/buildPresentParameters.js +0 -95
  87. package/dist/buildPresentParameters.js.map +0 -1
  88. package/dist/constants.d.ts +0 -15
  89. package/dist/constants.d.ts.map +0 -1
  90. package/dist/constants.js +0 -19
  91. package/dist/constants.js.map +0 -1
  92. package/dist/convert/boundSpec.d.ts +0 -48
  93. package/dist/convert/boundSpec.d.ts.map +0 -1
  94. package/dist/convert/boundSpec.js +0 -108
  95. package/dist/convert/boundSpec.js.map +0 -1
  96. package/dist/convert/copyBounded.d.ts +0 -25
  97. package/dist/convert/copyBounded.d.ts.map +0 -1
  98. package/dist/convert/copyBounded.js +0 -38
  99. package/dist/convert/copyBounded.js.map +0 -1
  100. package/dist/convert/isElement.d.ts +0 -3
  101. package/dist/convert/isElement.d.ts.map +0 -1
  102. package/dist/convert/isElement.js +0 -6
  103. package/dist/convert/isElement.js.map +0 -1
  104. package/dist/convert/takeRun.d.ts +0 -6
  105. package/dist/convert/takeRun.d.ts.map +0 -1
  106. package/dist/convert/takeRun.js +0 -20
  107. package/dist/convert/takeRun.js.map +0 -1
  108. package/dist/defineGenerativeComponents.d.ts +0 -29
  109. package/dist/defineGenerativeComponents.d.ts.map +0 -1
  110. package/dist/defineGenerativeComponents.js +0 -34
  111. package/dist/defineGenerativeComponents.js.map +0 -1
  112. package/dist/fieldReferences.d.ts +0 -9
  113. package/dist/fieldReferences.d.ts.map +0 -1
  114. package/dist/fieldReferences.js +0 -53
  115. package/dist/fieldReferences.js.map +0 -1
  116. package/dist/generativeUIToJSX.d.ts +0 -18
  117. package/dist/generativeUIToJSX.d.ts.map +0 -1
  118. package/dist/generativeUIToJSX.js +0 -76
  119. package/dist/generativeUIToJSX.js.map +0 -1
  120. package/dist/index.shared.d.ts +0 -15
  121. package/dist/index.shared.d.ts.map +0 -1
  122. package/dist/index.shared.js +0 -9
  123. package/dist/ir.js.map +0 -1
  124. package/dist/renderGenerativeUI.d.ts +0 -14
  125. package/dist/renderGenerativeUI.d.ts.map +0 -1
  126. package/dist/renderGenerativeUI.js +0 -83
  127. package/dist/renderGenerativeUI.js.map +0 -1
  128. package/dist/scopeSchema.d.ts +0 -6
  129. package/dist/scopeSchema.d.ts.map +0 -1
  130. package/dist/scopeSchema.js +0 -56
  131. package/dist/scopeSchema.js.map +0 -1
  132. package/dist/slack/constants.d.ts +0 -93
  133. package/dist/slack/constants.d.ts.map +0 -1
  134. package/dist/slack/constants.js +0 -146
  135. package/dist/slack/constants.js.map +0 -1
  136. package/dist/slack/decodeBlockAction.d.ts +0 -10
  137. package/dist/slack/decodeBlockAction.d.ts.map +0 -1
  138. package/dist/slack/decodeBlockAction.js +0 -129
  139. package/dist/slack/decodeBlockAction.js.map +0 -1
  140. package/dist/slack/fromSlackBlocks.d.ts +0 -27
  141. package/dist/slack/fromSlackBlocks.d.ts.map +0 -1
  142. package/dist/slack/fromSlackBlocks.js +0 -483
  143. package/dist/slack/fromSlackBlocks.js.map +0 -1
  144. package/dist/slack/toSlackBlocks.d.ts +0 -4
  145. package/dist/slack/toSlackBlocks.d.ts.map +0 -1
  146. package/dist/slack/toSlackBlocks.js +0 -901
  147. package/dist/slack/toSlackBlocks.js.map +0 -1
  148. package/dist/slack/types.d.ts +0 -204
  149. package/dist/slack/types.d.ts.map +0 -1
  150. package/dist/slack/types.js +0 -0
  151. package/dist/teams/constants.d.ts +0 -34
  152. package/dist/teams/constants.d.ts.map +0 -1
  153. package/dist/teams/constants.js +0 -68
  154. package/dist/teams/constants.js.map +0 -1
  155. package/dist/teams/decodeSubmitData.d.ts +0 -26
  156. package/dist/teams/decodeSubmitData.d.ts.map +0 -1
  157. package/dist/teams/decodeSubmitData.js +0 -70
  158. package/dist/teams/decodeSubmitData.js.map +0 -1
  159. package/dist/teams/temporalId.d.ts +0 -5
  160. package/dist/teams/temporalId.d.ts.map +0 -1
  161. package/dist/teams/temporalId.js +0 -28
  162. package/dist/teams/temporalId.js.map +0 -1
  163. package/dist/teams/toAdaptiveCard.d.ts +0 -45
  164. package/dist/teams/toAdaptiveCard.d.ts.map +0 -1
  165. package/dist/teams/toAdaptiveCard.js +0 -642
  166. package/dist/teams/toAdaptiveCard.js.map +0 -1
  167. package/dist/teams/toTeamsAttachments.d.ts +0 -10
  168. package/dist/teams/toTeamsAttachments.d.ts.map +0 -1
  169. package/dist/teams/toTeamsAttachments.js +0 -99
  170. package/dist/teams/toTeamsAttachments.js.map +0 -1
  171. package/dist/teams/types.d.ts +0 -224
  172. package/dist/teams/types.d.ts.map +0 -1
  173. package/dist/teams/types.js +0 -0
  174. package/dist/temporal.d.ts +0 -33
  175. package/dist/temporal.d.ts.map +0 -1
  176. package/dist/temporal.js +0 -152
  177. package/dist/temporal.js.map +0 -1
  178. package/dist/types.d.ts +0 -99
  179. package/dist/types.d.ts.map +0 -1
  180. package/dist/types.js +0 -0
  181. package/dist/vocabulary/alert.d.ts +0 -32
  182. package/dist/vocabulary/alert.d.ts.map +0 -1
  183. package/dist/vocabulary/alert.js +0 -160
  184. package/dist/vocabulary/alert.js.map +0 -1
  185. package/dist/vocabulary/collectFormValues.d.ts +0 -23
  186. package/dist/vocabulary/collectFormValues.d.ts.map +0 -1
  187. package/dist/vocabulary/collectFormValues.js +0 -44
  188. package/dist/vocabulary/collectFormValues.js.map +0 -1
  189. package/dist/vocabulary/data.d.ts +0 -66
  190. package/dist/vocabulary/data.d.ts.map +0 -1
  191. package/dist/vocabulary/data.js +0 -503
  192. package/dist/vocabulary/data.js.map +0 -1
  193. package/dist/vocabulary/dispatch.d.ts +0 -9
  194. package/dist/vocabulary/dispatch.d.ts.map +0 -1
  195. package/dist/vocabulary/dispatch.js +0 -50
  196. package/dist/vocabulary/dispatch.js.map +0 -1
  197. package/dist/vocabulary/fact.d.ts +0 -19
  198. package/dist/vocabulary/fact.d.ts.map +0 -1
  199. package/dist/vocabulary/fact.js +0 -51
  200. package/dist/vocabulary/fact.js.map +0 -1
  201. package/dist/vocabulary/form.d.ts +0 -11
  202. package/dist/vocabulary/form.d.ts.map +0 -1
  203. package/dist/vocabulary/form.js +0 -23
  204. package/dist/vocabulary/form.js.map +0 -1
  205. package/dist/vocabulary/formatValue.d.ts +0 -7
  206. package/dist/vocabulary/formatValue.d.ts.map +0 -1
  207. package/dist/vocabulary/formatValue.js +0 -76
  208. package/dist/vocabulary/formatValue.js.map +0 -1
  209. package/dist/vocabulary/icon.d.ts +0 -41
  210. package/dist/vocabulary/icon.d.ts.map +0 -1
  211. package/dist/vocabulary/icon.js +0 -272
  212. package/dist/vocabulary/icon.js.map +0 -1
  213. package/dist/vocabulary/index.d.ts +0 -12
  214. package/dist/vocabulary/index.d.ts.map +0 -1
  215. package/dist/vocabulary/index.js +0 -36
  216. package/dist/vocabulary/index.js.map +0 -1
  217. package/dist/vocabulary/interactive.d.ts +0 -230
  218. package/dist/vocabulary/interactive.d.ts.map +0 -1
  219. package/dist/vocabulary/interactive.js +0 -530
  220. package/dist/vocabulary/interactive.js.map +0 -1
  221. package/dist/vocabulary/layout.d.ts +0 -79
  222. package/dist/vocabulary/layout.d.ts.map +0 -1
  223. package/dist/vocabulary/layout.js +0 -139
  224. package/dist/vocabulary/layout.js.map +0 -1
  225. package/dist/vocabulary/list.d.ts +0 -14
  226. package/dist/vocabulary/list.d.ts.map +0 -1
  227. package/dist/vocabulary/list.js +0 -50
  228. package/dist/vocabulary/list.js.map +0 -1
  229. package/dist/vocabulary/media.d.ts +0 -25
  230. package/dist/vocabulary/media.d.ts.map +0 -1
  231. package/dist/vocabulary/media.js +0 -42
  232. package/dist/vocabulary/media.js.map +0 -1
  233. package/dist/vocabulary/text.d.ts +0 -57
  234. package/dist/vocabulary/text.d.ts.map +0 -1
  235. package/dist/vocabulary/text.js +0 -49
  236. package/dist/vocabulary/text.js.map +0 -1
  237. package/dist/vocabulary/toTextContent.d.ts +0 -2
  238. package/dist/vocabulary/toTextContent.d.ts.map +0 -1
  239. package/dist/vocabulary/toTextContent.js +0 -6
  240. package/dist/vocabulary/toTextContent.js.map +0 -1
  241. package/src/JSONGenerativeUI.client.tsx +0 -168
  242. package/src/JSONGenerativeUI.server.tsx +0 -39
  243. package/src/JSONGenerativeUI.shared.ts +0 -90
  244. package/src/JSONGenerativeUI.test.tsx +0 -1298
  245. package/src/RadioGroupScope.server.test.tsx +0 -24
  246. package/src/RadioGroupScope.tsx +0 -34
  247. package/src/a2ui/BindingContext.ts +0 -26
  248. package/src/a2ui/PresentRenderer.tsx +0 -83
  249. package/src/a2ui/convert.test.ts +0 -2923
  250. package/src/a2ui/convert.ts +0 -1207
  251. package/src/a2ui/dataModel.ts +0 -69
  252. package/src/a2ui/reducer.test.ts +0 -422
  253. package/src/a2ui/reducer.ts +0 -363
  254. package/src/a2ui/snapshot.test.ts +0 -52
  255. package/src/a2ui/snapshot.ts +0 -52
  256. package/src/a2ui/types.ts +0 -114
  257. package/src/a2ui/valueFunctions.test.ts +0 -271
  258. package/src/a2ui/valueFunctions.ts +0 -523
  259. package/src/actionRegistry.test.ts +0 -90
  260. package/src/actionRegistry.ts +0 -88
  261. package/src/answeredValues.test.ts +0 -33
  262. package/src/answeredValues.tsx +0 -70
  263. package/src/buildPresentParameters.test.ts +0 -246
  264. package/src/buildPresentParameters.ts +0 -130
  265. package/src/constants.ts +0 -17
  266. package/src/convert/boundSpec.test.ts +0 -192
  267. package/src/convert/boundSpec.ts +0 -134
  268. package/src/convert/copyBounded.test.ts +0 -131
  269. package/src/convert/copyBounded.ts +0 -38
  270. package/src/convert/isElement.ts +0 -6
  271. package/src/convert/takeRun.test.ts +0 -64
  272. package/src/convert/takeRun.ts +0 -19
  273. package/src/defineGenerativeComponents.ts +0 -38
  274. package/src/fieldReferences.test.ts +0 -66
  275. package/src/fieldReferences.ts +0 -83
  276. package/src/generativeUIToJSX.test.ts +0 -268
  277. package/src/generativeUIToJSX.ts +0 -152
  278. package/src/index.server.test.ts +0 -106
  279. package/src/index.shared.ts +0 -61
  280. package/src/ir.test.ts +0 -203
  281. package/src/renderGenerativeUI.test.tsx +0 -373
  282. package/src/renderGenerativeUI.tsx +0 -165
  283. package/src/scopeSchema.test.ts +0 -72
  284. package/src/scopeSchema.ts +0 -71
  285. package/src/slack/a2uiSlack.test.ts +0 -198
  286. package/src/slack/constants.ts +0 -194
  287. package/src/slack/datePicker.test.ts +0 -612
  288. package/src/slack/decodeBlockAction.test.ts +0 -233
  289. package/src/slack/decodeBlockAction.ts +0 -232
  290. package/src/slack/fromSlackBlocks.test.ts +0 -1465
  291. package/src/slack/fromSlackBlocks.ts +0 -789
  292. package/src/slack/toSlackBlocks.test.ts +0 -3065
  293. package/src/slack/toSlackBlocks.ts +0 -1818
  294. package/src/slack/types.ts +0 -264
  295. package/src/teams/constants.ts +0 -93
  296. package/src/teams/decodeSubmitData.test.ts +0 -397
  297. package/src/teams/decodeSubmitData.ts +0 -110
  298. package/src/teams/temporal.test.ts +0 -766
  299. package/src/teams/temporalId.ts +0 -56
  300. package/src/teams/toAdaptiveCard.test.ts +0 -1897
  301. package/src/teams/toAdaptiveCard.ts +0 -1057
  302. package/src/teams/toTeamsAttachments.test.ts +0 -74
  303. package/src/teams/toTeamsAttachments.ts +0 -133
  304. package/src/teams/types.ts +0 -266
  305. package/src/temporal.test.ts +0 -319
  306. package/src/temporal.ts +0 -259
  307. package/src/types.ts +0 -119
  308. package/src/vocabulary/alert.test.tsx +0 -427
  309. package/src/vocabulary/alert.tsx +0 -217
  310. package/src/vocabulary/collectFormValues.test.ts +0 -389
  311. package/src/vocabulary/collectFormValues.ts +0 -116
  312. package/src/vocabulary/data.test.tsx +0 -858
  313. package/src/vocabulary/data.tsx +0 -819
  314. package/src/vocabulary/datepicker.dom.test.tsx +0 -1148
  315. package/src/vocabulary/dispatch.ts +0 -83
  316. package/src/vocabulary/fact.test.tsx +0 -94
  317. package/src/vocabulary/fact.tsx +0 -54
  318. package/src/vocabulary/form.test.tsx +0 -113
  319. package/src/vocabulary/form.tsx +0 -39
  320. package/src/vocabulary/formatValue.test.ts +0 -72
  321. package/src/vocabulary/formatValue.ts +0 -127
  322. package/src/vocabulary/icon.test.tsx +0 -64
  323. package/src/vocabulary/icon.tsx +0 -174
  324. package/src/vocabulary/index.test.ts +0 -65
  325. package/src/vocabulary/index.ts +0 -33
  326. package/src/vocabulary/interactive.dispatch.test.tsx +0 -454
  327. package/src/vocabulary/interactive.dom.test.tsx +0 -1747
  328. package/src/vocabulary/interactive.test.tsx +0 -377
  329. package/src/vocabulary/interactive.tsx +0 -1048
  330. package/src/vocabulary/layout.test.tsx +0 -323
  331. package/src/vocabulary/layout.tsx +0 -247
  332. package/src/vocabulary/list.test.tsx +0 -222
  333. package/src/vocabulary/list.tsx +0 -50
  334. package/src/vocabulary/media.test.tsx +0 -85
  335. package/src/vocabulary/media.tsx +0 -56
  336. package/src/vocabulary/text.test.tsx +0 -102
  337. package/src/vocabulary/text.tsx +0 -60
  338. package/src/vocabulary/toTextContent.ts +0 -2
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @assistant-ui/react-generative-ui
2
2
 
3
+ This package re-exports [`@assistant-ui/generative-ui`](https://www.npmjs.com/package/@assistant-ui/generative-ui), the framework-neutral home of assistant-ui's generative UI. Existing imports keep working unchanged; new code should depend on `@assistant-ui/generative-ui` directly and import the React renderer from `@assistant-ui/generative-ui/react`.
4
+
3
5
  Generative UI tools for assistant-ui.
4
6
 
5
7
  ## Installation
package/dist/a2ui.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- export { applyA2uiOperations } from "./a2ui/reducer.js";
2
- export { convertSurfaceToUISpec } from "./a2ui/convert.js";
3
- export { surfaceToOperations } from "./a2ui/snapshot.js";
4
- export type { A2uiCreateSurfaceOperation, A2uiCreateSurfaceV09Payload, A2uiCreateSurfaceV10Payload, A2uiDeleteSurfaceOperation, A2uiDeleteSurfacePayload, A2uiOperation, A2uiOperationResult, A2uiState, A2uiSurfaceSnapshotOperation, A2uiSurfaceState, A2uiTemplateChildren, A2uiUpdateComponentsOperation, A2uiUpdateComponentsPayload, A2uiUpdateDataModelOperation, A2uiUpdateDataModelPayload, A2uiVersion, ComponentNode, } from "./a2ui/types.js";
1
+ export * from "@assistant-ui/generative-ui/a2ui";
5
2
  //# sourceMappingURL=a2ui.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"a2ui.d.ts","sourceRoot":"","sources":["../src/a2ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,0BAAuB;AACrD,OAAO,EAAE,sBAAsB,EAAE,0BAAuB;AACxD,OAAO,EAAE,mBAAmB,EAAE,2BAAwB;AACtD,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,4BAA4B,EAC5B,gBAAgB,EAChB,oBAAoB,EACpB,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,WAAW,EACX,aAAa,GACd,wBAAqB"}
1
+ {"version":3,"file":"a2ui.d.ts","sourceRoot":"","sources":["../src/a2ui.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
package/dist/a2ui.js CHANGED
@@ -1,4 +1 @@
1
- import { applyA2uiOperations } from "./a2ui/reducer.js";
2
- import { convertSurfaceToUISpec } from "./a2ui/convert.js";
3
- import { surfaceToOperations } from "./a2ui/snapshot.js";
4
- export { applyA2uiOperations, convertSurfaceToUISpec, surfaceToOperations };
1
+ export * from "@assistant-ui/generative-ui/a2ui";
package/dist/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export { JSONGenerativeUI } from "./JSONGenerativeUI.client.js";
2
- export * from "./index.shared.js";
1
+ export * from "@assistant-ui/generative-ui/react";
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qCAAkC;AAC7D,kCAA+B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
package/dist/index.js CHANGED
@@ -1,10 +1 @@
1
- import { TYPE_KEY } from "./constants.js";
2
- import { ALERT_TONES, ALIGNS, BUTTON_STYLES, COLORS, ICON_NAMES, IMAGE_SIZE_TOKENS, JUSTIFIES, TEXT_SIZES, WEIGHTS, normalizeSpec, normalizeUINode } from "./ir.js";
3
- import { renderGenerativeUI } from "./renderGenerativeUI.js";
4
- import { buildPresentParameters } from "./buildPresentParameters.js";
5
- import { createActionRegistry, emptyActionRegistry } from "./actionRegistry.js";
6
- import { JSONGenerativeUI } from "./JSONGenerativeUI.client.js";
7
- import { defineGenerativeComponents } from "./defineGenerativeComponents.js";
8
- import { generativeUIToJSX } from "./generativeUIToJSX.js";
9
- import { defaultGenerativeUILibrary } from "./vocabulary/index.js";
10
- export { ALERT_TONES, ALIGNS, BUTTON_STYLES, COLORS, ICON_NAMES, IMAGE_SIZE_TOKENS, JSONGenerativeUI, JUSTIFIES, TEXT_SIZES, TYPE_KEY, WEIGHTS, buildPresentParameters, createActionRegistry, defaultGenerativeUILibrary, defineGenerativeComponents, emptyActionRegistry, generativeUIToJSX, normalizeSpec, normalizeUINode, renderGenerativeUI };
1
+ export * from "@assistant-ui/generative-ui/react";
@@ -1,3 +1,2 @@
1
- export { JSONGenerativeUI } from "./JSONGenerativeUI.server.js";
2
- export * from "./index.shared.js";
1
+ export * from "@assistant-ui/generative-ui/react";
3
2
  //# sourceMappingURL=index.server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../src/index.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qCAAkC;AAC7D,kCAA+B"}
1
+ {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
@@ -1,10 +1 @@
1
- import { TYPE_KEY } from "./constants.js";
2
- import { ALERT_TONES, ALIGNS, BUTTON_STYLES, COLORS, ICON_NAMES, IMAGE_SIZE_TOKENS, JUSTIFIES, TEXT_SIZES, WEIGHTS, normalizeSpec, normalizeUINode } from "./ir.js";
3
- import { renderGenerativeUI } from "./renderGenerativeUI.js";
4
- import { buildPresentParameters } from "./buildPresentParameters.js";
5
- import { createActionRegistry, emptyActionRegistry } from "./actionRegistry.js";
6
- import { JSONGenerativeUI } from "./JSONGenerativeUI.server.js";
7
- import { defineGenerativeComponents } from "./defineGenerativeComponents.js";
8
- import { generativeUIToJSX } from "./generativeUIToJSX.js";
9
- import { defaultGenerativeUILibrary } from "./vocabulary/index.js";
10
- export { ALERT_TONES, ALIGNS, BUTTON_STYLES, COLORS, ICON_NAMES, IMAGE_SIZE_TOKENS, JSONGenerativeUI, JUSTIFIES, TEXT_SIZES, TYPE_KEY, WEIGHTS, buildPresentParameters, createActionRegistry, defaultGenerativeUILibrary, defineGenerativeComponents, emptyActionRegistry, generativeUIToJSX, normalizeSpec, normalizeUINode, renderGenerativeUI };
1
+ export * from "@assistant-ui/generative-ui/react";
package/dist/ir.d.ts CHANGED
@@ -1,112 +1,2 @@
1
- /**
2
- * The generative-ui intermediate representation: a model-emitted, cross-platform
3
- * UI tree. React-free, so converters and non-web runtimes consume it without
4
- * pulling React. The flat `$type` shape is the canonical form; the legacy
5
- * `component` shape is accepted as a backward-compatible alias.
6
- *
7
- * Reserved keys are partitioned off from component props so the component prop
8
- * namespace stays fully free:
9
- *
10
- * - `$`-prefixed keys are framework-reserved (`$type`, `$key`, `$action`,
11
- * `$status`). Components never declare `$`-prefixed props, so a component
12
- * can use `type`, `status`, `variant`, etc. as ordinary props without
13
- * colliding with the framework.
14
- * - `children` is additionally reserved (the JSX convention).
15
- * - every other key is an inline prop passed straight to the component.
16
- */
17
- export declare const TEXT_SIZES: readonly ["sm", "md", "lg", "xl", "2xl", "3xl"];
18
- export type TextSize = (typeof TEXT_SIZES)[number];
19
- export declare const IMAGE_SIZE_TOKENS: readonly ["sm", "md", "lg"];
20
- export type ImageSize = (typeof IMAGE_SIZE_TOKENS)[number] | number;
21
- export declare const WEIGHTS: readonly ["normal", "medium", "semibold", "bold"];
22
- export type Weight = (typeof WEIGHTS)[number];
23
- export declare const COLORS: readonly ["emphasis", "secondary", "alpha-70", "white", "white-70", "white-50"];
24
- export type Color = (typeof COLORS)[number];
25
- export declare const ALIGNS: readonly ["start", "center", "end"];
26
- export type Align = (typeof ALIGNS)[number];
27
- export declare const JUSTIFIES: readonly ["start", "center", "end", "between"];
28
- export type Justify = (typeof JUSTIFIES)[number];
29
- export declare const BUTTON_STYLES: readonly ["primary", "secondary", "outline", "ghost", "danger"];
30
- export type ButtonStyle = (typeof BUTTON_STYLES)[number];
31
- export declare const ALERT_TONES: readonly ["info", "success", "warning", "danger"];
32
- /** A severity level, from informational to destructive. */
33
- export type AlertTone = (typeof ALERT_TONES)[number];
34
- export declare const ICON_NAMES: readonly ["sun", "moon", "cloud", "rain", "snow", "wind", "play", "pause", "check", "x", "star", "heart", "arrow-right", "arrow-up-right", "chevron-right", "calendar", "clock", "map-pin", "plane", "truck", "credit-card", "user", "search", "bell"];
35
- /** A name from the built-in icon set; the closed enum lets the model see exactly which icons exist. */
36
- export type IconName = (typeof ICON_NAMES)[number];
37
- /**
38
- * Behavior payload carried by an interactive node. `type` is resolved by the host's action registry, not the renderer; keeping behavior as data keeps the tree serializable, so the same node renders on web while converters may bind the type to a native action id on other platforms. A `{ "$field": name }` value anywhere in the payload refers to the current value of the control with that `name`, resolved when the action fires, and `{ "$field": name, "fallback": value }` resolves to `fallback` when no control holds a value.
39
- */
40
- export interface Action {
41
- readonly type: string;
42
- readonly [payload: string]: unknown;
43
- }
44
- /**
45
- * Anything renderable as generative UI, as the model emits it. The renderer
46
- * also accepts `number`, `boolean`, `null`, `undefined`, and arrays at the
47
- * input boundary (numbers render as text, falsy/boolean as nothing, arrays as
48
- * lists); {@link normalizeUINode} accepts that full range.
49
- */
50
- export type UINode = string | number | UIElement | LegacyComponentNode;
51
- export type UIChildren = UINode | readonly UINode[];
52
- /** The flat node shape: inline props keep the tree compact and natural for a
53
- * model to emit, instead of a nested `{ type, props }` bag. Reserved keys are
54
- * stripped before props reach the component (see the module header). */
55
- export interface UIElement {
56
- readonly $type: string;
57
- readonly $key?: string | number;
58
- readonly children?: UIChildren;
59
- readonly $action?: Action;
60
- readonly [prop: string]: unknown;
61
- }
62
- /**
63
- * The legacy node shape: a `component` name plus a nested `props` bag. Kept
64
- * for backward compatibility. New code authors the flat {@link UIElement}
65
- * shape instead.
66
- */
67
- export interface LegacyComponentNode {
68
- readonly component: string;
69
- readonly props?: Record<string, unknown>;
70
- readonly children?: UIChildren;
71
- readonly key?: string;
72
- }
73
- export type UISpec = UINode | readonly UINode[];
74
- /**
75
- * A node normalized to a single canonical shape: a `type` string, an inline
76
- * `props` bag, recursive `children`, an optional `key`, and an optional
77
- * `action`. Renderers and platform converters consume this form, so they never
78
- * branch on whether the model emitted the flat `$type` shape or the legacy
79
- * `component` shape, and they never see the reserved `$`-prefixed keys leak
80
- * into component props.
81
- */
82
- export interface NormalizedUIElement {
83
- readonly type: string;
84
- readonly props: Readonly<Record<string, unknown>>;
85
- readonly children?: NormalizedUINode | undefined;
86
- readonly key?: string | number | undefined;
87
- readonly action?: Action | undefined;
88
- }
89
- export type NormalizedUINode = string | number | readonly NormalizedUINode[] | NormalizedUIElement | null;
90
- /**
91
- * Normalizes a generative-ui input to {@link NormalizedUINode}. The flat
92
- * `$type` shape and the legacy `component` shape both map to the same canonical
93
- * element, with reserved keys (`$type`, `$key`, `$action`, `children`) stripped
94
- * from the prop bag. A node that carries neither a `$type` nor a `component`
95
- * string is not renderable and resolves to `null` rather than throwing, so a
96
- * partially-streamed or malformed node degrades to "render nothing".
97
- *
98
- * `partialPath` carries streaming state from the tool-args parse meta: a node
99
- * whose `$type` is still mid-arrival is held back (resolves to `null`) until it
100
- * completes, and the path is threaded into `children` so a nested streaming
101
- * node is held back while completed siblings render. Omit it for a
102
- * non-streaming (converter) normalize.
103
- */
104
- export declare function normalizeUINode(node: unknown, partialPath?: readonly string[] | undefined, depth?: number): NormalizedUINode;
105
- /**
106
- * Normalizes the root of a {@link UISpec}, preserving whether the root was a
107
- * single node or a list.
108
- */
109
- export declare function normalizeSpec(spec: UISpec): {
110
- readonly root: NormalizedUINode | readonly NormalizedUINode[];
111
- };
1
+ export * from "@assistant-ui/generative-ui";
112
2
  //# sourceMappingURL=ir.d.ts.map
package/dist/ir.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ir.d.ts","sourceRoot":"","sources":["../src/ir.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"ir.d.ts","sourceRoot":"","sources":["../src/ir.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
package/dist/ir.js CHANGED
@@ -1,175 +1 @@
1
- import { TYPE_KEY } from "./constants.js";
2
- //#region src/ir.ts
3
- /**
4
- * The generative-ui intermediate representation: a model-emitted, cross-platform
5
- * UI tree. React-free, so converters and non-web runtimes consume it without
6
- * pulling React. The flat `$type` shape is the canonical form; the legacy
7
- * `component` shape is accepted as a backward-compatible alias.
8
- *
9
- * Reserved keys are partitioned off from component props so the component prop
10
- * namespace stays fully free:
11
- *
12
- * - `$`-prefixed keys are framework-reserved (`$type`, `$key`, `$action`,
13
- * `$status`). Components never declare `$`-prefixed props, so a component
14
- * can use `type`, `status`, `variant`, etc. as ordinary props without
15
- * colliding with the framework.
16
- * - `children` is additionally reserved (the JSX convention).
17
- * - every other key is an inline prop passed straight to the component.
18
- */
19
- const TEXT_SIZES = [
20
- "sm",
21
- "md",
22
- "lg",
23
- "xl",
24
- "2xl",
25
- "3xl"
26
- ];
27
- const IMAGE_SIZE_TOKENS = [
28
- "sm",
29
- "md",
30
- "lg"
31
- ];
32
- const WEIGHTS = [
33
- "normal",
34
- "medium",
35
- "semibold",
36
- "bold"
37
- ];
38
- const COLORS = [
39
- "emphasis",
40
- "secondary",
41
- "alpha-70",
42
- "white",
43
- "white-70",
44
- "white-50"
45
- ];
46
- const ALIGNS = [
47
- "start",
48
- "center",
49
- "end"
50
- ];
51
- const JUSTIFIES = [
52
- "start",
53
- "center",
54
- "end",
55
- "between"
56
- ];
57
- const BUTTON_STYLES = [
58
- "primary",
59
- "secondary",
60
- "outline",
61
- "ghost",
62
- "danger"
63
- ];
64
- const ALERT_TONES = [
65
- "info",
66
- "success",
67
- "warning",
68
- "danger"
69
- ];
70
- const ICON_NAMES = [
71
- "sun",
72
- "moon",
73
- "cloud",
74
- "rain",
75
- "snow",
76
- "wind",
77
- "play",
78
- "pause",
79
- "check",
80
- "x",
81
- "star",
82
- "heart",
83
- "arrow-right",
84
- "arrow-up-right",
85
- "chevron-right",
86
- "calendar",
87
- "clock",
88
- "map-pin",
89
- "plane",
90
- "truck",
91
- "credit-card",
92
- "user",
93
- "search",
94
- "bell"
95
- ];
96
- const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
97
- const isLegacyNode = (node) => typeof node["component"] === "string";
98
- const isTypeNode = (node) => typeof node[TYPE_KEY] === "string";
99
- /** Bounds recursion so a runaway or adversarial model response cannot overflow
100
- * the stack; past this depth (far beyond any real UI) we stop. */
101
- const MAX_DEPTH = 64;
102
- /**
103
- * Steps a streaming partial path down into `key`. `partialPath` is the remaining
104
- * segment of the parse meta's partial path relative to `node` (`undefined` once
105
- * the walk leaves the partial frontier, i.e. everything below is complete).
106
- */
107
- function descend(partialPath, key) {
108
- return partialPath?.[0] === key ? partialPath.slice(1) : void 0;
109
- }
110
- /**
111
- * Normalizes a generative-ui input to {@link NormalizedUINode}. The flat
112
- * `$type` shape and the legacy `component` shape both map to the same canonical
113
- * element, with reserved keys (`$type`, `$key`, `$action`, `children`) stripped
114
- * from the prop bag. A node that carries neither a `$type` nor a `component`
115
- * string is not renderable and resolves to `null` rather than throwing, so a
116
- * partially-streamed or malformed node degrades to "render nothing".
117
- *
118
- * `partialPath` carries streaming state from the tool-args parse meta: a node
119
- * whose `$type` is still mid-arrival is held back (resolves to `null`) until it
120
- * completes, and the path is threaded into `children` so a nested streaming
121
- * node is held back while completed siblings render. Omit it for a
122
- * non-streaming (converter) normalize.
123
- */
124
- function normalizeUINode(node, partialPath, depth = 0) {
125
- if (depth > MAX_DEPTH) return null;
126
- if (node == null || typeof node === "boolean") return null;
127
- if (typeof node === "string" || typeof node === "number") return node;
128
- if (Array.isArray(node)) return node.map((child, index) => normalizeUINode(child, descend(partialPath, String(index)), depth + 1));
129
- if (!isRecord(node)) return null;
130
- if (isTypeNode(node)) {
131
- if (partialPath?.length === 1 && partialPath[0] === "$type") return null;
132
- const { [TYPE_KEY]: type, $key, $action, children, ...rest } = node;
133
- return {
134
- type,
135
- props: stripReservedProps(rest),
136
- children: normalizeChildren(children, partialPath, depth),
137
- key: $key,
138
- action: $action
139
- };
140
- }
141
- if (isLegacyNode(node)) {
142
- const props = stripReservedProps(node.props ?? {});
143
- return {
144
- type: node.component,
145
- props,
146
- children: normalizeChildren(node.children, partialPath, depth),
147
- key: node.key
148
- };
149
- }
150
- return null;
151
- }
152
- function stripReservedProps(props) {
153
- let out;
154
- for (const key of Object.keys(props)) if (key.startsWith("$")) {
155
- out ??= { ...props };
156
- delete out[key];
157
- }
158
- return out ?? props;
159
- }
160
- function normalizeChildren(children, partialPath, depth) {
161
- if (children === void 0) return void 0;
162
- return normalizeUINode(children, descend(partialPath, "children"), depth + 1);
163
- }
164
- /**
165
- * Normalizes the root of a {@link UISpec}, preserving whether the root was a
166
- * single node or a list.
167
- */
168
- function normalizeSpec(spec) {
169
- if (Array.isArray(spec)) return { root: spec.map((node) => normalizeUINode(node)) };
170
- return { root: normalizeUINode(spec) };
171
- }
172
- //#endregion
173
- export { ALERT_TONES, ALIGNS, BUTTON_STYLES, COLORS, ICON_NAMES, IMAGE_SIZE_TOKENS, JUSTIFIES, TEXT_SIZES, WEIGHTS, normalizeSpec, normalizeUINode };
174
-
175
- //# sourceMappingURL=ir.js.map
1
+ export * from "@assistant-ui/generative-ui";
package/dist/slack.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- export { decodeBlockAction } from "./slack/decodeBlockAction.js";
2
- export { fromSlackBlocks } from "./slack/fromSlackBlocks.js";
3
- export { toSlackBlocks } from "./slack/toSlackBlocks.js";
4
- export type { FromSlackBlocksResult, SlackActionElement, SlackActionsBlock, SlackAlertBlock, SlackAlertLevel, SlackBlock, SlackBlocksResult, SlackButtonElement, SlackCardBlock, SlackCarouselBlock, SlackCheckboxesElement, SlackContextBlock, SlackConversionWarning, SlackDataTableBlock, SlackDataTableCell, SlackDataTableRawNumberCell, SlackDataTableRawTextCell, SlackDatePickerElement, SlackDateTimePickerElement, SlackDividerBlock, SlackHeaderBlock, SlackImageBlock, SlackInputBlock, SlackMarkdownBlock, SlackMrkdwnText, SlackOption, SlackPlainText, SlackPlainTextInputElement, SlackRadioButtonsElement, SlackSectionBlock, SlackStaticSelectElement, SlackTextObject, SlackTimePickerElement, ToSlackBlocksOptions, } from "./slack/types.js";
1
+ export * from "@assistant-ui/generative-ui/slack";
5
2
  //# sourceMappingURL=slack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../src/slack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,qCAAkC;AAC9D,OAAO,EAAE,eAAe,EAAE,mCAAgC;AAC1D,OAAO,EAAE,aAAa,EAAE,iCAA8B;AACtD,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,cAAc,EACd,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,GACrB,yBAAsB"}
1
+ {"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../src/slack.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
package/dist/slack.js CHANGED
@@ -1,4 +1 @@
1
- import { decodeBlockAction } from "./slack/decodeBlockAction.js";
2
- import { fromSlackBlocks } from "./slack/fromSlackBlocks.js";
3
- import { toSlackBlocks } from "./slack/toSlackBlocks.js";
4
- export { decodeBlockAction, fromSlackBlocks, toSlackBlocks };
1
+ export * from "@assistant-ui/generative-ui/slack";
package/dist/teams.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- export { decodeSubmitData } from "./teams/decodeSubmitData.js";
2
- export { toAdaptiveCard } from "./teams/toAdaptiveCard.js";
3
- export { toTeamsAttachments } from "./teams/toTeamsAttachments.js";
4
- export type { AdaptiveCardResult, TeamsAdaptiveCard, TeamsActionSet, TeamsAttachmentsResult, TeamsCardAction, TeamsCardAttachment, TeamsCardElement, TeamsColumn, TeamsColumnSet, TeamsContainer, TeamsContainerStyle, TeamsConversionWarning, TeamsFact, TeamsFactSet, TeamsImage, TeamsInputChoice, TeamsInputChoiceSet, TeamsInputDate, TeamsInputText, TeamsInputTime, TeamsInputToggle, TeamsSubmitAction, TeamsSubmitData, TeamsTable, TeamsTableCell, TeamsTableColumnDefinition, TeamsTableRow, TeamsTextBlock, TeamsTextSize, ToAdaptiveCardOptions, } from "./teams/types.js";
1
+ export * from "@assistant-ui/generative-ui/teams";
5
2
  //# sourceMappingURL=teams.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../src/teams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oCAAiC;AAC5D,OAAO,EAAE,cAAc,EAAE,kCAA+B;AACxD,OAAO,EAAE,kBAAkB,EAAE,sCAAmC;AAChE,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,SAAS,EACT,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,cAAc,EACd,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACd,aAAa,EACb,qBAAqB,GACtB,yBAAsB"}
1
+ {"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../src/teams.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
package/dist/teams.js CHANGED
@@ -1,4 +1 @@
1
- import { decodeSubmitData } from "./teams/decodeSubmitData.js";
2
- import { toAdaptiveCard } from "./teams/toAdaptiveCard.js";
3
- import { toTeamsAttachments } from "./teams/toTeamsAttachments.js";
4
- export { decodeSubmitData, toAdaptiveCard, toTeamsAttachments };
1
+ export * from "@assistant-ui/generative-ui/teams";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/react-generative-ui",
3
- "version": "0.0.23",
3
+ "version": "0.1.0",
4
4
  "description": "Generative UI components for assistant-ui",
5
5
  "keywords": [
6
6
  "generative-ui",
@@ -50,8 +50,7 @@
50
50
  ],
51
51
  "sideEffects": false,
52
52
  "dependencies": {
53
- "@types/json-schema": "^7.0.15",
54
- "assistant-stream": "^0.3.47"
53
+ "@assistant-ui/generative-ui": "^0.0.1"
55
54
  },
56
55
  "peerDependencies": {
57
56
  "@assistant-ui/react": "^0.15.0",
@@ -65,11 +64,11 @@
65
64
  }
66
65
  },
67
66
  "devDependencies": {
68
- "@assistant-ui/react": "0.15.24",
67
+ "@assistant-ui/react": "0.15.26",
69
68
  "@assistant-ui/x-buildutils": "0.0.30",
70
69
  "@assistant-ui/x-react18": "0.0.0",
71
70
  "@types/react": "^19.3.0",
72
- "jsdom": "^30.0.1",
71
+ "jsdom": "^30.1.2",
73
72
  "react": "^19.3.0",
74
73
  "react-dom": "^19.3.0",
75
74
  "vitest": "^5.0.3",
@@ -91,6 +90,7 @@
91
90
  "scripts": {
92
91
  "build": "aui-build",
93
92
  "test": "vitest run",
93
+ "test:coverage": "vitest run --coverage --coverage.reporter=text --coverage.reporter=html --coverage.reporter=json-summary",
94
94
  "typecheck": "tsc --noEmit",
95
95
  "test:peer-react18": "vitest run --config vitest.peer-react18.config.ts",
96
96
  "test:types:peer-react18": "aui-react18-types",
package/src/a2ui.ts CHANGED
@@ -1,22 +1 @@
1
- export { applyA2uiOperations } from "./a2ui/reducer";
2
- export { convertSurfaceToUISpec } from "./a2ui/convert";
3
- export { surfaceToOperations } from "./a2ui/snapshot";
4
- export type {
5
- A2uiCreateSurfaceOperation,
6
- A2uiCreateSurfaceV09Payload,
7
- A2uiCreateSurfaceV10Payload,
8
- A2uiDeleteSurfaceOperation,
9
- A2uiDeleteSurfacePayload,
10
- A2uiOperation,
11
- A2uiOperationResult,
12
- A2uiState,
13
- A2uiSurfaceSnapshotOperation,
14
- A2uiSurfaceState,
15
- A2uiTemplateChildren,
16
- A2uiUpdateComponentsOperation,
17
- A2uiUpdateComponentsPayload,
18
- A2uiUpdateDataModelOperation,
19
- A2uiUpdateDataModelPayload,
20
- A2uiVersion,
21
- ComponentNode,
22
- } from "./a2ui/types";
1
+ export * from "@assistant-ui/generative-ui/a2ui";
@@ -1,2 +1 @@
1
- export { JSONGenerativeUI } from "./JSONGenerativeUI.server";
2
- export * from "./index.shared";
1
+ export * from "@assistant-ui/generative-ui/react";
@@ -0,0 +1,75 @@
1
+ /// <reference types="node" />
2
+
3
+ import { spawnSync } from "node:child_process";
4
+ import { fileURLToPath } from "node:url";
5
+ import * as upstreamRoot from "@assistant-ui/generative-ui";
6
+ import * as upstreamA2ui from "@assistant-ui/generative-ui/a2ui";
7
+ import * as upstreamReact from "@assistant-ui/generative-ui/react";
8
+ import * as upstreamSlack from "@assistant-ui/generative-ui/slack";
9
+ import * as upstreamTeams from "@assistant-ui/generative-ui/teams";
10
+ import { describe, expect, it } from "vitest";
11
+ import * as a2ui from "./a2ui";
12
+ import * as index from "./index";
13
+ import * as indexServer from "./index.server";
14
+ import * as ir from "./ir";
15
+ import * as slack from "./slack";
16
+ import * as teams from "./teams";
17
+
18
+ const PACKAGE_DIR = fileURLToPath(new URL("..", import.meta.url));
19
+
20
+ describe("@assistant-ui/react-generative-ui", () => {
21
+ it.each([
22
+ ["index", index, upstreamReact],
23
+ ["index.server", indexServer, upstreamReact],
24
+ ["ir", ir, upstreamRoot],
25
+ ["a2ui", a2ui, upstreamA2ui],
26
+ ["slack", slack, upstreamSlack],
27
+ ["teams", teams, upstreamTeams],
28
+ ])(
29
+ "%s exports exactly what its @assistant-ui/generative-ui entry exports",
30
+ (_, entry, upstream) => {
31
+ const exported: Record<string, unknown> = { ...entry };
32
+ const expected: Record<string, unknown> = { ...upstream };
33
+
34
+ expect(Object.keys(exported).sort()).toEqual(
35
+ Object.keys(expected).sort(),
36
+ );
37
+ for (const name of Object.keys(expected)) {
38
+ expect(exported[name]).toBe(expected[name]);
39
+ }
40
+ },
41
+ );
42
+
43
+ it.each([
44
+ [[], ["react-generative-ui/dist/index.js", "generative-ui/dist/react.js"]],
45
+ [
46
+ ["react-server"],
47
+ [
48
+ "react-generative-ui/dist/index.server.js",
49
+ "generative-ui/dist/react.server.js",
50
+ ],
51
+ ],
52
+ ])(
53
+ "resolves the root and @assistant-ui/generative-ui/react under conditions %j",
54
+ (conditions, expected) => {
55
+ const result = spawnSync(
56
+ process.execPath,
57
+ [
58
+ ...conditions.map((condition) => `--conditions=${condition}`),
59
+ "--input-type=module",
60
+ "--eval",
61
+ 'for (const id of ["@assistant-ui/react-generative-ui", "@assistant-ui/generative-ui/react"]) console.log(import.meta.resolve(id));',
62
+ ],
63
+ { cwd: PACKAGE_DIR, encoding: "utf8" },
64
+ );
65
+
66
+ expect(result.status, result.stderr).toBe(0);
67
+ expect(
68
+ result.stdout
69
+ .trim()
70
+ .split("\n")
71
+ .map((url) => url.split("/").slice(-3).join("/")),
72
+ ).toEqual(expected);
73
+ },
74
+ );
75
+ });
package/src/index.ts CHANGED
@@ -1,2 +1 @@
1
- export { JSONGenerativeUI } from "./JSONGenerativeUI.client";
2
- export * from "./index.shared";
1
+ export * from "@assistant-ui/generative-ui/react";