stream-chat-react-native-core 9.12.1 → 9.14.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 (939) hide show
  1. package/a2ui/package.json +6 -0
  2. package/ai-components/conversation/package.json +6 -0
  3. package/lib/commonjs/a11y/a11yUtils.js.map +1 -1
  4. package/lib/commonjs/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -1
  5. package/lib/commonjs/a2ui/A2UIContexts.js +8 -0
  6. package/lib/commonjs/a2ui/A2UIContexts.js.map +1 -0
  7. package/lib/commonjs/a2ui/A2UIInstructions.js +49 -0
  8. package/lib/commonjs/a2ui/A2UIInstructions.js.map +1 -0
  9. package/lib/commonjs/a2ui/A2UIPlaceholder.js +37 -0
  10. package/lib/commonjs/a2ui/A2UIPlaceholder.js.map +1 -0
  11. package/lib/commonjs/a2ui/A2UIRenderer.js +363 -0
  12. package/lib/commonjs/a2ui/A2UIRenderer.js.map +1 -0
  13. package/lib/commonjs/a2ui/A2UIStream.js +91 -0
  14. package/lib/commonjs/a2ui/A2UIStream.js.map +1 -0
  15. package/lib/commonjs/a2ui/A2UISurface.js +237 -0
  16. package/lib/commonjs/a2ui/A2UISurface.js.map +1 -0
  17. package/lib/commonjs/a2ui/basicCatalog.json +1206 -0
  18. package/lib/commonjs/a2ui/basicFunctions.js +398 -0
  19. package/lib/commonjs/a2ui/basicFunctions.js.map +1 -0
  20. package/lib/commonjs/a2ui/catalogDocument.js +80 -0
  21. package/lib/commonjs/a2ui/catalogDocument.js.map +1 -0
  22. package/lib/commonjs/a2ui/catalogs.js +105 -0
  23. package/lib/commonjs/a2ui/catalogs.js.map +1 -0
  24. package/lib/commonjs/a2ui/components/DateTimeInput.js +445 -0
  25. package/lib/commonjs/a2ui/components/DateTimeInput.js.map +1 -0
  26. package/lib/commonjs/a2ui/components/Media.js +316 -0
  27. package/lib/commonjs/a2ui/components/Media.js.map +1 -0
  28. package/lib/commonjs/a2ui/components/basicComponents.js +975 -0
  29. package/lib/commonjs/a2ui/components/basicComponents.js.map +1 -0
  30. package/lib/commonjs/a2ui/components/iconPaths.js +66 -0
  31. package/lib/commonjs/a2ui/components/iconPaths.js.map +1 -0
  32. package/lib/commonjs/a2ui/components/types.js +4 -0
  33. package/lib/commonjs/a2ui/components/types.js.map +1 -0
  34. package/lib/commonjs/a2ui/index.js +70 -0
  35. package/lib/commonjs/a2ui/index.js.map +1 -0
  36. package/lib/commonjs/a2ui/instructions.js +268 -0
  37. package/lib/commonjs/a2ui/instructions.js.map +1 -0
  38. package/lib/commonjs/a2ui/secrets.js +169 -0
  39. package/lib/commonjs/a2ui/secrets.js.map +1 -0
  40. package/lib/commonjs/a2ui/useReplyState.js +35 -0
  41. package/lib/commonjs/a2ui/useReplyState.js.map +1 -0
  42. package/lib/commonjs/ai-components/AITypingIndicatorView.js +8 -18
  43. package/lib/commonjs/ai-components/AITypingIndicatorView.js.map +1 -1
  44. package/lib/commonjs/ai-components/README.md +64 -3
  45. package/lib/commonjs/ai-components/StreamingMessageView.js +26 -0
  46. package/lib/commonjs/ai-components/StreamingMessageView.js.map +1 -1
  47. package/lib/commonjs/ai-components/charts/components/PieLegend.js +2 -1
  48. package/lib/commonjs/ai-components/charts/components/PieLegend.js.map +1 -1
  49. package/lib/commonjs/ai-components/charts/components/VictoryChart.js +7 -2
  50. package/lib/commonjs/ai-components/charts/components/VictoryChart.js.map +1 -1
  51. package/lib/commonjs/ai-components/charts/utils/format-time-label.js +15 -0
  52. package/lib/commonjs/ai-components/charts/utils/format-time-label.js.map +1 -0
  53. package/lib/commonjs/ai-components/charts/vega-lite/schema.js +17 -2
  54. package/lib/commonjs/ai-components/charts/vega-lite/schema.js.map +1 -1
  55. package/lib/commonjs/ai-components/contexts/composer-context.js +13 -6
  56. package/lib/commonjs/ai-components/contexts/composer-context.js.map +1 -1
  57. package/lib/commonjs/ai-components/contexts/index.js +11 -0
  58. package/lib/commonjs/ai-components/contexts/index.js.map +1 -1
  59. package/lib/commonjs/ai-components/contexts/theme-context.js +33 -2
  60. package/lib/commonjs/ai-components/contexts/theme-context.js.map +1 -1
  61. package/lib/commonjs/ai-components/contexts/translation-context.js +29 -0
  62. package/lib/commonjs/ai-components/contexts/translation-context.js.map +1 -0
  63. package/lib/commonjs/ai-components/conversation/AIConversation.js +374 -0
  64. package/lib/commonjs/ai-components/conversation/AIConversation.js.map +1 -0
  65. package/lib/commonjs/ai-components/conversation/entries.js +98 -0
  66. package/lib/commonjs/ai-components/conversation/entries.js.map +1 -0
  67. package/lib/commonjs/ai-components/conversation/index.js +15 -0
  68. package/lib/commonjs/ai-components/conversation/index.js.map +1 -0
  69. package/lib/commonjs/ai-components/conversation/list/AIChatList.js +224 -0
  70. package/lib/commonjs/ai-components/conversation/list/AIChatList.js.map +1 -0
  71. package/lib/commonjs/ai-components/conversation/list/useChatListController.js +78 -0
  72. package/lib/commonjs/ai-components/conversation/list/useChatListController.js.map +1 -0
  73. package/lib/commonjs/ai-components/conversation/list/useEndInView.js +51 -0
  74. package/lib/commonjs/ai-components/conversation/list/useEndInView.js.map +1 -0
  75. package/lib/commonjs/ai-components/conversation/list/useKeyboardOverlap.js +53 -0
  76. package/lib/commonjs/ai-components/conversation/list/useKeyboardOverlap.js.map +1 -0
  77. package/lib/commonjs/ai-components/conversation/list/useLoadOlder.js +73 -0
  78. package/lib/commonjs/ai-components/conversation/list/useLoadOlder.js.map +1 -0
  79. package/lib/commonjs/ai-components/conversation/list/usePinnedAnchor.js +84 -0
  80. package/lib/commonjs/ai-components/conversation/list/usePinnedAnchor.js.map +1 -0
  81. package/lib/commonjs/ai-components/conversation/useConversationRows.js +117 -0
  82. package/lib/commonjs/ai-components/conversation/useConversationRows.js.map +1 -0
  83. package/lib/commonjs/ai-components/conversation-state/controller/AIAgentError.js +13 -0
  84. package/lib/commonjs/ai-components/conversation-state/controller/AIAgentError.js.map +1 -0
  85. package/lib/commonjs/ai-components/conversation-state/controller/AIConversationController.js +431 -0
  86. package/lib/commonjs/ai-components/conversation-state/controller/AIConversationController.js.map +1 -0
  87. package/lib/commonjs/ai-components/conversation-state/controller/AIConversationExchange.js +89 -0
  88. package/lib/commonjs/ai-components/conversation-state/controller/AIConversationExchange.js.map +1 -0
  89. package/lib/commonjs/ai-components/conversation-state/controller/index.js +48 -0
  90. package/lib/commonjs/ai-components/conversation-state/controller/index.js.map +1 -0
  91. package/lib/commonjs/ai-components/conversation-state/controller/offers.js +35 -0
  92. package/lib/commonjs/ai-components/conversation-state/controller/offers.js.map +1 -0
  93. package/lib/commonjs/ai-components/conversation-state/controller/types.js +13 -0
  94. package/lib/commonjs/ai-components/conversation-state/controller/types.js.map +1 -0
  95. package/lib/commonjs/ai-components/conversation-state/controller/useAIConversationState.js +8 -0
  96. package/lib/commonjs/ai-components/conversation-state/controller/useAIConversationState.js.map +1 -0
  97. package/lib/commonjs/ai-components/conversation-state/fromStreamMessage.js +67 -0
  98. package/lib/commonjs/ai-components/conversation-state/fromStreamMessage.js.map +1 -0
  99. package/lib/commonjs/ai-components/conversation-state/index.js +37 -0
  100. package/lib/commonjs/ai-components/conversation-state/index.js.map +1 -0
  101. package/lib/commonjs/ai-components/conversation-state/types.js +4 -0
  102. package/lib/commonjs/ai-components/conversation-state/types.js.map +1 -0
  103. package/lib/commonjs/ai-components/generative-ui/AIUIAction.js +30 -0
  104. package/lib/commonjs/ai-components/generative-ui/AIUIAction.js.map +1 -0
  105. package/lib/commonjs/ai-components/generative-ui/AIUIArguments.js +128 -0
  106. package/lib/commonjs/ai-components/generative-ui/AIUIArguments.js.map +1 -0
  107. package/lib/commonjs/ai-components/generative-ui/AIUIComponent.js +50 -0
  108. package/lib/commonjs/ai-components/generative-ui/AIUIComponent.js.map +1 -0
  109. package/lib/commonjs/ai-components/generative-ui/AIUIComponentDefinition.js +134 -0
  110. package/lib/commonjs/ai-components/generative-ui/AIUIComponentDefinition.js.map +1 -0
  111. package/lib/commonjs/ai-components/generative-ui/AIUIDocument.js +32 -0
  112. package/lib/commonjs/ai-components/generative-ui/AIUIDocument.js.map +1 -0
  113. package/lib/commonjs/ai-components/generative-ui/AIUIEntrance.js +197 -0
  114. package/lib/commonjs/ai-components/generative-ui/AIUIEntrance.js.map +1 -0
  115. package/lib/commonjs/ai-components/generative-ui/AIUIErrorBoundary.js +30 -0
  116. package/lib/commonjs/ai-components/generative-ui/AIUIErrorBoundary.js.map +1 -0
  117. package/lib/commonjs/ai-components/generative-ui/AIUIHelpers.js +54 -0
  118. package/lib/commonjs/ai-components/generative-ui/AIUIHelpers.js.map +1 -0
  119. package/lib/commonjs/ai-components/generative-ui/AIUIHost.js +259 -0
  120. package/lib/commonjs/ai-components/generative-ui/AIUIHost.js.map +1 -0
  121. package/lib/commonjs/ai-components/generative-ui/AIUIMedia.js +24 -0
  122. package/lib/commonjs/ai-components/generative-ui/AIUIMedia.js.map +1 -0
  123. package/lib/commonjs/ai-components/generative-ui/AIUIRenderer.js +10 -0
  124. package/lib/commonjs/ai-components/generative-ui/AIUIRenderer.js.map +1 -0
  125. package/lib/commonjs/ai-components/generative-ui/AIUIView.js +57 -0
  126. package/lib/commonjs/ai-components/generative-ui/AIUIView.js.map +1 -0
  127. package/lib/commonjs/ai-components/generative-ui/index.js +181 -0
  128. package/lib/commonjs/ai-components/generative-ui/index.js.map +1 -0
  129. package/lib/commonjs/ai-components/icons.js +44 -0
  130. package/lib/commonjs/ai-components/icons.js.map +1 -0
  131. package/lib/commonjs/ai-components/index.js +96 -0
  132. package/lib/commonjs/ai-components/index.js.map +1 -1
  133. package/lib/commonjs/ai-components/internal/Shimmer.js +36 -0
  134. package/lib/commonjs/ai-components/internal/Shimmer.js.map +1 -0
  135. package/lib/commonjs/ai-components/internal/format.js +66 -0
  136. package/lib/commonjs/ai-components/internal/format.js.map +1 -0
  137. package/lib/commonjs/ai-components/internal/hooks/useBottomSafeArea.js +12 -0
  138. package/lib/commonjs/ai-components/internal/hooks/useBottomSafeArea.js.map +1 -0
  139. package/lib/commonjs/ai-components/internal/icons/AgentIcons.js +74 -0
  140. package/lib/commonjs/ai-components/internal/icons/AgentIcons.js.map +1 -0
  141. package/lib/commonjs/ai-components/internal/keyboard.js +40 -0
  142. package/lib/commonjs/ai-components/internal/keyboard.js.map +1 -0
  143. package/lib/commonjs/ai-components/internal/tokens.js +11 -0
  144. package/lib/commonjs/ai-components/internal/tokens.js.map +1 -0
  145. package/lib/commonjs/ai-components/internal/uuid.js +21 -0
  146. package/lib/commonjs/ai-components/internal/uuid.js.map +1 -0
  147. package/lib/commonjs/ai-components/markdown/components/CodeBlock.js +4 -2
  148. package/lib/commonjs/ai-components/markdown/components/CodeBlock.js.map +1 -1
  149. package/lib/commonjs/ai-components/markdown/components/InlineCode.js +1 -0
  150. package/lib/commonjs/ai-components/markdown/components/InlineCode.js.map +1 -1
  151. package/lib/commonjs/ai-components/markdown/components/Text.js +11 -2
  152. package/lib/commonjs/ai-components/markdown/components/Text.js.map +1 -1
  153. package/lib/commonjs/ai-components/markdown/styles.js +27 -29
  154. package/lib/commonjs/ai-components/markdown/styles.js.map +1 -1
  155. package/lib/commonjs/ai-components/message/AIAssistantMessage.js +64 -0
  156. package/lib/commonjs/ai-components/message/AIAssistantMessage.js.map +1 -0
  157. package/lib/commonjs/ai-components/message/AIMessageAttachment.js +189 -0
  158. package/lib/commonjs/ai-components/message/AIMessageAttachment.js.map +1 -0
  159. package/lib/commonjs/ai-components/message/AIReplyActions.js +132 -0
  160. package/lib/commonjs/ai-components/message/AIReplyActions.js.map +1 -0
  161. package/lib/commonjs/ai-components/message/AIUserMessage.js +104 -0
  162. package/lib/commonjs/ai-components/message/AIUserMessage.js.map +1 -0
  163. package/lib/commonjs/ai-components/message/UserMessageMenu.js +150 -0
  164. package/lib/commonjs/ai-components/message/UserMessageMenu.js.map +1 -0
  165. package/lib/commonjs/ai-components/message/index.js +48 -0
  166. package/lib/commonjs/ai-components/message/index.js.map +1 -0
  167. package/lib/commonjs/ai-components/message-composer/ActionButton.js +4 -2
  168. package/lib/commonjs/ai-components/message-composer/ActionButton.js.map +1 -1
  169. package/lib/commonjs/ai-components/message-composer/ActionSheet.js +22 -6
  170. package/lib/commonjs/ai-components/message-composer/ActionSheet.js.map +1 -1
  171. package/lib/commonjs/ai-components/message-composer/AttachmentButton.js +5 -1
  172. package/lib/commonjs/ai-components/message-composer/AttachmentButton.js.map +1 -1
  173. package/lib/commonjs/ai-components/message-composer/ChatOptions.js +147 -0
  174. package/lib/commonjs/ai-components/message-composer/ChatOptions.js.map +1 -0
  175. package/lib/commonjs/ai-components/message-composer/ComposerView.js +146 -20
  176. package/lib/commonjs/ai-components/message-composer/ComposerView.js.map +1 -1
  177. package/lib/commonjs/ai-components/message-composer/EditingMessageChip.js +81 -0
  178. package/lib/commonjs/ai-components/message-composer/EditingMessageChip.js.map +1 -0
  179. package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js +26 -1
  180. package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js.map +1 -1
  181. package/lib/commonjs/ai-components/message-composer/index.js +11 -0
  182. package/lib/commonjs/ai-components/message-composer/index.js.map +1 -1
  183. package/lib/commonjs/ai-components/message-parts/AIMessageParts.js +133 -0
  184. package/lib/commonjs/ai-components/message-parts/AIMessageParts.js.map +1 -0
  185. package/lib/commonjs/ai-components/message-parts/AIToolApproval.js +197 -0
  186. package/lib/commonjs/ai-components/message-parts/AIToolApproval.js.map +1 -0
  187. package/lib/commonjs/ai-components/message-parts/AIToolAuthorization.js +250 -0
  188. package/lib/commonjs/ai-components/message-parts/AIToolAuthorization.js.map +1 -0
  189. package/lib/commonjs/ai-components/message-parts/AIToolCall.js +159 -0
  190. package/lib/commonjs/ai-components/message-parts/AIToolCall.js.map +1 -0
  191. package/lib/commonjs/ai-components/message-parts/callStates.js +54 -0
  192. package/lib/commonjs/ai-components/message-parts/callStates.js.map +1 -0
  193. package/lib/commonjs/ai-components/message-parts/index.js +70 -0
  194. package/lib/commonjs/ai-components/message-parts/index.js.map +1 -0
  195. package/lib/commonjs/ai-components/message-parts/parseMessageParts.js +126 -0
  196. package/lib/commonjs/ai-components/message-parts/parseMessageParts.js.map +1 -0
  197. package/lib/commonjs/ai-components/message-parts/types.js +2 -0
  198. package/lib/commonjs/ai-components/message-parts/types.js.map +1 -0
  199. package/lib/commonjs/ai-components/native-specs/NativeAIAgent.js +7 -0
  200. package/lib/commonjs/ai-components/native-specs/NativeAIAgent.js.map +1 -0
  201. package/lib/commonjs/ai-components/reasoning/AIReasoning.js +401 -0
  202. package/lib/commonjs/ai-components/reasoning/AIReasoning.js.map +1 -0
  203. package/lib/commonjs/ai-components/reasoning/index.js +26 -0
  204. package/lib/commonjs/ai-components/reasoning/index.js.map +1 -0
  205. package/lib/commonjs/ai-components/reasoning/thinkingClock.js +63 -0
  206. package/lib/commonjs/ai-components/reasoning/thinkingClock.js.map +1 -0
  207. package/lib/commonjs/ai-components/services/clipboard-service/expo.js +7 -2
  208. package/lib/commonjs/ai-components/services/clipboard-service/expo.js.map +1 -1
  209. package/lib/commonjs/ai-components/store/composer/store.js.map +1 -1
  210. package/lib/commonjs/ai-components/store/composer/useComposerChatOption.js +18 -0
  211. package/lib/commonjs/ai-components/store/composer/useComposerChatOption.js.map +1 -0
  212. package/lib/commonjs/ai-components/store/composer/useComposerIsEditing.js +18 -0
  213. package/lib/commonjs/ai-components/store/composer/useComposerIsEditing.js.map +1 -0
  214. package/lib/commonjs/ai-components/store/index.js +22 -0
  215. package/lib/commonjs/ai-components/store/index.js.map +1 -1
  216. package/lib/commonjs/ai-components/suggestions/AISuggestions.js +66 -0
  217. package/lib/commonjs/ai-components/suggestions/AISuggestions.js.map +1 -0
  218. package/lib/commonjs/ai-components/suggestions/index.js +15 -0
  219. package/lib/commonjs/ai-components/suggestions/index.js.map +1 -0
  220. package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js +2 -1
  221. package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -1
  222. package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js +3 -2
  223. package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js.map +1 -1
  224. package/lib/commonjs/ai-components/theme.js +137 -1
  225. package/lib/commonjs/ai-components/theme.js.map +1 -1
  226. package/lib/commonjs/ai-components/tool-calls/AIClientIdentity.js +22 -0
  227. package/lib/commonjs/ai-components/tool-calls/AIClientIdentity.js.map +1 -0
  228. package/lib/commonjs/ai-components/tool-calls/AIClientToolRunner.js +109 -0
  229. package/lib/commonjs/ai-components/tool-calls/AIClientToolRunner.js.map +1 -0
  230. package/lib/commonjs/ai-components/tool-calls/AIToolApprover.js +23 -0
  231. package/lib/commonjs/ai-components/tool-calls/AIToolApprover.js.map +1 -0
  232. package/lib/commonjs/ai-components/tool-calls/authSessionAuthorizer.js +88 -0
  233. package/lib/commonjs/ai-components/tool-calls/authSessionAuthorizer.js.map +1 -0
  234. package/lib/commonjs/ai-components/tool-calls/index.js +48 -0
  235. package/lib/commonjs/ai-components/tool-calls/index.js.map +1 -0
  236. package/lib/commonjs/ai-components/voice-visualization/glowShader.js.map +1 -1
  237. package/lib/commonjs/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -1
  238. package/lib/commonjs/components/Message/MessageItemView/utils/renderText.js.map +1 -1
  239. package/lib/commonjs/contexts/translationContext/TranslationContext.js +2 -2
  240. package/lib/commonjs/contexts/translationContext/TranslationContext.js.map +1 -1
  241. package/lib/commonjs/i18n/ar.json +40 -1
  242. package/lib/commonjs/i18n/en.json +40 -1
  243. package/lib/commonjs/i18n/es.json +40 -1
  244. package/lib/commonjs/i18n/fr.json +40 -1
  245. package/lib/commonjs/i18n/he.json +40 -1
  246. package/lib/commonjs/i18n/hi.json +40 -1
  247. package/lib/commonjs/i18n/it.json +40 -1
  248. package/lib/commonjs/i18n/ja.json +40 -1
  249. package/lib/commonjs/i18n/ko.json +40 -1
  250. package/lib/commonjs/i18n/nl.json +40 -1
  251. package/lib/commonjs/i18n/pt-br.json +40 -1
  252. package/lib/commonjs/i18n/ru.json +40 -1
  253. package/lib/commonjs/i18n/tr.json +40 -1
  254. package/lib/commonjs/mock-builders/a2ui/ohrid.js +84 -0
  255. package/lib/commonjs/mock-builders/a2ui/ohrid.js.map +1 -0
  256. package/lib/commonjs/utils/i18n/Streami18n.js +9 -4
  257. package/lib/commonjs/utils/i18n/Streami18n.js.map +1 -1
  258. package/lib/commonjs/utils/i18n/utils.js +7 -0
  259. package/lib/commonjs/utils/i18n/utils.js.map +1 -0
  260. package/lib/commonjs/version.json +1 -1
  261. package/lib/module/a11y/a11yUtils.js.map +1 -1
  262. package/lib/module/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -1
  263. package/lib/module/a2ui/A2UIContexts.js +8 -0
  264. package/lib/module/a2ui/A2UIContexts.js.map +1 -0
  265. package/lib/module/a2ui/A2UIInstructions.js +49 -0
  266. package/lib/module/a2ui/A2UIInstructions.js.map +1 -0
  267. package/lib/module/a2ui/A2UIPlaceholder.js +37 -0
  268. package/lib/module/a2ui/A2UIPlaceholder.js.map +1 -0
  269. package/lib/module/a2ui/A2UIRenderer.js +363 -0
  270. package/lib/module/a2ui/A2UIRenderer.js.map +1 -0
  271. package/lib/module/a2ui/A2UIStream.js +91 -0
  272. package/lib/module/a2ui/A2UIStream.js.map +1 -0
  273. package/lib/module/a2ui/A2UISurface.js +237 -0
  274. package/lib/module/a2ui/A2UISurface.js.map +1 -0
  275. package/lib/module/a2ui/basicCatalog.json +1206 -0
  276. package/lib/module/a2ui/basicFunctions.js +398 -0
  277. package/lib/module/a2ui/basicFunctions.js.map +1 -0
  278. package/lib/module/a2ui/catalogDocument.js +80 -0
  279. package/lib/module/a2ui/catalogDocument.js.map +1 -0
  280. package/lib/module/a2ui/catalogs.js +105 -0
  281. package/lib/module/a2ui/catalogs.js.map +1 -0
  282. package/lib/module/a2ui/components/DateTimeInput.js +445 -0
  283. package/lib/module/a2ui/components/DateTimeInput.js.map +1 -0
  284. package/lib/module/a2ui/components/Media.js +316 -0
  285. package/lib/module/a2ui/components/Media.js.map +1 -0
  286. package/lib/module/a2ui/components/basicComponents.js +975 -0
  287. package/lib/module/a2ui/components/basicComponents.js.map +1 -0
  288. package/lib/module/a2ui/components/iconPaths.js +66 -0
  289. package/lib/module/a2ui/components/iconPaths.js.map +1 -0
  290. package/lib/module/a2ui/components/types.js +4 -0
  291. package/lib/module/a2ui/components/types.js.map +1 -0
  292. package/lib/module/a2ui/index.js +70 -0
  293. package/lib/module/a2ui/index.js.map +1 -0
  294. package/lib/module/a2ui/instructions.js +268 -0
  295. package/lib/module/a2ui/instructions.js.map +1 -0
  296. package/lib/module/a2ui/secrets.js +169 -0
  297. package/lib/module/a2ui/secrets.js.map +1 -0
  298. package/lib/module/a2ui/useReplyState.js +35 -0
  299. package/lib/module/a2ui/useReplyState.js.map +1 -0
  300. package/lib/module/ai-components/AITypingIndicatorView.js +8 -18
  301. package/lib/module/ai-components/AITypingIndicatorView.js.map +1 -1
  302. package/lib/module/ai-components/README.md +64 -3
  303. package/lib/module/ai-components/StreamingMessageView.js +26 -0
  304. package/lib/module/ai-components/StreamingMessageView.js.map +1 -1
  305. package/lib/module/ai-components/charts/components/PieLegend.js +2 -1
  306. package/lib/module/ai-components/charts/components/PieLegend.js.map +1 -1
  307. package/lib/module/ai-components/charts/components/VictoryChart.js +7 -2
  308. package/lib/module/ai-components/charts/components/VictoryChart.js.map +1 -1
  309. package/lib/module/ai-components/charts/utils/format-time-label.js +15 -0
  310. package/lib/module/ai-components/charts/utils/format-time-label.js.map +1 -0
  311. package/lib/module/ai-components/charts/vega-lite/schema.js +17 -2
  312. package/lib/module/ai-components/charts/vega-lite/schema.js.map +1 -1
  313. package/lib/module/ai-components/contexts/composer-context.js +13 -6
  314. package/lib/module/ai-components/contexts/composer-context.js.map +1 -1
  315. package/lib/module/ai-components/contexts/index.js +11 -0
  316. package/lib/module/ai-components/contexts/index.js.map +1 -1
  317. package/lib/module/ai-components/contexts/theme-context.js +33 -2
  318. package/lib/module/ai-components/contexts/theme-context.js.map +1 -1
  319. package/lib/module/ai-components/contexts/translation-context.js +29 -0
  320. package/lib/module/ai-components/contexts/translation-context.js.map +1 -0
  321. package/lib/module/ai-components/conversation/AIConversation.js +374 -0
  322. package/lib/module/ai-components/conversation/AIConversation.js.map +1 -0
  323. package/lib/module/ai-components/conversation/entries.js +98 -0
  324. package/lib/module/ai-components/conversation/entries.js.map +1 -0
  325. package/lib/module/ai-components/conversation/index.js +15 -0
  326. package/lib/module/ai-components/conversation/index.js.map +1 -0
  327. package/lib/module/ai-components/conversation/list/AIChatList.js +224 -0
  328. package/lib/module/ai-components/conversation/list/AIChatList.js.map +1 -0
  329. package/lib/module/ai-components/conversation/list/useChatListController.js +78 -0
  330. package/lib/module/ai-components/conversation/list/useChatListController.js.map +1 -0
  331. package/lib/module/ai-components/conversation/list/useEndInView.js +51 -0
  332. package/lib/module/ai-components/conversation/list/useEndInView.js.map +1 -0
  333. package/lib/module/ai-components/conversation/list/useKeyboardOverlap.js +53 -0
  334. package/lib/module/ai-components/conversation/list/useKeyboardOverlap.js.map +1 -0
  335. package/lib/module/ai-components/conversation/list/useLoadOlder.js +73 -0
  336. package/lib/module/ai-components/conversation/list/useLoadOlder.js.map +1 -0
  337. package/lib/module/ai-components/conversation/list/usePinnedAnchor.js +84 -0
  338. package/lib/module/ai-components/conversation/list/usePinnedAnchor.js.map +1 -0
  339. package/lib/module/ai-components/conversation/useConversationRows.js +117 -0
  340. package/lib/module/ai-components/conversation/useConversationRows.js.map +1 -0
  341. package/lib/module/ai-components/conversation-state/controller/AIAgentError.js +13 -0
  342. package/lib/module/ai-components/conversation-state/controller/AIAgentError.js.map +1 -0
  343. package/lib/module/ai-components/conversation-state/controller/AIConversationController.js +431 -0
  344. package/lib/module/ai-components/conversation-state/controller/AIConversationController.js.map +1 -0
  345. package/lib/module/ai-components/conversation-state/controller/AIConversationExchange.js +89 -0
  346. package/lib/module/ai-components/conversation-state/controller/AIConversationExchange.js.map +1 -0
  347. package/lib/module/ai-components/conversation-state/controller/index.js +48 -0
  348. package/lib/module/ai-components/conversation-state/controller/index.js.map +1 -0
  349. package/lib/module/ai-components/conversation-state/controller/offers.js +35 -0
  350. package/lib/module/ai-components/conversation-state/controller/offers.js.map +1 -0
  351. package/lib/module/ai-components/conversation-state/controller/types.js +13 -0
  352. package/lib/module/ai-components/conversation-state/controller/types.js.map +1 -0
  353. package/lib/module/ai-components/conversation-state/controller/useAIConversationState.js +8 -0
  354. package/lib/module/ai-components/conversation-state/controller/useAIConversationState.js.map +1 -0
  355. package/lib/module/ai-components/conversation-state/fromStreamMessage.js +67 -0
  356. package/lib/module/ai-components/conversation-state/fromStreamMessage.js.map +1 -0
  357. package/lib/module/ai-components/conversation-state/index.js +37 -0
  358. package/lib/module/ai-components/conversation-state/index.js.map +1 -0
  359. package/lib/module/ai-components/conversation-state/types.js +4 -0
  360. package/lib/module/ai-components/conversation-state/types.js.map +1 -0
  361. package/lib/module/ai-components/generative-ui/AIUIAction.js +30 -0
  362. package/lib/module/ai-components/generative-ui/AIUIAction.js.map +1 -0
  363. package/lib/module/ai-components/generative-ui/AIUIArguments.js +128 -0
  364. package/lib/module/ai-components/generative-ui/AIUIArguments.js.map +1 -0
  365. package/lib/module/ai-components/generative-ui/AIUIComponent.js +50 -0
  366. package/lib/module/ai-components/generative-ui/AIUIComponent.js.map +1 -0
  367. package/lib/module/ai-components/generative-ui/AIUIComponentDefinition.js +134 -0
  368. package/lib/module/ai-components/generative-ui/AIUIComponentDefinition.js.map +1 -0
  369. package/lib/module/ai-components/generative-ui/AIUIDocument.js +32 -0
  370. package/lib/module/ai-components/generative-ui/AIUIDocument.js.map +1 -0
  371. package/lib/module/ai-components/generative-ui/AIUIEntrance.js +197 -0
  372. package/lib/module/ai-components/generative-ui/AIUIEntrance.js.map +1 -0
  373. package/lib/module/ai-components/generative-ui/AIUIErrorBoundary.js +30 -0
  374. package/lib/module/ai-components/generative-ui/AIUIErrorBoundary.js.map +1 -0
  375. package/lib/module/ai-components/generative-ui/AIUIHelpers.js +54 -0
  376. package/lib/module/ai-components/generative-ui/AIUIHelpers.js.map +1 -0
  377. package/lib/module/ai-components/generative-ui/AIUIHost.js +259 -0
  378. package/lib/module/ai-components/generative-ui/AIUIHost.js.map +1 -0
  379. package/lib/module/ai-components/generative-ui/AIUIMedia.js +24 -0
  380. package/lib/module/ai-components/generative-ui/AIUIMedia.js.map +1 -0
  381. package/lib/module/ai-components/generative-ui/AIUIRenderer.js +10 -0
  382. package/lib/module/ai-components/generative-ui/AIUIRenderer.js.map +1 -0
  383. package/lib/module/ai-components/generative-ui/AIUIView.js +57 -0
  384. package/lib/module/ai-components/generative-ui/AIUIView.js.map +1 -0
  385. package/lib/module/ai-components/generative-ui/index.js +181 -0
  386. package/lib/module/ai-components/generative-ui/index.js.map +1 -0
  387. package/lib/module/ai-components/icons.js +44 -0
  388. package/lib/module/ai-components/icons.js.map +1 -0
  389. package/lib/module/ai-components/index.js +96 -0
  390. package/lib/module/ai-components/index.js.map +1 -1
  391. package/lib/module/ai-components/internal/Shimmer.js +36 -0
  392. package/lib/module/ai-components/internal/Shimmer.js.map +1 -0
  393. package/lib/module/ai-components/internal/format.js +66 -0
  394. package/lib/module/ai-components/internal/format.js.map +1 -0
  395. package/lib/module/ai-components/internal/hooks/useBottomSafeArea.js +12 -0
  396. package/lib/module/ai-components/internal/hooks/useBottomSafeArea.js.map +1 -0
  397. package/lib/module/ai-components/internal/icons/AgentIcons.js +74 -0
  398. package/lib/module/ai-components/internal/icons/AgentIcons.js.map +1 -0
  399. package/lib/module/ai-components/internal/keyboard.js +40 -0
  400. package/lib/module/ai-components/internal/keyboard.js.map +1 -0
  401. package/lib/module/ai-components/internal/tokens.js +11 -0
  402. package/lib/module/ai-components/internal/tokens.js.map +1 -0
  403. package/lib/module/ai-components/internal/uuid.js +21 -0
  404. package/lib/module/ai-components/internal/uuid.js.map +1 -0
  405. package/lib/module/ai-components/markdown/components/CodeBlock.js +4 -2
  406. package/lib/module/ai-components/markdown/components/CodeBlock.js.map +1 -1
  407. package/lib/module/ai-components/markdown/components/InlineCode.js +1 -0
  408. package/lib/module/ai-components/markdown/components/InlineCode.js.map +1 -1
  409. package/lib/module/ai-components/markdown/components/Text.js +11 -2
  410. package/lib/module/ai-components/markdown/components/Text.js.map +1 -1
  411. package/lib/module/ai-components/markdown/styles.js +27 -29
  412. package/lib/module/ai-components/markdown/styles.js.map +1 -1
  413. package/lib/module/ai-components/message/AIAssistantMessage.js +64 -0
  414. package/lib/module/ai-components/message/AIAssistantMessage.js.map +1 -0
  415. package/lib/module/ai-components/message/AIMessageAttachment.js +189 -0
  416. package/lib/module/ai-components/message/AIMessageAttachment.js.map +1 -0
  417. package/lib/module/ai-components/message/AIReplyActions.js +132 -0
  418. package/lib/module/ai-components/message/AIReplyActions.js.map +1 -0
  419. package/lib/module/ai-components/message/AIUserMessage.js +104 -0
  420. package/lib/module/ai-components/message/AIUserMessage.js.map +1 -0
  421. package/lib/module/ai-components/message/UserMessageMenu.js +150 -0
  422. package/lib/module/ai-components/message/UserMessageMenu.js.map +1 -0
  423. package/lib/module/ai-components/message/index.js +48 -0
  424. package/lib/module/ai-components/message/index.js.map +1 -0
  425. package/lib/module/ai-components/message-composer/ActionButton.js +4 -2
  426. package/lib/module/ai-components/message-composer/ActionButton.js.map +1 -1
  427. package/lib/module/ai-components/message-composer/ActionSheet.js +22 -6
  428. package/lib/module/ai-components/message-composer/ActionSheet.js.map +1 -1
  429. package/lib/module/ai-components/message-composer/AttachmentButton.js +5 -1
  430. package/lib/module/ai-components/message-composer/AttachmentButton.js.map +1 -1
  431. package/lib/module/ai-components/message-composer/ChatOptions.js +147 -0
  432. package/lib/module/ai-components/message-composer/ChatOptions.js.map +1 -0
  433. package/lib/module/ai-components/message-composer/ComposerView.js +146 -20
  434. package/lib/module/ai-components/message-composer/ComposerView.js.map +1 -1
  435. package/lib/module/ai-components/message-composer/EditingMessageChip.js +81 -0
  436. package/lib/module/ai-components/message-composer/EditingMessageChip.js.map +1 -0
  437. package/lib/module/ai-components/message-composer/MediaPreviewList.js +26 -1
  438. package/lib/module/ai-components/message-composer/MediaPreviewList.js.map +1 -1
  439. package/lib/module/ai-components/message-composer/index.js +11 -0
  440. package/lib/module/ai-components/message-composer/index.js.map +1 -1
  441. package/lib/module/ai-components/message-parts/AIMessageParts.js +133 -0
  442. package/lib/module/ai-components/message-parts/AIMessageParts.js.map +1 -0
  443. package/lib/module/ai-components/message-parts/AIToolApproval.js +197 -0
  444. package/lib/module/ai-components/message-parts/AIToolApproval.js.map +1 -0
  445. package/lib/module/ai-components/message-parts/AIToolAuthorization.js +250 -0
  446. package/lib/module/ai-components/message-parts/AIToolAuthorization.js.map +1 -0
  447. package/lib/module/ai-components/message-parts/AIToolCall.js +159 -0
  448. package/lib/module/ai-components/message-parts/AIToolCall.js.map +1 -0
  449. package/lib/module/ai-components/message-parts/callStates.js +54 -0
  450. package/lib/module/ai-components/message-parts/callStates.js.map +1 -0
  451. package/lib/module/ai-components/message-parts/index.js +70 -0
  452. package/lib/module/ai-components/message-parts/index.js.map +1 -0
  453. package/lib/module/ai-components/message-parts/parseMessageParts.js +126 -0
  454. package/lib/module/ai-components/message-parts/parseMessageParts.js.map +1 -0
  455. package/lib/module/ai-components/message-parts/types.js +2 -0
  456. package/lib/module/ai-components/message-parts/types.js.map +1 -0
  457. package/lib/module/ai-components/native-specs/NativeAIAgent.js +7 -0
  458. package/lib/module/ai-components/native-specs/NativeAIAgent.js.map +1 -0
  459. package/lib/module/ai-components/reasoning/AIReasoning.js +401 -0
  460. package/lib/module/ai-components/reasoning/AIReasoning.js.map +1 -0
  461. package/lib/module/ai-components/reasoning/index.js +26 -0
  462. package/lib/module/ai-components/reasoning/index.js.map +1 -0
  463. package/lib/module/ai-components/reasoning/thinkingClock.js +63 -0
  464. package/lib/module/ai-components/reasoning/thinkingClock.js.map +1 -0
  465. package/lib/module/ai-components/services/clipboard-service/expo.js +7 -2
  466. package/lib/module/ai-components/services/clipboard-service/expo.js.map +1 -1
  467. package/lib/module/ai-components/store/composer/store.js.map +1 -1
  468. package/lib/module/ai-components/store/composer/useComposerChatOption.js +18 -0
  469. package/lib/module/ai-components/store/composer/useComposerChatOption.js.map +1 -0
  470. package/lib/module/ai-components/store/composer/useComposerIsEditing.js +18 -0
  471. package/lib/module/ai-components/store/composer/useComposerIsEditing.js.map +1 -0
  472. package/lib/module/ai-components/store/index.js +22 -0
  473. package/lib/module/ai-components/store/index.js.map +1 -1
  474. package/lib/module/ai-components/suggestions/AISuggestions.js +66 -0
  475. package/lib/module/ai-components/suggestions/AISuggestions.js.map +1 -0
  476. package/lib/module/ai-components/suggestions/index.js +15 -0
  477. package/lib/module/ai-components/suggestions/index.js.map +1 -0
  478. package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js +2 -1
  479. package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -1
  480. package/lib/module/ai-components/syntax-highlighting/utils/renderer.js +3 -2
  481. package/lib/module/ai-components/syntax-highlighting/utils/renderer.js.map +1 -1
  482. package/lib/module/ai-components/theme.js +137 -1
  483. package/lib/module/ai-components/theme.js.map +1 -1
  484. package/lib/module/ai-components/tool-calls/AIClientIdentity.js +22 -0
  485. package/lib/module/ai-components/tool-calls/AIClientIdentity.js.map +1 -0
  486. package/lib/module/ai-components/tool-calls/AIClientToolRunner.js +109 -0
  487. package/lib/module/ai-components/tool-calls/AIClientToolRunner.js.map +1 -0
  488. package/lib/module/ai-components/tool-calls/AIToolApprover.js +23 -0
  489. package/lib/module/ai-components/tool-calls/AIToolApprover.js.map +1 -0
  490. package/lib/module/ai-components/tool-calls/authSessionAuthorizer.js +88 -0
  491. package/lib/module/ai-components/tool-calls/authSessionAuthorizer.js.map +1 -0
  492. package/lib/module/ai-components/tool-calls/index.js +48 -0
  493. package/lib/module/ai-components/tool-calls/index.js.map +1 -0
  494. package/lib/module/ai-components/voice-visualization/glowShader.js.map +1 -1
  495. package/lib/module/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -1
  496. package/lib/module/components/Message/MessageItemView/utils/renderText.js.map +1 -1
  497. package/lib/module/contexts/translationContext/TranslationContext.js +2 -2
  498. package/lib/module/contexts/translationContext/TranslationContext.js.map +1 -1
  499. package/lib/module/i18n/ar.json +40 -1
  500. package/lib/module/i18n/en.json +40 -1
  501. package/lib/module/i18n/es.json +40 -1
  502. package/lib/module/i18n/fr.json +40 -1
  503. package/lib/module/i18n/he.json +40 -1
  504. package/lib/module/i18n/hi.json +40 -1
  505. package/lib/module/i18n/it.json +40 -1
  506. package/lib/module/i18n/ja.json +40 -1
  507. package/lib/module/i18n/ko.json +40 -1
  508. package/lib/module/i18n/nl.json +40 -1
  509. package/lib/module/i18n/pt-br.json +40 -1
  510. package/lib/module/i18n/ru.json +40 -1
  511. package/lib/module/i18n/tr.json +40 -1
  512. package/lib/module/mock-builders/a2ui/ohrid.js +84 -0
  513. package/lib/module/mock-builders/a2ui/ohrid.js.map +1 -0
  514. package/lib/module/utils/i18n/Streami18n.js +9 -4
  515. package/lib/module/utils/i18n/Streami18n.js.map +1 -1
  516. package/lib/module/utils/i18n/utils.js +7 -0
  517. package/lib/module/utils/i18n/utils.js.map +1 -0
  518. package/lib/module/version.json +1 -1
  519. package/lib/typescript/a11y/a11yUtils.d.ts +0 -1
  520. package/lib/typescript/a11y/a11yUtils.d.ts.map +1 -1
  521. package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts +2 -3
  522. package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts.map +1 -1
  523. package/lib/typescript/a2ui/A2UIContexts.d.ts +9 -0
  524. package/lib/typescript/a2ui/A2UIContexts.d.ts.map +1 -0
  525. package/lib/typescript/a2ui/A2UIInstructions.d.ts +47 -0
  526. package/lib/typescript/a2ui/A2UIInstructions.d.ts.map +1 -0
  527. package/lib/typescript/a2ui/A2UIPlaceholder.d.ts +4 -0
  528. package/lib/typescript/a2ui/A2UIPlaceholder.d.ts.map +1 -0
  529. package/lib/typescript/a2ui/A2UIRenderer.d.ts +130 -0
  530. package/lib/typescript/a2ui/A2UIRenderer.d.ts.map +1 -0
  531. package/lib/typescript/a2ui/A2UIStream.d.ts +23 -0
  532. package/lib/typescript/a2ui/A2UIStream.d.ts.map +1 -0
  533. package/lib/typescript/a2ui/A2UISurface.d.ts +19 -0
  534. package/lib/typescript/a2ui/A2UISurface.d.ts.map +1 -0
  535. package/lib/typescript/a2ui/basicFunctions.d.ts +10 -0
  536. package/lib/typescript/a2ui/basicFunctions.d.ts.map +1 -0
  537. package/lib/typescript/a2ui/catalogDocument.d.ts +56 -0
  538. package/lib/typescript/a2ui/catalogDocument.d.ts.map +1 -0
  539. package/lib/typescript/a2ui/catalogs.d.ts +42 -0
  540. package/lib/typescript/a2ui/catalogs.d.ts.map +1 -0
  541. package/lib/typescript/a2ui/components/DateTimeInput.d.ts +44 -0
  542. package/lib/typescript/a2ui/components/DateTimeInput.d.ts.map +1 -0
  543. package/lib/typescript/a2ui/components/Media.d.ts +27 -0
  544. package/lib/typescript/a2ui/components/Media.d.ts.map +1 -0
  545. package/lib/typescript/a2ui/components/basicComponents.d.ts +4 -0
  546. package/lib/typescript/a2ui/components/basicComponents.d.ts.map +1 -0
  547. package/lib/typescript/a2ui/components/iconPaths.d.ts +2 -0
  548. package/lib/typescript/a2ui/components/iconPaths.d.ts.map +1 -0
  549. package/lib/typescript/a2ui/components/types.d.ts +23 -0
  550. package/lib/typescript/a2ui/components/types.d.ts.map +1 -0
  551. package/lib/typescript/a2ui/index.d.ts +8 -0
  552. package/lib/typescript/a2ui/index.d.ts.map +1 -0
  553. package/lib/typescript/a2ui/instructions.d.ts +39 -0
  554. package/lib/typescript/a2ui/instructions.d.ts.map +1 -0
  555. package/lib/typescript/a2ui/secrets.d.ts +20 -0
  556. package/lib/typescript/a2ui/secrets.d.ts.map +1 -0
  557. package/lib/typescript/a2ui/useReplyState.d.ts +4 -0
  558. package/lib/typescript/a2ui/useReplyState.d.ts.map +1 -0
  559. package/lib/typescript/ai-components/AITypingIndicatorView.d.ts.map +1 -1
  560. package/lib/typescript/ai-components/StreamingMessageView.d.ts +4 -1
  561. package/lib/typescript/ai-components/StreamingMessageView.d.ts.map +1 -1
  562. package/lib/typescript/ai-components/charts/components/PieLegend.d.ts.map +1 -1
  563. package/lib/typescript/ai-components/charts/components/VictoryChart.d.ts.map +1 -1
  564. package/lib/typescript/ai-components/charts/utils/format-time-label.d.ts +7 -0
  565. package/lib/typescript/ai-components/charts/utils/format-time-label.d.ts.map +1 -0
  566. package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts +8 -8
  567. package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts.map +1 -1
  568. package/lib/typescript/ai-components/contexts/composer-context.d.ts +3 -0
  569. package/lib/typescript/ai-components/contexts/composer-context.d.ts.map +1 -1
  570. package/lib/typescript/ai-components/contexts/index.d.ts +1 -0
  571. package/lib/typescript/ai-components/contexts/index.d.ts.map +1 -1
  572. package/lib/typescript/ai-components/contexts/theme-context.d.ts.map +1 -1
  573. package/lib/typescript/ai-components/contexts/translation-context.d.ts +19 -0
  574. package/lib/typescript/ai-components/contexts/translation-context.d.ts.map +1 -0
  575. package/lib/typescript/ai-components/conversation/AIConversation.d.ts +133 -0
  576. package/lib/typescript/ai-components/conversation/AIConversation.d.ts.map +1 -0
  577. package/lib/typescript/ai-components/conversation/entries.d.ts +47 -0
  578. package/lib/typescript/ai-components/conversation/entries.d.ts.map +1 -0
  579. package/lib/typescript/ai-components/conversation/index.d.ts +3 -0
  580. package/lib/typescript/ai-components/conversation/index.d.ts.map +1 -0
  581. package/lib/typescript/ai-components/conversation/list/AIChatList.d.ts +30 -0
  582. package/lib/typescript/ai-components/conversation/list/AIChatList.d.ts.map +1 -0
  583. package/lib/typescript/ai-components/conversation/list/useChatListController.d.ts +45 -0
  584. package/lib/typescript/ai-components/conversation/list/useChatListController.d.ts.map +1 -0
  585. package/lib/typescript/ai-components/conversation/list/useEndInView.d.ts +26 -0
  586. package/lib/typescript/ai-components/conversation/list/useEndInView.d.ts.map +1 -0
  587. package/lib/typescript/ai-components/conversation/list/useKeyboardOverlap.d.ts +17 -0
  588. package/lib/typescript/ai-components/conversation/list/useKeyboardOverlap.d.ts.map +1 -0
  589. package/lib/typescript/ai-components/conversation/list/useLoadOlder.d.ts +24 -0
  590. package/lib/typescript/ai-components/conversation/list/useLoadOlder.d.ts.map +1 -0
  591. package/lib/typescript/ai-components/conversation/list/usePinnedAnchor.d.ts +26 -0
  592. package/lib/typescript/ai-components/conversation/list/usePinnedAnchor.d.ts.map +1 -0
  593. package/lib/typescript/ai-components/conversation/useConversationRows.d.ts +66 -0
  594. package/lib/typescript/ai-components/conversation/useConversationRows.d.ts.map +1 -0
  595. package/lib/typescript/ai-components/conversation-state/controller/AIAgentError.d.ts +10 -0
  596. package/lib/typescript/ai-components/conversation-state/controller/AIAgentError.d.ts.map +1 -0
  597. package/lib/typescript/ai-components/conversation-state/controller/AIConversationController.d.ts +173 -0
  598. package/lib/typescript/ai-components/conversation-state/controller/AIConversationController.d.ts.map +1 -0
  599. package/lib/typescript/ai-components/conversation-state/controller/AIConversationExchange.d.ts +23 -0
  600. package/lib/typescript/ai-components/conversation-state/controller/AIConversationExchange.d.ts.map +1 -0
  601. package/lib/typescript/ai-components/conversation-state/controller/index.d.ts +5 -0
  602. package/lib/typescript/ai-components/conversation-state/controller/index.d.ts.map +1 -0
  603. package/lib/typescript/ai-components/conversation-state/controller/offers.d.ts +25 -0
  604. package/lib/typescript/ai-components/conversation-state/controller/offers.d.ts.map +1 -0
  605. package/lib/typescript/ai-components/conversation-state/controller/types.d.ts +142 -0
  606. package/lib/typescript/ai-components/conversation-state/controller/types.d.ts.map +1 -0
  607. package/lib/typescript/ai-components/conversation-state/controller/useAIConversationState.d.ts +9 -0
  608. package/lib/typescript/ai-components/conversation-state/controller/useAIConversationState.d.ts.map +1 -0
  609. package/lib/typescript/ai-components/conversation-state/fromStreamMessage.d.ts +25 -0
  610. package/lib/typescript/ai-components/conversation-state/fromStreamMessage.d.ts.map +1 -0
  611. package/lib/typescript/ai-components/conversation-state/index.d.ts +4 -0
  612. package/lib/typescript/ai-components/conversation-state/index.d.ts.map +1 -0
  613. package/lib/typescript/ai-components/conversation-state/types.d.ts +55 -0
  614. package/lib/typescript/ai-components/conversation-state/types.d.ts.map +1 -0
  615. package/lib/typescript/ai-components/generative-ui/AIUIAction.d.ts +48 -0
  616. package/lib/typescript/ai-components/generative-ui/AIUIAction.d.ts.map +1 -0
  617. package/lib/typescript/ai-components/generative-ui/AIUIArguments.d.ts +15 -0
  618. package/lib/typescript/ai-components/generative-ui/AIUIArguments.d.ts.map +1 -0
  619. package/lib/typescript/ai-components/generative-ui/AIUIComponent.d.ts +51 -0
  620. package/lib/typescript/ai-components/generative-ui/AIUIComponent.d.ts.map +1 -0
  621. package/lib/typescript/ai-components/generative-ui/AIUIComponentDefinition.d.ts +84 -0
  622. package/lib/typescript/ai-components/generative-ui/AIUIComponentDefinition.d.ts.map +1 -0
  623. package/lib/typescript/ai-components/generative-ui/AIUIDocument.d.ts +50 -0
  624. package/lib/typescript/ai-components/generative-ui/AIUIDocument.d.ts.map +1 -0
  625. package/lib/typescript/ai-components/generative-ui/AIUIEntrance.d.ts +76 -0
  626. package/lib/typescript/ai-components/generative-ui/AIUIEntrance.d.ts.map +1 -0
  627. package/lib/typescript/ai-components/generative-ui/AIUIErrorBoundary.d.ts +26 -0
  628. package/lib/typescript/ai-components/generative-ui/AIUIErrorBoundary.d.ts.map +1 -0
  629. package/lib/typescript/ai-components/generative-ui/AIUIHelpers.d.ts +23 -0
  630. package/lib/typescript/ai-components/generative-ui/AIUIHelpers.d.ts.map +1 -0
  631. package/lib/typescript/ai-components/generative-ui/AIUIHost.d.ts +160 -0
  632. package/lib/typescript/ai-components/generative-ui/AIUIHost.d.ts.map +1 -0
  633. package/lib/typescript/ai-components/generative-ui/AIUIMedia.d.ts +22 -0
  634. package/lib/typescript/ai-components/generative-ui/AIUIMedia.d.ts.map +1 -0
  635. package/lib/typescript/ai-components/generative-ui/AIUIRenderer.d.ts +53 -0
  636. package/lib/typescript/ai-components/generative-ui/AIUIRenderer.d.ts.map +1 -0
  637. package/lib/typescript/ai-components/generative-ui/AIUIView.d.ts +35 -0
  638. package/lib/typescript/ai-components/generative-ui/AIUIView.d.ts.map +1 -0
  639. package/lib/typescript/ai-components/generative-ui/index.d.ts +11 -0
  640. package/lib/typescript/ai-components/generative-ui/index.d.ts.map +1 -0
  641. package/lib/typescript/ai-components/icons.d.ts +66 -0
  642. package/lib/typescript/ai-components/icons.d.ts.map +1 -0
  643. package/lib/typescript/ai-components/index.d.ts +8 -0
  644. package/lib/typescript/ai-components/index.d.ts.map +1 -1
  645. package/lib/typescript/ai-components/internal/Shimmer.d.ts +14 -0
  646. package/lib/typescript/ai-components/internal/Shimmer.d.ts.map +1 -0
  647. package/lib/typescript/ai-components/internal/format.d.ts +7 -0
  648. package/lib/typescript/ai-components/internal/format.d.ts.map +1 -0
  649. package/lib/typescript/ai-components/internal/hooks/useBottomSafeArea.d.ts +3 -0
  650. package/lib/typescript/ai-components/internal/hooks/useBottomSafeArea.d.ts.map +1 -0
  651. package/lib/typescript/ai-components/internal/icons/AgentIcons.d.ts +31 -0
  652. package/lib/typescript/ai-components/internal/icons/AgentIcons.d.ts.map +1 -0
  653. package/lib/typescript/ai-components/internal/keyboard.d.ts +9 -0
  654. package/lib/typescript/ai-components/internal/keyboard.d.ts.map +1 -0
  655. package/lib/typescript/ai-components/internal/tokens.d.ts +2 -0
  656. package/lib/typescript/ai-components/internal/tokens.d.ts.map +1 -0
  657. package/lib/typescript/ai-components/internal/uuid.d.ts +2 -0
  658. package/lib/typescript/ai-components/internal/uuid.d.ts.map +1 -0
  659. package/lib/typescript/ai-components/markdown/components/CodeBlock.d.ts.map +1 -1
  660. package/lib/typescript/ai-components/markdown/components/InlineCode.d.ts.map +1 -1
  661. package/lib/typescript/ai-components/markdown/components/Text.d.ts.map +1 -1
  662. package/lib/typescript/ai-components/markdown/styles.d.ts +23 -4
  663. package/lib/typescript/ai-components/markdown/styles.d.ts.map +1 -1
  664. package/lib/typescript/ai-components/markdown/types.d.ts +1 -0
  665. package/lib/typescript/ai-components/markdown/types.d.ts.map +1 -1
  666. package/lib/typescript/ai-components/message/AIAssistantMessage.d.ts +40 -0
  667. package/lib/typescript/ai-components/message/AIAssistantMessage.d.ts.map +1 -0
  668. package/lib/typescript/ai-components/message/AIMessageAttachment.d.ts +33 -0
  669. package/lib/typescript/ai-components/message/AIMessageAttachment.d.ts.map +1 -0
  670. package/lib/typescript/ai-components/message/AIReplyActions.d.ts +19 -0
  671. package/lib/typescript/ai-components/message/AIReplyActions.d.ts.map +1 -0
  672. package/lib/typescript/ai-components/message/AIUserMessage.d.ts +17 -0
  673. package/lib/typescript/ai-components/message/AIUserMessage.d.ts.map +1 -0
  674. package/lib/typescript/ai-components/message/UserMessageMenu.d.ts +31 -0
  675. package/lib/typescript/ai-components/message/UserMessageMenu.d.ts.map +1 -0
  676. package/lib/typescript/ai-components/message/index.d.ts +5 -0
  677. package/lib/typescript/ai-components/message/index.d.ts.map +1 -0
  678. package/lib/typescript/ai-components/message-composer/ActionButton.d.ts +1 -1
  679. package/lib/typescript/ai-components/message-composer/ActionButton.d.ts.map +1 -1
  680. package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts +2 -2
  681. package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts.map +1 -1
  682. package/lib/typescript/ai-components/message-composer/AttachmentButton.d.ts.map +1 -1
  683. package/lib/typescript/ai-components/message-composer/ChatOptions.d.ts +35 -0
  684. package/lib/typescript/ai-components/message-composer/ChatOptions.d.ts.map +1 -0
  685. package/lib/typescript/ai-components/message-composer/ComposerView.d.ts +39 -3
  686. package/lib/typescript/ai-components/message-composer/ComposerView.d.ts.map +1 -1
  687. package/lib/typescript/ai-components/message-composer/EditingMessageChip.d.ts +7 -0
  688. package/lib/typescript/ai-components/message-composer/EditingMessageChip.d.ts.map +1 -0
  689. package/lib/typescript/ai-components/message-composer/MediaPreviewList.d.ts.map +1 -1
  690. package/lib/typescript/ai-components/message-composer/index.d.ts +1 -0
  691. package/lib/typescript/ai-components/message-composer/index.d.ts.map +1 -1
  692. package/lib/typescript/ai-components/message-parts/AIMessageParts.d.ts +40 -0
  693. package/lib/typescript/ai-components/message-parts/AIMessageParts.d.ts.map +1 -0
  694. package/lib/typescript/ai-components/message-parts/AIToolApproval.d.ts +38 -0
  695. package/lib/typescript/ai-components/message-parts/AIToolApproval.d.ts.map +1 -0
  696. package/lib/typescript/ai-components/message-parts/AIToolAuthorization.d.ts +48 -0
  697. package/lib/typescript/ai-components/message-parts/AIToolAuthorization.d.ts.map +1 -0
  698. package/lib/typescript/ai-components/message-parts/AIToolCall.d.ts +11 -0
  699. package/lib/typescript/ai-components/message-parts/AIToolCall.d.ts.map +1 -0
  700. package/lib/typescript/ai-components/message-parts/callStates.d.ts +9 -0
  701. package/lib/typescript/ai-components/message-parts/callStates.d.ts.map +1 -0
  702. package/lib/typescript/ai-components/message-parts/index.d.ts +7 -0
  703. package/lib/typescript/ai-components/message-parts/index.d.ts.map +1 -0
  704. package/lib/typescript/ai-components/message-parts/parseMessageParts.d.ts +47 -0
  705. package/lib/typescript/ai-components/message-parts/parseMessageParts.d.ts.map +1 -0
  706. package/lib/typescript/ai-components/message-parts/types.d.ts +137 -0
  707. package/lib/typescript/ai-components/message-parts/types.d.ts.map +1 -0
  708. package/lib/typescript/ai-components/native-specs/NativeAIAgent.d.ts +22 -0
  709. package/lib/typescript/ai-components/native-specs/NativeAIAgent.d.ts.map +1 -0
  710. package/lib/typescript/ai-components/reasoning/AIReasoning.d.ts +63 -0
  711. package/lib/typescript/ai-components/reasoning/AIReasoning.d.ts.map +1 -0
  712. package/lib/typescript/ai-components/reasoning/index.d.ts +3 -0
  713. package/lib/typescript/ai-components/reasoning/index.d.ts.map +1 -0
  714. package/lib/typescript/ai-components/reasoning/thinkingClock.d.ts +29 -0
  715. package/lib/typescript/ai-components/reasoning/thinkingClock.d.ts.map +1 -0
  716. package/lib/typescript/ai-components/services/clipboard-service/expo.d.ts.map +1 -1
  717. package/lib/typescript/ai-components/store/composer/store.d.ts +8 -0
  718. package/lib/typescript/ai-components/store/composer/store.d.ts.map +1 -1
  719. package/lib/typescript/ai-components/store/composer/useComposerChatOption.d.ts +5 -0
  720. package/lib/typescript/ai-components/store/composer/useComposerChatOption.d.ts.map +1 -0
  721. package/lib/typescript/ai-components/store/composer/useComposerIsEditing.d.ts +5 -0
  722. package/lib/typescript/ai-components/store/composer/useComposerIsEditing.d.ts.map +1 -0
  723. package/lib/typescript/ai-components/store/index.d.ts +2 -0
  724. package/lib/typescript/ai-components/store/index.d.ts.map +1 -1
  725. package/lib/typescript/ai-components/suggestions/AISuggestions.d.ts +13 -0
  726. package/lib/typescript/ai-components/suggestions/AISuggestions.d.ts.map +1 -0
  727. package/lib/typescript/ai-components/suggestions/index.d.ts +2 -0
  728. package/lib/typescript/ai-components/suggestions/index.d.ts.map +1 -0
  729. package/lib/typescript/ai-components/syntax-highlighting/utils/flatten-nodes.d.ts.map +1 -1
  730. package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts +1 -1
  731. package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts.map +1 -1
  732. package/lib/typescript/ai-components/theme.d.ts +200 -0
  733. package/lib/typescript/ai-components/theme.d.ts.map +1 -1
  734. package/lib/typescript/ai-components/tool-calls/AIClientIdentity.d.ts +14 -0
  735. package/lib/typescript/ai-components/tool-calls/AIClientIdentity.d.ts.map +1 -0
  736. package/lib/typescript/ai-components/tool-calls/AIClientToolRunner.d.ts +109 -0
  737. package/lib/typescript/ai-components/tool-calls/AIClientToolRunner.d.ts.map +1 -0
  738. package/lib/typescript/ai-components/tool-calls/AIToolApprover.d.ts +48 -0
  739. package/lib/typescript/ai-components/tool-calls/AIToolApprover.d.ts.map +1 -0
  740. package/lib/typescript/ai-components/tool-calls/authSessionAuthorizer.d.ts +57 -0
  741. package/lib/typescript/ai-components/tool-calls/authSessionAuthorizer.d.ts.map +1 -0
  742. package/lib/typescript/ai-components/tool-calls/index.d.ts +5 -0
  743. package/lib/typescript/ai-components/tool-calls/index.d.ts.map +1 -0
  744. package/lib/typescript/ai-components/voice-visualization/glowShader.d.ts.map +1 -1
  745. package/lib/typescript/ai-components/voice-visualization/simplex.d.ts +1 -1
  746. package/lib/typescript/components/Accessibility/NotificationAnnouncer.d.ts +5 -5
  747. package/lib/typescript/components/Accessibility/hooks/useIncomingMessageAnnouncements.d.ts +1 -1
  748. package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts +0 -2
  749. package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts.map +1 -1
  750. package/lib/typescript/components/Message/MessageItemView/utils/renderText.d.ts.map +1 -1
  751. package/lib/typescript/contexts/translationContext/TranslationContext.d.ts +1 -1
  752. package/lib/typescript/contexts/translationContext/TranslationContext.d.ts.map +1 -1
  753. package/lib/typescript/i18n/ar.json +40 -1
  754. package/lib/typescript/i18n/en.json +40 -1
  755. package/lib/typescript/i18n/es.json +40 -1
  756. package/lib/typescript/i18n/fr.json +40 -1
  757. package/lib/typescript/i18n/he.json +40 -1
  758. package/lib/typescript/i18n/hi.json +40 -1
  759. package/lib/typescript/i18n/it.json +40 -1
  760. package/lib/typescript/i18n/ja.json +40 -1
  761. package/lib/typescript/i18n/ko.json +40 -1
  762. package/lib/typescript/i18n/nl.json +40 -1
  763. package/lib/typescript/i18n/pt-br.json +40 -1
  764. package/lib/typescript/i18n/ru.json +40 -1
  765. package/lib/typescript/i18n/tr.json +40 -1
  766. package/lib/typescript/utils/i18n/Streami18n.d.ts +41 -2
  767. package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
  768. package/lib/typescript/utils/i18n/utils.d.ts +3 -0
  769. package/lib/typescript/utils/i18n/utils.d.ts.map +1 -0
  770. package/package.json +10 -2
  771. package/src/a11y/a11yUtils.ts +0 -1
  772. package/src/a11y/hooks/useResolvedModalAccessibilityProps.ts +2 -3
  773. package/src/a2ui/A2UIContexts.ts +15 -0
  774. package/src/a2ui/A2UIInstructions.ts +102 -0
  775. package/src/a2ui/A2UIPlaceholder.tsx +24 -0
  776. package/src/a2ui/A2UIRenderer.tsx +504 -0
  777. package/src/a2ui/A2UIStream.ts +105 -0
  778. package/src/a2ui/A2UISurface.tsx +270 -0
  779. package/src/a2ui/__tests__/A2UIInstructions.test.ts +233 -0
  780. package/src/a2ui/__tests__/A2UIRenderer.test.tsx +1559 -0
  781. package/src/a2ui/__tests__/conformance.test.ts +579 -0
  782. package/src/a2ui/basicCatalog.json +1206 -0
  783. package/src/a2ui/basicFunctions.ts +429 -0
  784. package/src/a2ui/catalogDocument.ts +119 -0
  785. package/src/a2ui/catalogs.ts +185 -0
  786. package/src/a2ui/components/DateTimeInput.tsx +381 -0
  787. package/src/a2ui/components/Media.tsx +278 -0
  788. package/src/a2ui/components/basicComponents.tsx +832 -0
  789. package/src/a2ui/components/iconPaths.ts +116 -0
  790. package/src/a2ui/components/types.ts +24 -0
  791. package/src/a2ui/index.ts +18 -0
  792. package/src/a2ui/instructions.ts +341 -0
  793. package/src/a2ui/secrets.ts +154 -0
  794. package/src/a2ui/useReplyState.ts +26 -0
  795. package/src/ai-components/AITypingIndicatorView.tsx +6 -22
  796. package/src/ai-components/README.md +64 -3
  797. package/src/ai-components/StreamingMessageView.tsx +27 -3
  798. package/src/ai-components/__tests__/ComposerView.test.tsx +247 -2
  799. package/src/ai-components/__tests__/Markdown.test.tsx +13 -0
  800. package/src/ai-components/__tests__/StreamingMessageView.test.tsx +69 -0
  801. package/src/ai-components/__tests__/charts.test.ts +75 -0
  802. package/src/ai-components/__tests__/clientToolRunner.test.ts +239 -0
  803. package/src/ai-components/__tests__/conversation.test.tsx +787 -0
  804. package/src/ai-components/__tests__/conversationController.test.ts +1561 -0
  805. package/src/ai-components/__tests__/conversationExchange.test.ts +187 -0
  806. package/src/ai-components/__tests__/conversationRows.test.ts +207 -0
  807. package/src/ai-components/__tests__/conversationUI.test.tsx +606 -0
  808. package/src/ai-components/__tests__/format.test.ts +32 -0
  809. package/src/ai-components/__tests__/generativeUI.test.ts +634 -0
  810. package/src/ai-components/__tests__/keyboard.test.ts +14 -0
  811. package/src/ai-components/__tests__/messagePartViews.test.tsx +385 -0
  812. package/src/ai-components/__tests__/messageParts.test.ts +336 -0
  813. package/src/ai-components/__tests__/messageViews.test.tsx +321 -0
  814. package/src/ai-components/__tests__/signIn.test.tsx +324 -0
  815. package/src/ai-components/__tests__/theme.test.tsx +18 -0
  816. package/src/ai-components/__tests__/translation.test.tsx +85 -0
  817. package/src/ai-components/__tests__/voiceDriver.test.ts +0 -3
  818. package/src/ai-components/__tests__/voicePalette.test.ts +1 -1
  819. package/src/ai-components/__tests__/withoutKeyboardController.test.tsx +60 -0
  820. package/src/ai-components/charts/components/PieLegend.tsx +2 -1
  821. package/src/ai-components/charts/components/VictoryChart.tsx +10 -2
  822. package/src/ai-components/charts/utils/format-time-label.ts +18 -0
  823. package/src/ai-components/charts/vega-lite/schema.ts +19 -2
  824. package/src/ai-components/contexts/composer-context.tsx +13 -5
  825. package/src/ai-components/contexts/index.ts +1 -0
  826. package/src/ai-components/contexts/theme-context.tsx +19 -4
  827. package/src/ai-components/contexts/translation-context.tsx +44 -0
  828. package/src/ai-components/conversation/AIConversation.tsx +612 -0
  829. package/src/ai-components/conversation/entries.ts +177 -0
  830. package/src/ai-components/conversation/index.ts +2 -0
  831. package/src/ai-components/conversation/list/AIChatList.tsx +227 -0
  832. package/src/ai-components/conversation/list/useChatListController.ts +91 -0
  833. package/src/ai-components/conversation/list/useEndInView.ts +61 -0
  834. package/src/ai-components/conversation/list/useKeyboardOverlap.ts +52 -0
  835. package/src/ai-components/conversation/list/useLoadOlder.ts +97 -0
  836. package/src/ai-components/conversation/list/usePinnedAnchor.ts +113 -0
  837. package/src/ai-components/conversation/useConversationRows.ts +231 -0
  838. package/src/ai-components/conversation-state/controller/AIAgentError.ts +14 -0
  839. package/src/ai-components/conversation-state/controller/AIConversationController.ts +628 -0
  840. package/src/ai-components/conversation-state/controller/AIConversationExchange.ts +132 -0
  841. package/src/ai-components/conversation-state/controller/index.ts +4 -0
  842. package/src/ai-components/conversation-state/controller/offers.ts +53 -0
  843. package/src/ai-components/conversation-state/controller/types.ts +154 -0
  844. package/src/ai-components/conversation-state/controller/useAIConversationState.ts +21 -0
  845. package/src/ai-components/conversation-state/fromStreamMessage.ts +89 -0
  846. package/src/ai-components/conversation-state/index.ts +3 -0
  847. package/src/ai-components/conversation-state/types.ts +57 -0
  848. package/src/ai-components/generative-ui/AIUIAction.ts +73 -0
  849. package/src/ai-components/generative-ui/AIUIArguments.ts +117 -0
  850. package/src/ai-components/generative-ui/AIUIComponent.tsx +106 -0
  851. package/src/ai-components/generative-ui/AIUIComponentDefinition.ts +163 -0
  852. package/src/ai-components/generative-ui/AIUIDocument.ts +77 -0
  853. package/src/ai-components/generative-ui/AIUIEntrance.tsx +229 -0
  854. package/src/ai-components/generative-ui/AIUIErrorBoundary.tsx +39 -0
  855. package/src/ai-components/generative-ui/AIUIHelpers.ts +86 -0
  856. package/src/ai-components/generative-ui/AIUIHost.ts +358 -0
  857. package/src/ai-components/generative-ui/AIUIMedia.ts +45 -0
  858. package/src/ai-components/generative-ui/AIUIRenderer.ts +60 -0
  859. package/src/ai-components/generative-ui/AIUIView.tsx +87 -0
  860. package/src/ai-components/generative-ui/index.ts +48 -0
  861. package/src/ai-components/icons.ts +101 -0
  862. package/src/ai-components/index.ts +10 -0
  863. package/src/ai-components/internal/Shimmer.tsx +40 -0
  864. package/src/ai-components/internal/format.ts +69 -0
  865. package/src/ai-components/internal/hooks/useBottomSafeArea.ts +6 -0
  866. package/src/ai-components/internal/icons/AgentIcons.tsx +138 -0
  867. package/src/ai-components/internal/keyboard.tsx +34 -0
  868. package/src/ai-components/internal/tokens.ts +4 -0
  869. package/src/ai-components/internal/uuid.ts +17 -0
  870. package/src/ai-components/markdown/components/CodeBlock.tsx +13 -2
  871. package/src/ai-components/markdown/components/InlineCode.tsx +1 -0
  872. package/src/ai-components/markdown/components/Text.tsx +7 -2
  873. package/src/ai-components/markdown/styles.ts +29 -27
  874. package/src/ai-components/markdown/types.ts +1 -0
  875. package/src/ai-components/message/AIAssistantMessage.tsx +100 -0
  876. package/src/ai-components/message/AIMessageAttachment.tsx +245 -0
  877. package/src/ai-components/message/AIReplyActions.tsx +139 -0
  878. package/src/ai-components/message/AIUserMessage.tsx +121 -0
  879. package/src/ai-components/message/UserMessageMenu.tsx +149 -0
  880. package/src/ai-components/message/index.ts +4 -0
  881. package/src/ai-components/message-composer/ActionButton.tsx +10 -5
  882. package/src/ai-components/message-composer/ActionSheet.tsx +28 -6
  883. package/src/ai-components/message-composer/AttachmentButton.tsx +9 -1
  884. package/src/ai-components/message-composer/ChatOptions.tsx +144 -0
  885. package/src/ai-components/message-composer/ComposerView.tsx +194 -30
  886. package/src/ai-components/message-composer/EditingMessageChip.tsx +62 -0
  887. package/src/ai-components/message-composer/MediaPreviewList.tsx +34 -8
  888. package/src/ai-components/message-composer/index.ts +1 -0
  889. package/src/ai-components/message-parts/AIMessageParts.tsx +145 -0
  890. package/src/ai-components/message-parts/AIToolApproval.tsx +196 -0
  891. package/src/ai-components/message-parts/AIToolAuthorization.tsx +279 -0
  892. package/src/ai-components/message-parts/AIToolCall.tsx +117 -0
  893. package/src/ai-components/message-parts/callStates.ts +44 -0
  894. package/src/ai-components/message-parts/index.ts +6 -0
  895. package/src/ai-components/message-parts/parseMessageParts.ts +195 -0
  896. package/src/ai-components/message-parts/types.ts +157 -0
  897. package/src/ai-components/native-specs/NativeAIAgent.ts +25 -0
  898. package/src/ai-components/reasoning/AIReasoning.tsx +509 -0
  899. package/src/ai-components/reasoning/index.ts +2 -0
  900. package/src/ai-components/reasoning/thinkingClock.ts +109 -0
  901. package/src/ai-components/services/clipboard-service/expo.ts +18 -4
  902. package/src/ai-components/store/composer/store.ts +9 -0
  903. package/src/ai-components/store/composer/useComposerChatOption.ts +15 -0
  904. package/src/ai-components/store/composer/useComposerIsEditing.ts +15 -0
  905. package/src/ai-components/store/index.ts +2 -0
  906. package/src/ai-components/suggestions/AISuggestions.tsx +73 -0
  907. package/src/ai-components/suggestions/index.ts +1 -0
  908. package/src/ai-components/syntax-highlighting/utils/flatten-nodes.ts +2 -1
  909. package/src/ai-components/syntax-highlighting/utils/renderer.tsx +4 -2
  910. package/src/ai-components/theme.ts +334 -0
  911. package/src/ai-components/tool-calls/AIClientIdentity.ts +33 -0
  912. package/src/ai-components/tool-calls/AIClientToolRunner.ts +200 -0
  913. package/src/ai-components/tool-calls/AIToolApprover.tsx +60 -0
  914. package/src/ai-components/tool-calls/authSessionAuthorizer.ts +137 -0
  915. package/src/ai-components/tool-calls/index.ts +4 -0
  916. package/src/ai-components/voice-visualization/glowShader.ts +1 -3
  917. package/src/ai-components/voice-visualization/simplex.ts +1 -1
  918. package/src/components/Accessibility/NotificationAnnouncer.tsx +5 -5
  919. package/src/components/Accessibility/hooks/useIncomingMessageAnnouncements.ts +1 -1
  920. package/src/components/Accessibility/useAccessibilityAnnouncer.ts +0 -2
  921. package/src/components/Message/MessageItemView/utils/renderText.tsx +1 -2
  922. package/src/contexts/translationContext/TranslationContext.tsx +2 -2
  923. package/src/i18n/ar.json +40 -1
  924. package/src/i18n/en.json +40 -1
  925. package/src/i18n/es.json +40 -1
  926. package/src/i18n/fr.json +40 -1
  927. package/src/i18n/he.json +40 -1
  928. package/src/i18n/hi.json +40 -1
  929. package/src/i18n/it.json +40 -1
  930. package/src/i18n/ja.json +40 -1
  931. package/src/i18n/ko.json +40 -1
  932. package/src/i18n/nl.json +40 -1
  933. package/src/i18n/pt-br.json +40 -1
  934. package/src/i18n/ru.json +40 -1
  935. package/src/i18n/tr.json +40 -1
  936. package/src/mock-builders/a2ui/ohrid.ts +106 -0
  937. package/src/utils/i18n/Streami18n.ts +4 -1
  938. package/src/utils/i18n/utils.ts +3 -0
  939. package/src/version.json +1 -1
@@ -0,0 +1,116 @@
1
+ /*
2
+ * The paths of Material Icons (Round), from Google's material-design-icons
3
+ * (https://github.com/google/material-design-icons), licensed under the Apache License, Version 2.0:
4
+ * https://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+
7
+ // Copied from @material-design-icons/svg 0.14.15 (round): one 24 × 24 path for each icon name of
8
+ // the A2UI basic catalog, as Material names them (`photo_camera` for `camera`, `credit_card` for
9
+ // `payment`, …).
10
+ export const A2UI_ICON_PATHS: Record<string, string> = {
11
+ accountCircle:
12
+ 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88a9.947 9.947 0 0 1 12.28 0C16.43 19.18 14.03 20 12 20z',
13
+ add: 'M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z',
14
+ arrowBack:
15
+ 'M19 11H7.83l4.88-4.88c.39-.39.39-1.03 0-1.42a.996.996 0 0 0-1.41 0l-6.59 6.59a.996.996 0 0 0 0 1.41l6.59 6.59a.996.996 0 1 0 1.41-1.41L7.83 13H19c.55 0 1-.45 1-1s-.45-1-1-1z',
16
+ arrowForward:
17
+ 'M5 13h11.17l-4.88 4.88c-.39.39-.39 1.03 0 1.42.39.39 1.02.39 1.41 0l6.59-6.59a.996.996 0 0 0 0-1.41l-6.58-6.6a.996.996 0 1 0-1.41 1.41L16.17 11H5c-.55 0-1 .45-1 1s.45 1 1 1z',
18
+ attachFile:
19
+ 'M16.5 6.75v10.58c0 2.09-1.53 3.95-3.61 4.15A3.993 3.993 0 0 1 8.5 17.5V5.14c0-1.31.94-2.5 2.24-2.63A2.5 2.5 0 0 1 13.5 5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6.75c0-.41-.34-.75-.75-.75s-.75.34-.75.75v8.61c0 1.31.94 2.5 2.24 2.63A2.5 2.5 0 0 0 15 15.5V5.17c0-2.09-1.53-3.95-3.61-4.15A3.998 3.998 0 0 0 7 5v12.27c0 2.87 2.1 5.44 4.96 5.71 3.29.3 6.04-2.26 6.04-5.48V6.75c0-.41-.34-.75-.75-.75s-.75.34-.75.75z',
20
+ calendarToday:
21
+ 'M20 3h-1V2c0-.55-.45-1-1-1s-1 .45-1 1v1H7V2c0-.55-.45-1-1-1s-1 .45-1 1v1H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 18H5c-.55 0-1-.45-1-1V8h16v12c0 .55-.45 1-1 1z',
22
+ call: 'm19.23 15.26-2.54-.29a1.99 1.99 0 0 0-1.64.57l-1.84 1.84a15.045 15.045 0 0 1-6.59-6.59l1.85-1.85c.43-.43.64-1.03.57-1.64l-.29-2.52a2.001 2.001 0 0 0-1.99-1.77H5.03c-1.13 0-2.07.94-2 2.07.53 8.54 7.36 15.36 15.89 15.89 1.13.07 2.07-.87 2.07-2v-1.73c.01-1.01-.75-1.86-1.76-1.98z',
23
+ camera:
24
+ 'M20 4h-3.17l-1.24-1.35A1.99 1.99 0 0 0 14.12 2H9.88c-.56 0-1.1.24-1.48.65L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 13c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z',
25
+ check:
26
+ 'M9 16.17 5.53 12.7a.996.996 0 1 0-1.41 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71a.996.996 0 1 0-1.41-1.41L9 16.17z',
27
+ close:
28
+ 'M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7A.996.996 0 1 0 5.7 7.11L10.59 12 5.7 16.89a.996.996 0 1 0 1.41 1.41L12 13.41l4.89 4.89a.996.996 0 1 0 1.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z',
29
+ delete:
30
+ 'M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v10zM18 4h-2.5l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1z',
31
+ download:
32
+ 'M16.59 9H15V4c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v5H7.41c-.89 0-1.34 1.08-.71 1.71l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.63-.63.19-1.71-.7-1.71zM5 19c0 .55.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1H6c-.55 0-1 .45-1 1z',
33
+ edit: 'M3 17.46v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15L17.81 9.94l-3.75-3.75L3.15 17.1c-.1.1-.15.22-.15.36zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z',
34
+ event:
35
+ 'M16 10.53a.754.754 0 0 0-1.06 0l-4.35 4.35L9 13.29a.754.754 0 0 0-1.06 0c-.29.29-.29.77 0 1.06l1.94 1.94c.39.39 1.02.39 1.41 0l4.7-4.7c.3-.29.3-.77.01-1.06zM19 3h-1V2c0-.55-.45-1-1-1s-1 .45-1 1v1H8V2c0-.55-.45-1-1-1s-1 .45-1 1v1H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 16H6c-.55 0-1-.45-1-1V8h14v10c0 .55-.45 1-1 1z',
36
+ error:
37
+ 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm1 4h-2v-2h2v2z',
38
+ fastForward:
39
+ 'm5.58 16.89 5.77-4.07c.56-.4.56-1.24 0-1.63L5.58 7.11C4.91 6.65 4 7.12 4 7.93v8.14c0 .81.91 1.28 1.58.82zM13 7.93v8.14c0 .81.91 1.28 1.58.82l5.77-4.07c.56-.4.56-1.24 0-1.63l-5.77-4.07c-.67-.47-1.58 0-1.58.81z',
40
+ favorite:
41
+ 'M13.35 20.13c-.76.69-1.93.69-2.69-.01l-.11-.1C5.3 15.27 1.87 12.16 2 8.28c.06-1.7.93-3.33 2.34-4.29 2.64-1.8 5.9-.96 7.66 1.1 1.76-2.06 5.02-2.91 7.66-1.1 1.41.96 2.28 2.59 2.34 4.29.14 3.88-3.3 6.99-8.55 11.76l-.1.09z',
42
+ favoriteOff:
43
+ 'M19.66 3.99c-2.64-1.8-5.9-.96-7.66 1.1-1.76-2.06-5.02-2.91-7.66-1.1-1.4.96-2.28 2.58-2.34 4.29-.14 3.88 3.3 6.99 8.55 11.76l.1.09c.76.69 1.93.69 2.69-.01l.11-.1c5.25-4.76 8.68-7.87 8.55-11.75-.06-1.7-.94-3.32-2.34-4.28zM12.1 18.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z',
44
+ folder:
45
+ 'M10.59 4.59C10.21 4.21 9.7 4 9.17 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-1.41-1.41z',
46
+ help: 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75-.9.92c-.5.51-.86.97-1.04 1.69-.08.32-.13.68-.13 1.14h-2v-.5a3.997 3.997 0 0 1 1.17-2.83l1.24-1.26c.46-.44.68-1.1.55-1.8a1.99 1.99 0 0 0-1.39-1.53c-1.11-.31-2.14.32-2.47 1.27-.12.37-.43.65-.82.65h-.3C8.4 9 8 8.44 8.16 7.88a4.008 4.008 0 0 1 3.23-2.83c1.52-.24 2.97.55 3.87 1.8 1.18 1.63.83 3.38-.19 4.4z',
47
+ home: 'M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z',
48
+ info: 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 15c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm1-8h-2V7h2v2z',
49
+ locationOn:
50
+ 'M12 2c-4.2 0-8 3.22-8 8.2 0 3.18 2.45 6.92 7.34 11.23.38.33.95.33 1.33 0C17.55 17.12 20 13.38 20 10.2 20 5.22 16.2 2 12 2zm0 10c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z',
51
+ lock: 'M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z',
52
+ lockOpen:
53
+ 'M12 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6-5h-1V6c0-2.76-2.24-5-5-5-2.28 0-4.27 1.54-4.84 3.75-.14.54.18 1.08.72 1.22a1 1 0 0 0 1.22-.72A2.996 2.996 0 0 1 12 3c1.65 0 3 1.35 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 11c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-8c0-.55.45-1 1-1h10c.55 0 1 .45 1 1v8z',
54
+ mail: 'M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-.4 4.25-7.07 4.42c-.32.2-.74.2-1.06 0L4.4 8.25a.85.85 0 1 1 .9-1.44L12 11l6.7-4.19a.85.85 0 1 1 .9 1.44z',
55
+ menu: 'M4 18h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0-5h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zM3 7c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1z',
56
+ moreVert:
57
+ 'M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z',
58
+ moreHoriz:
59
+ 'M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z',
60
+ notificationsOff:
61
+ 'M12 22c1.1 0 2-.9 2-2h-4a2 2 0 0 0 2 2zm6-11c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68c-.24.06-.47.15-.69.23L18 13.1V11zM5.41 3.35 4 4.76l2.81 2.81C6.29 8.57 6 9.73 6 11v5l-1.29 1.29c-.63.63-.19 1.71.7 1.71h12.83l1.74 1.74 1.41-1.41L5.41 3.35z',
62
+ notifications:
63
+ 'M12 22c1.1 0 2-.9 2-2h-4a2 2 0 0 0 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-1.29 1.29c-.63.63-.19 1.71.7 1.71h13.17c.89 0 1.34-1.08.71-1.71L18 16z',
64
+ pause:
65
+ 'M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z',
66
+ payment:
67
+ 'M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm-1 14H5c-.55 0-1-.45-1-1v-5h16v5c0 .55-.45 1-1 1zm1-10H4V6h16v2z',
68
+ person:
69
+ 'M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v1c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-1c0-2.66-5.33-4-8-4z',
70
+ phone:
71
+ 'm19.23 15.26-2.54-.29a1.99 1.99 0 0 0-1.64.57l-1.84 1.84a15.045 15.045 0 0 1-6.59-6.59l1.85-1.85c.43-.43.64-1.03.57-1.64l-.29-2.52a2.001 2.001 0 0 0-1.99-1.77H5.03c-1.13 0-2.07.94-2 2.07.53 8.54 7.36 15.36 15.89 15.89 1.13.07 2.07-.87 2.07-2v-1.73c.01-1.01-.75-1.86-1.76-1.98z',
72
+ photo:
73
+ 'M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.9 13.98l2.1 2.53 3.1-3.99c.2-.26.6-.26.8.01l3.51 4.68a.5.5 0 0 1-.4.8H6.02c-.42 0-.65-.48-.39-.81L8.12 14c.19-.26.57-.27.78-.02z',
74
+ play: 'M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 0 0 0-1.69L9.54 5.98A.998.998 0 0 0 8 6.82z',
75
+ print:
76
+ 'M19 8H5c-1.66 0-3 1.34-3 3v4c0 1.1.9 2 2 2h2v2c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2v-2h2c1.1 0 2-.9 2-2v-4c0-1.66-1.34-3-3-3zm-4 11H9c-.55 0-1-.45-1-1v-4h8v4c0 .55-.45 1-1 1zm4-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-2-9H7c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1z',
77
+ refresh:
78
+ 'M17.65 6.35a7.95 7.95 0 0 0-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 0 0 7.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 0 1-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0 1 12 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z',
79
+ rewind:
80
+ 'M11 16.07V7.93c0-.81-.91-1.28-1.58-.82l-5.77 4.07c-.56.4-.56 1.24 0 1.63l5.77 4.07c.67.47 1.58 0 1.58-.81zm1.66-3.25 5.77 4.07c.66.47 1.58-.01 1.58-.82V7.93c0-.81-.91-1.28-1.58-.82l-5.77 4.07a1 1 0 0 0 0 1.64z',
81
+ search:
82
+ 'M15.5 14h-.79l-.28-.27a6.5 6.5 0 0 0 1.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 0 0-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 0 0 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z',
83
+ send: 'm3.4 20.4 17.45-7.48a1 1 0 0 0 0-1.84L3.4 3.6a.993.993 0 0 0-1.39.91L2 9.12c0 .5.37.93.87.99L17 12 2.87 13.88c-.5.07-.87.5-.87 1l.01 4.61c0 .71.73 1.2 1.39.91z',
84
+ settings:
85
+ 'M19.5 12c0-.23-.01-.45-.03-.68l1.86-1.41c.4-.3.51-.86.26-1.3l-1.87-3.23a.987.987 0 0 0-1.25-.42l-2.15.91c-.37-.26-.76-.49-1.17-.68l-.29-2.31c-.06-.5-.49-.88-.99-.88h-3.73c-.51 0-.94.38-1 .88l-.29 2.31c-.41.19-.8.42-1.17.68l-2.15-.91c-.46-.2-1-.02-1.25.42L2.41 8.62c-.25.44-.14.99.26 1.3l1.86 1.41a7.343 7.343 0 0 0 0 1.35l-1.86 1.41c-.4.3-.51.86-.26 1.3l1.87 3.23c.25.44.79.62 1.25.42l2.15-.91c.37.26.76.49 1.17.68l.29 2.31c.06.5.49.88.99.88h3.73c.5 0 .93-.38.99-.88l.29-2.31c.41-.19.8-.42 1.17-.68l2.15.91c.46.2 1 .02 1.25-.42l1.87-3.23c.25-.44.14-.99-.26-1.3l-1.86-1.41c.03-.23.04-.45.04-.68zm-7.46 3.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z',
86
+ share:
87
+ 'M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z',
88
+ shoppingCart:
89
+ 'M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 3c0 .55.45 1 1 1h1l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h11c.55 0 1-.45 1-1s-.45-1-1-1H7l1.1-2h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49A.996.996 0 0 0 20.01 4H5.21l-.67-1.43a.993.993 0 0 0-.9-.57H2c-.55 0-1 .45-1 1zm16 15c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z',
90
+ skipNext:
91
+ 'm7.58 16.89 5.77-4.07c.56-.4.56-1.24 0-1.63L7.58 7.11C6.91 6.65 6 7.12 6 7.93v8.14c0 .81.91 1.28 1.58.82zM16 7v10c0 .55.45 1 1 1s1-.45 1-1V7c0-.55-.45-1-1-1s-1 .45-1 1z',
92
+ skipPrevious:
93
+ 'M7 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zm3.66 6.82 5.77 4.07c.66.47 1.58-.01 1.58-.82V7.93c0-.81-.91-1.28-1.58-.82l-5.77 4.07a1 1 0 0 0 0 1.64z',
94
+ star: 'm12 17.27 4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4.72 3.67-3.18c.67-.58.31-1.68-.57-1.75l-4.83-.41-1.89-4.46c-.34-.81-1.5-.81-1.84 0L9.19 8.63l-4.83.41c-.88.07-1.24 1.17-.57 1.75l3.67 3.18-1.1 4.72c-.2.86.73 1.54 1.49 1.08l4.15-2.5z',
95
+ starHalf:
96
+ 'm19.65 9.04-4.84-.42-1.89-4.45c-.34-.81-1.5-.81-1.84 0L9.19 8.63l-4.83.41c-.88.07-1.24 1.17-.57 1.75l3.67 3.18-1.1 4.72c-.2.86.73 1.54 1.49 1.08l4.15-2.5 4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4.73 3.67-3.18c.67-.58.32-1.68-.56-1.75zM12 15.4V6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z',
97
+ starOff:
98
+ 'm19.65 9.04-4.84-.42-1.89-4.45c-.34-.81-1.5-.81-1.84 0L9.19 8.63l-4.83.41c-.88.07-1.24 1.17-.57 1.75l3.67 3.18-1.1 4.72c-.2.86.73 1.54 1.49 1.08l4.15-2.5 4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4.73 3.67-3.18c.67-.58.32-1.68-.56-1.75zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z',
99
+ stop: 'M8 6h8c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2H8c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2z',
100
+ upload:
101
+ 'M10 16h4c.55 0 1-.45 1-1v-5h1.59c.89 0 1.34-1.08.71-1.71L12.71 3.7a.996.996 0 0 0-1.41 0L6.71 8.29c-.63.63-.19 1.71.7 1.71H9v5c0 .55.45 1 1 1zm-4 2h12c.55 0 1 .45 1 1s-.45 1-1 1H6c-.55 0-1-.45-1-1s.45-1 1-1z',
102
+ visibility:
103
+ 'M12 4C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z',
104
+ visibilityOff:
105
+ 'M12 6.5c2.76 0 5 2.24 5 5 0 .51-.1 1-.24 1.46l3.06 3.06c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l2.17 2.17c.47-.14.96-.24 1.47-.24zM2.71 3.16a.996.996 0 0 0 0 1.41l1.97 1.97A11.892 11.892 0 0 0 1 11.5C2.73 15.89 7 19 12 19c1.52 0 2.97-.3 4.31-.82l2.72 2.72a.996.996 0 1 0 1.41-1.41L4.13 3.16c-.39-.39-1.03-.39-1.42 0zM12 16.5c-2.76 0-5-2.24-5-5 0-.77.18-1.5.49-2.14l1.57 1.57c-.03.18-.06.37-.06.57 0 1.66 1.34 3 3 3 .2 0 .38-.03.57-.07L14.14 16c-.65.32-1.37.5-2.14.5zm2.97-5.33a2.97 2.97 0 0 0-2.64-2.64l2.64 2.64z',
106
+ volumeDown:
107
+ 'M18.5 12A4.5 4.5 0 0 0 16 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 10v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71V6.41c0-.89-1.08-1.34-1.71-.71L9 9H6c-.55 0-1 .45-1 1z',
108
+ volumeMute:
109
+ 'M7 10v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71V6.41c0-.89-1.08-1.34-1.71-.71L11 9H8c-.55 0-1 .45-1 1z',
110
+ volumeOff:
111
+ 'M3.63 3.63a.996.996 0 0 0 0 1.41L7.29 8.7 7 9H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71v-4.17l4.18 4.18c-.49.37-1.02.68-1.6.91-.36.15-.58.53-.58.92 0 .72.73 1.18 1.39.91.8-.33 1.55-.77 2.22-1.31l1.34 1.34a.996.996 0 1 0 1.41-1.41L5.05 3.63c-.39-.39-1.02-.39-1.42 0zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-3.83-2.4-7.11-5.78-8.4-.59-.23-1.22.23-1.22.86v.19c0 .38.25.71.61.85C17.18 6.54 19 9.06 19 12zm-8.71-6.29-.17.17L12 7.76V6.41c0-.89-1.08-1.33-1.71-.7zM16.5 12A4.5 4.5 0 0 0 14 7.97v1.79l2.48 2.48c.01-.08.02-.16.02-.24z',
112
+ volumeUp:
113
+ 'M3 10v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71V6.41c0-.89-1.08-1.34-1.71-.71L7 9H4c-.55 0-1 .45-1 1zm13.5 2A4.5 4.5 0 0 0 14 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 4.45v.2c0 .38.25.71.6.85C17.18 6.53 19 9.06 19 12s-1.82 5.47-4.4 6.5c-.36.14-.6.47-.6.85v.2c0 .63.63 1.07 1.21.85C18.6 19.11 21 15.84 21 12s-2.4-7.11-5.79-8.4c-.58-.23-1.21.22-1.21.85z',
114
+ warning:
115
+ 'M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3zM12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1zm1 4h-2v-2h2v2z',
116
+ };
@@ -0,0 +1,24 @@
1
+ import type { ComponentType } from 'react';
2
+
3
+ import type { ComponentNode } from '@a2ui/web_core';
4
+
5
+ /**
6
+ * What a view of one of the basic catalog's components gets: what the agent wrote for it, with
7
+ * its bindings and functions worked out. A property the person can change, such as a TextField's
8
+ * `value`, comes with a setter named after it (`setValue`). A child is a node, drawn with
9
+ * `A2UIChild`, and children are a list of them.
10
+ */
11
+ export type A2UIComponentProps = {
12
+ /** The component where the agent placed it, for its id and its place in the data model. */
13
+ node: ComponentNode;
14
+ props: Record<string, unknown>;
15
+ };
16
+
17
+ /** Views of the basic catalog's components by their A2UI type, such as `Card`. */
18
+ export type A2UIComponents = Partial<Record<string, ComponentType<A2UIComponentProps>>>;
19
+
20
+ /** An icon an app draws for A2UI's Icon, in the color and at the size it is given. */
21
+ export type A2UIIcon = ComponentType<{ color: string; size: number }>;
22
+
23
+ /** The app's icons by the names A2UI's Icon takes, such as `shoppingCart`. */
24
+ export type A2UIIcons = Partial<Record<string, A2UIIcon>>;
@@ -0,0 +1,18 @@
1
+ // The A2UI renderer for the AI components' generated UI. Its own entry point, so an app whose
2
+ // agent never writes A2UI doesn't bundle the A2UI core.
3
+ export {
4
+ A2UI_DEFAULT_CATALOG_ID,
5
+ type A2UIError,
6
+ type A2UIRendererOptions,
7
+ createA2UIRenderer,
8
+ } from './A2UIRenderer';
9
+ export { A2UI_VERSION } from './A2UIStream';
10
+ export {
11
+ A2UI_PROTOCOL_OVERVIEW,
12
+ type A2UIInstructionsConfig,
13
+ A2UIInstructionsError,
14
+ } from './A2UIInstructions';
15
+ export { a2uiInstructions, a2uiProblems } from './instructions';
16
+ export { A2UIChild, A2UIChildren } from './A2UISurface';
17
+ export { A2UI_BASIC_COMPONENTS } from './components/basicComponents';
18
+ export type { A2UIComponentProps, A2UIComponents, A2UIIcon, A2UIIcons } from './components/types';
@@ -0,0 +1,341 @@
1
+ // What teaches an agent's model to write A2UI, and what checks what it is shown. It runs the
2
+ // A2UI core alone, without the renderer's views, so it runs in a script or a build too.
3
+ import {
4
+ Catalog,
5
+ type ComponentApi,
6
+ type FunctionImplementation,
7
+ getComponentReferences,
8
+ MAX_GLOBAL_DEPTH,
9
+ MessageProcessor,
10
+ RELAXED_VALIDATION,
11
+ } from '@a2ui/web_core';
12
+
13
+ import {
14
+ A2UI_PROTOCOL_OVERVIEW,
15
+ type A2UIInstructionsConfig,
16
+ A2UIInstructionsError,
17
+ blocksIn,
18
+ fenceOf,
19
+ sorted,
20
+ writing,
21
+ } from './A2UIInstructions';
22
+ import { A2UI_VERSION, a2uiMessagesIn, normalizeA2UIMessage } from './A2UIStream';
23
+ import { A2UI_DEFAULT_CATALOG_ID, a2uiAppCatalogDocument } from './catalogDocument';
24
+ import { basicCatalogDefinitions } from './catalogs';
25
+
26
+ import type { AIUIComponent } from '../ai-components/generative-ui/AIUIComponent';
27
+ import type { AIUIComponentDefinition } from '../ai-components/generative-ui/AIUIComponentDefinition';
28
+ import { isRecord } from '../ai-components/generative-ui/AIUIHelpers';
29
+
30
+ type Entry = ComponentApi;
31
+
32
+ const definitionOf = (component: AIUIComponent | AIUIComponentDefinition) =>
33
+ 'definition' in component ? component.definition : component;
34
+
35
+ /**
36
+ * The catalog an agent writes with: the basic catalog, or what `keep` names of it less what
37
+ * `removing` names, and the app's components.
38
+ */
39
+ export const a2uiCatalogFor = ({
40
+ catalogId = A2UI_DEFAULT_CATALOG_ID,
41
+ components = [],
42
+ keep,
43
+ removing,
44
+ tools = [],
45
+ }: Pick<
46
+ A2UIInstructionsConfig,
47
+ 'catalogId' | 'components' | 'keep' | 'removing' | 'tools'
48
+ > = {}): Catalog<Entry> => {
49
+ const basicCatalog = basicCatalogDefinitions();
50
+ const kept = keep && new Set(keep);
51
+ const removed = new Set(removing);
52
+ const ofBasic = (names: Iterable<string>) =>
53
+ [...names].filter((name) => (!kept || kept.has(name)) && !removed.has(name));
54
+ const definitions = components.map(definitionOf);
55
+ const app = definitions.length
56
+ ? [
57
+ ...Catalog.fromJson(
58
+ a2uiAppCatalogDocument(catalogId, definitions, { bindings: false }),
59
+ A2UI_VERSION,
60
+ ).components.values(),
61
+ ]
62
+ : [];
63
+ // The app's tools, as functions the agent can call from the UI, less one named like a function of
64
+ // the basic catalog, which comes first.
65
+ const usable = tools.filter(({ name }) => !basicCatalog.functions.has(name));
66
+ const toolFunctions = usable.length
67
+ ? [
68
+ ...Catalog.fromJson(
69
+ a2uiAppCatalogDocument(catalogId, [], { bindings: false, tools: usable }),
70
+ A2UI_VERSION,
71
+ ).functions.values(),
72
+ ]
73
+ : [];
74
+ // The catalog's guidelines, without its examples: they name the basic catalog rather than
75
+ // this one, and components `keep` may leave out.
76
+ const guidelines = basicCatalog.instructions?.split('\n## Examples')[0].trim();
77
+ return (basicCatalog as unknown as Catalog<Entry>).derive({
78
+ catalogId,
79
+ components: [...ofBasic(basicCatalog.components.keys()), ...app],
80
+ // Only described, never run: what the agent is told and what is checked needs no implementation.
81
+ functions: [
82
+ ...ofBasic(basicCatalog.functions.keys()),
83
+ ...(toolFunctions as unknown as FunctionImplementation[]),
84
+ ],
85
+ ...(guidelines ? { instructions: guidelines } : {}),
86
+ });
87
+ };
88
+
89
+ /**
90
+ * The instructions that teach an agent's model to write A2UI the app's renderer shows, in
91
+ * Markdown: how a reply carries its UI, the protocol, the catalog's guidelines and the catalog
92
+ * itself with the app's components, then what `config` adds. Throws an `A2UIInstructionsError`
93
+ * when an example would not render.
94
+ */
95
+ export const a2uiInstructionsText = (config: A2UIInstructionsConfig = {}) => {
96
+ const catalog = a2uiCatalogFor(config);
97
+ const fence = fenceOf(config.fence);
98
+ const broken = (config.examples ?? []).flatMap((example) =>
99
+ blocksIn(example, fence).flatMap((block) =>
100
+ a2uiProblemsWith(block, catalog).map((problem) => `example: ${problem}`),
101
+ ),
102
+ );
103
+ if (broken.length) throw new A2UIInstructionsError(broken);
104
+ const { instructions, ...document } = catalog.toJson() as Record<string, unknown>;
105
+ const { examples = [], notes = [], preamble, rules = [] } = config;
106
+ return [
107
+ ...(preamble ? [preamble] : []),
108
+ writing(fence, catalog.id),
109
+ A2UI_PROTOCOL_OVERVIEW,
110
+ ...(typeof instructions === 'string' && instructions ? [instructions] : []),
111
+ ...(notes.length ? [`## The app's components\n\n${notes.join('\n')}`] : []),
112
+ `## The catalog \`${catalog.id}\`\n\n\`\`\`json\n${JSON.stringify(sorted(document))}\n\`\`\``,
113
+ ...(rules.length
114
+ ? [`## Rules\n\n${rules.map((rule, index) => `${index + 1}. ${rule}`).join('\n')}`]
115
+ : []),
116
+ ...(examples.length ? [`## Examples\n\n${examples.join('\n\n')}`] : []),
117
+ ].join('\n\n');
118
+ };
119
+
120
+ type Components = Map<string, Record<string, unknown>>;
121
+
122
+ const MESSAGE_KINDS = [
123
+ 'createSurface',
124
+ 'updateComponents',
125
+ 'updateDataModel',
126
+ 'deleteSurface',
127
+ 'callRendererFunction',
128
+ 'agentFunctionResponse',
129
+ ];
130
+
131
+ const componentsOf = (value: unknown) => (Array.isArray(value) ? value.filter(isRecord) : []);
132
+
133
+ const duplicates = (components: Record<string, unknown>[], surfaceId: string) => {
134
+ const seen = new Set<unknown>();
135
+ const repeated = new Set<unknown>();
136
+ for (const { id } of components) {
137
+ if (seen.has(id)) repeated.add(id);
138
+ seen.add(id);
139
+ }
140
+ return [...repeated].map(
141
+ (id) => `surface ${surfaceId} defines ${String(id)} more than once in one message`,
142
+ );
143
+ };
144
+
145
+ /**
146
+ * What is wrong with the A2UI messages of `text` for a renderer with `catalog`, or nothing
147
+ * when they render as written: messages it can't read, components it doesn't have or that don't
148
+ * fit their schemas, and references that lead nowhere, with each component checked against its
149
+ * schema by the A2UI core as a renderer checks it.
150
+ */
151
+ export const a2uiProblemsWith = (text: string, catalog: Catalog<Entry>) => {
152
+ const problems: string[] = [];
153
+ const surfaces = new Map<string, Components>();
154
+ let created = false;
155
+ for (const raw of a2uiMessagesIn(text)) {
156
+ let json: unknown;
157
+ try {
158
+ json = JSON.parse(raw);
159
+ } catch {
160
+ json = undefined;
161
+ }
162
+ if (!isRecord(json)) {
163
+ problems.push(`this isn't JSON: ${raw.slice(0, 80)}`);
164
+ continue;
165
+ }
166
+ const message = normalizeA2UIMessage(json, catalog.id);
167
+ const kind = MESSAGE_KINDS.find((name) => name in message);
168
+ const body = kind ? message[kind] : undefined;
169
+ const surfaceId = isRecord(body) ? body.surfaceId : undefined;
170
+ if (!kind) {
171
+ problems.push(`this isn't an A2UI message: ${raw.slice(0, 80)}`);
172
+ } else if (kind === 'callRendererFunction' || kind === 'agentFunctionResponse') {
173
+ problems.push("a reply's UI calls no functions");
174
+ } else if (typeof surfaceId !== 'string' || !isRecord(body)) {
175
+ problems.push(`a ${kind} names no surfaceId`);
176
+ } else if (kind === 'createSurface') {
177
+ if (surfaces.has(surfaceId)) {
178
+ problems.push(
179
+ `surface ${surfaceId} is created again: delete it first, or change it with updateComponents and updateDataModel`,
180
+ );
181
+ continue;
182
+ }
183
+ created = true;
184
+ const components = componentsOf(body.components);
185
+ problems.push(...duplicates(components, surfaceId));
186
+ if (typeof body.catalogId === 'string' && body.catalogId !== catalog.id) {
187
+ problems.push(
188
+ `surface ${surfaceId} names the catalog ${body.catalogId}, not ${catalog.id}`,
189
+ );
190
+ }
191
+ surfaces.set(
192
+ surfaceId,
193
+ new Map(components.map((component) => [String(component.id), component])),
194
+ );
195
+ } else if (kind === 'updateComponents') {
196
+ const kept = surfaces.get(surfaceId);
197
+ if (!kept) {
198
+ problems.push(`surface ${surfaceId} gets components before it is created`);
199
+ continue;
200
+ }
201
+ const components = componentsOf(body.components);
202
+ problems.push(...duplicates(components, surfaceId));
203
+ for (const component of components) kept.set(String(component.id), component);
204
+ } else if (kind === 'updateDataModel' && !surfaces.has(surfaceId)) {
205
+ problems.push(`surface ${surfaceId} gets data before it is created`);
206
+ } else if (kind === 'deleteSurface') {
207
+ // What a deleted surface held never shows; its id may be created again.
208
+ surfaces.delete(surfaceId);
209
+ }
210
+ }
211
+ if (!created) problems.push('nothing renders: there is no createSurface');
212
+ for (const [surfaceId, components] of surfaces) {
213
+ problems.push(...surfaceProblems(components, surfaceId, catalog));
214
+ }
215
+ return problems;
216
+ };
217
+
218
+ // Each component checked against its schema, by the A2UI core as a renderer checks it, then
219
+ // what the surface's components make together.
220
+ const surfaceProblems = (components: Components, surfaceId: string, catalog: Catalog<Entry>) => {
221
+ const problems: string[] = [];
222
+ const processor = new MessageProcessor([catalog], undefined, {
223
+ reportErrorsOnly: true,
224
+ });
225
+ const config = { ...RELAXED_VALIDATION, allowUnknownElements: false };
226
+ processor.processMessagesWithErrors(
227
+ {
228
+ createSurface: { catalogId: catalog.id, surfaceId: 'lint' },
229
+ version: A2UI_VERSION,
230
+ },
231
+ { validationConfig: config },
232
+ );
233
+ const references = new Map<string, string[]>();
234
+ const ids = [...components.keys()].sort();
235
+ for (const id of ids) {
236
+ const component = components.get(id) as Record<string, unknown>;
237
+ const errors = processor.processMessagesWithErrors(
238
+ {
239
+ updateComponents: { components: [component], surfaceId: 'lint' },
240
+ version: A2UI_VERSION,
241
+ },
242
+ { validationConfig: config },
243
+ );
244
+ // A cycle is told once, with the depth, below.
245
+ for (const { error } of errors) {
246
+ if (error.code === 'RECURSION_LIMIT_EXCEEDED') continue;
247
+ problems.push(`${id}: ${String(error.message)}`);
248
+ }
249
+ let children: string[] = [];
250
+ try {
251
+ children = [...getComponentReferences(component, catalog)].map(([child]) => child);
252
+ } catch {
253
+ children = [];
254
+ }
255
+ references.set(id, children);
256
+ }
257
+ for (const [id, children] of references) {
258
+ for (const child of children) {
259
+ if (!components.has(child)) problems.push(`${id} holds ${child}, which is not defined`);
260
+ }
261
+ }
262
+ if (!components.has('root')) {
263
+ return [...problems, `surface ${surfaceId} has no component with the id root`];
264
+ }
265
+ const reached = new Set<string>();
266
+ const next = ['root'];
267
+ while (next.length) {
268
+ const id = next.pop() as string;
269
+ if (reached.has(id)) continue;
270
+ reached.add(id);
271
+ next.push(...(references.get(id) ?? []));
272
+ }
273
+ for (const id of ids) {
274
+ if (!reached.has(id)) problems.push(`${id} is defined but nothing holds it`);
275
+ }
276
+ return [...problems, ...nestingProblems(references, surfaceId)];
277
+ };
278
+
279
+ // A component that holds itself, directly or through others, never finishes rendering, and a
280
+ // renderer stops at MAX_GLOBAL_DEPTH levels.
281
+ const nestingProblems = (references: Map<string, string[]>, surfaceId: string) => {
282
+ const problems: string[] = [];
283
+ const depths = new Map<string, number>();
284
+ const visiting = new Set<string>();
285
+ let reportedCycle = false;
286
+ const depthOf = (id: string): number => {
287
+ const known = depths.get(id);
288
+ if (known !== undefined) return known;
289
+ if (visiting.has(id)) {
290
+ if (!reportedCycle) {
291
+ problems.push(`${id} holds itself through its children, so it never finishes rendering`);
292
+ reportedCycle = true;
293
+ }
294
+ return 0;
295
+ }
296
+ visiting.add(id);
297
+ const deepest = Math.max(
298
+ 0,
299
+ ...(references.get(id) ?? []).filter((child) => references.has(child)).map(depthOf),
300
+ );
301
+ visiting.delete(id);
302
+ depths.set(id, deepest + 1);
303
+ return deepest + 1;
304
+ };
305
+ if (references.has('root') && depthOf('root') > MAX_GLOBAL_DEPTH) {
306
+ problems.push(`surface ${surfaceId} nests components deeper than ${MAX_GLOBAL_DEPTH} levels`);
307
+ }
308
+ for (const id of [...references.keys()].sort()) depthOf(id);
309
+ return problems;
310
+ };
311
+
312
+ /** What is wrong with the A2UI messages of `text` for the catalog `config` makes, or nothing. */
313
+ export const a2uiProblemsIn = (
314
+ text: string,
315
+ config: Pick<
316
+ A2UIInstructionsConfig,
317
+ 'catalogId' | 'components' | 'keep' | 'removing' | 'tools'
318
+ > = {},
319
+ ) => a2uiProblemsWith(text, a2uiCatalogFor(config));
320
+
321
+ /**
322
+ * The instructions that teach an agent's model to write A2UI with the basic catalog and the
323
+ * app's components, in Markdown, from the A2UI core's own catalog. Give them to the agent's
324
+ * backend, as the part of its instructions about UI. It runs in a script or
325
+ * a build too, and rejects with an `A2UIInstructionsError` when an example would not render.
326
+ */
327
+ export const a2uiInstructions = (config: A2UIInstructionsConfig = {}) =>
328
+ new Promise<string>((resolve) => resolve(a2uiInstructionsText(config)));
329
+
330
+ /**
331
+ * What is wrong with the A2UI messages of `text`, such as an agent's example, for the catalog
332
+ * `config` makes, or nothing when they render as written: messages the renderer can't read,
333
+ * components it doesn't have or that don't fit their schemas, and references that lead nowhere.
334
+ */
335
+ export const a2uiProblems = (
336
+ text: string,
337
+ config: Pick<
338
+ A2UIInstructionsConfig,
339
+ 'catalogId' | 'components' | 'keep' | 'removing' | 'tools'
340
+ > = {},
341
+ ) => new Promise<string[]>((resolve) => resolve(a2uiProblemsIn(text, config)));
@@ -0,0 +1,154 @@
1
+ import type { ComponentApi, SurfaceModel } from '@a2ui/web_core';
2
+
3
+ import { isRecord } from '../ai-components/generative-ui/AIUIHelpers';
4
+
5
+ /**
6
+ * `value` without the person's secrets, such as a password they typed into an obscured TextField:
7
+ * each string that holds one has it cut out, wherever it is, so none reaches the agent.
8
+ */
9
+ export const withoutSecrets = <T>(value: T, secrets: readonly string[]): T => {
10
+ const known = secrets.filter((secret) => secret !== '');
11
+ if (known.length === 0) return value;
12
+ const clean = (item: unknown): unknown => {
13
+ if (typeof item === 'string') {
14
+ return known.reduce((text, secret) => text.split(secret).join(''), item);
15
+ }
16
+ if (Array.isArray(item)) return item.map(clean);
17
+ if (isRecord(item)) {
18
+ return Object.fromEntries(Object.entries(item).map(([key, entry]) => [key, clean(entry)]));
19
+ }
20
+ return item;
21
+ };
22
+ return clean(value) as T;
23
+ };
24
+
25
+ const resolvedPath = (base: string, path: string) => {
26
+ if (path.startsWith('/')) return path;
27
+ const parent = base === '/' ? '' : base.replace(/\/$/, '');
28
+ return path === '' || path === '.' ? parent || '/' : `${parent}/${path}`;
29
+ };
30
+
31
+ const placesOf = (surface: SurfaceModel<ComponentApi>) => {
32
+ const places: Array<{ dataPath: string; id: string }> = [];
33
+ const seen = new Set<string>();
34
+ const visit = (id: string, dataPath: string) => {
35
+ const key = `${id}\u0000${dataPath}`;
36
+ const component = surface.componentsModel.get(id);
37
+ if (!component || seen.has(key)) return;
38
+ seen.add(key);
39
+ places.push({ dataPath, id });
40
+ const children = (value: unknown): void => {
41
+ if (typeof value === 'string') return visit(value, dataPath);
42
+ if (Array.isArray(value)) return value.forEach(children);
43
+ if (!isRecord(value)) return;
44
+ const { componentId, path } = value;
45
+ if (typeof componentId === 'string' && typeof path === 'string') {
46
+ const listPath = resolvedPath(dataPath, path);
47
+ const items: unknown = surface.dataModel.get(listPath);
48
+ if (Array.isArray(items)) {
49
+ items.forEach((_, index) => visit(componentId, resolvedPath(listPath, `${index}`)));
50
+ }
51
+ return;
52
+ }
53
+ Object.values(value).forEach(children);
54
+ };
55
+ Object.values(component.properties as Record<string, unknown>).forEach(children);
56
+ };
57
+ visit(surface.rootId, '/');
58
+ for (const component of surface.componentsModel.values) {
59
+ if (!places.some(({ id }) => id === component.id)) visit(component.id, '/');
60
+ }
61
+ return places;
62
+ };
63
+
64
+ // The paths each surface's obscured fields write, as they resolved when they showed: inside a
65
+ // list, or with a variant bound to the data model, the components alone don't tell.
66
+ const shownSecretPaths = new WeakMap<object, Set<string>>();
67
+
68
+ /** Keeps what is written at `path` of `surface`'s data model from the agent, such as a password. */
69
+ export const keepSecretPath = (surface: SurfaceModel<ComponentApi>, path: string) => {
70
+ let paths = shownSecretPaths.get(surface);
71
+ if (!paths) {
72
+ paths = new Set();
73
+ shownSecretPaths.set(surface, paths);
74
+ }
75
+ paths.add(path);
76
+ };
77
+
78
+ /**
79
+ * The data model paths a surface's obscured TextFields write, such as a password's: those its
80
+ * components name, whether or not they show, and those of the ones that showed.
81
+ */
82
+ export const secretPathsOf = (surface: SurfaceModel<ComponentApi> | undefined) => {
83
+ if (!surface) return [];
84
+ const paths = new Set(shownSecretPaths.get(surface));
85
+ for (const { dataPath, id } of placesOf(surface)) {
86
+ const component = surface.componentsModel.get(id);
87
+ const { value, variant } = (component?.properties ?? {}) as Record<string, unknown>;
88
+ if (component?.type !== 'TextField' || variant !== 'obscured' || !isRecord(value)) continue;
89
+ const path = value['@path'];
90
+ if (typeof path === 'string') paths.add(resolvedPath(dataPath, path));
91
+ }
92
+ return [...paths];
93
+ };
94
+
95
+ /** What the person typed into a surface's obscured TextFields. */
96
+ export const secretValuesOf = (surface: SurfaceModel<ComponentApi> | undefined): string[] =>
97
+ secretPathsOf(surface).flatMap((path) => {
98
+ const value: unknown = surface?.dataModel.get(path);
99
+ return typeof value === 'string' && value !== '' ? [value] : [];
100
+ });
101
+
102
+ /** The keys of an action's context the agent bound to one of the surface's obscured fields. */
103
+ export const secretContextKeysOf = (
104
+ surface: SurfaceModel<ComponentApi> | undefined,
105
+ sourceComponentId: string,
106
+ ) => {
107
+ const secretPaths = secretPathsOf(surface);
108
+ const action: unknown = surface?.componentsModel.get(sourceComponentId)?.properties.action;
109
+ const context = isRecord(action) && isRecord(action.event) ? action.event.context : undefined;
110
+ if (!isRecord(context) || !surface) return [];
111
+ const dataPaths = placesOf(surface)
112
+ .filter(({ id }) => id === sourceComponentId)
113
+ .map(({ dataPath }) => dataPath);
114
+ return Object.entries(context).flatMap(([key, value]) => {
115
+ const path = isRecord(value) ? value['@path'] : undefined;
116
+ if (typeof path !== 'string') return [];
117
+ return dataPaths.some((dataPath) => {
118
+ const bound = resolvedPath(dataPath, path);
119
+ return secretPaths.some((secret) => bound === secret || bound.startsWith(`${secret}/`));
120
+ })
121
+ ? [key]
122
+ : [];
123
+ });
124
+ };
125
+
126
+ const unescape = (segment: string) => segment.replace(/~1/g, '/').replace(/~0/g, '~');
127
+
128
+ /** `value` without what is at each of `paths`, JSON Pointers such as `/account/password`. */
129
+ export const withoutPaths = (value: unknown, paths: Iterable<string>): unknown => {
130
+ let result = value;
131
+ for (const path of paths) {
132
+ const segments = path.split('/').slice(1).map(unescape);
133
+ if (segments.length === 0) return undefined;
134
+ const remove = (node: unknown, index: number): unknown => {
135
+ const key = segments[index];
136
+ const last = index === segments.length - 1;
137
+ if (Array.isArray(node)) {
138
+ const at = Number(key);
139
+ if (!Number.isInteger(at) || at < 0 || at >= node.length) return node;
140
+ return last
141
+ ? node.filter((_, position) => position !== at)
142
+ : node.map((item, position) => (position === at ? remove(item, index + 1) : item));
143
+ }
144
+ if (!isRecord(node) || !(key in node)) return node;
145
+ if (last) {
146
+ const { [key]: _removed, ...rest } = node;
147
+ return rest;
148
+ }
149
+ return { ...node, [key]: remove(node[key], index + 1) };
150
+ };
151
+ result = remove(result, 0);
152
+ }
153
+ return result;
154
+ };