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,579 @@
|
|
|
1
|
+
// The A2UI specification's conformance suite (`package/__fixtures__/a2ui-conformance`), run against
|
|
2
|
+
// this renderer's core: the basic catalog built from its document, its functions, and the A2UI core
|
|
3
|
+
// they run in. Cases of other protocol versions, and of parts this renderer leaves out, are skipped
|
|
4
|
+
// with the reason.
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
Catalog,
|
|
10
|
+
type ComponentApi,
|
|
11
|
+
DataContext,
|
|
12
|
+
ExpressionParser,
|
|
13
|
+
isComponentNode,
|
|
14
|
+
isSignal,
|
|
15
|
+
NodeResolver,
|
|
16
|
+
MessageProcessor,
|
|
17
|
+
peekValue,
|
|
18
|
+
RELAXED_VALIDATION,
|
|
19
|
+
ResolvedBinding,
|
|
20
|
+
STRICT_VALIDATION,
|
|
21
|
+
type SurfaceModel,
|
|
22
|
+
} from '@a2ui/web_core';
|
|
23
|
+
|
|
24
|
+
import basicCatalogDocument from '../basicCatalog.json';
|
|
25
|
+
import { a2uiCatalogsOf } from '../catalogs';
|
|
26
|
+
|
|
27
|
+
type Case = Record<string, unknown> & { action: string; description: string; name: string };
|
|
28
|
+
|
|
29
|
+
const SUITE = path.join(__dirname, '../../../__fixtures__/a2ui-conformance');
|
|
30
|
+
const BASIC_ID = basicCatalogDocument.catalogId;
|
|
31
|
+
|
|
32
|
+
const casesOf = (file: string): Case[] =>
|
|
33
|
+
JSON.parse(fs.readFileSync(path.join(SUITE, 'core', file), 'utf8')) as Case[];
|
|
34
|
+
|
|
35
|
+
const FILES = fs.readdirSync(path.join(SUITE, 'core')).filter((file) => file.endsWith('.json'));
|
|
36
|
+
|
|
37
|
+
const isRecord = (value: unknown): value is Record<string, unknown> =>
|
|
38
|
+
typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
39
|
+
|
|
40
|
+
// The kinds of case this renderer runs; the others belong to parts it leaves out.
|
|
41
|
+
const RUNS = new Set([
|
|
42
|
+
'evaluate_function',
|
|
43
|
+
'parse_expression_template',
|
|
44
|
+
'process_messages',
|
|
45
|
+
'validate',
|
|
46
|
+
]);
|
|
47
|
+
const LEFT_OUT: Record<string, string> = {
|
|
48
|
+
accessibility_check: 'Accessibility trees of a page: the views draw their own',
|
|
49
|
+
data_model: 'The A2UI core’s data model, which its own suite runs',
|
|
50
|
+
dispatch_action: 'Dispatching through a transport, which the agents router does',
|
|
51
|
+
get_renderer_capabilities: 'Renderer capabilities belong to the A2A transport',
|
|
52
|
+
get_renderer_data_model: 'Synchronizing the data model belongs to the A2A transport',
|
|
53
|
+
handle_rpc: 'Calls from the agent, which the agents router never makes',
|
|
54
|
+
resolve_path: 'The A2UI core’s paths, which its own suite runs',
|
|
55
|
+
select_catalog: 'Choosing among a client’s catalogs belongs to the A2A transport',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// What a case asks of A2UI before 1.0, which this renderer doesn't read.
|
|
59
|
+
const OTHER_VERSIONS = new Set(['v0.8', 'v0.9', 'v0.9.1', '0.8', '0.9']);
|
|
60
|
+
const versionOf = (testCase: Case) => {
|
|
61
|
+
const catalog = isRecord(testCase.catalog) ? testCase.catalog : undefined;
|
|
62
|
+
return (testCase.protocolVersion ?? catalog?.protocolVersion) as string | undefined;
|
|
63
|
+
};
|
|
64
|
+
const usesOtherVersion = (testCase: Case) =>
|
|
65
|
+
OTHER_VERSIONS.has(String(versionOf(testCase))) ||
|
|
66
|
+
JSON.stringify(testCase).includes('"version":"v0.') ||
|
|
67
|
+
JSON.stringify(testCase).includes('"version":"0.');
|
|
68
|
+
|
|
69
|
+
// Cases that don't apply to this renderer, and why, by name.
|
|
70
|
+
const CALL_CONFIG = 'A per-call validation config, of the optional agent_renderer_app feature';
|
|
71
|
+
const SKIPS: Record<string, string> = {
|
|
72
|
+
test_composition_dropped_child_is_reported_as_orphan:
|
|
73
|
+
'The A2UI core checks reachability as components arrive, not after a later update drops one',
|
|
74
|
+
test_v10_call_validation_config_leaves_out_rules_as_strict: CALL_CONFIG,
|
|
75
|
+
test_v10_call_validation_config_relaxes_strict_processor: CALL_CONFIG,
|
|
76
|
+
test_v10_call_validation_config_tightens_permissive_processor: CALL_CONFIG,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const skipReason = (testCase: Case) =>
|
|
80
|
+
SKIPS[testCase.name] ??
|
|
81
|
+
(usesOtherVersion(testCase) ? 'Another A2UI version: this renderer reads 1.0' : undefined) ??
|
|
82
|
+
LEFT_OUT[testCase.action];
|
|
83
|
+
|
|
84
|
+
// The basic catalog as this renderer builds it: its definitions, with its functions.
|
|
85
|
+
const basicFor = (testCase: Case) =>
|
|
86
|
+
a2uiCatalogsOf({
|
|
87
|
+
catalogId: BASIC_ID,
|
|
88
|
+
components: [],
|
|
89
|
+
locale: typeof testCase.locale === 'string' ? testCase.locale : undefined,
|
|
90
|
+
onComponentError: () => undefined,
|
|
91
|
+
openUrl: () => undefined,
|
|
92
|
+
})[0];
|
|
93
|
+
|
|
94
|
+
const withId = (catalog: Catalog<ComponentApi>, id: string) =>
|
|
95
|
+
new Catalog<ComponentApi>(id, '1.0', [...catalog.components.values()], [
|
|
96
|
+
...catalog.functions.values(),
|
|
97
|
+
] as never);
|
|
98
|
+
|
|
99
|
+
// The components a case places in `catalogId`, each taking the properties it is given.
|
|
100
|
+
const usedComponentsOf = (
|
|
101
|
+
value: unknown,
|
|
102
|
+
catalogId: string,
|
|
103
|
+
found = new Map<string, Set<string>>(),
|
|
104
|
+
) => {
|
|
105
|
+
if (Array.isArray(value)) value.forEach((item) => usedComponentsOf(item, catalogId, found));
|
|
106
|
+
else if (isRecord(value)) {
|
|
107
|
+
if (typeof value.component === 'string' && value.catalogId === catalogId) {
|
|
108
|
+
const properties = found.get(value.component) ?? new Set<string>();
|
|
109
|
+
Object.keys(value)
|
|
110
|
+
.filter((key) => !['catalogId', 'component', 'id'].includes(key))
|
|
111
|
+
.forEach((key) => properties.add(key));
|
|
112
|
+
found.set(value.component, properties);
|
|
113
|
+
}
|
|
114
|
+
Object.values(value).forEach((item) => usedComponentsOf(item, catalogId, found));
|
|
115
|
+
}
|
|
116
|
+
return found;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* A catalog the case names without a schema, as the suite means it: the basic catalog's
|
|
121
|
+
* components, and the ones the case places in it, taking what they are given.
|
|
122
|
+
*/
|
|
123
|
+
const withUsedComponents = (basic: Catalog<ComponentApi>, catalogId: string, testCase: Case) => {
|
|
124
|
+
const used = usedComponentsOf(testCase, catalogId);
|
|
125
|
+
if (used.size === 0) return withId(basic, catalogId);
|
|
126
|
+
const document = {
|
|
127
|
+
catalogId,
|
|
128
|
+
components: Object.fromEntries(
|
|
129
|
+
[...used].map(([type, properties]) => [
|
|
130
|
+
type,
|
|
131
|
+
{
|
|
132
|
+
properties: {
|
|
133
|
+
component: { const: type },
|
|
134
|
+
...Object.fromEntries([...properties].map((name) => [name, {}])),
|
|
135
|
+
},
|
|
136
|
+
required: ['component'],
|
|
137
|
+
type: 'object',
|
|
138
|
+
},
|
|
139
|
+
]),
|
|
140
|
+
),
|
|
141
|
+
protocolVersion: '1.0',
|
|
142
|
+
};
|
|
143
|
+
const own = Catalog.fromJson(document as never, '1.0') as Catalog<ComponentApi>;
|
|
144
|
+
return new Catalog<ComponentApi>(
|
|
145
|
+
catalogId,
|
|
146
|
+
'1.0',
|
|
147
|
+
[...basic.components.values(), ...own.components.values()],
|
|
148
|
+
[...basic.functions.values()] as never,
|
|
149
|
+
);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// The suite's own catalog a path names, from `conformance/test_data/catalogs/`.
|
|
153
|
+
const suiteCatalogOf = (file: string) =>
|
|
154
|
+
Catalog.fromJson(
|
|
155
|
+
JSON.parse(fs.readFileSync(path.join(SUITE, 'catalogs', path.basename(file)), 'utf8')) as never,
|
|
156
|
+
'1.0',
|
|
157
|
+
) as Catalog<ComponentApi>;
|
|
158
|
+
|
|
159
|
+
// The catalog ids the case's surfaces are created with.
|
|
160
|
+
const surfaceCatalogIdsOf = (value: unknown, ids = new Set<string>()): Set<string> => {
|
|
161
|
+
if (Array.isArray(value)) value.forEach((item) => surfaceCatalogIdsOf(item, ids));
|
|
162
|
+
else if (isRecord(value)) {
|
|
163
|
+
if (isRecord(value.createSurface) && typeof value.createSurface.catalogId === 'string') {
|
|
164
|
+
ids.add(value.createSurface.catalogId);
|
|
165
|
+
}
|
|
166
|
+
Object.values(value).forEach((item) => surfaceCatalogIdsOf(item, ids));
|
|
167
|
+
}
|
|
168
|
+
return ids;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The catalogs a case names, read as the suite means them: the basic catalog as this renderer
|
|
173
|
+
* builds it, under its own id and as `basic`, the suite's catalogs, inline ones, and, for a surface
|
|
174
|
+
* naming a catalog the case doesn't define, one with the basic components, unless the case is about
|
|
175
|
+
* that catalog being missing.
|
|
176
|
+
*/
|
|
177
|
+
const catalogsOf = (testCase: Case): Catalog<ComponentApi>[] => {
|
|
178
|
+
const basic = basicFor(testCase);
|
|
179
|
+
const catalogs = new Map<string, Catalog<ComponentApi>>([
|
|
180
|
+
[basic.id, basic],
|
|
181
|
+
['basic', withId(basic, 'basic')],
|
|
182
|
+
]);
|
|
183
|
+
const paths = Array.isArray(testCase.catalogPaths) ? (testCase.catalogPaths as string[]) : [];
|
|
184
|
+
for (const file of paths) {
|
|
185
|
+
if (!file.startsWith('conformance/test_data/catalogs/') || !file.endsWith('_v1_0.json'))
|
|
186
|
+
continue;
|
|
187
|
+
const catalog = suiteCatalogOf(file);
|
|
188
|
+
catalogs.set(catalog.id, catalog);
|
|
189
|
+
if (!catalogs.has('test-catalog'))
|
|
190
|
+
catalogs.set('test-catalog', withId(catalog, 'test-catalog'));
|
|
191
|
+
}
|
|
192
|
+
const inline = [
|
|
193
|
+
...(isRecord(testCase.catalog) ? [testCase.catalog] : []),
|
|
194
|
+
...(Array.isArray(testCase.catalogs) ? testCase.catalogs.filter(isRecord) : []),
|
|
195
|
+
];
|
|
196
|
+
for (const spec of inline) {
|
|
197
|
+
const schema = isRecord(spec.catalogSchema) ? spec.catalogSchema : undefined;
|
|
198
|
+
const version = String(spec.protocolVersion ?? schema?.protocolVersion ?? '1.0');
|
|
199
|
+
if (OTHER_VERSIONS.has(version)) continue;
|
|
200
|
+
if (schema) {
|
|
201
|
+
const catalog = Catalog.fromJson(schema as never, '1.0') as Catalog<ComponentApi>;
|
|
202
|
+
catalogs.set(catalog.id, catalog);
|
|
203
|
+
} else if (typeof spec.catalogId === 'string' && (spec.components || spec.functions)) {
|
|
204
|
+
const catalog = Catalog.fromJson(spec as never, '1.0') as Catalog<ComponentApi>;
|
|
205
|
+
catalogs.set(catalog.id, catalog);
|
|
206
|
+
} else if (typeof spec.catalogId === 'string') {
|
|
207
|
+
catalogs.set(spec.catalogId, withUsedComponents(basic, spec.catalogId, testCase));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const expectError = testCase.expectError ?? testCase.expect_error;
|
|
211
|
+
const expectsCatalogError = isRecord(expectError) && expectError.category === 'CatalogError';
|
|
212
|
+
if (!expectsCatalogError) {
|
|
213
|
+
for (const id of surfaceCatalogIdsOf(testCase)) {
|
|
214
|
+
if (!catalogs.has(id)) catalogs.set(id, withId(basic, id));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return [...catalogs.values()];
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// The error codes each of the suite's categories of error stands for.
|
|
221
|
+
const CATEGORY_CODES: Record<string, string[]> = {
|
|
222
|
+
CatalogError: ['CATALOG_NOT_FOUND', 'CATALOG_ERROR'],
|
|
223
|
+
DataError: ['DATA_ERROR'],
|
|
224
|
+
ExpressionError: ['EXPRESSION_ERROR', 'EXECUTION_ERROR', 'INVALID_FUNCTION_CALL'],
|
|
225
|
+
IntegrityError: ['INTEGRITY_ERROR', 'RECURSION_LIMIT_EXCEEDED'],
|
|
226
|
+
ParseError: ['VALIDATION_FAILED', 'EXPRESSION_ERROR'],
|
|
227
|
+
RecursionError: ['RECURSION_LIMIT_EXCEEDED'],
|
|
228
|
+
ValidationError: [
|
|
229
|
+
'VALIDATION_FAILED',
|
|
230
|
+
'UNALLOWED_PARENT',
|
|
231
|
+
'UNALLOWED_CHILD',
|
|
232
|
+
'INVALID_FUNCTION_CALL',
|
|
233
|
+
'EXPRESSION_ERROR',
|
|
234
|
+
'INTEGRITY_ERROR',
|
|
235
|
+
'RECURSION_LIMIT_EXCEEDED',
|
|
236
|
+
'CATALOG_NOT_FOUND',
|
|
237
|
+
'INVALID_ACTION',
|
|
238
|
+
],
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
type Reported = { code?: string; message?: string; path?: string };
|
|
242
|
+
|
|
243
|
+
// Whether a message says what the case expects: the words, in any case and quotes, or a match of
|
|
244
|
+
// the pattern.
|
|
245
|
+
const messageMatches = (expected: string, actual: string) => {
|
|
246
|
+
const normal = (text: string) => text.toLowerCase().replace(/"/g, "'");
|
|
247
|
+
const wanted = normal(expected);
|
|
248
|
+
const got = normal(actual);
|
|
249
|
+
if (got.includes(wanted)) return true;
|
|
250
|
+
try {
|
|
251
|
+
if (new RegExp(expected).test(actual)) return true;
|
|
252
|
+
} catch {
|
|
253
|
+
// Not a pattern: the words alone decide.
|
|
254
|
+
}
|
|
255
|
+
// The same failure in other words.
|
|
256
|
+
return (
|
|
257
|
+
(wanted.includes('circular') && (got.includes('circular') || got.includes('self-reference'))) ||
|
|
258
|
+
(wanted.includes('orphan') && got.includes('not reachable')) ||
|
|
259
|
+
(wanted.includes('is a required property') && got.includes('required'))
|
|
260
|
+
);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Whether one of `errors` meets what the case expects. The protocol's error codes are its
|
|
265
|
+
* contract, and the words of a message each engine's own, so a message decides only when the case
|
|
266
|
+
* gives nothing else: a category or a code, and a path, otherwise.
|
|
267
|
+
*/
|
|
268
|
+
const matchesExpectedError = (expected: unknown, errors: Reported[]) =>
|
|
269
|
+
errors.some((error) => {
|
|
270
|
+
if (typeof expected === 'string') return messageMatches(expected, String(error.message));
|
|
271
|
+
if (!isRecord(expected)) return true;
|
|
272
|
+
const { category, code, message } = expected;
|
|
273
|
+
if (typeof code === 'string' && error.code !== code) return false;
|
|
274
|
+
if (
|
|
275
|
+
typeof category === 'string' &&
|
|
276
|
+
CATEGORY_CODES[category] &&
|
|
277
|
+
!CATEGORY_CODES[category].includes(String(error.code))
|
|
278
|
+
) {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
if (
|
|
282
|
+
typeof message === 'string' &&
|
|
283
|
+
typeof code !== 'string' &&
|
|
284
|
+
typeof category !== 'string' &&
|
|
285
|
+
!messageMatches(message, String(error.message))
|
|
286
|
+
) {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
return true;
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
// A value as JSON writes it: `undefined` in a list as `null`, and left out of an object.
|
|
293
|
+
const asJSON = (value: unknown): unknown =>
|
|
294
|
+
value === undefined ? null : (JSON.parse(JSON.stringify(value)) as unknown);
|
|
295
|
+
|
|
296
|
+
// Whether `actual` holds what `expected` says, objects and lists in part, as JSON.
|
|
297
|
+
const contains = (expected: unknown, actual: unknown): boolean => holds(expected, asJSON(actual));
|
|
298
|
+
|
|
299
|
+
const holds = (expected: unknown, actual: unknown): boolean => {
|
|
300
|
+
if (Array.isArray(expected)) {
|
|
301
|
+
return (
|
|
302
|
+
Array.isArray(actual) &&
|
|
303
|
+
expected.length === actual.length &&
|
|
304
|
+
expected.every((item, index) => holds(item, actual[index]))
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
if (isRecord(expected)) {
|
|
308
|
+
return (
|
|
309
|
+
isRecord(actual) &&
|
|
310
|
+
Object.entries(expected).every(([key, value]) => holds(value, actual[key] ?? null))
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
if (typeof expected === 'number' && typeof actual === 'number') {
|
|
314
|
+
return Math.abs(expected - actual) < 1e-9;
|
|
315
|
+
}
|
|
316
|
+
// A Text shows what it is given as text.
|
|
317
|
+
if (typeof expected === 'string' && (typeof actual === 'number' || typeof actual === 'boolean')) {
|
|
318
|
+
return expected === String(actual);
|
|
319
|
+
}
|
|
320
|
+
return Object.is(expected, actual);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
const errorOf = (error: unknown): Reported =>
|
|
324
|
+
isRecord(error) || error instanceof Error
|
|
325
|
+
? {
|
|
326
|
+
code: String((error as { code?: unknown }).code ?? ''),
|
|
327
|
+
message: String((error as { message?: unknown }).message ?? ''),
|
|
328
|
+
}
|
|
329
|
+
: { message: String(error) };
|
|
330
|
+
|
|
331
|
+
const runEvaluateFunction = (testCase: Case) => {
|
|
332
|
+
const surfaceBlock = isRecord(testCase.surface) ? testCase.surface : undefined;
|
|
333
|
+
const catalogs = catalogsOf(testCase);
|
|
334
|
+
const catalogId = surfaceBlock ? (surfaceBlock.catalogId as string | undefined) : BASIC_ID;
|
|
335
|
+
const processor = new MessageProcessor(catalogs);
|
|
336
|
+
const errors: Reported[] = [];
|
|
337
|
+
processor.model.onError.subscribe((error) => {
|
|
338
|
+
errors.push(errorOf(error));
|
|
339
|
+
});
|
|
340
|
+
const created = processor.processMessagesWithErrors({
|
|
341
|
+
createSurface: {
|
|
342
|
+
surfaceId: 'main',
|
|
343
|
+
...(catalogId ? { catalogId } : {}),
|
|
344
|
+
dataModel: isRecord(testCase.dataModel) ? testCase.dataModel : {},
|
|
345
|
+
},
|
|
346
|
+
version: '1.0',
|
|
347
|
+
});
|
|
348
|
+
errors.push(...created.map(({ error }) => errorOf(error)));
|
|
349
|
+
const surface = processor.model.getSurface('main');
|
|
350
|
+
let value: unknown;
|
|
351
|
+
if (surface && !surfaceBlock) {
|
|
352
|
+
// Without a surface, the case calls the function's implementation directly, as a person's
|
|
353
|
+
// tap would, with the arguments as written.
|
|
354
|
+
const implementation = catalogs[0].functions.get(String(testCase.function)) as
|
|
355
|
+
| { execute: (args: unknown, context: DataContext) => unknown }
|
|
356
|
+
| undefined;
|
|
357
|
+
try {
|
|
358
|
+
if (!implementation)
|
|
359
|
+
throw Object.assign(new Error(`No function ${String(testCase.function)}`), {
|
|
360
|
+
code: 'EXPRESSION_ERROR',
|
|
361
|
+
});
|
|
362
|
+
const result = implementation.execute(
|
|
363
|
+
isRecord(testCase.args) ? testCase.args : {},
|
|
364
|
+
new DataContext(surface, '/'),
|
|
365
|
+
);
|
|
366
|
+
value = isSignal(result) ? peekValue(result) : result;
|
|
367
|
+
} catch (error) {
|
|
368
|
+
errors.push(errorOf(error));
|
|
369
|
+
}
|
|
370
|
+
} else if (surface) {
|
|
371
|
+
const call = {
|
|
372
|
+
'@call': testCase.function,
|
|
373
|
+
args: isRecord(testCase.args) ? testCase.args : {},
|
|
374
|
+
...(typeof testCase.catalogId === 'string' ? { catalogId: testCase.catalogId } : {}),
|
|
375
|
+
};
|
|
376
|
+
try {
|
|
377
|
+
value = peekValue(new DataContext(surface, '/').resolveSignal(call));
|
|
378
|
+
} catch (error) {
|
|
379
|
+
errors.push(errorOf(error));
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const expectError = testCase.expectError ?? testCase.expect_error;
|
|
383
|
+
if (expectError !== undefined) {
|
|
384
|
+
expect({ errors, matched: matchesExpectedError(expectError, errors) }).toMatchObject({
|
|
385
|
+
matched: true,
|
|
386
|
+
});
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
expect(errors).toEqual([]);
|
|
390
|
+
const expected = testCase.expect;
|
|
391
|
+
const actual =
|
|
392
|
+
typeof expected === 'boolean' && isRecord(value) && 'valid' in value ? value.valid : value;
|
|
393
|
+
expect({ actual, ok: contains(expected, actual) }).toMatchObject({ ok: true });
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
const runParseExpression = (testCase: Case) => {
|
|
397
|
+
const expectError = testCase.expectError ?? testCase.expect_error;
|
|
398
|
+
const parse = () => {
|
|
399
|
+
const parts = new ExpressionParser().parse(String(testCase.input)) as unknown[];
|
|
400
|
+
// Neighbouring literal text reads as one part, as the suite writes it.
|
|
401
|
+
const joined: unknown[] = [];
|
|
402
|
+
for (const part of parts) {
|
|
403
|
+
const last = joined.length - 1;
|
|
404
|
+
if (typeof part === 'string' && typeof joined[last] === 'string') {
|
|
405
|
+
joined[last] = `${joined[last] as string}${part}`;
|
|
406
|
+
} else joined.push(part);
|
|
407
|
+
}
|
|
408
|
+
return joined.filter((part) => part !== '');
|
|
409
|
+
};
|
|
410
|
+
if (expectError !== undefined) {
|
|
411
|
+
let thrown: unknown;
|
|
412
|
+
try {
|
|
413
|
+
parse();
|
|
414
|
+
} catch (error) {
|
|
415
|
+
thrown = error;
|
|
416
|
+
}
|
|
417
|
+
expect(thrown).toBeDefined();
|
|
418
|
+
expect(matchesExpectedError(expectError, [errorOf(thrown)])).toBe(true);
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
expect(parse()).toEqual(testCase.expect);
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
const messagesOf = (step: Record<string, unknown>) => {
|
|
425
|
+
const raw =
|
|
426
|
+
step.messages ?? step.payload ?? (step.message === undefined ? undefined : [step.message]);
|
|
427
|
+
if (raw === undefined) return undefined;
|
|
428
|
+
return Array.isArray(raw) ? raw : [raw];
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
// What the surfaces hold, as the case expects them: which exist, their data model and their
|
|
432
|
+
// components' types.
|
|
433
|
+
const expectSurfaces = (processor: MessageProcessor<ComponentApi>, expected: unknown) => {
|
|
434
|
+
const surfaces = isRecord(expected) && isRecord(expected.surfaces) ? expected.surfaces : {};
|
|
435
|
+
for (const [surfaceId, raw] of Object.entries(surfaces)) {
|
|
436
|
+
if (!isRecord(raw)) continue;
|
|
437
|
+
const surface = processor.model.getSurface(surfaceId);
|
|
438
|
+
if (raw.exists === false) {
|
|
439
|
+
expect(surface).toBeUndefined();
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
expect(surface).toBeDefined();
|
|
443
|
+
if (!surface) continue;
|
|
444
|
+
if ('sendDataModel' in raw) expect(surface.sendDataModel).toBe(raw.sendDataModel);
|
|
445
|
+
if ('dataModel' in raw) expect(asJSON(surface.dataModel.get('/'))).toEqual(raw.dataModel);
|
|
446
|
+
const resolved = resolvedComponentsOf(surface);
|
|
447
|
+
const components = isRecord(raw.components)
|
|
448
|
+
? Object.entries(raw.components)
|
|
449
|
+
: Array.isArray(raw.components)
|
|
450
|
+
? raw.components
|
|
451
|
+
.filter(isRecord)
|
|
452
|
+
.map((component) => [String(component.id), component] as const)
|
|
453
|
+
: [];
|
|
454
|
+
for (const [id, component] of components) {
|
|
455
|
+
const model = surface.componentsModel.get(id);
|
|
456
|
+
const node = resolved.get(id);
|
|
457
|
+
expect({ id, present: !!model || !!node }).toEqual({ id, present: true });
|
|
458
|
+
if (!isRecord(component)) continue;
|
|
459
|
+
if (typeof component.component === 'string') {
|
|
460
|
+
expect({ id, type: model?.type ?? node?.type }).toEqual({ id, type: component.component });
|
|
461
|
+
}
|
|
462
|
+
if (!node) continue;
|
|
463
|
+
for (const [key, value] of Object.entries(component)) {
|
|
464
|
+
if (key === 'id' || key === 'component' || key === 'metadata') continue;
|
|
465
|
+
const actual = unwrap(node.props[key]);
|
|
466
|
+
expect({ id, key, ok: contains(value, actual) }).toEqual({ id, key, ok: true });
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
// A bound or worked-out value as its value, nodes as their ids, all the way down.
|
|
473
|
+
const unwrap = (value: unknown): unknown => {
|
|
474
|
+
if (value instanceof ResolvedBinding) return unwrap(value.value);
|
|
475
|
+
if (isComponentNode(value)) return value.componentId;
|
|
476
|
+
if (Array.isArray(value)) return value.map(unwrap);
|
|
477
|
+
if (isRecord(value))
|
|
478
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, unwrap(item)]));
|
|
479
|
+
return value;
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Each component of a surface as it is resolved, by the id the suite gives it: a component's own,
|
|
484
|
+
* and for one repeated by a list template, its id with each index of its place, `item_0`.
|
|
485
|
+
*/
|
|
486
|
+
const resolvedComponentsOf = (surface: SurfaceModel<ComponentApi>) => {
|
|
487
|
+
const nodes = new Map<string, { props: Record<string, unknown>; type: string }>();
|
|
488
|
+
const resolver = new NodeResolver(surface, surface.defaultCatalog);
|
|
489
|
+
const visit = (value: unknown) => {
|
|
490
|
+
if (isComponentNode(value)) {
|
|
491
|
+
const indices = value.dataPath.split('/').filter((segment) => /^\d+$/.test(segment));
|
|
492
|
+
const id = [value.componentId, ...indices].join('_');
|
|
493
|
+
const props = peekValue(value.props) as Record<string, unknown>;
|
|
494
|
+
if (!nodes.has(id)) nodes.set(id, { props, type: value.type });
|
|
495
|
+
Object.values(props).forEach(visit);
|
|
496
|
+
} else if (value instanceof ResolvedBinding) visit(value.value);
|
|
497
|
+
else if (Array.isArray(value)) value.forEach(visit);
|
|
498
|
+
else if (isRecord(value)) Object.values(value).forEach(visit);
|
|
499
|
+
};
|
|
500
|
+
visit(peekValue(resolver.rootNode));
|
|
501
|
+
resolver.dispose();
|
|
502
|
+
return nodes;
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
const runProcessMessages = (testCase: Case) => {
|
|
506
|
+
const strict =
|
|
507
|
+
testCase.action === 'validate' ? testCase.strictMode !== false : testCase.strictMode === true;
|
|
508
|
+
const validationConfig = {
|
|
509
|
+
...(strict ? STRICT_VALIDATION : RELAXED_VALIDATION),
|
|
510
|
+
...(isRecord(testCase.validationConfig) ? testCase.validationConfig : {}),
|
|
511
|
+
};
|
|
512
|
+
const processor = new MessageProcessor(catalogsOf(testCase), undefined, { validationConfig });
|
|
513
|
+
const steps = Array.isArray(testCase.steps) ? testCase.steps.filter(isRecord) : [testCase];
|
|
514
|
+
steps.forEach((step, index) => {
|
|
515
|
+
const messages = messagesOf(step);
|
|
516
|
+
if (!messages) return;
|
|
517
|
+
const isLast = index === steps.length - 1;
|
|
518
|
+
const expectError =
|
|
519
|
+
step.expectError ??
|
|
520
|
+
step.expect_error ??
|
|
521
|
+
(isLast ? (testCase.expectError ?? testCase.expect_error) : undefined);
|
|
522
|
+
const errors: Reported[] = [];
|
|
523
|
+
const subscription = processor.model.onError.subscribe((error) => {
|
|
524
|
+
errors.push(errorOf(error));
|
|
525
|
+
});
|
|
526
|
+
try {
|
|
527
|
+
errors.push(
|
|
528
|
+
...processor
|
|
529
|
+
.processMessagesWithErrors(messages, { validationConfig })
|
|
530
|
+
.map(({ error }) => errorOf(error)),
|
|
531
|
+
);
|
|
532
|
+
} catch (error) {
|
|
533
|
+
errors.push(errorOf(error));
|
|
534
|
+
} finally {
|
|
535
|
+
subscription.unsubscribe();
|
|
536
|
+
}
|
|
537
|
+
if (expectError !== undefined) {
|
|
538
|
+
// What fails as the components are worked out, such as an expression that can't be read,
|
|
539
|
+
// fails when they are shown.
|
|
540
|
+
const resolving = processor.model.onError.subscribe((error) => {
|
|
541
|
+
errors.push(errorOf(error));
|
|
542
|
+
});
|
|
543
|
+
for (const surface of processor.getSurfaces().values()) {
|
|
544
|
+
try {
|
|
545
|
+
resolvedComponentsOf(surface);
|
|
546
|
+
} catch (error) {
|
|
547
|
+
errors.push(errorOf(error));
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
resolving.unsubscribe();
|
|
551
|
+
expect({ errors, matched: matchesExpectedError(expectError, errors) }).toMatchObject({
|
|
552
|
+
matched: true,
|
|
553
|
+
});
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
expect(errors).toEqual([]);
|
|
557
|
+
const expected = step.expect ?? (isLast ? testCase.expect : undefined);
|
|
558
|
+
if (expected !== undefined) expectSurfaces(processor, expected);
|
|
559
|
+
});
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
const RUNNERS: Record<string, (testCase: Case) => void> = {
|
|
563
|
+
evaluate_function: runEvaluateFunction,
|
|
564
|
+
parse_expression_template: runParseExpression,
|
|
565
|
+
process_messages: runProcessMessages,
|
|
566
|
+
validate: runProcessMessages,
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
describe.each(FILES)('A2UI conformance: %s', (file) => {
|
|
570
|
+
const cases = casesOf(file);
|
|
571
|
+
for (const testCase of cases) {
|
|
572
|
+
const reason = skipReason(testCase);
|
|
573
|
+
if (reason || !RUNS.has(testCase.action)) {
|
|
574
|
+
it.skip(`${testCase.name} (${reason ?? 'not run'})`, () => undefined);
|
|
575
|
+
continue;
|
|
576
|
+
}
|
|
577
|
+
it(testCase.name, () => RUNNERS[testCase.action](testCase));
|
|
578
|
+
}
|
|
579
|
+
});
|