stream-chat-react-native-core 9.12.1 → 9.13.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.
- package/a2ui/package.json +6 -0
- package/lib/commonjs/a11y/a11yUtils.js.map +1 -1
- package/lib/commonjs/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -1
- package/lib/commonjs/a2ui/A2UIContexts.js +8 -0
- package/lib/commonjs/a2ui/A2UIContexts.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIInstructions.js +49 -0
- package/lib/commonjs/a2ui/A2UIInstructions.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIPlaceholder.js +37 -0
- package/lib/commonjs/a2ui/A2UIPlaceholder.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIRenderer.js +363 -0
- package/lib/commonjs/a2ui/A2UIRenderer.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIStream.js +91 -0
- package/lib/commonjs/a2ui/A2UIStream.js.map +1 -0
- package/lib/commonjs/a2ui/A2UISurface.js +212 -0
- package/lib/commonjs/a2ui/A2UISurface.js.map +1 -0
- package/lib/commonjs/a2ui/basicCatalog.json +1206 -0
- package/lib/commonjs/a2ui/basicFunctions.js +398 -0
- package/lib/commonjs/a2ui/basicFunctions.js.map +1 -0
- package/lib/commonjs/a2ui/catalogDocument.js +80 -0
- package/lib/commonjs/a2ui/catalogDocument.js.map +1 -0
- package/lib/commonjs/a2ui/catalogs.js +105 -0
- package/lib/commonjs/a2ui/catalogs.js.map +1 -0
- package/lib/commonjs/a2ui/components/DateTimeInput.js +445 -0
- package/lib/commonjs/a2ui/components/DateTimeInput.js.map +1 -0
- package/lib/commonjs/a2ui/components/Media.js +316 -0
- package/lib/commonjs/a2ui/components/Media.js.map +1 -0
- package/lib/commonjs/a2ui/components/basicComponents.js +975 -0
- package/lib/commonjs/a2ui/components/basicComponents.js.map +1 -0
- package/lib/commonjs/a2ui/components/iconPaths.js +66 -0
- package/lib/commonjs/a2ui/components/iconPaths.js.map +1 -0
- package/lib/commonjs/a2ui/components/types.js +4 -0
- package/lib/commonjs/a2ui/components/types.js.map +1 -0
- package/lib/commonjs/a2ui/index.js +70 -0
- package/lib/commonjs/a2ui/index.js.map +1 -0
- package/lib/commonjs/a2ui/instructions.js +268 -0
- package/lib/commonjs/a2ui/instructions.js.map +1 -0
- package/lib/commonjs/a2ui/secrets.js +169 -0
- package/lib/commonjs/a2ui/secrets.js.map +1 -0
- package/lib/commonjs/a2ui/useReplyState.js +35 -0
- package/lib/commonjs/a2ui/useReplyState.js.map +1 -0
- package/lib/commonjs/ai-components/AITypingIndicatorView.js +8 -18
- package/lib/commonjs/ai-components/AITypingIndicatorView.js.map +1 -1
- package/lib/commonjs/ai-components/README.md +55 -3
- package/lib/commonjs/ai-components/StreamingMessageView.js +26 -0
- package/lib/commonjs/ai-components/StreamingMessageView.js.map +1 -1
- package/lib/commonjs/ai-components/charts/components/PieLegend.js +2 -1
- package/lib/commonjs/ai-components/charts/components/PieLegend.js.map +1 -1
- package/lib/commonjs/ai-components/charts/components/VictoryChart.js +7 -2
- package/lib/commonjs/ai-components/charts/components/VictoryChart.js.map +1 -1
- package/lib/commonjs/ai-components/charts/utils/format-time-label.js +15 -0
- package/lib/commonjs/ai-components/charts/utils/format-time-label.js.map +1 -0
- package/lib/commonjs/ai-components/charts/vega-lite/schema.js +17 -2
- package/lib/commonjs/ai-components/charts/vega-lite/schema.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/composer-context.js +13 -6
- package/lib/commonjs/ai-components/contexts/composer-context.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/index.js +11 -0
- package/lib/commonjs/ai-components/contexts/index.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/theme-context.js +33 -2
- package/lib/commonjs/ai-components/contexts/theme-context.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/translation-context.js +29 -0
- package/lib/commonjs/ai-components/contexts/translation-context.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/AIConversation.js +366 -0
- package/lib/commonjs/ai-components/conversation/AIConversation.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/AIAgentError.js +13 -0
- package/lib/commonjs/ai-components/conversation/controller/AIAgentError.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/AIConversationController.js +425 -0
- package/lib/commonjs/ai-components/conversation/controller/AIConversationController.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/AIConversationExchange.js +89 -0
- package/lib/commonjs/ai-components/conversation/controller/AIConversationExchange.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/index.js +48 -0
- package/lib/commonjs/ai-components/conversation/controller/index.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/offers.js +29 -0
- package/lib/commonjs/ai-components/conversation/controller/offers.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/types.js +13 -0
- package/lib/commonjs/ai-components/conversation/controller/types.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/useAIConversationState.js +8 -0
- package/lib/commonjs/ai-components/conversation/controller/useAIConversationState.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/entries.js +98 -0
- package/lib/commonjs/ai-components/conversation/entries.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/fromStreamMessage.js +66 -0
- package/lib/commonjs/ai-components/conversation/fromStreamMessage.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/index.js +48 -0
- package/lib/commonjs/ai-components/conversation/index.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/AIChatList.js +224 -0
- package/lib/commonjs/ai-components/conversation/list/AIChatList.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useChatListController.js +78 -0
- package/lib/commonjs/ai-components/conversation/list/useChatListController.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useEndInView.js +51 -0
- package/lib/commonjs/ai-components/conversation/list/useEndInView.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useKeyboardOverlap.js +54 -0
- package/lib/commonjs/ai-components/conversation/list/useKeyboardOverlap.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useLoadOlder.js +73 -0
- package/lib/commonjs/ai-components/conversation/list/useLoadOlder.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/usePinnedAnchor.js +84 -0
- package/lib/commonjs/ai-components/conversation/list/usePinnedAnchor.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/types.js +4 -0
- package/lib/commonjs/ai-components/conversation/types.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/useConversationRows.js +117 -0
- package/lib/commonjs/ai-components/conversation/useConversationRows.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIAction.js +30 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIAction.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIArguments.js +128 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIArguments.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponent.js +50 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponent.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponentDefinition.js +134 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponentDefinition.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIDocument.js +32 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIDocument.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIEntrance.js +193 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIEntrance.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIErrorBoundary.js +30 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIErrorBoundary.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHelpers.js +54 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHelpers.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHost.js +259 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHost.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIMedia.js +24 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIMedia.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIRenderer.js +10 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIRenderer.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIView.js +57 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIView.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/index.js +181 -0
- package/lib/commonjs/ai-components/generative-ui/index.js.map +1 -0
- package/lib/commonjs/ai-components/icons.js +44 -0
- package/lib/commonjs/ai-components/icons.js.map +1 -0
- package/lib/commonjs/ai-components/index.js +96 -0
- package/lib/commonjs/ai-components/index.js.map +1 -1
- package/lib/commonjs/ai-components/internal/Shimmer.js +36 -0
- package/lib/commonjs/ai-components/internal/Shimmer.js.map +1 -0
- package/lib/commonjs/ai-components/internal/format.js +66 -0
- package/lib/commonjs/ai-components/internal/format.js.map +1 -0
- package/lib/commonjs/ai-components/internal/hooks/useBottomSafeArea.js +12 -0
- package/lib/commonjs/ai-components/internal/hooks/useBottomSafeArea.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/AgentIcons.js +74 -0
- package/lib/commonjs/ai-components/internal/icons/AgentIcons.js.map +1 -0
- package/lib/commonjs/ai-components/internal/tokens.js +11 -0
- package/lib/commonjs/ai-components/internal/tokens.js.map +1 -0
- package/lib/commonjs/ai-components/internal/uuid.js +21 -0
- package/lib/commonjs/ai-components/internal/uuid.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/CodeBlock.js +4 -2
- package/lib/commonjs/ai-components/markdown/components/CodeBlock.js.map +1 -1
- package/lib/commonjs/ai-components/markdown/components/InlineCode.js +1 -0
- package/lib/commonjs/ai-components/markdown/components/InlineCode.js.map +1 -1
- package/lib/commonjs/ai-components/markdown/components/Text.js +11 -2
- package/lib/commonjs/ai-components/markdown/components/Text.js.map +1 -1
- package/lib/commonjs/ai-components/markdown/styles.js +27 -29
- package/lib/commonjs/ai-components/markdown/styles.js.map +1 -1
- package/lib/commonjs/ai-components/message/AIAssistantMessage.js +63 -0
- package/lib/commonjs/ai-components/message/AIAssistantMessage.js.map +1 -0
- package/lib/commonjs/ai-components/message/AIMessageAttachment.js +189 -0
- package/lib/commonjs/ai-components/message/AIMessageAttachment.js.map +1 -0
- package/lib/commonjs/ai-components/message/AIReplyActions.js +132 -0
- package/lib/commonjs/ai-components/message/AIReplyActions.js.map +1 -0
- package/lib/commonjs/ai-components/message/AIUserMessage.js +104 -0
- package/lib/commonjs/ai-components/message/AIUserMessage.js.map +1 -0
- package/lib/commonjs/ai-components/message/UserMessageMenu.js +150 -0
- package/lib/commonjs/ai-components/message/UserMessageMenu.js.map +1 -0
- package/lib/commonjs/ai-components/message/index.js +48 -0
- package/lib/commonjs/ai-components/message/index.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ActionButton.js +2 -1
- package/lib/commonjs/ai-components/message-composer/ActionButton.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/ActionSheet.js +22 -6
- package/lib/commonjs/ai-components/message-composer/ActionSheet.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/AttachmentButton.js +5 -1
- package/lib/commonjs/ai-components/message-composer/AttachmentButton.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/ChatOptions.js +147 -0
- package/lib/commonjs/ai-components/message-composer/ChatOptions.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ComposerView.js +136 -20
- package/lib/commonjs/ai-components/message-composer/ComposerView.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/EditingMessageChip.js +80 -0
- package/lib/commonjs/ai-components/message-composer/EditingMessageChip.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js +26 -1
- package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/index.js +11 -0
- package/lib/commonjs/ai-components/message-composer/index.js.map +1 -1
- package/lib/commonjs/ai-components/message-parts/AIMessageParts.js +110 -0
- package/lib/commonjs/ai-components/message-parts/AIMessageParts.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/AIToolApproval.js +197 -0
- package/lib/commonjs/ai-components/message-parts/AIToolApproval.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/AIToolAuthorization.js +250 -0
- package/lib/commonjs/ai-components/message-parts/AIToolAuthorization.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/AIToolCall.js +159 -0
- package/lib/commonjs/ai-components/message-parts/AIToolCall.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/callStates.js +54 -0
- package/lib/commonjs/ai-components/message-parts/callStates.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/index.js +70 -0
- package/lib/commonjs/ai-components/message-parts/index.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/parseMessageParts.js +126 -0
- package/lib/commonjs/ai-components/message-parts/parseMessageParts.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/types.js +2 -0
- package/lib/commonjs/ai-components/message-parts/types.js.map +1 -0
- package/lib/commonjs/ai-components/native-specs/NativeAIAgent.js +7 -0
- package/lib/commonjs/ai-components/native-specs/NativeAIAgent.js.map +1 -0
- package/lib/commonjs/ai-components/reasoning/AIReasoning.js +401 -0
- package/lib/commonjs/ai-components/reasoning/AIReasoning.js.map +1 -0
- package/lib/commonjs/ai-components/reasoning/index.js +26 -0
- package/lib/commonjs/ai-components/reasoning/index.js.map +1 -0
- package/lib/commonjs/ai-components/reasoning/thinkingClock.js +63 -0
- package/lib/commonjs/ai-components/reasoning/thinkingClock.js.map +1 -0
- package/lib/commonjs/ai-components/services/clipboard-service/expo.js +7 -2
- package/lib/commonjs/ai-components/services/clipboard-service/expo.js.map +1 -1
- package/lib/commonjs/ai-components/store/composer/store.js.map +1 -1
- package/lib/commonjs/ai-components/store/composer/useComposerChatOption.js +18 -0
- package/lib/commonjs/ai-components/store/composer/useComposerChatOption.js.map +1 -0
- package/lib/commonjs/ai-components/store/composer/useComposerIsEditing.js +18 -0
- package/lib/commonjs/ai-components/store/composer/useComposerIsEditing.js.map +1 -0
- package/lib/commonjs/ai-components/store/index.js +22 -0
- package/lib/commonjs/ai-components/store/index.js.map +1 -1
- package/lib/commonjs/ai-components/suggestions/AISuggestions.js +66 -0
- package/lib/commonjs/ai-components/suggestions/AISuggestions.js.map +1 -0
- package/lib/commonjs/ai-components/suggestions/index.js +15 -0
- package/lib/commonjs/ai-components/suggestions/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js +2 -1
- package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -1
- package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js +3 -2
- package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js.map +1 -1
- package/lib/commonjs/ai-components/theme.js +137 -1
- package/lib/commonjs/ai-components/theme.js.map +1 -1
- package/lib/commonjs/ai-components/tool-calls/AIClientIdentity.js +22 -0
- package/lib/commonjs/ai-components/tool-calls/AIClientIdentity.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/AIClientToolRunner.js +109 -0
- package/lib/commonjs/ai-components/tool-calls/AIClientToolRunner.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/AIToolApprover.js +23 -0
- package/lib/commonjs/ai-components/tool-calls/AIToolApprover.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/authSessionAuthorizer.js +88 -0
- package/lib/commonjs/ai-components/tool-calls/authSessionAuthorizer.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/index.js +48 -0
- package/lib/commonjs/ai-components/tool-calls/index.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/glowShader.js.map +1 -1
- package/lib/commonjs/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/utils/renderText.js.map +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +2 -2
- package/lib/commonjs/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/commonjs/i18n/ar.json +39 -1
- package/lib/commonjs/i18n/en.json +39 -1
- package/lib/commonjs/i18n/es.json +39 -1
- package/lib/commonjs/i18n/fr.json +39 -1
- package/lib/commonjs/i18n/he.json +39 -1
- package/lib/commonjs/i18n/hi.json +39 -1
- package/lib/commonjs/i18n/it.json +39 -1
- package/lib/commonjs/i18n/ja.json +39 -1
- package/lib/commonjs/i18n/ko.json +39 -1
- package/lib/commonjs/i18n/nl.json +39 -1
- package/lib/commonjs/i18n/pt-br.json +39 -1
- package/lib/commonjs/i18n/ru.json +39 -1
- package/lib/commonjs/i18n/tr.json +39 -1
- package/lib/commonjs/mock-builders/a2ui/ohrid.js +84 -0
- package/lib/commonjs/mock-builders/a2ui/ohrid.js.map +1 -0
- package/lib/commonjs/utils/i18n/Streami18n.js +9 -4
- package/lib/commonjs/utils/i18n/Streami18n.js.map +1 -1
- package/lib/commonjs/utils/i18n/utils.js +7 -0
- package/lib/commonjs/utils/i18n/utils.js.map +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/a11y/a11yUtils.js.map +1 -1
- package/lib/module/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -1
- package/lib/module/a2ui/A2UIContexts.js +8 -0
- package/lib/module/a2ui/A2UIContexts.js.map +1 -0
- package/lib/module/a2ui/A2UIInstructions.js +49 -0
- package/lib/module/a2ui/A2UIInstructions.js.map +1 -0
- package/lib/module/a2ui/A2UIPlaceholder.js +37 -0
- package/lib/module/a2ui/A2UIPlaceholder.js.map +1 -0
- package/lib/module/a2ui/A2UIRenderer.js +363 -0
- package/lib/module/a2ui/A2UIRenderer.js.map +1 -0
- package/lib/module/a2ui/A2UIStream.js +91 -0
- package/lib/module/a2ui/A2UIStream.js.map +1 -0
- package/lib/module/a2ui/A2UISurface.js +212 -0
- package/lib/module/a2ui/A2UISurface.js.map +1 -0
- package/lib/module/a2ui/basicCatalog.json +1206 -0
- package/lib/module/a2ui/basicFunctions.js +398 -0
- package/lib/module/a2ui/basicFunctions.js.map +1 -0
- package/lib/module/a2ui/catalogDocument.js +80 -0
- package/lib/module/a2ui/catalogDocument.js.map +1 -0
- package/lib/module/a2ui/catalogs.js +105 -0
- package/lib/module/a2ui/catalogs.js.map +1 -0
- package/lib/module/a2ui/components/DateTimeInput.js +445 -0
- package/lib/module/a2ui/components/DateTimeInput.js.map +1 -0
- package/lib/module/a2ui/components/Media.js +316 -0
- package/lib/module/a2ui/components/Media.js.map +1 -0
- package/lib/module/a2ui/components/basicComponents.js +975 -0
- package/lib/module/a2ui/components/basicComponents.js.map +1 -0
- package/lib/module/a2ui/components/iconPaths.js +66 -0
- package/lib/module/a2ui/components/iconPaths.js.map +1 -0
- package/lib/module/a2ui/components/types.js +4 -0
- package/lib/module/a2ui/components/types.js.map +1 -0
- package/lib/module/a2ui/index.js +70 -0
- package/lib/module/a2ui/index.js.map +1 -0
- package/lib/module/a2ui/instructions.js +268 -0
- package/lib/module/a2ui/instructions.js.map +1 -0
- package/lib/module/a2ui/secrets.js +169 -0
- package/lib/module/a2ui/secrets.js.map +1 -0
- package/lib/module/a2ui/useReplyState.js +35 -0
- package/lib/module/a2ui/useReplyState.js.map +1 -0
- package/lib/module/ai-components/AITypingIndicatorView.js +8 -18
- package/lib/module/ai-components/AITypingIndicatorView.js.map +1 -1
- package/lib/module/ai-components/README.md +55 -3
- package/lib/module/ai-components/StreamingMessageView.js +26 -0
- package/lib/module/ai-components/StreamingMessageView.js.map +1 -1
- package/lib/module/ai-components/charts/components/PieLegend.js +2 -1
- package/lib/module/ai-components/charts/components/PieLegend.js.map +1 -1
- package/lib/module/ai-components/charts/components/VictoryChart.js +7 -2
- package/lib/module/ai-components/charts/components/VictoryChart.js.map +1 -1
- package/lib/module/ai-components/charts/utils/format-time-label.js +15 -0
- package/lib/module/ai-components/charts/utils/format-time-label.js.map +1 -0
- package/lib/module/ai-components/charts/vega-lite/schema.js +17 -2
- package/lib/module/ai-components/charts/vega-lite/schema.js.map +1 -1
- package/lib/module/ai-components/contexts/composer-context.js +13 -6
- package/lib/module/ai-components/contexts/composer-context.js.map +1 -1
- package/lib/module/ai-components/contexts/index.js +11 -0
- package/lib/module/ai-components/contexts/index.js.map +1 -1
- package/lib/module/ai-components/contexts/theme-context.js +33 -2
- package/lib/module/ai-components/contexts/theme-context.js.map +1 -1
- package/lib/module/ai-components/contexts/translation-context.js +29 -0
- package/lib/module/ai-components/contexts/translation-context.js.map +1 -0
- package/lib/module/ai-components/conversation/AIConversation.js +366 -0
- package/lib/module/ai-components/conversation/AIConversation.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/AIAgentError.js +13 -0
- package/lib/module/ai-components/conversation/controller/AIAgentError.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/AIConversationController.js +425 -0
- package/lib/module/ai-components/conversation/controller/AIConversationController.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/AIConversationExchange.js +89 -0
- package/lib/module/ai-components/conversation/controller/AIConversationExchange.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/index.js +48 -0
- package/lib/module/ai-components/conversation/controller/index.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/offers.js +29 -0
- package/lib/module/ai-components/conversation/controller/offers.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/types.js +13 -0
- package/lib/module/ai-components/conversation/controller/types.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/useAIConversationState.js +8 -0
- package/lib/module/ai-components/conversation/controller/useAIConversationState.js.map +1 -0
- package/lib/module/ai-components/conversation/entries.js +98 -0
- package/lib/module/ai-components/conversation/entries.js.map +1 -0
- package/lib/module/ai-components/conversation/fromStreamMessage.js +66 -0
- package/lib/module/ai-components/conversation/fromStreamMessage.js.map +1 -0
- package/lib/module/ai-components/conversation/index.js +48 -0
- package/lib/module/ai-components/conversation/index.js.map +1 -0
- package/lib/module/ai-components/conversation/list/AIChatList.js +224 -0
- package/lib/module/ai-components/conversation/list/AIChatList.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useChatListController.js +78 -0
- package/lib/module/ai-components/conversation/list/useChatListController.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useEndInView.js +51 -0
- package/lib/module/ai-components/conversation/list/useEndInView.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useKeyboardOverlap.js +54 -0
- package/lib/module/ai-components/conversation/list/useKeyboardOverlap.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useLoadOlder.js +73 -0
- package/lib/module/ai-components/conversation/list/useLoadOlder.js.map +1 -0
- package/lib/module/ai-components/conversation/list/usePinnedAnchor.js +84 -0
- package/lib/module/ai-components/conversation/list/usePinnedAnchor.js.map +1 -0
- package/lib/module/ai-components/conversation/types.js +4 -0
- package/lib/module/ai-components/conversation/types.js.map +1 -0
- package/lib/module/ai-components/conversation/useConversationRows.js +117 -0
- package/lib/module/ai-components/conversation/useConversationRows.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIAction.js +30 -0
- package/lib/module/ai-components/generative-ui/AIUIAction.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIArguments.js +128 -0
- package/lib/module/ai-components/generative-ui/AIUIArguments.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIComponent.js +50 -0
- package/lib/module/ai-components/generative-ui/AIUIComponent.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIComponentDefinition.js +134 -0
- package/lib/module/ai-components/generative-ui/AIUIComponentDefinition.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIDocument.js +32 -0
- package/lib/module/ai-components/generative-ui/AIUIDocument.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIEntrance.js +193 -0
- package/lib/module/ai-components/generative-ui/AIUIEntrance.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIErrorBoundary.js +30 -0
- package/lib/module/ai-components/generative-ui/AIUIErrorBoundary.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIHelpers.js +54 -0
- package/lib/module/ai-components/generative-ui/AIUIHelpers.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIHost.js +259 -0
- package/lib/module/ai-components/generative-ui/AIUIHost.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIMedia.js +24 -0
- package/lib/module/ai-components/generative-ui/AIUIMedia.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIRenderer.js +10 -0
- package/lib/module/ai-components/generative-ui/AIUIRenderer.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIView.js +57 -0
- package/lib/module/ai-components/generative-ui/AIUIView.js.map +1 -0
- package/lib/module/ai-components/generative-ui/index.js +181 -0
- package/lib/module/ai-components/generative-ui/index.js.map +1 -0
- package/lib/module/ai-components/icons.js +44 -0
- package/lib/module/ai-components/icons.js.map +1 -0
- package/lib/module/ai-components/index.js +96 -0
- package/lib/module/ai-components/index.js.map +1 -1
- package/lib/module/ai-components/internal/Shimmer.js +36 -0
- package/lib/module/ai-components/internal/Shimmer.js.map +1 -0
- package/lib/module/ai-components/internal/format.js +66 -0
- package/lib/module/ai-components/internal/format.js.map +1 -0
- package/lib/module/ai-components/internal/hooks/useBottomSafeArea.js +12 -0
- package/lib/module/ai-components/internal/hooks/useBottomSafeArea.js.map +1 -0
- package/lib/module/ai-components/internal/icons/AgentIcons.js +74 -0
- package/lib/module/ai-components/internal/icons/AgentIcons.js.map +1 -0
- package/lib/module/ai-components/internal/tokens.js +11 -0
- package/lib/module/ai-components/internal/tokens.js.map +1 -0
- package/lib/module/ai-components/internal/uuid.js +21 -0
- package/lib/module/ai-components/internal/uuid.js.map +1 -0
- package/lib/module/ai-components/markdown/components/CodeBlock.js +4 -2
- package/lib/module/ai-components/markdown/components/CodeBlock.js.map +1 -1
- package/lib/module/ai-components/markdown/components/InlineCode.js +1 -0
- package/lib/module/ai-components/markdown/components/InlineCode.js.map +1 -1
- package/lib/module/ai-components/markdown/components/Text.js +11 -2
- package/lib/module/ai-components/markdown/components/Text.js.map +1 -1
- package/lib/module/ai-components/markdown/styles.js +27 -29
- package/lib/module/ai-components/markdown/styles.js.map +1 -1
- package/lib/module/ai-components/message/AIAssistantMessage.js +63 -0
- package/lib/module/ai-components/message/AIAssistantMessage.js.map +1 -0
- package/lib/module/ai-components/message/AIMessageAttachment.js +189 -0
- package/lib/module/ai-components/message/AIMessageAttachment.js.map +1 -0
- package/lib/module/ai-components/message/AIReplyActions.js +132 -0
- package/lib/module/ai-components/message/AIReplyActions.js.map +1 -0
- package/lib/module/ai-components/message/AIUserMessage.js +104 -0
- package/lib/module/ai-components/message/AIUserMessage.js.map +1 -0
- package/lib/module/ai-components/message/UserMessageMenu.js +150 -0
- package/lib/module/ai-components/message/UserMessageMenu.js.map +1 -0
- package/lib/module/ai-components/message/index.js +48 -0
- package/lib/module/ai-components/message/index.js.map +1 -0
- package/lib/module/ai-components/message-composer/ActionButton.js +2 -1
- package/lib/module/ai-components/message-composer/ActionButton.js.map +1 -1
- package/lib/module/ai-components/message-composer/ActionSheet.js +22 -6
- package/lib/module/ai-components/message-composer/ActionSheet.js.map +1 -1
- package/lib/module/ai-components/message-composer/AttachmentButton.js +5 -1
- package/lib/module/ai-components/message-composer/AttachmentButton.js.map +1 -1
- package/lib/module/ai-components/message-composer/ChatOptions.js +147 -0
- package/lib/module/ai-components/message-composer/ChatOptions.js.map +1 -0
- package/lib/module/ai-components/message-composer/ComposerView.js +136 -20
- package/lib/module/ai-components/message-composer/ComposerView.js.map +1 -1
- package/lib/module/ai-components/message-composer/EditingMessageChip.js +80 -0
- package/lib/module/ai-components/message-composer/EditingMessageChip.js.map +1 -0
- package/lib/module/ai-components/message-composer/MediaPreviewList.js +26 -1
- package/lib/module/ai-components/message-composer/MediaPreviewList.js.map +1 -1
- package/lib/module/ai-components/message-composer/index.js +11 -0
- package/lib/module/ai-components/message-composer/index.js.map +1 -1
- package/lib/module/ai-components/message-parts/AIMessageParts.js +110 -0
- package/lib/module/ai-components/message-parts/AIMessageParts.js.map +1 -0
- package/lib/module/ai-components/message-parts/AIToolApproval.js +197 -0
- package/lib/module/ai-components/message-parts/AIToolApproval.js.map +1 -0
- package/lib/module/ai-components/message-parts/AIToolAuthorization.js +250 -0
- package/lib/module/ai-components/message-parts/AIToolAuthorization.js.map +1 -0
- package/lib/module/ai-components/message-parts/AIToolCall.js +159 -0
- package/lib/module/ai-components/message-parts/AIToolCall.js.map +1 -0
- package/lib/module/ai-components/message-parts/callStates.js +54 -0
- package/lib/module/ai-components/message-parts/callStates.js.map +1 -0
- package/lib/module/ai-components/message-parts/index.js +70 -0
- package/lib/module/ai-components/message-parts/index.js.map +1 -0
- package/lib/module/ai-components/message-parts/parseMessageParts.js +126 -0
- package/lib/module/ai-components/message-parts/parseMessageParts.js.map +1 -0
- package/lib/module/ai-components/message-parts/types.js +2 -0
- package/lib/module/ai-components/message-parts/types.js.map +1 -0
- package/lib/module/ai-components/native-specs/NativeAIAgent.js +7 -0
- package/lib/module/ai-components/native-specs/NativeAIAgent.js.map +1 -0
- package/lib/module/ai-components/reasoning/AIReasoning.js +401 -0
- package/lib/module/ai-components/reasoning/AIReasoning.js.map +1 -0
- package/lib/module/ai-components/reasoning/index.js +26 -0
- package/lib/module/ai-components/reasoning/index.js.map +1 -0
- package/lib/module/ai-components/reasoning/thinkingClock.js +63 -0
- package/lib/module/ai-components/reasoning/thinkingClock.js.map +1 -0
- package/lib/module/ai-components/services/clipboard-service/expo.js +7 -2
- package/lib/module/ai-components/services/clipboard-service/expo.js.map +1 -1
- package/lib/module/ai-components/store/composer/store.js.map +1 -1
- package/lib/module/ai-components/store/composer/useComposerChatOption.js +18 -0
- package/lib/module/ai-components/store/composer/useComposerChatOption.js.map +1 -0
- package/lib/module/ai-components/store/composer/useComposerIsEditing.js +18 -0
- package/lib/module/ai-components/store/composer/useComposerIsEditing.js.map +1 -0
- package/lib/module/ai-components/store/index.js +22 -0
- package/lib/module/ai-components/store/index.js.map +1 -1
- package/lib/module/ai-components/suggestions/AISuggestions.js +66 -0
- package/lib/module/ai-components/suggestions/AISuggestions.js.map +1 -0
- package/lib/module/ai-components/suggestions/index.js +15 -0
- package/lib/module/ai-components/suggestions/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js +2 -1
- package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -1
- package/lib/module/ai-components/syntax-highlighting/utils/renderer.js +3 -2
- package/lib/module/ai-components/syntax-highlighting/utils/renderer.js.map +1 -1
- package/lib/module/ai-components/theme.js +137 -1
- package/lib/module/ai-components/theme.js.map +1 -1
- package/lib/module/ai-components/tool-calls/AIClientIdentity.js +22 -0
- package/lib/module/ai-components/tool-calls/AIClientIdentity.js.map +1 -0
- package/lib/module/ai-components/tool-calls/AIClientToolRunner.js +109 -0
- package/lib/module/ai-components/tool-calls/AIClientToolRunner.js.map +1 -0
- package/lib/module/ai-components/tool-calls/AIToolApprover.js +23 -0
- package/lib/module/ai-components/tool-calls/AIToolApprover.js.map +1 -0
- package/lib/module/ai-components/tool-calls/authSessionAuthorizer.js +88 -0
- package/lib/module/ai-components/tool-calls/authSessionAuthorizer.js.map +1 -0
- package/lib/module/ai-components/tool-calls/index.js +48 -0
- package/lib/module/ai-components/tool-calls/index.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/glowShader.js.map +1 -1
- package/lib/module/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/utils/renderText.js.map +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +2 -2
- package/lib/module/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/module/i18n/ar.json +39 -1
- package/lib/module/i18n/en.json +39 -1
- package/lib/module/i18n/es.json +39 -1
- package/lib/module/i18n/fr.json +39 -1
- package/lib/module/i18n/he.json +39 -1
- package/lib/module/i18n/hi.json +39 -1
- package/lib/module/i18n/it.json +39 -1
- package/lib/module/i18n/ja.json +39 -1
- package/lib/module/i18n/ko.json +39 -1
- package/lib/module/i18n/nl.json +39 -1
- package/lib/module/i18n/pt-br.json +39 -1
- package/lib/module/i18n/ru.json +39 -1
- package/lib/module/i18n/tr.json +39 -1
- package/lib/module/mock-builders/a2ui/ohrid.js +84 -0
- package/lib/module/mock-builders/a2ui/ohrid.js.map +1 -0
- package/lib/module/utils/i18n/Streami18n.js +9 -4
- package/lib/module/utils/i18n/Streami18n.js.map +1 -1
- package/lib/module/utils/i18n/utils.js +7 -0
- package/lib/module/utils/i18n/utils.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/a11y/a11yUtils.d.ts +0 -1
- package/lib/typescript/a11y/a11yUtils.d.ts.map +1 -1
- package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts +2 -3
- package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts.map +1 -1
- package/lib/typescript/a2ui/A2UIContexts.d.ts +9 -0
- package/lib/typescript/a2ui/A2UIContexts.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIInstructions.d.ts +47 -0
- package/lib/typescript/a2ui/A2UIInstructions.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIPlaceholder.d.ts +4 -0
- package/lib/typescript/a2ui/A2UIPlaceholder.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIRenderer.d.ts +130 -0
- package/lib/typescript/a2ui/A2UIRenderer.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIStream.d.ts +23 -0
- package/lib/typescript/a2ui/A2UIStream.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UISurface.d.ts +19 -0
- package/lib/typescript/a2ui/A2UISurface.d.ts.map +1 -0
- package/lib/typescript/a2ui/basicFunctions.d.ts +10 -0
- package/lib/typescript/a2ui/basicFunctions.d.ts.map +1 -0
- package/lib/typescript/a2ui/catalogDocument.d.ts +56 -0
- package/lib/typescript/a2ui/catalogDocument.d.ts.map +1 -0
- package/lib/typescript/a2ui/catalogs.d.ts +42 -0
- package/lib/typescript/a2ui/catalogs.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/DateTimeInput.d.ts +44 -0
- package/lib/typescript/a2ui/components/DateTimeInput.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/Media.d.ts +27 -0
- package/lib/typescript/a2ui/components/Media.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/basicComponents.d.ts +4 -0
- package/lib/typescript/a2ui/components/basicComponents.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/iconPaths.d.ts +2 -0
- package/lib/typescript/a2ui/components/iconPaths.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/types.d.ts +23 -0
- package/lib/typescript/a2ui/components/types.d.ts.map +1 -0
- package/lib/typescript/a2ui/index.d.ts +8 -0
- package/lib/typescript/a2ui/index.d.ts.map +1 -0
- package/lib/typescript/a2ui/instructions.d.ts +39 -0
- package/lib/typescript/a2ui/instructions.d.ts.map +1 -0
- package/lib/typescript/a2ui/secrets.d.ts +20 -0
- package/lib/typescript/a2ui/secrets.d.ts.map +1 -0
- package/lib/typescript/a2ui/useReplyState.d.ts +4 -0
- package/lib/typescript/a2ui/useReplyState.d.ts.map +1 -0
- package/lib/typescript/ai-components/AITypingIndicatorView.d.ts.map +1 -1
- package/lib/typescript/ai-components/StreamingMessageView.d.ts +4 -1
- package/lib/typescript/ai-components/StreamingMessageView.d.ts.map +1 -1
- package/lib/typescript/ai-components/charts/components/PieLegend.d.ts.map +1 -1
- package/lib/typescript/ai-components/charts/components/VictoryChart.d.ts.map +1 -1
- package/lib/typescript/ai-components/charts/utils/format-time-label.d.ts +7 -0
- package/lib/typescript/ai-components/charts/utils/format-time-label.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts +8 -8
- package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/composer-context.d.ts +3 -0
- package/lib/typescript/ai-components/contexts/composer-context.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/index.d.ts +1 -0
- package/lib/typescript/ai-components/contexts/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/theme-context.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/translation-context.d.ts +19 -0
- package/lib/typescript/ai-components/contexts/translation-context.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/AIConversation.d.ts +130 -0
- package/lib/typescript/ai-components/conversation/AIConversation.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/AIAgentError.d.ts +10 -0
- package/lib/typescript/ai-components/conversation/controller/AIAgentError.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/AIConversationController.d.ts +173 -0
- package/lib/typescript/ai-components/conversation/controller/AIConversationController.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/AIConversationExchange.d.ts +23 -0
- package/lib/typescript/ai-components/conversation/controller/AIConversationExchange.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/index.d.ts +5 -0
- package/lib/typescript/ai-components/conversation/controller/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/offers.d.ts +23 -0
- package/lib/typescript/ai-components/conversation/controller/offers.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/types.d.ts +142 -0
- package/lib/typescript/ai-components/conversation/controller/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/useAIConversationState.d.ts +9 -0
- package/lib/typescript/ai-components/conversation/controller/useAIConversationState.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/entries.d.ts +47 -0
- package/lib/typescript/ai-components/conversation/entries.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/fromStreamMessage.d.ts +25 -0
- package/lib/typescript/ai-components/conversation/fromStreamMessage.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/index.d.ts +6 -0
- package/lib/typescript/ai-components/conversation/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/AIChatList.d.ts +30 -0
- package/lib/typescript/ai-components/conversation/list/AIChatList.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useChatListController.d.ts +45 -0
- package/lib/typescript/ai-components/conversation/list/useChatListController.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useEndInView.d.ts +26 -0
- package/lib/typescript/ai-components/conversation/list/useEndInView.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useKeyboardOverlap.d.ts +17 -0
- package/lib/typescript/ai-components/conversation/list/useKeyboardOverlap.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useLoadOlder.d.ts +24 -0
- package/lib/typescript/ai-components/conversation/list/useLoadOlder.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/usePinnedAnchor.d.ts +26 -0
- package/lib/typescript/ai-components/conversation/list/usePinnedAnchor.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/types.d.ts +55 -0
- package/lib/typescript/ai-components/conversation/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/useConversationRows.d.ts +66 -0
- package/lib/typescript/ai-components/conversation/useConversationRows.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIAction.d.ts +48 -0
- package/lib/typescript/ai-components/generative-ui/AIUIAction.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIArguments.d.ts +15 -0
- package/lib/typescript/ai-components/generative-ui/AIUIArguments.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponent.d.ts +51 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponent.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponentDefinition.d.ts +84 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponentDefinition.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIDocument.d.ts +50 -0
- package/lib/typescript/ai-components/generative-ui/AIUIDocument.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIEntrance.d.ts +75 -0
- package/lib/typescript/ai-components/generative-ui/AIUIEntrance.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIErrorBoundary.d.ts +26 -0
- package/lib/typescript/ai-components/generative-ui/AIUIErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHelpers.d.ts +23 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHelpers.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHost.d.ts +160 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHost.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIMedia.d.ts +22 -0
- package/lib/typescript/ai-components/generative-ui/AIUIMedia.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIRenderer.d.ts +53 -0
- package/lib/typescript/ai-components/generative-ui/AIUIRenderer.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIView.d.ts +35 -0
- package/lib/typescript/ai-components/generative-ui/AIUIView.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/index.d.ts +11 -0
- package/lib/typescript/ai-components/generative-ui/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/icons.d.ts +66 -0
- package/lib/typescript/ai-components/icons.d.ts.map +1 -0
- package/lib/typescript/ai-components/index.d.ts +8 -0
- package/lib/typescript/ai-components/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/internal/Shimmer.d.ts +14 -0
- package/lib/typescript/ai-components/internal/Shimmer.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/format.d.ts +7 -0
- package/lib/typescript/ai-components/internal/format.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/hooks/useBottomSafeArea.d.ts +3 -0
- package/lib/typescript/ai-components/internal/hooks/useBottomSafeArea.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/AgentIcons.d.ts +31 -0
- package/lib/typescript/ai-components/internal/icons/AgentIcons.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/tokens.d.ts +2 -0
- package/lib/typescript/ai-components/internal/tokens.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/uuid.d.ts +2 -0
- package/lib/typescript/ai-components/internal/uuid.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/CodeBlock.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/components/InlineCode.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/components/Text.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/styles.d.ts +23 -4
- package/lib/typescript/ai-components/markdown/styles.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/types.d.ts +1 -0
- package/lib/typescript/ai-components/markdown/types.d.ts.map +1 -1
- package/lib/typescript/ai-components/message/AIAssistantMessage.d.ts +40 -0
- package/lib/typescript/ai-components/message/AIAssistantMessage.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/AIMessageAttachment.d.ts +33 -0
- package/lib/typescript/ai-components/message/AIMessageAttachment.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/AIReplyActions.d.ts +19 -0
- package/lib/typescript/ai-components/message/AIReplyActions.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/AIUserMessage.d.ts +17 -0
- package/lib/typescript/ai-components/message/AIUserMessage.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/UserMessageMenu.d.ts +31 -0
- package/lib/typescript/ai-components/message/UserMessageMenu.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/index.d.ts +5 -0
- package/lib/typescript/ai-components/message/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ActionButton.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts +2 -2
- package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/AttachmentButton.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/ChatOptions.d.ts +35 -0
- package/lib/typescript/ai-components/message-composer/ChatOptions.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts +34 -3
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/EditingMessageChip.d.ts +7 -0
- package/lib/typescript/ai-components/message-composer/EditingMessageChip.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/MediaPreviewList.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/index.d.ts +1 -0
- package/lib/typescript/ai-components/message-composer/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-parts/AIMessageParts.d.ts +38 -0
- package/lib/typescript/ai-components/message-parts/AIMessageParts.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/AIToolApproval.d.ts +38 -0
- package/lib/typescript/ai-components/message-parts/AIToolApproval.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/AIToolAuthorization.d.ts +48 -0
- package/lib/typescript/ai-components/message-parts/AIToolAuthorization.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/AIToolCall.d.ts +11 -0
- package/lib/typescript/ai-components/message-parts/AIToolCall.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/callStates.d.ts +9 -0
- package/lib/typescript/ai-components/message-parts/callStates.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/index.d.ts +7 -0
- package/lib/typescript/ai-components/message-parts/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/parseMessageParts.d.ts +47 -0
- package/lib/typescript/ai-components/message-parts/parseMessageParts.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/types.d.ts +137 -0
- package/lib/typescript/ai-components/message-parts/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/native-specs/NativeAIAgent.d.ts +22 -0
- package/lib/typescript/ai-components/native-specs/NativeAIAgent.d.ts.map +1 -0
- package/lib/typescript/ai-components/reasoning/AIReasoning.d.ts +63 -0
- package/lib/typescript/ai-components/reasoning/AIReasoning.d.ts.map +1 -0
- package/lib/typescript/ai-components/reasoning/index.d.ts +3 -0
- package/lib/typescript/ai-components/reasoning/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/reasoning/thinkingClock.d.ts +29 -0
- package/lib/typescript/ai-components/reasoning/thinkingClock.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/clipboard-service/expo.d.ts.map +1 -1
- package/lib/typescript/ai-components/store/composer/store.d.ts +8 -0
- package/lib/typescript/ai-components/store/composer/store.d.ts.map +1 -1
- package/lib/typescript/ai-components/store/composer/useComposerChatOption.d.ts +5 -0
- package/lib/typescript/ai-components/store/composer/useComposerChatOption.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/composer/useComposerIsEditing.d.ts +5 -0
- package/lib/typescript/ai-components/store/composer/useComposerIsEditing.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/index.d.ts +2 -0
- package/lib/typescript/ai-components/store/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/suggestions/AISuggestions.d.ts +13 -0
- package/lib/typescript/ai-components/suggestions/AISuggestions.d.ts.map +1 -0
- package/lib/typescript/ai-components/suggestions/index.d.ts +2 -0
- package/lib/typescript/ai-components/suggestions/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/flatten-nodes.d.ts.map +1 -1
- package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts +1 -1
- package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts.map +1 -1
- package/lib/typescript/ai-components/theme.d.ts +200 -0
- package/lib/typescript/ai-components/theme.d.ts.map +1 -1
- package/lib/typescript/ai-components/tool-calls/AIClientIdentity.d.ts +14 -0
- package/lib/typescript/ai-components/tool-calls/AIClientIdentity.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/AIClientToolRunner.d.ts +109 -0
- package/lib/typescript/ai-components/tool-calls/AIClientToolRunner.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/AIToolApprover.d.ts +48 -0
- package/lib/typescript/ai-components/tool-calls/AIToolApprover.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/authSessionAuthorizer.d.ts +57 -0
- package/lib/typescript/ai-components/tool-calls/authSessionAuthorizer.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/index.d.ts +5 -0
- package/lib/typescript/ai-components/tool-calls/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/glowShader.d.ts.map +1 -1
- package/lib/typescript/ai-components/voice-visualization/simplex.d.ts +1 -1
- package/lib/typescript/components/Accessibility/NotificationAnnouncer.d.ts +5 -5
- package/lib/typescript/components/Accessibility/hooks/useIncomingMessageAnnouncements.d.ts +1 -1
- package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts +0 -2
- package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/utils/renderText.d.ts.map +1 -1
- package/lib/typescript/contexts/translationContext/TranslationContext.d.ts +1 -1
- package/lib/typescript/contexts/translationContext/TranslationContext.d.ts.map +1 -1
- package/lib/typescript/i18n/ar.json +39 -1
- package/lib/typescript/i18n/en.json +39 -1
- package/lib/typescript/i18n/es.json +39 -1
- package/lib/typescript/i18n/fr.json +39 -1
- package/lib/typescript/i18n/he.json +39 -1
- package/lib/typescript/i18n/hi.json +39 -1
- package/lib/typescript/i18n/it.json +39 -1
- package/lib/typescript/i18n/ja.json +39 -1
- package/lib/typescript/i18n/ko.json +39 -1
- package/lib/typescript/i18n/nl.json +39 -1
- package/lib/typescript/i18n/pt-br.json +39 -1
- package/lib/typescript/i18n/ru.json +39 -1
- package/lib/typescript/i18n/tr.json +39 -1
- package/lib/typescript/utils/i18n/Streami18n.d.ts +40 -2
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/lib/typescript/utils/i18n/utils.d.ts +3 -0
- package/lib/typescript/utils/i18n/utils.d.ts.map +1 -0
- package/package.json +10 -2
- package/src/a11y/a11yUtils.ts +0 -1
- package/src/a11y/hooks/useResolvedModalAccessibilityProps.ts +2 -3
- package/src/a2ui/A2UIContexts.ts +15 -0
- package/src/a2ui/A2UIInstructions.ts +102 -0
- package/src/a2ui/A2UIPlaceholder.tsx +24 -0
- package/src/a2ui/A2UIRenderer.tsx +504 -0
- package/src/a2ui/A2UIStream.ts +105 -0
- package/src/a2ui/A2UISurface.tsx +241 -0
- package/src/a2ui/__tests__/A2UIInstructions.test.ts +233 -0
- package/src/a2ui/__tests__/A2UIRenderer.test.tsx +1514 -0
- package/src/a2ui/__tests__/conformance.test.ts +579 -0
- package/src/a2ui/basicCatalog.json +1206 -0
- package/src/a2ui/basicFunctions.ts +429 -0
- package/src/a2ui/catalogDocument.ts +119 -0
- package/src/a2ui/catalogs.ts +185 -0
- package/src/a2ui/components/DateTimeInput.tsx +381 -0
- package/src/a2ui/components/Media.tsx +278 -0
- package/src/a2ui/components/basicComponents.tsx +832 -0
- package/src/a2ui/components/iconPaths.ts +116 -0
- package/src/a2ui/components/types.ts +24 -0
- package/src/a2ui/index.ts +18 -0
- package/src/a2ui/instructions.ts +341 -0
- package/src/a2ui/secrets.ts +154 -0
- package/src/a2ui/useReplyState.ts +26 -0
- package/src/ai-components/AITypingIndicatorView.tsx +6 -22
- package/src/ai-components/README.md +55 -3
- package/src/ai-components/StreamingMessageView.tsx +27 -3
- package/src/ai-components/__tests__/ComposerView.test.tsx +227 -2
- package/src/ai-components/__tests__/Markdown.test.tsx +13 -0
- package/src/ai-components/__tests__/StreamingMessageView.test.tsx +69 -0
- package/src/ai-components/__tests__/charts.test.ts +75 -0
- package/src/ai-components/__tests__/clientToolRunner.test.ts +239 -0
- package/src/ai-components/__tests__/conversation.test.tsx +705 -0
- package/src/ai-components/__tests__/conversationController.test.ts +1561 -0
- package/src/ai-components/__tests__/conversationExchange.test.ts +187 -0
- package/src/ai-components/__tests__/conversationRows.test.ts +207 -0
- package/src/ai-components/__tests__/conversationUI.test.tsx +586 -0
- package/src/ai-components/__tests__/format.test.ts +32 -0
- package/src/ai-components/__tests__/generativeUI.test.ts +634 -0
- package/src/ai-components/__tests__/keyboard.test.ts +14 -0
- package/src/ai-components/__tests__/messagePartViews.test.tsx +343 -0
- package/src/ai-components/__tests__/messageParts.test.ts +336 -0
- package/src/ai-components/__tests__/messageViews.test.tsx +321 -0
- package/src/ai-components/__tests__/signIn.test.tsx +324 -0
- package/src/ai-components/__tests__/theme.test.tsx +18 -0
- package/src/ai-components/__tests__/translation.test.tsx +85 -0
- package/src/ai-components/__tests__/voiceDriver.test.ts +0 -3
- package/src/ai-components/__tests__/voicePalette.test.ts +1 -1
- package/src/ai-components/charts/components/PieLegend.tsx +2 -1
- package/src/ai-components/charts/components/VictoryChart.tsx +10 -2
- package/src/ai-components/charts/utils/format-time-label.ts +18 -0
- package/src/ai-components/charts/vega-lite/schema.ts +19 -2
- package/src/ai-components/contexts/composer-context.tsx +13 -5
- package/src/ai-components/contexts/index.ts +1 -0
- package/src/ai-components/contexts/theme-context.tsx +19 -4
- package/src/ai-components/contexts/translation-context.tsx +44 -0
- package/src/ai-components/conversation/AIConversation.tsx +590 -0
- package/src/ai-components/conversation/controller/AIAgentError.ts +14 -0
- package/src/ai-components/conversation/controller/AIConversationController.ts +623 -0
- package/src/ai-components/conversation/controller/AIConversationExchange.ts +132 -0
- package/src/ai-components/conversation/controller/index.ts +4 -0
- package/src/ai-components/conversation/controller/offers.ts +43 -0
- package/src/ai-components/conversation/controller/types.ts +154 -0
- package/src/ai-components/conversation/controller/useAIConversationState.ts +21 -0
- package/src/ai-components/conversation/entries.ts +177 -0
- package/src/ai-components/conversation/fromStreamMessage.ts +87 -0
- package/src/ai-components/conversation/index.ts +5 -0
- package/src/ai-components/conversation/list/AIChatList.tsx +227 -0
- package/src/ai-components/conversation/list/useChatListController.ts +91 -0
- package/src/ai-components/conversation/list/useEndInView.ts +61 -0
- package/src/ai-components/conversation/list/useKeyboardOverlap.ts +51 -0
- package/src/ai-components/conversation/list/useLoadOlder.ts +97 -0
- package/src/ai-components/conversation/list/usePinnedAnchor.ts +113 -0
- package/src/ai-components/conversation/types.ts +57 -0
- package/src/ai-components/conversation/useConversationRows.ts +230 -0
- package/src/ai-components/generative-ui/AIUIAction.ts +73 -0
- package/src/ai-components/generative-ui/AIUIArguments.ts +117 -0
- package/src/ai-components/generative-ui/AIUIComponent.tsx +106 -0
- package/src/ai-components/generative-ui/AIUIComponentDefinition.ts +163 -0
- package/src/ai-components/generative-ui/AIUIDocument.ts +77 -0
- package/src/ai-components/generative-ui/AIUIEntrance.tsx +223 -0
- package/src/ai-components/generative-ui/AIUIErrorBoundary.tsx +39 -0
- package/src/ai-components/generative-ui/AIUIHelpers.ts +86 -0
- package/src/ai-components/generative-ui/AIUIHost.ts +358 -0
- package/src/ai-components/generative-ui/AIUIMedia.ts +45 -0
- package/src/ai-components/generative-ui/AIUIRenderer.ts +60 -0
- package/src/ai-components/generative-ui/AIUIView.tsx +87 -0
- package/src/ai-components/generative-ui/index.ts +48 -0
- package/src/ai-components/icons.ts +101 -0
- package/src/ai-components/index.ts +10 -0
- package/src/ai-components/internal/Shimmer.tsx +40 -0
- package/src/ai-components/internal/format.ts +69 -0
- package/src/ai-components/internal/hooks/useBottomSafeArea.ts +6 -0
- package/src/ai-components/internal/icons/AgentIcons.tsx +138 -0
- package/src/ai-components/internal/tokens.ts +4 -0
- package/src/ai-components/internal/uuid.ts +17 -0
- package/src/ai-components/markdown/components/CodeBlock.tsx +13 -2
- package/src/ai-components/markdown/components/InlineCode.tsx +1 -0
- package/src/ai-components/markdown/components/Text.tsx +7 -2
- package/src/ai-components/markdown/styles.ts +29 -27
- package/src/ai-components/markdown/types.ts +1 -0
- package/src/ai-components/message/AIAssistantMessage.tsx +99 -0
- package/src/ai-components/message/AIMessageAttachment.tsx +245 -0
- package/src/ai-components/message/AIReplyActions.tsx +139 -0
- package/src/ai-components/message/AIUserMessage.tsx +121 -0
- package/src/ai-components/message/UserMessageMenu.tsx +149 -0
- package/src/ai-components/message/index.ts +4 -0
- package/src/ai-components/message-composer/ActionButton.tsx +5 -1
- package/src/ai-components/message-composer/ActionSheet.tsx +28 -6
- package/src/ai-components/message-composer/AttachmentButton.tsx +9 -1
- package/src/ai-components/message-composer/ChatOptions.tsx +144 -0
- package/src/ai-components/message-composer/ComposerView.tsx +179 -29
- package/src/ai-components/message-composer/EditingMessageChip.tsx +61 -0
- package/src/ai-components/message-composer/MediaPreviewList.tsx +34 -8
- package/src/ai-components/message-composer/index.ts +1 -0
- package/src/ai-components/message-parts/AIMessageParts.tsx +120 -0
- package/src/ai-components/message-parts/AIToolApproval.tsx +196 -0
- package/src/ai-components/message-parts/AIToolAuthorization.tsx +279 -0
- package/src/ai-components/message-parts/AIToolCall.tsx +117 -0
- package/src/ai-components/message-parts/callStates.ts +44 -0
- package/src/ai-components/message-parts/index.ts +6 -0
- package/src/ai-components/message-parts/parseMessageParts.ts +195 -0
- package/src/ai-components/message-parts/types.ts +157 -0
- package/src/ai-components/native-specs/NativeAIAgent.ts +25 -0
- package/src/ai-components/reasoning/AIReasoning.tsx +509 -0
- package/src/ai-components/reasoning/index.ts +2 -0
- package/src/ai-components/reasoning/thinkingClock.ts +109 -0
- package/src/ai-components/services/clipboard-service/expo.ts +18 -4
- package/src/ai-components/store/composer/store.ts +9 -0
- package/src/ai-components/store/composer/useComposerChatOption.ts +15 -0
- package/src/ai-components/store/composer/useComposerIsEditing.ts +15 -0
- package/src/ai-components/store/index.ts +2 -0
- package/src/ai-components/suggestions/AISuggestions.tsx +73 -0
- package/src/ai-components/suggestions/index.ts +1 -0
- package/src/ai-components/syntax-highlighting/utils/flatten-nodes.ts +2 -1
- package/src/ai-components/syntax-highlighting/utils/renderer.tsx +4 -2
- package/src/ai-components/theme.ts +334 -0
- package/src/ai-components/tool-calls/AIClientIdentity.ts +33 -0
- package/src/ai-components/tool-calls/AIClientToolRunner.ts +200 -0
- package/src/ai-components/tool-calls/AIToolApprover.tsx +60 -0
- package/src/ai-components/tool-calls/authSessionAuthorizer.ts +137 -0
- package/src/ai-components/tool-calls/index.ts +4 -0
- package/src/ai-components/voice-visualization/glowShader.ts +1 -3
- package/src/ai-components/voice-visualization/simplex.ts +1 -1
- package/src/components/Accessibility/NotificationAnnouncer.tsx +5 -5
- package/src/components/Accessibility/hooks/useIncomingMessageAnnouncements.ts +1 -1
- package/src/components/Accessibility/useAccessibilityAnnouncer.ts +0 -2
- package/src/components/Message/MessageItemView/utils/renderText.tsx +1 -2
- package/src/contexts/translationContext/TranslationContext.tsx +2 -2
- package/src/i18n/ar.json +39 -1
- package/src/i18n/en.json +39 -1
- package/src/i18n/es.json +39 -1
- package/src/i18n/fr.json +39 -1
- package/src/i18n/he.json +39 -1
- package/src/i18n/hi.json +39 -1
- package/src/i18n/it.json +39 -1
- package/src/i18n/ja.json +39 -1
- package/src/i18n/ko.json +39 -1
- package/src/i18n/nl.json +39 -1
- package/src/i18n/pt-br.json +39 -1
- package/src/i18n/ru.json +39 -1
- package/src/i18n/tr.json +39 -1
- package/src/mock-builders/a2ui/ohrid.ts +106 -0
- package/src/utils/i18n/Streami18n.ts +4 -1
- package/src/utils/i18n/utils.ts +3 -0
- package/src/version.json +1 -1
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
createContext,
|
|
3
|
+
memo,
|
|
4
|
+
type ReactNode,
|
|
5
|
+
useCallback,
|
|
6
|
+
useContext,
|
|
7
|
+
useLayoutEffect,
|
|
8
|
+
useMemo,
|
|
9
|
+
useSyncExternalStore,
|
|
10
|
+
} from 'react';
|
|
11
|
+
import { type AccessibilityProps, View as RNView, type ViewProps } from 'react-native';
|
|
12
|
+
import Animated from 'react-native-reanimated';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
type ComponentApi,
|
|
16
|
+
type ComponentNode,
|
|
17
|
+
effect,
|
|
18
|
+
getValue,
|
|
19
|
+
isComponentNode,
|
|
20
|
+
isWritable,
|
|
21
|
+
NodeResolver,
|
|
22
|
+
peekValue,
|
|
23
|
+
ResolvedBinding,
|
|
24
|
+
type Signal,
|
|
25
|
+
type SurfaceModel,
|
|
26
|
+
} from '@a2ui/web_core';
|
|
27
|
+
|
|
28
|
+
import { A2UIEngineContext, A2UIReplyContext } from './A2UIContexts';
|
|
29
|
+
import { keepSecretPath } from './secrets';
|
|
30
|
+
|
|
31
|
+
import { AIUIComponentView } from '../ai-components/generative-ui/AIUIComponent';
|
|
32
|
+
import { useAIUIComesIn, useAIUIEntrance } from '../ai-components/generative-ui/AIUIEntrance';
|
|
33
|
+
import { isRecord } from '../ai-components/generative-ui/AIUIHelpers';
|
|
34
|
+
|
|
35
|
+
/** The value of an A2UI signal, following it. */
|
|
36
|
+
export const useSignalValue = <T,>(signal: Signal<T>) => {
|
|
37
|
+
const subscribe = useCallback(
|
|
38
|
+
(onChange: () => void) =>
|
|
39
|
+
effect(() => {
|
|
40
|
+
getValue(signal);
|
|
41
|
+
onChange();
|
|
42
|
+
}),
|
|
43
|
+
[signal],
|
|
44
|
+
);
|
|
45
|
+
const getSnapshot = useCallback(() => peekValue(signal), [signal]);
|
|
46
|
+
return useSyncExternalStore(subscribe, getSnapshot);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const isPlainObject = (value: unknown): value is Record<string, unknown> => {
|
|
50
|
+
if (!isRecord(value)) return false;
|
|
51
|
+
const prototype = Object.getPrototypeOf(value);
|
|
52
|
+
return prototype === Object.prototype || prototype === null;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const viewValueOf = (value: unknown): unknown => {
|
|
56
|
+
if (isComponentNode(value)) return value;
|
|
57
|
+
if (value instanceof ResolvedBinding) return viewValueOf(value.value);
|
|
58
|
+
if (Array.isArray(value)) return value.map(viewValueOf);
|
|
59
|
+
if (isPlainObject(value)) return viewPropsOf(value);
|
|
60
|
+
return value;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const noop = () => undefined;
|
|
64
|
+
|
|
65
|
+
// What a component's view reads: bindings as their values, with a setter for each one the person
|
|
66
|
+
// can change, named after it, such as `setValue` for `value`. Children stay nodes.
|
|
67
|
+
const viewPropsOf = (props: Record<string, unknown>) => {
|
|
68
|
+
const view: Record<string, unknown> = {};
|
|
69
|
+
for (const [key, value] of Object.entries(props)) {
|
|
70
|
+
if (value instanceof ResolvedBinding) {
|
|
71
|
+
view[key] = viewValueOf(value.value);
|
|
72
|
+
view[`set${key.charAt(0).toUpperCase()}${key.slice(1)}`] = isWritable(value)
|
|
73
|
+
? value.set
|
|
74
|
+
: noop;
|
|
75
|
+
} else view[key] = viewValueOf(value);
|
|
76
|
+
}
|
|
77
|
+
return view;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** The axis the parent of a part lays its children out on, which a part's weight grows along. */
|
|
81
|
+
export const A2UIAxisContext = createContext<'column' | 'row'>('column');
|
|
82
|
+
|
|
83
|
+
const said = (value: unknown) =>
|
|
84
|
+
value === undefined || value === null || value === '' ? undefined : String(value);
|
|
85
|
+
|
|
86
|
+
// What the agent tells assistive technology about a part, with its `accessibility`: what to call
|
|
87
|
+
// it, what more to say about it, whether to announce its changes, and whether to leave it out.
|
|
88
|
+
const accessibilityOf = (accessibility: unknown): AccessibilityProps => {
|
|
89
|
+
if (!isRecord(accessibility)) return {};
|
|
90
|
+
const { description, hidden, label, live } = accessibility;
|
|
91
|
+
const named = said(label);
|
|
92
|
+
const described = said(description);
|
|
93
|
+
return {
|
|
94
|
+
...(named ? { accessibilityLabel: named } : {}),
|
|
95
|
+
...(described ? { accessibilityHint: described } : {}),
|
|
96
|
+
...(live === 'polite' || live === 'assertive' ? { accessibilityLiveRegion: live } : {}),
|
|
97
|
+
...(hidden === true
|
|
98
|
+
? { accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' }
|
|
99
|
+
: {}),
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// One of the app's components where the agent placed it, with the arguments it declares.
|
|
104
|
+
const PlacedComponent = ({
|
|
105
|
+
node,
|
|
106
|
+
props,
|
|
107
|
+
}: {
|
|
108
|
+
node: ComponentNode;
|
|
109
|
+
props: Record<string, unknown>;
|
|
110
|
+
}) => {
|
|
111
|
+
const engine = useContext(A2UIEngineContext);
|
|
112
|
+
const reply = useContext(A2UIReplyContext);
|
|
113
|
+
const component = engine?.appComponent(node.type);
|
|
114
|
+
const names = component?.definition.parameters.map(({ name }) => name);
|
|
115
|
+
const args = useMemo(
|
|
116
|
+
() =>
|
|
117
|
+
Object.fromEntries(
|
|
118
|
+
(names ?? []).filter((name) => name in props).map((name) => [name, props[name]]),
|
|
119
|
+
),
|
|
120
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- the names change with the component
|
|
121
|
+
[component, props],
|
|
122
|
+
);
|
|
123
|
+
if (!engine || !reply || !component) return null;
|
|
124
|
+
const { messageId } = reply;
|
|
125
|
+
const { name } = component.definition;
|
|
126
|
+
return (
|
|
127
|
+
<AIUIComponentView
|
|
128
|
+
args={args}
|
|
129
|
+
component={component}
|
|
130
|
+
context={{
|
|
131
|
+
emit: (event, label, payload = {}) =>
|
|
132
|
+
void engine.host.send({
|
|
133
|
+
format: 'a2ui',
|
|
134
|
+
label,
|
|
135
|
+
messageId,
|
|
136
|
+
name: event,
|
|
137
|
+
payload: { ...payload, component: name },
|
|
138
|
+
}),
|
|
139
|
+
host: engine.host,
|
|
140
|
+
isStreaming: reply.isStreaming,
|
|
141
|
+
messageId,
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* One part of a surface: its view from the basic catalog, or the app's component of its type,
|
|
149
|
+
* coming in when it shows, with its weight and what the agent tells assistive technology. A part
|
|
150
|
+
* whose type no catalog has, or that is still on its way, shows nothing.
|
|
151
|
+
*/
|
|
152
|
+
// The path of the data model a TextField writes what the person types to, when it is obscured,
|
|
153
|
+
// such as a password, which must never reach the agent.
|
|
154
|
+
const secretPathOf = (node: ComponentNode, resolved: Record<string, unknown>) => {
|
|
155
|
+
if (node.type !== 'TextField') return undefined;
|
|
156
|
+
const variant =
|
|
157
|
+
resolved.variant instanceof ResolvedBinding ? resolved.variant.value : resolved.variant;
|
|
158
|
+
const { value } = resolved;
|
|
159
|
+
return variant === 'obscured' && value instanceof ResolvedBinding && isWritable(value)
|
|
160
|
+
? (node.context?.dataContext.resolvePath(value.path) ?? value.path)
|
|
161
|
+
: undefined;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const A2UINode = memo(({ node }: { node: ComponentNode }) => {
|
|
165
|
+
const engine = useContext(A2UIEngineContext);
|
|
166
|
+
const axis = useContext(A2UIAxisContext);
|
|
167
|
+
const resolved = useSignalValue(node.props) as Record<string, unknown>;
|
|
168
|
+
const props = useMemo(() => viewPropsOf(resolved), [resolved]);
|
|
169
|
+
// Before the person can type: whichever view draws the field, what they type stays theirs.
|
|
170
|
+
const secretPath = secretPathOf(node, resolved);
|
|
171
|
+
const surface = node.context?.dataContext.surface;
|
|
172
|
+
useLayoutEffect(() => {
|
|
173
|
+
if (secretPath && surface) keepSecretPath(surface, secretPath);
|
|
174
|
+
}, [secretPath, surface]);
|
|
175
|
+
const comesIn = useAIUIComesIn();
|
|
176
|
+
if (!engine || node.isPlaceholder || node.state !== 'resolved') return null;
|
|
177
|
+
const View = engine.components[node.type];
|
|
178
|
+
const isApp = !View && !!engine.appComponent(node.type);
|
|
179
|
+
if (!View && !isApp) return null;
|
|
180
|
+
// A weighted part shares the room its row leaves, as flex-grow from nothing does.
|
|
181
|
+
const weight = typeof props.weight === 'number' && axis === 'row' ? props.weight : undefined;
|
|
182
|
+
const Part = comesIn ? EnteringPart : ShownPart;
|
|
183
|
+
return (
|
|
184
|
+
<Part
|
|
185
|
+
{...accessibilityOf(props.accessibility)}
|
|
186
|
+
style={weight !== undefined ? { flexBasis: 0, flexGrow: weight } : undefined}
|
|
187
|
+
testID={`a2ui-${node.componentId}`}
|
|
188
|
+
>
|
|
189
|
+
{View ? <View node={node} props={props} /> : <PlacedComponent node={node} props={props} />}
|
|
190
|
+
</Part>
|
|
191
|
+
);
|
|
192
|
+
});
|
|
193
|
+
A2UINode.displayName = 'A2UINode';
|
|
194
|
+
|
|
195
|
+
type PartProps = ViewProps & { children: ReactNode };
|
|
196
|
+
|
|
197
|
+
// A part that comes in as it shows, such as while the agent writes it.
|
|
198
|
+
const EnteringPart = ({ children, style, ...props }: PartProps) => {
|
|
199
|
+
const { scope, style: entrance } = useAIUIEntrance();
|
|
200
|
+
return (
|
|
201
|
+
<Animated.View {...props} style={[entrance, style]}>
|
|
202
|
+
{scope(children)}
|
|
203
|
+
</Animated.View>
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// A part that shows at once, such as one of a reply from history: a plain view, since nothing of
|
|
208
|
+
// it moves and a list that scrolls fast mounts it all the time.
|
|
209
|
+
const ShownPart = ({ children, ...props }: PartProps) => <RNView {...props}>{children}</RNView>;
|
|
210
|
+
|
|
211
|
+
/** A child of a part, as its view gets it: a node, or nothing while it is on its way. */
|
|
212
|
+
export const A2UIChild = ({ node }: { node: unknown }) =>
|
|
213
|
+
isComponentNode(node) ? <A2UINode node={node} /> : null;
|
|
214
|
+
|
|
215
|
+
/** The children of a part, as its view gets them. */
|
|
216
|
+
export const A2UIChildren = ({ nodes }: { nodes: unknown }) => (
|
|
217
|
+
<>
|
|
218
|
+
{Array.isArray(nodes)
|
|
219
|
+
? nodes.map((node) =>
|
|
220
|
+
isComponentNode(node) ? <A2UINode key={node.instanceId} node={node} /> : null,
|
|
221
|
+
)
|
|
222
|
+
: null}
|
|
223
|
+
</>
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
const resolvers = new WeakMap<SurfaceModel<ComponentApi>, NodeResolver<ComponentApi>>();
|
|
227
|
+
|
|
228
|
+
const resolverOf = (surface: SurfaceModel<ComponentApi>) => {
|
|
229
|
+
let resolver = resolvers.get(surface);
|
|
230
|
+
if (!resolver) {
|
|
231
|
+
resolver = new NodeResolver<ComponentApi>(surface, surface.defaultCatalog);
|
|
232
|
+
resolvers.set(surface, resolver);
|
|
233
|
+
}
|
|
234
|
+
return resolver;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/** A surface of a reply: its tree of parts, from its root, as the agent writes them. */
|
|
238
|
+
export const A2UISurfaceView = ({ surface }: { surface: SurfaceModel<ComponentApi> }) => {
|
|
239
|
+
const root = useSignalValue(resolverOf(surface).rootNode);
|
|
240
|
+
return root ? <A2UINode node={root} /> : null;
|
|
241
|
+
};
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
// What an agent is told, written in a script or a build too.
|
|
2
|
+
import { parseAIUIComponentDefinition } from '../../ai-components';
|
|
3
|
+
import { ohridLines, uiComponents } from '../../mock-builders/a2ui/ohrid';
|
|
4
|
+
import {
|
|
5
|
+
A2UI_DEFAULT_CATALOG_ID,
|
|
6
|
+
a2uiInstructions,
|
|
7
|
+
A2UIInstructionsError,
|
|
8
|
+
a2uiProblems,
|
|
9
|
+
} from '../index';
|
|
10
|
+
|
|
11
|
+
const components = uiComponents.flatMap((json) => {
|
|
12
|
+
const definition = parseAIUIComponentDefinition(json);
|
|
13
|
+
return definition ? [definition] : [];
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// The basic catalog's part the Swift assistant's `a2ui/prompt.json` keeps.
|
|
17
|
+
const keep = [
|
|
18
|
+
'Text',
|
|
19
|
+
'Icon',
|
|
20
|
+
'Row',
|
|
21
|
+
'Column',
|
|
22
|
+
'List',
|
|
23
|
+
'Card',
|
|
24
|
+
'Tabs',
|
|
25
|
+
'Divider',
|
|
26
|
+
'Button',
|
|
27
|
+
'TextField',
|
|
28
|
+
'CheckBox',
|
|
29
|
+
'ChoicePicker',
|
|
30
|
+
'Slider',
|
|
31
|
+
'DateTimeInput',
|
|
32
|
+
'formatString',
|
|
33
|
+
'formatDate',
|
|
34
|
+
'formatNumber',
|
|
35
|
+
'openUrl',
|
|
36
|
+
'required',
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const example = (lines: string[]) =>
|
|
40
|
+
[
|
|
41
|
+
'Example — a weekend trip:',
|
|
42
|
+
'A weekend in Ohrid by the lake: a map, your calendar and a plan for each day.',
|
|
43
|
+
`\`\`\`ui:a2ui@1.0\n${lines.join('\n')}\n\`\`\``,
|
|
44
|
+
].join('\n\n');
|
|
45
|
+
|
|
46
|
+
const line = (message: Record<string, unknown>) => JSON.stringify({ version: '1.0', ...message });
|
|
47
|
+
|
|
48
|
+
const surface = (components: Record<string, unknown>[]) => [
|
|
49
|
+
line({ createSurface: { catalogId: A2UI_DEFAULT_CATALOG_ID, surfaceId: 's' } }),
|
|
50
|
+
line({ updateComponents: { components, surfaceId: 's' } }),
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
describe('a2uiInstructions', () => {
|
|
54
|
+
it('writes the instructions from prompt.json, in its order', async () => {
|
|
55
|
+
const text = await a2uiInstructions({
|
|
56
|
+
components,
|
|
57
|
+
examples: [example(ohridLines)],
|
|
58
|
+
keep,
|
|
59
|
+
notes: ['- PlaceCard, TripMap and CalendarCheck are the phone’s own views.'],
|
|
60
|
+
preamble: 'Some answers work better as interactive UI than as text.',
|
|
61
|
+
rules: ['Never add images for places.', 'Write the whole UI again.'],
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const headings = text.split('\n').filter((row) => /^#{1,2} /.test(row));
|
|
65
|
+
expect(headings).toEqual([
|
|
66
|
+
'## Writing UI in A2UI',
|
|
67
|
+
'# Generating user interfaces with A2UI v1.0',
|
|
68
|
+
'## Catalog Guidelines',
|
|
69
|
+
"## The app's components",
|
|
70
|
+
'## The catalog `getstream.io:app-catalog`',
|
|
71
|
+
'## Rules',
|
|
72
|
+
'## Examples',
|
|
73
|
+
]);
|
|
74
|
+
expect(text.startsWith('Some answers work better')).toBe(true);
|
|
75
|
+
expect(text).toContain('whose info string is `ui:a2ui@1.0`');
|
|
76
|
+
expect(text).toContain('the `catalogId` `getstream.io:app-catalog`');
|
|
77
|
+
expect(text).toContain('1. Never add images for places.\n2. Write the whole UI again.');
|
|
78
|
+
|
|
79
|
+
const catalog = JSON.parse((text.match(/```json\n(\{.*\})\n```/) ?? [])[1] ?? '{}') as {
|
|
80
|
+
catalogId: string;
|
|
81
|
+
components: Record<string, unknown>;
|
|
82
|
+
};
|
|
83
|
+
expect(catalog.catalogId).toBe(A2UI_DEFAULT_CATALOG_ID);
|
|
84
|
+
expect(Object.keys(catalog.components)).toEqual(
|
|
85
|
+
expect.arrayContaining(['PlaceCard', 'TripMap', 'CalendarCheck', 'Text', 'Tabs']),
|
|
86
|
+
);
|
|
87
|
+
expect(catalog.components).not.toHaveProperty('Video');
|
|
88
|
+
expect(catalog.components).not.toHaveProperty('Modal');
|
|
89
|
+
expect(catalog.components.CalendarCheck).toEqual({
|
|
90
|
+
description:
|
|
91
|
+
"The person's own calendar for the days of a plan, read on the phone. You never see it: use it whenever a plan has dates, so they can see what the trip would clash with.",
|
|
92
|
+
properties: {
|
|
93
|
+
component: { const: 'CalendarCheck' },
|
|
94
|
+
end: {
|
|
95
|
+
description: 'The last day, as YYYY-MM-DD',
|
|
96
|
+
format: 'date',
|
|
97
|
+
type: 'string',
|
|
98
|
+
},
|
|
99
|
+
start: {
|
|
100
|
+
description: 'The first day, as YYYY-MM-DD',
|
|
101
|
+
format: 'date',
|
|
102
|
+
type: 'string',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
required: ['component', 'end', 'start'],
|
|
106
|
+
type: 'object',
|
|
107
|
+
});
|
|
108
|
+
expect(JSON.stringify(catalog.components.PlaceCard)).toContain(
|
|
109
|
+
'Tapping the card asks you about the place.',
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('writes nothing when an example would not render, and says why', async () => {
|
|
114
|
+
const broken = [
|
|
115
|
+
...ohridLines.slice(0, 2),
|
|
116
|
+
line({
|
|
117
|
+
updateComponents: {
|
|
118
|
+
components: [{ component: 'Globe', id: 'map' }],
|
|
119
|
+
surfaceId: 'ohrid-weekend',
|
|
120
|
+
},
|
|
121
|
+
}),
|
|
122
|
+
];
|
|
123
|
+
const asked = a2uiInstructions({ components, examples: [example(broken)], keep });
|
|
124
|
+
await expect(asked).rejects.toBeInstanceOf(A2UIInstructionsError);
|
|
125
|
+
await expect(asked).rejects.toMatchObject({
|
|
126
|
+
problems: expect.arrayContaining([expect.stringMatching(/^example: map: .*Globe/)]),
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
describe('a2uiProblems', () => {
|
|
132
|
+
it('finds nothing in the Ohrid plan', async () => {
|
|
133
|
+
expect(await a2uiProblems(ohridLines.join('\n'), { components })).toEqual([]);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('says what doesn’t fit the catalog: components, properties and their values', async () => {
|
|
137
|
+
const problems = await a2uiProblems(
|
|
138
|
+
surface([
|
|
139
|
+
{ children: ['title', 'map', 'go'], component: 'Column', id: 'root' },
|
|
140
|
+
{ component: 'Text', id: 'title', size: 3, text: 'A weekend' },
|
|
141
|
+
{ component: 'Globe', id: 'map' },
|
|
142
|
+
{ child: 'title', component: 'Button', id: 'go' },
|
|
143
|
+
]).join('\n'),
|
|
144
|
+
{ components },
|
|
145
|
+
);
|
|
146
|
+
expect(problems).toEqual([
|
|
147
|
+
expect.stringMatching(/^go: .*action/),
|
|
148
|
+
expect.stringMatching(/^map: .*Globe/),
|
|
149
|
+
expect.stringMatching(/^title: .*size/),
|
|
150
|
+
]);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('says what the components make together: references, root, orphans, cycles and ids', async () => {
|
|
154
|
+
const dangling = await a2uiProblems(
|
|
155
|
+
surface([
|
|
156
|
+
{ children: ['a', 'gone'], component: 'Column', id: 'root' },
|
|
157
|
+
{ component: 'Text', id: 'a', text: 'Here' },
|
|
158
|
+
{ component: 'Text', id: 'lost', text: 'Nobody holds this' },
|
|
159
|
+
]).join('\n'),
|
|
160
|
+
);
|
|
161
|
+
expect(dangling).toEqual([
|
|
162
|
+
'root holds gone, which is not defined',
|
|
163
|
+
'lost is defined but nothing holds it',
|
|
164
|
+
]);
|
|
165
|
+
|
|
166
|
+
expect(
|
|
167
|
+
await a2uiProblems(surface([{ component: 'Text', id: 'top', text: 'Hi' }]).join('\n')),
|
|
168
|
+
).toEqual(['surface s has no component with the id root']);
|
|
169
|
+
|
|
170
|
+
const cycle = await a2uiProblems(
|
|
171
|
+
surface([
|
|
172
|
+
{ children: ['loop'], component: 'Column', id: 'root' },
|
|
173
|
+
{ children: ['root'], component: 'Column', id: 'loop' },
|
|
174
|
+
]).join('\n'),
|
|
175
|
+
);
|
|
176
|
+
expect(cycle).toEqual([expect.stringMatching(/holds itself through its children/)]);
|
|
177
|
+
|
|
178
|
+
const named = await a2uiProblems(
|
|
179
|
+
surface([
|
|
180
|
+
{ children: ['saturday-plan'], component: 'Column', id: 'root' },
|
|
181
|
+
{ component: 'Text', id: 'saturday-plan', text: 'Morning' },
|
|
182
|
+
]).join('\n'),
|
|
183
|
+
);
|
|
184
|
+
expect(named).toEqual([expect.stringMatching(/^saturday-plan: .*identifier/)]);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
it('says what is wrong with the messages themselves', async () => {
|
|
188
|
+
const problems = await a2uiProblems(
|
|
189
|
+
[
|
|
190
|
+
'{not json}',
|
|
191
|
+
line({ updateComponents: { components: [], surfaceId: 'later' } }),
|
|
192
|
+
line({ callRendererFunction: { name: 'openUrl' } }),
|
|
193
|
+
line({ createSurface: { catalogId: 'someone-else', surfaceId: 's' } }),
|
|
194
|
+
line({
|
|
195
|
+
updateComponents: {
|
|
196
|
+
components: [
|
|
197
|
+
{ component: 'Text', id: 'root', text: 'One' },
|
|
198
|
+
{ component: 'Text', id: 'root', text: 'Two' },
|
|
199
|
+
],
|
|
200
|
+
surfaceId: 's',
|
|
201
|
+
},
|
|
202
|
+
}),
|
|
203
|
+
].join('\n'),
|
|
204
|
+
);
|
|
205
|
+
expect(problems).toEqual([
|
|
206
|
+
"this isn't JSON: {not json}",
|
|
207
|
+
'surface later gets components before it is created',
|
|
208
|
+
"a reply's UI calls no functions",
|
|
209
|
+
'surface s names the catalog someone-else, not getstream.io:app-catalog',
|
|
210
|
+
'surface s defines root more than once in one message',
|
|
211
|
+
]);
|
|
212
|
+
expect(
|
|
213
|
+
await a2uiProblems(
|
|
214
|
+
[
|
|
215
|
+
...surface([{ component: 'Text', id: 'root', text: 'One' }]),
|
|
216
|
+
line({ createSurface: { catalogId: A2UI_DEFAULT_CATALOG_ID, surfaceId: 's' } }),
|
|
217
|
+
].join('\n'),
|
|
218
|
+
),
|
|
219
|
+
).toEqual([expect.stringMatching(/^surface s is created again/)]);
|
|
220
|
+
expect(
|
|
221
|
+
await a2uiProblems(
|
|
222
|
+
[
|
|
223
|
+
...surface([{ component: 'Text', id: 'root', text: 'One' }]),
|
|
224
|
+
line({ deleteSurface: { surfaceId: 's' } }),
|
|
225
|
+
...surface([{ component: 'Text', id: 'root', text: 'Two' }]),
|
|
226
|
+
].join('\n'),
|
|
227
|
+
),
|
|
228
|
+
).toEqual([]);
|
|
229
|
+
expect(await a2uiProblems('Just words.')).toEqual([
|
|
230
|
+
'nothing renders: there is no createSurface',
|
|
231
|
+
]);
|
|
232
|
+
});
|
|
233
|
+
});
|