stream-chat-react-native-core 9.12.1 → 9.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a2ui/package.json +6 -0
- package/ai-components/conversation/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 +237 -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 +64 -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 +374 -0
- package/lib/commonjs/ai-components/conversation/AIConversation.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/index.js +15 -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 +53 -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/useConversationRows.js +117 -0
- package/lib/commonjs/ai-components/conversation/useConversationRows.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIAgentError.js +13 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIAgentError.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIConversationController.js +431 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIConversationController.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIConversationExchange.js +89 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIConversationExchange.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/index.js +48 -0
- package/lib/commonjs/ai-components/conversation-state/controller/index.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/offers.js +35 -0
- package/lib/commonjs/ai-components/conversation-state/controller/offers.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/types.js +13 -0
- package/lib/commonjs/ai-components/conversation-state/controller/types.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/useAIConversationState.js +8 -0
- package/lib/commonjs/ai-components/conversation-state/controller/useAIConversationState.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/fromStreamMessage.js +67 -0
- package/lib/commonjs/ai-components/conversation-state/fromStreamMessage.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/index.js +37 -0
- package/lib/commonjs/ai-components/conversation-state/index.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/types.js +4 -0
- package/lib/commonjs/ai-components/conversation-state/types.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 +197 -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/keyboard.js +40 -0
- package/lib/commonjs/ai-components/internal/keyboard.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 +64 -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 +4 -2
- 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 +146 -20
- package/lib/commonjs/ai-components/message-composer/ComposerView.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/EditingMessageChip.js +81 -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 +133 -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 +40 -1
- package/lib/commonjs/i18n/en.json +40 -1
- package/lib/commonjs/i18n/es.json +40 -1
- package/lib/commonjs/i18n/fr.json +40 -1
- package/lib/commonjs/i18n/he.json +40 -1
- package/lib/commonjs/i18n/hi.json +40 -1
- package/lib/commonjs/i18n/it.json +40 -1
- package/lib/commonjs/i18n/ja.json +40 -1
- package/lib/commonjs/i18n/ko.json +40 -1
- package/lib/commonjs/i18n/nl.json +40 -1
- package/lib/commonjs/i18n/pt-br.json +40 -1
- package/lib/commonjs/i18n/ru.json +40 -1
- package/lib/commonjs/i18n/tr.json +40 -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 +237 -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 +64 -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 +374 -0
- package/lib/module/ai-components/conversation/AIConversation.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/index.js +15 -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 +53 -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/useConversationRows.js +117 -0
- package/lib/module/ai-components/conversation/useConversationRows.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/AIAgentError.js +13 -0
- package/lib/module/ai-components/conversation-state/controller/AIAgentError.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/AIConversationController.js +431 -0
- package/lib/module/ai-components/conversation-state/controller/AIConversationController.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/AIConversationExchange.js +89 -0
- package/lib/module/ai-components/conversation-state/controller/AIConversationExchange.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/index.js +48 -0
- package/lib/module/ai-components/conversation-state/controller/index.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/offers.js +35 -0
- package/lib/module/ai-components/conversation-state/controller/offers.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/types.js +13 -0
- package/lib/module/ai-components/conversation-state/controller/types.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/useAIConversationState.js +8 -0
- package/lib/module/ai-components/conversation-state/controller/useAIConversationState.js.map +1 -0
- package/lib/module/ai-components/conversation-state/fromStreamMessage.js +67 -0
- package/lib/module/ai-components/conversation-state/fromStreamMessage.js.map +1 -0
- package/lib/module/ai-components/conversation-state/index.js +37 -0
- package/lib/module/ai-components/conversation-state/index.js.map +1 -0
- package/lib/module/ai-components/conversation-state/types.js +4 -0
- package/lib/module/ai-components/conversation-state/types.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 +197 -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/keyboard.js +40 -0
- package/lib/module/ai-components/internal/keyboard.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 +64 -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 +4 -2
- 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 +146 -20
- package/lib/module/ai-components/message-composer/ComposerView.js.map +1 -1
- package/lib/module/ai-components/message-composer/EditingMessageChip.js +81 -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 +133 -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 +40 -1
- package/lib/module/i18n/en.json +40 -1
- package/lib/module/i18n/es.json +40 -1
- package/lib/module/i18n/fr.json +40 -1
- package/lib/module/i18n/he.json +40 -1
- package/lib/module/i18n/hi.json +40 -1
- package/lib/module/i18n/it.json +40 -1
- package/lib/module/i18n/ja.json +40 -1
- package/lib/module/i18n/ko.json +40 -1
- package/lib/module/i18n/nl.json +40 -1
- package/lib/module/i18n/pt-br.json +40 -1
- package/lib/module/i18n/ru.json +40 -1
- package/lib/module/i18n/tr.json +40 -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 +133 -0
- package/lib/typescript/ai-components/conversation/AIConversation.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/index.d.ts +3 -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/useConversationRows.d.ts +66 -0
- package/lib/typescript/ai-components/conversation/useConversationRows.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIAgentError.d.ts +10 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIAgentError.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIConversationController.d.ts +173 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIConversationController.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIConversationExchange.d.ts +23 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIConversationExchange.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/index.d.ts +5 -0
- package/lib/typescript/ai-components/conversation-state/controller/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/offers.d.ts +25 -0
- package/lib/typescript/ai-components/conversation-state/controller/offers.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/types.d.ts +142 -0
- package/lib/typescript/ai-components/conversation-state/controller/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/useAIConversationState.d.ts +9 -0
- package/lib/typescript/ai-components/conversation-state/controller/useAIConversationState.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/fromStreamMessage.d.ts +25 -0
- package/lib/typescript/ai-components/conversation-state/fromStreamMessage.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/index.d.ts +4 -0
- package/lib/typescript/ai-components/conversation-state/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/types.d.ts +55 -0
- package/lib/typescript/ai-components/conversation-state/types.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 +76 -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/keyboard.d.ts +9 -0
- package/lib/typescript/ai-components/internal/keyboard.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 +1 -1
- 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 +39 -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 +40 -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 +40 -1
- package/lib/typescript/i18n/en.json +40 -1
- package/lib/typescript/i18n/es.json +40 -1
- package/lib/typescript/i18n/fr.json +40 -1
- package/lib/typescript/i18n/he.json +40 -1
- package/lib/typescript/i18n/hi.json +40 -1
- package/lib/typescript/i18n/it.json +40 -1
- package/lib/typescript/i18n/ja.json +40 -1
- package/lib/typescript/i18n/ko.json +40 -1
- package/lib/typescript/i18n/nl.json +40 -1
- package/lib/typescript/i18n/pt-br.json +40 -1
- package/lib/typescript/i18n/ru.json +40 -1
- package/lib/typescript/i18n/tr.json +40 -1
- package/lib/typescript/utils/i18n/Streami18n.d.ts +41 -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 +270 -0
- package/src/a2ui/__tests__/A2UIInstructions.test.ts +233 -0
- package/src/a2ui/__tests__/A2UIRenderer.test.tsx +1559 -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 +64 -3
- package/src/ai-components/StreamingMessageView.tsx +27 -3
- package/src/ai-components/__tests__/ComposerView.test.tsx +247 -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 +787 -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 +606 -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 +385 -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/__tests__/withoutKeyboardController.test.tsx +60 -0
- 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 +612 -0
- package/src/ai-components/conversation/entries.ts +177 -0
- package/src/ai-components/conversation/index.ts +2 -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 +52 -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/useConversationRows.ts +231 -0
- package/src/ai-components/conversation-state/controller/AIAgentError.ts +14 -0
- package/src/ai-components/conversation-state/controller/AIConversationController.ts +628 -0
- package/src/ai-components/conversation-state/controller/AIConversationExchange.ts +132 -0
- package/src/ai-components/conversation-state/controller/index.ts +4 -0
- package/src/ai-components/conversation-state/controller/offers.ts +53 -0
- package/src/ai-components/conversation-state/controller/types.ts +154 -0
- package/src/ai-components/conversation-state/controller/useAIConversationState.ts +21 -0
- package/src/ai-components/conversation-state/fromStreamMessage.ts +89 -0
- package/src/ai-components/conversation-state/index.ts +3 -0
- package/src/ai-components/conversation-state/types.ts +57 -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 +229 -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/keyboard.tsx +34 -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 +100 -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 +10 -5
- 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 +194 -30
- package/src/ai-components/message-composer/EditingMessageChip.tsx +62 -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 +145 -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 +40 -1
- package/src/i18n/en.json +40 -1
- package/src/i18n/es.json +40 -1
- package/src/i18n/fr.json +40 -1
- package/src/i18n/he.json +40 -1
- package/src/i18n/hi.json +40 -1
- package/src/i18n/it.json +40 -1
- package/src/i18n/ja.json +40 -1
- package/src/i18n/ko.json +40 -1
- package/src/i18n/nl.json +40 -1
- package/src/i18n/pt-br.json +40 -1
- package/src/i18n/ru.json +40 -1
- package/src/i18n/tr.json +40 -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,634 @@
|
|
|
1
|
+
import { Linking } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { aiUICamelCase, aiUIDate } from '../generative-ui/AIUIArguments';
|
|
4
|
+
import { utf8ByteLength } from '../generative-ui/AIUIHelpers';
|
|
5
|
+
import {
|
|
6
|
+
AI_UI_ACTION_MAX_BYTES,
|
|
7
|
+
type AIUIAction,
|
|
8
|
+
aiUIActionJSON,
|
|
9
|
+
aiUIActionProblem,
|
|
10
|
+
AIUICascade,
|
|
11
|
+
aiUIComponentDefinitionJSON,
|
|
12
|
+
AIUIHost,
|
|
13
|
+
AIUIToolError,
|
|
14
|
+
AIUIParameterType,
|
|
15
|
+
type AIUIRenderer,
|
|
16
|
+
decodeAIUIArguments,
|
|
17
|
+
defineAIUIComponent,
|
|
18
|
+
fromStreamMessage,
|
|
19
|
+
isWebOrEmailLink,
|
|
20
|
+
parseAIUIComponentDefinition,
|
|
21
|
+
parseAIUIDocument,
|
|
22
|
+
requiredAIUIParameter,
|
|
23
|
+
} from '../index';
|
|
24
|
+
|
|
25
|
+
import type { AIMessage } from '../index';
|
|
26
|
+
|
|
27
|
+
// The components the Swift assistant describes once for every platform.
|
|
28
|
+
const uiComponents = [
|
|
29
|
+
{
|
|
30
|
+
description: 'One place of a plan, with its photo and a short summary.',
|
|
31
|
+
events: [{ description: 'Tapping the card asks you about the place.', name: 'ask_about' }],
|
|
32
|
+
name: 'place_card',
|
|
33
|
+
parameters: {
|
|
34
|
+
properties: {
|
|
35
|
+
note: { description: 'One short line about it for this plan', type: 'string' },
|
|
36
|
+
title: {
|
|
37
|
+
description: "The place's exact English Wikipedia title",
|
|
38
|
+
type: 'string',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
required: ['title'],
|
|
42
|
+
type: 'object',
|
|
43
|
+
'x-order': ['title', 'note'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
description: 'A map of a plan with a pin for each place.',
|
|
48
|
+
events: [{ description: 'Tapping a pin asks you about that place.', name: 'select_place' }],
|
|
49
|
+
name: 'trip_map',
|
|
50
|
+
parameters: {
|
|
51
|
+
properties: {
|
|
52
|
+
places: {
|
|
53
|
+
description: 'Every place of the plan, with its coordinates',
|
|
54
|
+
items: {
|
|
55
|
+
properties: {
|
|
56
|
+
latitude: { type: 'number' },
|
|
57
|
+
longitude: { type: 'number' },
|
|
58
|
+
name: { type: 'string' },
|
|
59
|
+
},
|
|
60
|
+
required: ['name', 'latitude', 'longitude'],
|
|
61
|
+
type: 'object',
|
|
62
|
+
'x-order': ['name', 'latitude', 'longitude'],
|
|
63
|
+
},
|
|
64
|
+
type: 'array',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
required: ['places'],
|
|
68
|
+
type: 'object',
|
|
69
|
+
'x-order': ['places'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
description: "The person's own calendar for the days of a plan.",
|
|
74
|
+
events: [],
|
|
75
|
+
name: 'calendar_check',
|
|
76
|
+
parameters: {
|
|
77
|
+
properties: {
|
|
78
|
+
end: {
|
|
79
|
+
description: 'The last day, as YYYY-MM-DD',
|
|
80
|
+
format: 'date',
|
|
81
|
+
type: 'string',
|
|
82
|
+
},
|
|
83
|
+
start: {
|
|
84
|
+
description: 'The first day, as YYYY-MM-DD',
|
|
85
|
+
format: 'date',
|
|
86
|
+
type: 'string',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
required: ['start', 'end'],
|
|
90
|
+
type: 'object',
|
|
91
|
+
'x-order': ['start', 'end'],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
const reply = (id: string, ui?: unknown): AIMessage =>
|
|
97
|
+
fromStreamMessage({
|
|
98
|
+
ai_generated: true,
|
|
99
|
+
ai_ui: ui,
|
|
100
|
+
attachments: [],
|
|
101
|
+
id,
|
|
102
|
+
text: 'Here.',
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// A renderer that records what its engine was given, and shows a document's text.
|
|
106
|
+
const recordingRenderer = (format: string, supports?: (version?: string) => boolean) => {
|
|
107
|
+
const log: string[] = [];
|
|
108
|
+
const renderer: AIUIRenderer = {
|
|
109
|
+
createEngine: () => {
|
|
110
|
+
log.push('engine');
|
|
111
|
+
return {
|
|
112
|
+
receive: (document, messageId) => log.push(`receive ${messageId} ${document.content}`),
|
|
113
|
+
remove: (messageId) => log.push(`remove ${messageId}`),
|
|
114
|
+
view: (document) => (document.content === 'nothing' ? null : `${document.content}`),
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
format,
|
|
118
|
+
supports,
|
|
119
|
+
};
|
|
120
|
+
return { log, renderer };
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
describe('AIUIDocument', () => {
|
|
124
|
+
it('reads the format, version, status and content of a reply’s ai_ui', () => {
|
|
125
|
+
expect(
|
|
126
|
+
parseAIUIDocument({
|
|
127
|
+
content: '{"version":"1.0"}',
|
|
128
|
+
format: 'a2ui',
|
|
129
|
+
status: 'streaming',
|
|
130
|
+
v: 1,
|
|
131
|
+
version: '1.0',
|
|
132
|
+
}),
|
|
133
|
+
).toEqual({
|
|
134
|
+
content: '{"version":"1.0"}',
|
|
135
|
+
format: 'a2ui',
|
|
136
|
+
isStreaming: true,
|
|
137
|
+
version: '1.0',
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('treats only status streaming as being written', () => {
|
|
142
|
+
for (const status of ['complete', undefined, 'other']) {
|
|
143
|
+
expect(parseAIUIDocument({ content: 'x', format: 'openui', status })?.isStreaming).toBe(
|
|
144
|
+
false,
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('keeps JSON content, as a backend can send A2UI messages as JSON', () => {
|
|
150
|
+
const content = [{ version: '1.0' }];
|
|
151
|
+
expect(parseAIUIDocument({ content, format: 'a2ui' })?.content).toBe(content);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('reads none without a format or content, or from a field newer than this SDK', () => {
|
|
155
|
+
expect(parseAIUIDocument(undefined)).toBeUndefined();
|
|
156
|
+
expect(parseAIUIDocument({ content: 'x' })).toBeUndefined();
|
|
157
|
+
expect(parseAIUIDocument({ content: 'x', format: '' })).toBeUndefined();
|
|
158
|
+
expect(parseAIUIDocument({ content: null, format: 'a2ui' })).toBeUndefined();
|
|
159
|
+
expect(parseAIUIDocument({ content: 'x', format: 'a2ui', v: 2 })).toBeUndefined();
|
|
160
|
+
expect(parseAIUIDocument({ content: 'x', format: 'a2ui' })).toBeDefined();
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it('treats an empty version as none', () => {
|
|
164
|
+
expect(parseAIUIDocument({ content: 'x', format: 'a2ui', version: '' })).not.toHaveProperty(
|
|
165
|
+
'version',
|
|
166
|
+
);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('is read from a reply only, never from a person’s message', () => {
|
|
170
|
+
const ui = { content: 'x', format: 'a2ui' };
|
|
171
|
+
expect(reply('a1', ui).uiDocument?.format).toBe('a2ui');
|
|
172
|
+
expect(
|
|
173
|
+
fromStreamMessage({ ai_ui: ui, attachments: [], id: 'u1', text: 'Hi' }).uiDocument,
|
|
174
|
+
).toBeUndefined();
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
describe('AIUIAction', () => {
|
|
179
|
+
const action: AIUIAction = {
|
|
180
|
+
format: 'a2ui',
|
|
181
|
+
label: 'Update the plan',
|
|
182
|
+
messageId: 'reply-1',
|
|
183
|
+
name: 'update_plan',
|
|
184
|
+
payload: { pace: 'relaxed' },
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
it('goes to the agent as the JSON its backend reads, with the label as the text', () => {
|
|
188
|
+
expect(aiUIActionJSON(action)).toEqual({
|
|
189
|
+
format: 'a2ui',
|
|
190
|
+
message_id: 'reply-1',
|
|
191
|
+
name: 'update_plan',
|
|
192
|
+
payload: { pace: 'relaxed' },
|
|
193
|
+
v: 1,
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('names what the agent’s backend would refuse before it is sent', () => {
|
|
198
|
+
expect(aiUIActionProblem(action)).toBeUndefined();
|
|
199
|
+
expect(aiUIActionProblem({ ...action, messageId: '' })).toMatch(/reply/);
|
|
200
|
+
expect(aiUIActionProblem({ ...action, name: '' })).toMatch(/what happened/);
|
|
201
|
+
expect(
|
|
202
|
+
aiUIActionProblem({
|
|
203
|
+
...action,
|
|
204
|
+
payload: { notes: 'x'.repeat(AI_UI_ACTION_MAX_BYTES) },
|
|
205
|
+
}),
|
|
206
|
+
).toMatch(/at most 8192 bytes/);
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
describe('AIUIComponentDefinition', () => {
|
|
211
|
+
it('reads the portable JSON every platform shares, keeping the parameters’ order', () => {
|
|
212
|
+
const [placeCard, tripMap] = uiComponents.map(parseAIUIComponentDefinition);
|
|
213
|
+
expect(placeCard?.parameters.map(({ isRequired, name }) => [name, isRequired])).toEqual([
|
|
214
|
+
['title', true],
|
|
215
|
+
['note', false],
|
|
216
|
+
]);
|
|
217
|
+
expect(placeCard?.parameters[0]?.description).toMatch(/Wikipedia/);
|
|
218
|
+
expect(placeCard?.events).toEqual([
|
|
219
|
+
{
|
|
220
|
+
description: 'Tapping the card asks you about the place.',
|
|
221
|
+
name: 'ask_about',
|
|
222
|
+
parameters: [],
|
|
223
|
+
},
|
|
224
|
+
]);
|
|
225
|
+
expect(tripMap?.parameters[0]?.type.type).toBe('array');
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it('writes the JSON it reads', () => {
|
|
229
|
+
for (const json of uiComponents) {
|
|
230
|
+
const definition = parseAIUIComponentDefinition(json);
|
|
231
|
+
expect(definition).toBeDefined();
|
|
232
|
+
if (!definition) continue;
|
|
233
|
+
expect(parseAIUIComponentDefinition(aiUIComponentDefinitionJSON(definition))).toEqual(
|
|
234
|
+
definition,
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it('orders the fields an object leaves unordered by name, after those it orders', () => {
|
|
240
|
+
const definition = parseAIUIComponentDefinition({
|
|
241
|
+
name: 'card',
|
|
242
|
+
parameters: {
|
|
243
|
+
properties: {
|
|
244
|
+
a: { type: 'string' },
|
|
245
|
+
b: { type: 'string' },
|
|
246
|
+
c: { type: 'string' },
|
|
247
|
+
},
|
|
248
|
+
'x-order': ['c'],
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
expect(definition?.parameters.map(({ name }) => name)).toEqual(['c', 'a', 'b']);
|
|
252
|
+
expect(definition?.description).toBe('');
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it('reads none without a name', () => {
|
|
256
|
+
expect(parseAIUIComponentDefinition({ description: 'x' })).toBeUndefined();
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
describe('decodeAIUIArguments', () => {
|
|
261
|
+
const [placeCard, tripMap, calendarCheck] = uiComponents.map(
|
|
262
|
+
(json) => parseAIUIComponentDefinition(json)?.parameters ?? [],
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
it('reads the snake_case the agent writes as camelCase', () => {
|
|
266
|
+
expect(aiUICamelCase('place_name')).toBe('placeName');
|
|
267
|
+
expect(aiUICamelCase('_private_key_')).toBe('_privateKey_');
|
|
268
|
+
expect(aiUICamelCase('title')).toBe('title');
|
|
269
|
+
expect(
|
|
270
|
+
decodeAIUIArguments(
|
|
271
|
+
{ best_time: 'sunset', note: 'Best at sunset', title: 'Kaneo' },
|
|
272
|
+
placeCard ?? [],
|
|
273
|
+
),
|
|
274
|
+
).toEqual({ bestTime: 'sunset', note: 'Best at sunset', title: 'Kaneo' });
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it('waits while a required argument is missing or of another type, as while it streams in', () => {
|
|
278
|
+
expect(decodeAIUIArguments({ note: 'Best at sunset' }, placeCard ?? [])).toBeUndefined();
|
|
279
|
+
expect(decodeAIUIArguments({ title: 3 }, placeCard ?? [])).toBeUndefined();
|
|
280
|
+
expect(
|
|
281
|
+
decodeAIUIArguments({ places: [{ latitude: 41.1, name: 'Kaneo' }] }, tripMap ?? []),
|
|
282
|
+
).toBeUndefined();
|
|
283
|
+
expect(
|
|
284
|
+
decodeAIUIArguments(
|
|
285
|
+
{ places: [{ latitude: 41.1, longitude: 20.79, name: 'Kaneo' }] },
|
|
286
|
+
tripMap ?? [],
|
|
287
|
+
),
|
|
288
|
+
).toEqual({ places: [{ latitude: 41.1, longitude: 20.79, name: 'Kaneo' }] });
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it('reads whole days as their start where the person is, and RFC 3339 moments', () => {
|
|
292
|
+
const decoded = decodeAIUIArguments<{ end: Date; start: Date }>(
|
|
293
|
+
{ end: '2026-11-15T18:00:00Z', start: '2026-11-14' },
|
|
294
|
+
calendarCheck ?? [],
|
|
295
|
+
);
|
|
296
|
+
expect(decoded?.start).toEqual(new Date(2026, 10, 14));
|
|
297
|
+
expect(decoded?.end.toISOString()).toBe('2026-11-15T18:00:00.000Z');
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
it('refuses dates the calendar does not have, and loose strings', () => {
|
|
301
|
+
expect(aiUIDate('2026-02-30')).toBeUndefined();
|
|
302
|
+
expect(aiUIDate('2026-2-3')).toBeUndefined();
|
|
303
|
+
expect(aiUIDate('next Friday')).toBeUndefined();
|
|
304
|
+
expect(aiUIDate('1700000000')).toBeUndefined();
|
|
305
|
+
expect(decodeAIUIArguments({ end: 'soon', start: '2026-11-14' }, calendarCheck ?? [])).toBe(
|
|
306
|
+
undefined,
|
|
307
|
+
);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it('checks enumerations, integers and nested objects', () => {
|
|
311
|
+
const parameters = [
|
|
312
|
+
requiredAIUIParameter('pace', AIUIParameterType.enumeration(['relaxed', 'busy'])),
|
|
313
|
+
requiredAIUIParameter('days', AIUIParameterType.integer),
|
|
314
|
+
requiredAIUIParameter(
|
|
315
|
+
'stay',
|
|
316
|
+
AIUIParameterType.object([requiredAIUIParameter('hotel_name', AIUIParameterType.string)]),
|
|
317
|
+
),
|
|
318
|
+
];
|
|
319
|
+
expect(
|
|
320
|
+
decodeAIUIArguments({ days: 2, pace: 'relaxed', stay: { hotel_name: 'Tino' } }, parameters),
|
|
321
|
+
).toEqual({ days: 2, pace: 'relaxed', stay: { hotelName: 'Tino' } });
|
|
322
|
+
expect(
|
|
323
|
+
decodeAIUIArguments({ days: 2, pace: 'lazy', stay: { hotel_name: 'Tino' } }, parameters),
|
|
324
|
+
).toBeUndefined();
|
|
325
|
+
expect(
|
|
326
|
+
decodeAIUIArguments({ days: 2.5, pace: 'busy', stay: { hotel_name: 'Tino' } }, parameters),
|
|
327
|
+
).toBeUndefined();
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
// Written in pieces, as a literal script link reads as eval to the linter.
|
|
332
|
+
const scriptLink = ['java', 'script:alert(1)'].join('');
|
|
333
|
+
|
|
334
|
+
describe('AIUIHost', () => {
|
|
335
|
+
const host = (renderers: AIUIRenderer[], send = jest.fn()) => new AIUIHost({ renderers, send });
|
|
336
|
+
|
|
337
|
+
it('shows a document with the first renderer that reads its format and version', () => {
|
|
338
|
+
const old = recordingRenderer('a2ui', (version) => version === '0.9');
|
|
339
|
+
const current = recordingRenderer('a2ui', (version) => version === '1.0');
|
|
340
|
+
const ui = host([old.renderer, current.renderer]);
|
|
341
|
+
const document = {
|
|
342
|
+
content: 'card',
|
|
343
|
+
format: 'a2ui',
|
|
344
|
+
isStreaming: false,
|
|
345
|
+
version: '1.0',
|
|
346
|
+
};
|
|
347
|
+
expect(ui.canShow(document)).toBe(true);
|
|
348
|
+
expect(ui.content(document, 'a1')).toBe('card');
|
|
349
|
+
expect(old.log).toEqual([]);
|
|
350
|
+
expect(current.log).toEqual(['engine']);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it('shows nothing for a format or version no renderer reads, so the text shows', () => {
|
|
354
|
+
const { renderer } = recordingRenderer('a2ui', (version) => version === '1.0');
|
|
355
|
+
const ui = host([renderer]);
|
|
356
|
+
for (const document of [
|
|
357
|
+
{ content: 'x', format: 'openui', isStreaming: false },
|
|
358
|
+
{ content: 'x', format: 'a2ui', isStreaming: false, version: '2.0' },
|
|
359
|
+
]) {
|
|
360
|
+
expect(ui.canShow(document)).toBe(false);
|
|
361
|
+
expect(ui.content(document, 'a1')).toBeNull();
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
it('says a renderer can show what its engine then shows nothing of its own for', () => {
|
|
366
|
+
const { renderer } = recordingRenderer('a2ui');
|
|
367
|
+
const ui = host([renderer]);
|
|
368
|
+
const document = { content: 'nothing', format: 'a2ui', isStreaming: false };
|
|
369
|
+
expect(ui.canShow(document)).toBe(true);
|
|
370
|
+
expect(ui.content(document, 'a1')).toBeNull();
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
it('keeps one engine per renderer for as long as it lives', () => {
|
|
374
|
+
const { log, renderer } = recordingRenderer('a2ui');
|
|
375
|
+
const ui = host([renderer]);
|
|
376
|
+
ui.content({ content: 'a', format: 'a2ui', isStreaming: false }, 'a1');
|
|
377
|
+
ui.content({ content: 'b', format: 'a2ui', isStreaming: false }, 'a2');
|
|
378
|
+
expect(log.filter((line) => line === 'engine')).toHaveLength(1);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
it('hands every reply’s document to its engine, oldest first, only as it arrives or changes', () => {
|
|
382
|
+
const { log, renderer } = recordingRenderer('a2ui');
|
|
383
|
+
const ui = host([renderer]);
|
|
384
|
+
const person: AIMessage = {
|
|
385
|
+
id: 'u1',
|
|
386
|
+
role: 'user',
|
|
387
|
+
text: 'Plan',
|
|
388
|
+
uiDocument: undefined,
|
|
389
|
+
};
|
|
390
|
+
const first = [
|
|
391
|
+
reply('a1', { content: 'one', format: 'a2ui' }),
|
|
392
|
+
person,
|
|
393
|
+
reply('a2', { content: 'two', format: 'a2ui', status: 'streaming' }),
|
|
394
|
+
reply('a3'),
|
|
395
|
+
];
|
|
396
|
+
ui.receive(first);
|
|
397
|
+
// the same documents in new message objects, as while a reply streams
|
|
398
|
+
ui.receive(first.map((message) => ({ ...message })));
|
|
399
|
+
ui.receive([
|
|
400
|
+
first[0] as AIMessage,
|
|
401
|
+
person,
|
|
402
|
+
reply('a2', { content: 'two more', format: 'a2ui', status: 'complete' }),
|
|
403
|
+
]);
|
|
404
|
+
expect(log).toEqual(['engine', 'receive a1 one', 'receive a2 two', 'receive a2 two more']);
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
it('tells the engine when a reply or its UI leaves, and forgets its state', async () => {
|
|
408
|
+
const { log, renderer } = recordingRenderer('a2ui');
|
|
409
|
+
const ui = host([renderer]);
|
|
410
|
+
ui.receive([reply('a1', { content: 'one', format: 'a2ui' })]);
|
|
411
|
+
ui.setState('a1', { pace: 'relaxed' });
|
|
412
|
+
expect(ui.state('a1')).toEqual({ pace: 'relaxed' });
|
|
413
|
+
ui.receive([reply('a1')]);
|
|
414
|
+
// after the render that left it out, which may be thrown away
|
|
415
|
+
expect(log).not.toContain('remove a1');
|
|
416
|
+
await Promise.resolve();
|
|
417
|
+
expect(log).toContain('remove a1');
|
|
418
|
+
expect(ui.state('a1')).toBeUndefined();
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
it('keeps the state of a reply that comes back in the same render', async () => {
|
|
422
|
+
const { log, renderer } = recordingRenderer('a2ui');
|
|
423
|
+
const ui = host([renderer]);
|
|
424
|
+
const first = reply('a1', { content: 'one', format: 'a2ui' });
|
|
425
|
+
ui.receive([first]);
|
|
426
|
+
ui.setState('a1', { pace: 'relaxed' });
|
|
427
|
+
// a render React throws away, then the one it keeps
|
|
428
|
+
ui.receive([]);
|
|
429
|
+
ui.receive([first]);
|
|
430
|
+
await Promise.resolve();
|
|
431
|
+
expect(log).not.toContain('remove a1');
|
|
432
|
+
expect(ui.state('a1')).toEqual({ pace: 'relaxed' });
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
it('sends a reply’s actions in the order they happened, past one that fails', async () => {
|
|
436
|
+
const sent: string[] = [];
|
|
437
|
+
let release: () => void = () => undefined;
|
|
438
|
+
const slow = new Promise<void>((resolve) => {
|
|
439
|
+
release = resolve;
|
|
440
|
+
});
|
|
441
|
+
const onError = jest.fn();
|
|
442
|
+
const ui = new AIUIHost({
|
|
443
|
+
onError,
|
|
444
|
+
renderers: [],
|
|
445
|
+
send: async (action) => {
|
|
446
|
+
if (action.name === 'first') await slow;
|
|
447
|
+
if (action.name === 'second') throw new Error('offline');
|
|
448
|
+
sent.push(action.name);
|
|
449
|
+
},
|
|
450
|
+
});
|
|
451
|
+
const action = (name: string): AIUIAction => ({
|
|
452
|
+
format: 'a2ui',
|
|
453
|
+
label: name,
|
|
454
|
+
messageId: 'a1',
|
|
455
|
+
name,
|
|
456
|
+
payload: {},
|
|
457
|
+
});
|
|
458
|
+
const first = ui.send(action('first'));
|
|
459
|
+
const second = ui.send(action('second'));
|
|
460
|
+
const last = ui.send(action('third'));
|
|
461
|
+
release();
|
|
462
|
+
// each says whether it was sent
|
|
463
|
+
expect(await Promise.all([first, second, last])).toEqual([true, false, true]);
|
|
464
|
+
expect(sent).toEqual(['first', 'third']);
|
|
465
|
+
expect(onError).toHaveBeenCalledTimes(1);
|
|
466
|
+
expect(onError.mock.calls[0]?.[1]).toMatchObject({ name: 'second' });
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
it('does not send an action the agent’s backend would refuse', async () => {
|
|
470
|
+
const send = jest.fn();
|
|
471
|
+
const onError = jest.fn();
|
|
472
|
+
const ui = new AIUIHost({ onError, renderers: [], send });
|
|
473
|
+
const sent = await ui.send({
|
|
474
|
+
format: 'a2ui',
|
|
475
|
+
label: 'Go',
|
|
476
|
+
messageId: '',
|
|
477
|
+
name: 'go',
|
|
478
|
+
payload: {},
|
|
479
|
+
});
|
|
480
|
+
expect(sent).toBe(false);
|
|
481
|
+
expect(send).not.toHaveBeenCalled();
|
|
482
|
+
expect(onError).toHaveBeenCalledTimes(1);
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
it('opens only web and email links by default, as the agent writes them', () => {
|
|
486
|
+
expect(isWebOrEmailLink('https://example.com')).toBe(true);
|
|
487
|
+
expect(isWebOrEmailLink('mailto:hi@example.com')).toBe(true);
|
|
488
|
+
for (const link of [
|
|
489
|
+
'tel:+123',
|
|
490
|
+
'sms:+123',
|
|
491
|
+
scriptLink,
|
|
492
|
+
'file:///etc/passwd',
|
|
493
|
+
'https:',
|
|
494
|
+
'https:///path',
|
|
495
|
+
'https://exa mple.com',
|
|
496
|
+
'https://example.com/\u0007',
|
|
497
|
+
]) {
|
|
498
|
+
expect(isWebOrEmailLink(link)).toBe(false);
|
|
499
|
+
}
|
|
500
|
+
const opened = jest.spyOn(Linking, 'openURL').mockResolvedValue(undefined);
|
|
501
|
+
const warn = jest.spyOn(console, 'warn').mockImplementation(() => undefined);
|
|
502
|
+
const ui = host([]);
|
|
503
|
+
ui.open(scriptLink);
|
|
504
|
+
ui.open('not a link');
|
|
505
|
+
expect(opened).not.toHaveBeenCalled();
|
|
506
|
+
ui.open(' https://en.wikipedia.org/wiki/Ohrid ');
|
|
507
|
+
expect(opened).toHaveBeenCalledWith('https://en.wikipedia.org/wiki/Ohrid');
|
|
508
|
+
opened.mockRestore();
|
|
509
|
+
warn.mockRestore();
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
it('opens links the app’s way when it says how', () => {
|
|
513
|
+
const open = jest.fn();
|
|
514
|
+
const ui = new AIUIHost({ open, renderers: [], send: jest.fn() });
|
|
515
|
+
ui.open('tel:+123');
|
|
516
|
+
expect(open).toHaveBeenCalledWith('tel:+123');
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
it('runs the app’s tools for a reply’s UI, and refuses one it does not have', async () => {
|
|
520
|
+
const ui = new AIUIHost({
|
|
521
|
+
renderers: [],
|
|
522
|
+
send: jest.fn(),
|
|
523
|
+
tools: [
|
|
524
|
+
{
|
|
525
|
+
definition: { annotations: { readOnlyHint: true }, name: 'weather' },
|
|
526
|
+
run: (call) => ({
|
|
527
|
+
output: { city: (call.arguments as { city: string }).city, sky: 'clear' },
|
|
528
|
+
}),
|
|
529
|
+
},
|
|
530
|
+
],
|
|
531
|
+
});
|
|
532
|
+
await expect(ui.runTool('weather', { city: 'Ohrid' })).resolves.toEqual({
|
|
533
|
+
city: 'Ohrid',
|
|
534
|
+
sky: 'clear',
|
|
535
|
+
});
|
|
536
|
+
await expect(ui.runTool('calendar')).rejects.toThrow('No tool named calendar');
|
|
537
|
+
await expect(ui.runTool('calendar')).rejects.toBeInstanceOf(AIUIToolError);
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
it('runs a tool that changes something only when the person started it', async () => {
|
|
541
|
+
const run = jest.fn(() => ({ output: 'Booked' }));
|
|
542
|
+
const ui = new AIUIHost({
|
|
543
|
+
renderers: [],
|
|
544
|
+
send: jest.fn(),
|
|
545
|
+
tools: [{ definition: { name: 'book' }, run }],
|
|
546
|
+
});
|
|
547
|
+
await expect(ui.runTool('book')).rejects.toThrow("book isn't read-only");
|
|
548
|
+
expect(run).not.toHaveBeenCalled();
|
|
549
|
+
await expect(ui.runTool('book', {}, { userInitiated: true })).resolves.toBe('Booked');
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
it('refuses a tool’s failure and output that isn’t JSON, naming the tool', async () => {
|
|
553
|
+
const looped: Record<string, unknown> = {};
|
|
554
|
+
looped.self = looped;
|
|
555
|
+
const readOnly = { annotations: { readOnlyHint: true } };
|
|
556
|
+
const ui = new AIUIHost({
|
|
557
|
+
renderers: [],
|
|
558
|
+
send: jest.fn(),
|
|
559
|
+
tools: [
|
|
560
|
+
{ definition: { ...readOnly, name: 'down' }, run: () => ({ failure: 'Offline' }) },
|
|
561
|
+
{
|
|
562
|
+
definition: { ...readOnly, name: 'broken' },
|
|
563
|
+
run: () => {
|
|
564
|
+
throw new Error('boom');
|
|
565
|
+
},
|
|
566
|
+
},
|
|
567
|
+
{ definition: { ...readOnly, name: 'loop' }, run: () => ({ output: looped }) },
|
|
568
|
+
{ definition: { ...readOnly, name: 'fn' }, run: () => ({ output: () => 1 }) },
|
|
569
|
+
],
|
|
570
|
+
});
|
|
571
|
+
await expect(ui.runTool('down')).rejects.toThrow('Offline');
|
|
572
|
+
await expect(ui.runTool('broken')).rejects.toThrow('broken failed: boom');
|
|
573
|
+
await expect(ui.runTool('loop')).rejects.toThrow("loop gave output that isn't JSON");
|
|
574
|
+
await expect(ui.runTool('fn')).rejects.toThrow("fn gave output that isn't JSON");
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
it('describes the formats it reads and the app’s components to the agent’s backend', async () => {
|
|
578
|
+
const renderer: AIUIRenderer = {
|
|
579
|
+
capabilities: (components) => ({
|
|
580
|
+
catalog_id: 'app',
|
|
581
|
+
components: components.length,
|
|
582
|
+
}),
|
|
583
|
+
createEngine: () => ({ view: () => null }),
|
|
584
|
+
format: 'a2ui',
|
|
585
|
+
};
|
|
586
|
+
// One whose capabilities take writing, such as its instructions.
|
|
587
|
+
const written: AIUIRenderer = {
|
|
588
|
+
capabilities: () => Promise.resolve({ instructions: 'Write OpenUI.' }),
|
|
589
|
+
createEngine: () => ({ view: () => null }),
|
|
590
|
+
format: 'openui',
|
|
591
|
+
};
|
|
592
|
+
const definition = parseAIUIComponentDefinition(uiComponents[0]);
|
|
593
|
+
if (!definition) throw new Error('no definition');
|
|
594
|
+
const ui = new AIUIHost({
|
|
595
|
+
components: [defineAIUIComponent(definition, () => null)],
|
|
596
|
+
renderers: [renderer, written],
|
|
597
|
+
send: jest.fn(),
|
|
598
|
+
});
|
|
599
|
+
expect(await ui.capabilities()).toEqual({
|
|
600
|
+
components: [aiUIComponentDefinitionJSON(definition)],
|
|
601
|
+
renderers: [
|
|
602
|
+
{ catalog_id: 'app', components: 1, format: 'a2ui' },
|
|
603
|
+
{ format: 'openui', instructions: 'Write OpenUI.' },
|
|
604
|
+
],
|
|
605
|
+
tools: [],
|
|
606
|
+
v: 1,
|
|
607
|
+
});
|
|
608
|
+
expect(ui.component('place_card')?.definition).toBe(definition);
|
|
609
|
+
});
|
|
610
|
+
});
|
|
611
|
+
|
|
612
|
+
describe('utf8ByteLength', () => {
|
|
613
|
+
it('counts bytes as UTF-8 does, as the agent’s backend counts an action', () => {
|
|
614
|
+
for (const text of ['', 'Ohrid', 'Охрид', '日本', 'a😀b', '\u{1F600}\u{1F600}']) {
|
|
615
|
+
expect(utf8ByteLength(text)).toBe(Buffer.byteLength(text, 'utf8'));
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
describe('AIUICascade', () => {
|
|
621
|
+
it('spaces out parts that come in together, waiting at most 0.4 seconds', () => {
|
|
622
|
+
const cascade = new AIUICascade();
|
|
623
|
+
const delays = [0, 1, 2, 3, 4, 5].map(() => cascade.delay(10));
|
|
624
|
+
expect(delays.map((delay) => Math.round(delay * 10) / 10)).toEqual([
|
|
625
|
+
0, 0.1, 0.2, 0.3, 0.4, 0.4,
|
|
626
|
+
]);
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
it('lets a part that comes in alone in at once', () => {
|
|
630
|
+
const cascade = new AIUICascade();
|
|
631
|
+
expect(cascade.delay(10)).toBe(0);
|
|
632
|
+
expect(cascade.delay(11)).toBe(0);
|
|
633
|
+
});
|
|
634
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { keyboardOverlapOf } from '../conversation/list/useKeyboardOverlap';
|
|
2
|
+
|
|
3
|
+
describe('keyboardOverlapOf', () => {
|
|
4
|
+
it('is how far the keyboard rises past the offset, as far as it is open', () => {
|
|
5
|
+
expect(keyboardOverlapOf({ height: 300, progress: 1 }, 34)).toBe(266);
|
|
6
|
+
// Halfway through opening, the offset counts by half.
|
|
7
|
+
expect(keyboardOverlapOf({ height: 150, progress: 0.5 }, 34)).toBe(133);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('is nothing while the keyboard is down or below the offset', () => {
|
|
11
|
+
expect(keyboardOverlapOf({ height: 0, progress: 0 }, 34)).toBe(0);
|
|
12
|
+
expect(keyboardOverlapOf({ height: 20, progress: 1 }, 34)).toBe(0);
|
|
13
|
+
});
|
|
14
|
+
});
|