stream-chat-react-native-core 9.12.1-beta.1 → 9.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a2ui/package.json +6 -0
- package/lib/commonjs/a11y/a11yUtils.js.map +1 -1
- package/lib/commonjs/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -1
- package/lib/commonjs/a2ui/A2UIContexts.js +8 -0
- package/lib/commonjs/a2ui/A2UIContexts.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIInstructions.js +49 -0
- package/lib/commonjs/a2ui/A2UIInstructions.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIPlaceholder.js +37 -0
- package/lib/commonjs/a2ui/A2UIPlaceholder.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIRenderer.js +363 -0
- package/lib/commonjs/a2ui/A2UIRenderer.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIStream.js +91 -0
- package/lib/commonjs/a2ui/A2UIStream.js.map +1 -0
- package/lib/commonjs/a2ui/A2UISurface.js +212 -0
- package/lib/commonjs/a2ui/A2UISurface.js.map +1 -0
- package/lib/commonjs/a2ui/basicCatalog.json +1206 -0
- package/lib/commonjs/a2ui/basicFunctions.js +398 -0
- package/lib/commonjs/a2ui/basicFunctions.js.map +1 -0
- package/lib/commonjs/a2ui/catalogDocument.js +80 -0
- package/lib/commonjs/a2ui/catalogDocument.js.map +1 -0
- package/lib/commonjs/a2ui/catalogs.js +105 -0
- package/lib/commonjs/a2ui/catalogs.js.map +1 -0
- package/lib/commonjs/a2ui/components/DateTimeInput.js +445 -0
- package/lib/commonjs/a2ui/components/DateTimeInput.js.map +1 -0
- package/lib/commonjs/a2ui/components/Media.js +316 -0
- package/lib/commonjs/a2ui/components/Media.js.map +1 -0
- package/lib/commonjs/a2ui/components/basicComponents.js +975 -0
- package/lib/commonjs/a2ui/components/basicComponents.js.map +1 -0
- package/lib/commonjs/a2ui/components/iconPaths.js +66 -0
- package/lib/commonjs/a2ui/components/iconPaths.js.map +1 -0
- package/lib/commonjs/a2ui/components/types.js +4 -0
- package/lib/commonjs/a2ui/components/types.js.map +1 -0
- package/lib/commonjs/a2ui/index.js +70 -0
- package/lib/commonjs/a2ui/index.js.map +1 -0
- package/lib/commonjs/a2ui/instructions.js +268 -0
- package/lib/commonjs/a2ui/instructions.js.map +1 -0
- package/lib/commonjs/a2ui/secrets.js +169 -0
- package/lib/commonjs/a2ui/secrets.js.map +1 -0
- package/lib/commonjs/a2ui/useReplyState.js +35 -0
- package/lib/commonjs/a2ui/useReplyState.js.map +1 -0
- package/lib/commonjs/ai-components/AITypingIndicatorView.js +8 -18
- package/lib/commonjs/ai-components/AITypingIndicatorView.js.map +1 -1
- package/lib/commonjs/ai-components/README.md +55 -3
- package/lib/commonjs/ai-components/StreamingMessageView.js +26 -0
- package/lib/commonjs/ai-components/StreamingMessageView.js.map +1 -1
- package/lib/commonjs/ai-components/charts/components/PieLegend.js +2 -1
- package/lib/commonjs/ai-components/charts/components/PieLegend.js.map +1 -1
- package/lib/commonjs/ai-components/charts/components/VictoryChart.js +7 -2
- package/lib/commonjs/ai-components/charts/components/VictoryChart.js.map +1 -1
- package/lib/commonjs/ai-components/charts/utils/format-time-label.js +15 -0
- package/lib/commonjs/ai-components/charts/utils/format-time-label.js.map +1 -0
- package/lib/commonjs/ai-components/charts/vega-lite/schema.js +17 -2
- package/lib/commonjs/ai-components/charts/vega-lite/schema.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/composer-context.js +13 -6
- package/lib/commonjs/ai-components/contexts/composer-context.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/index.js +11 -0
- package/lib/commonjs/ai-components/contexts/index.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/theme-context.js +33 -2
- package/lib/commonjs/ai-components/contexts/theme-context.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/translation-context.js +29 -0
- package/lib/commonjs/ai-components/contexts/translation-context.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/AIConversation.js +366 -0
- package/lib/commonjs/ai-components/conversation/AIConversation.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/AIAgentError.js +13 -0
- package/lib/commonjs/ai-components/conversation/controller/AIAgentError.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/AIConversationController.js +425 -0
- package/lib/commonjs/ai-components/conversation/controller/AIConversationController.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/AIConversationExchange.js +89 -0
- package/lib/commonjs/ai-components/conversation/controller/AIConversationExchange.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/index.js +48 -0
- package/lib/commonjs/ai-components/conversation/controller/index.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/offers.js +29 -0
- package/lib/commonjs/ai-components/conversation/controller/offers.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/types.js +13 -0
- package/lib/commonjs/ai-components/conversation/controller/types.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/controller/useAIConversationState.js +8 -0
- package/lib/commonjs/ai-components/conversation/controller/useAIConversationState.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/entries.js +98 -0
- package/lib/commonjs/ai-components/conversation/entries.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/fromStreamMessage.js +66 -0
- package/lib/commonjs/ai-components/conversation/fromStreamMessage.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/index.js +48 -0
- package/lib/commonjs/ai-components/conversation/index.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/AIChatList.js +224 -0
- package/lib/commonjs/ai-components/conversation/list/AIChatList.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useChatListController.js +78 -0
- package/lib/commonjs/ai-components/conversation/list/useChatListController.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useEndInView.js +51 -0
- package/lib/commonjs/ai-components/conversation/list/useEndInView.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useKeyboardOverlap.js +54 -0
- package/lib/commonjs/ai-components/conversation/list/useKeyboardOverlap.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useLoadOlder.js +73 -0
- package/lib/commonjs/ai-components/conversation/list/useLoadOlder.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/usePinnedAnchor.js +84 -0
- package/lib/commonjs/ai-components/conversation/list/usePinnedAnchor.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/types.js +4 -0
- package/lib/commonjs/ai-components/conversation/types.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/useConversationRows.js +117 -0
- package/lib/commonjs/ai-components/conversation/useConversationRows.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIAction.js +30 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIAction.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIArguments.js +128 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIArguments.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponent.js +50 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponent.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponentDefinition.js +134 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponentDefinition.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIDocument.js +32 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIDocument.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIEntrance.js +193 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIEntrance.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIErrorBoundary.js +30 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIErrorBoundary.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHelpers.js +54 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHelpers.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHost.js +259 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHost.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIMedia.js +24 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIMedia.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIRenderer.js +10 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIRenderer.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIView.js +57 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIView.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/index.js +181 -0
- package/lib/commonjs/ai-components/generative-ui/index.js.map +1 -0
- package/lib/commonjs/ai-components/icons.js +44 -0
- package/lib/commonjs/ai-components/icons.js.map +1 -0
- package/lib/commonjs/ai-components/index.js +96 -0
- package/lib/commonjs/ai-components/index.js.map +1 -1
- package/lib/commonjs/ai-components/internal/Shimmer.js +36 -0
- package/lib/commonjs/ai-components/internal/Shimmer.js.map +1 -0
- package/lib/commonjs/ai-components/internal/format.js +66 -0
- package/lib/commonjs/ai-components/internal/format.js.map +1 -0
- package/lib/commonjs/ai-components/internal/hooks/useBottomSafeArea.js +12 -0
- package/lib/commonjs/ai-components/internal/hooks/useBottomSafeArea.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/AgentIcons.js +74 -0
- package/lib/commonjs/ai-components/internal/icons/AgentIcons.js.map +1 -0
- package/lib/commonjs/ai-components/internal/tokens.js +11 -0
- package/lib/commonjs/ai-components/internal/tokens.js.map +1 -0
- package/lib/commonjs/ai-components/internal/uuid.js +21 -0
- package/lib/commonjs/ai-components/internal/uuid.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/CodeBlock.js +4 -2
- package/lib/commonjs/ai-components/markdown/components/CodeBlock.js.map +1 -1
- package/lib/commonjs/ai-components/markdown/components/InlineCode.js +1 -0
- package/lib/commonjs/ai-components/markdown/components/InlineCode.js.map +1 -1
- package/lib/commonjs/ai-components/markdown/components/Text.js +11 -2
- package/lib/commonjs/ai-components/markdown/components/Text.js.map +1 -1
- package/lib/commonjs/ai-components/markdown/styles.js +27 -29
- package/lib/commonjs/ai-components/markdown/styles.js.map +1 -1
- package/lib/commonjs/ai-components/message/AIAssistantMessage.js +63 -0
- package/lib/commonjs/ai-components/message/AIAssistantMessage.js.map +1 -0
- package/lib/commonjs/ai-components/message/AIMessageAttachment.js +189 -0
- package/lib/commonjs/ai-components/message/AIMessageAttachment.js.map +1 -0
- package/lib/commonjs/ai-components/message/AIReplyActions.js +132 -0
- package/lib/commonjs/ai-components/message/AIReplyActions.js.map +1 -0
- package/lib/commonjs/ai-components/message/AIUserMessage.js +104 -0
- package/lib/commonjs/ai-components/message/AIUserMessage.js.map +1 -0
- package/lib/commonjs/ai-components/message/UserMessageMenu.js +150 -0
- package/lib/commonjs/ai-components/message/UserMessageMenu.js.map +1 -0
- package/lib/commonjs/ai-components/message/index.js +48 -0
- package/lib/commonjs/ai-components/message/index.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ActionButton.js +2 -1
- package/lib/commonjs/ai-components/message-composer/ActionButton.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/ActionSheet.js +22 -6
- package/lib/commonjs/ai-components/message-composer/ActionSheet.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/AttachmentButton.js +5 -1
- package/lib/commonjs/ai-components/message-composer/AttachmentButton.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/ChatOptions.js +147 -0
- package/lib/commonjs/ai-components/message-composer/ChatOptions.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ComposerView.js +136 -20
- package/lib/commonjs/ai-components/message-composer/ComposerView.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/EditingMessageChip.js +80 -0
- package/lib/commonjs/ai-components/message-composer/EditingMessageChip.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js +26 -1
- package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/index.js +11 -0
- package/lib/commonjs/ai-components/message-composer/index.js.map +1 -1
- package/lib/commonjs/ai-components/message-parts/AIMessageParts.js +110 -0
- package/lib/commonjs/ai-components/message-parts/AIMessageParts.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/AIToolApproval.js +197 -0
- package/lib/commonjs/ai-components/message-parts/AIToolApproval.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/AIToolAuthorization.js +250 -0
- package/lib/commonjs/ai-components/message-parts/AIToolAuthorization.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/AIToolCall.js +159 -0
- package/lib/commonjs/ai-components/message-parts/AIToolCall.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/callStates.js +54 -0
- package/lib/commonjs/ai-components/message-parts/callStates.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/index.js +70 -0
- package/lib/commonjs/ai-components/message-parts/index.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/parseMessageParts.js +126 -0
- package/lib/commonjs/ai-components/message-parts/parseMessageParts.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/types.js +2 -0
- package/lib/commonjs/ai-components/message-parts/types.js.map +1 -0
- package/lib/commonjs/ai-components/native-specs/NativeAIAgent.js +7 -0
- package/lib/commonjs/ai-components/native-specs/NativeAIAgent.js.map +1 -0
- package/lib/commonjs/ai-components/reasoning/AIReasoning.js +401 -0
- package/lib/commonjs/ai-components/reasoning/AIReasoning.js.map +1 -0
- package/lib/commonjs/ai-components/reasoning/index.js +26 -0
- package/lib/commonjs/ai-components/reasoning/index.js.map +1 -0
- package/lib/commonjs/ai-components/reasoning/thinkingClock.js +63 -0
- package/lib/commonjs/ai-components/reasoning/thinkingClock.js.map +1 -0
- package/lib/commonjs/ai-components/services/clipboard-service/expo.js +7 -2
- package/lib/commonjs/ai-components/services/clipboard-service/expo.js.map +1 -1
- package/lib/commonjs/ai-components/store/composer/store.js.map +1 -1
- package/lib/commonjs/ai-components/store/composer/useComposerChatOption.js +18 -0
- package/lib/commonjs/ai-components/store/composer/useComposerChatOption.js.map +1 -0
- package/lib/commonjs/ai-components/store/composer/useComposerIsEditing.js +18 -0
- package/lib/commonjs/ai-components/store/composer/useComposerIsEditing.js.map +1 -0
- package/lib/commonjs/ai-components/store/index.js +22 -0
- package/lib/commonjs/ai-components/store/index.js.map +1 -1
- package/lib/commonjs/ai-components/suggestions/AISuggestions.js +66 -0
- package/lib/commonjs/ai-components/suggestions/AISuggestions.js.map +1 -0
- package/lib/commonjs/ai-components/suggestions/index.js +15 -0
- package/lib/commonjs/ai-components/suggestions/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js +2 -1
- package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -1
- package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js +3 -2
- package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js.map +1 -1
- package/lib/commonjs/ai-components/theme.js +137 -1
- package/lib/commonjs/ai-components/theme.js.map +1 -1
- package/lib/commonjs/ai-components/tool-calls/AIClientIdentity.js +22 -0
- package/lib/commonjs/ai-components/tool-calls/AIClientIdentity.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/AIClientToolRunner.js +109 -0
- package/lib/commonjs/ai-components/tool-calls/AIClientToolRunner.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/AIToolApprover.js +23 -0
- package/lib/commonjs/ai-components/tool-calls/AIToolApprover.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/authSessionAuthorizer.js +88 -0
- package/lib/commonjs/ai-components/tool-calls/authSessionAuthorizer.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/index.js +48 -0
- package/lib/commonjs/ai-components/tool-calls/index.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/glowShader.js.map +1 -1
- package/lib/commonjs/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/utils/renderText.js.map +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +2 -2
- package/lib/commonjs/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/commonjs/i18n/ar.json +39 -1
- package/lib/commonjs/i18n/en.json +39 -1
- package/lib/commonjs/i18n/es.json +39 -1
- package/lib/commonjs/i18n/fr.json +39 -1
- package/lib/commonjs/i18n/he.json +39 -1
- package/lib/commonjs/i18n/hi.json +39 -1
- package/lib/commonjs/i18n/it.json +39 -1
- package/lib/commonjs/i18n/ja.json +39 -1
- package/lib/commonjs/i18n/ko.json +39 -1
- package/lib/commonjs/i18n/nl.json +39 -1
- package/lib/commonjs/i18n/pt-br.json +39 -1
- package/lib/commonjs/i18n/ru.json +39 -1
- package/lib/commonjs/i18n/tr.json +39 -1
- package/lib/commonjs/mock-builders/a2ui/ohrid.js +84 -0
- package/lib/commonjs/mock-builders/a2ui/ohrid.js.map +1 -0
- package/lib/commonjs/utils/i18n/Streami18n.js +9 -4
- package/lib/commonjs/utils/i18n/Streami18n.js.map +1 -1
- package/lib/commonjs/utils/i18n/utils.js +7 -0
- package/lib/commonjs/utils/i18n/utils.js.map +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/a11y/a11yUtils.js.map +1 -1
- package/lib/module/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -1
- package/lib/module/a2ui/A2UIContexts.js +8 -0
- package/lib/module/a2ui/A2UIContexts.js.map +1 -0
- package/lib/module/a2ui/A2UIInstructions.js +49 -0
- package/lib/module/a2ui/A2UIInstructions.js.map +1 -0
- package/lib/module/a2ui/A2UIPlaceholder.js +37 -0
- package/lib/module/a2ui/A2UIPlaceholder.js.map +1 -0
- package/lib/module/a2ui/A2UIRenderer.js +363 -0
- package/lib/module/a2ui/A2UIRenderer.js.map +1 -0
- package/lib/module/a2ui/A2UIStream.js +91 -0
- package/lib/module/a2ui/A2UIStream.js.map +1 -0
- package/lib/module/a2ui/A2UISurface.js +212 -0
- package/lib/module/a2ui/A2UISurface.js.map +1 -0
- package/lib/module/a2ui/basicCatalog.json +1206 -0
- package/lib/module/a2ui/basicFunctions.js +398 -0
- package/lib/module/a2ui/basicFunctions.js.map +1 -0
- package/lib/module/a2ui/catalogDocument.js +80 -0
- package/lib/module/a2ui/catalogDocument.js.map +1 -0
- package/lib/module/a2ui/catalogs.js +105 -0
- package/lib/module/a2ui/catalogs.js.map +1 -0
- package/lib/module/a2ui/components/DateTimeInput.js +445 -0
- package/lib/module/a2ui/components/DateTimeInput.js.map +1 -0
- package/lib/module/a2ui/components/Media.js +316 -0
- package/lib/module/a2ui/components/Media.js.map +1 -0
- package/lib/module/a2ui/components/basicComponents.js +975 -0
- package/lib/module/a2ui/components/basicComponents.js.map +1 -0
- package/lib/module/a2ui/components/iconPaths.js +66 -0
- package/lib/module/a2ui/components/iconPaths.js.map +1 -0
- package/lib/module/a2ui/components/types.js +4 -0
- package/lib/module/a2ui/components/types.js.map +1 -0
- package/lib/module/a2ui/index.js +70 -0
- package/lib/module/a2ui/index.js.map +1 -0
- package/lib/module/a2ui/instructions.js +268 -0
- package/lib/module/a2ui/instructions.js.map +1 -0
- package/lib/module/a2ui/secrets.js +169 -0
- package/lib/module/a2ui/secrets.js.map +1 -0
- package/lib/module/a2ui/useReplyState.js +35 -0
- package/lib/module/a2ui/useReplyState.js.map +1 -0
- package/lib/module/ai-components/AITypingIndicatorView.js +8 -18
- package/lib/module/ai-components/AITypingIndicatorView.js.map +1 -1
- package/lib/module/ai-components/README.md +55 -3
- package/lib/module/ai-components/StreamingMessageView.js +26 -0
- package/lib/module/ai-components/StreamingMessageView.js.map +1 -1
- package/lib/module/ai-components/charts/components/PieLegend.js +2 -1
- package/lib/module/ai-components/charts/components/PieLegend.js.map +1 -1
- package/lib/module/ai-components/charts/components/VictoryChart.js +7 -2
- package/lib/module/ai-components/charts/components/VictoryChart.js.map +1 -1
- package/lib/module/ai-components/charts/utils/format-time-label.js +15 -0
- package/lib/module/ai-components/charts/utils/format-time-label.js.map +1 -0
- package/lib/module/ai-components/charts/vega-lite/schema.js +17 -2
- package/lib/module/ai-components/charts/vega-lite/schema.js.map +1 -1
- package/lib/module/ai-components/contexts/composer-context.js +13 -6
- package/lib/module/ai-components/contexts/composer-context.js.map +1 -1
- package/lib/module/ai-components/contexts/index.js +11 -0
- package/lib/module/ai-components/contexts/index.js.map +1 -1
- package/lib/module/ai-components/contexts/theme-context.js +33 -2
- package/lib/module/ai-components/contexts/theme-context.js.map +1 -1
- package/lib/module/ai-components/contexts/translation-context.js +29 -0
- package/lib/module/ai-components/contexts/translation-context.js.map +1 -0
- package/lib/module/ai-components/conversation/AIConversation.js +366 -0
- package/lib/module/ai-components/conversation/AIConversation.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/AIAgentError.js +13 -0
- package/lib/module/ai-components/conversation/controller/AIAgentError.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/AIConversationController.js +425 -0
- package/lib/module/ai-components/conversation/controller/AIConversationController.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/AIConversationExchange.js +89 -0
- package/lib/module/ai-components/conversation/controller/AIConversationExchange.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/index.js +48 -0
- package/lib/module/ai-components/conversation/controller/index.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/offers.js +29 -0
- package/lib/module/ai-components/conversation/controller/offers.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/types.js +13 -0
- package/lib/module/ai-components/conversation/controller/types.js.map +1 -0
- package/lib/module/ai-components/conversation/controller/useAIConversationState.js +8 -0
- package/lib/module/ai-components/conversation/controller/useAIConversationState.js.map +1 -0
- package/lib/module/ai-components/conversation/entries.js +98 -0
- package/lib/module/ai-components/conversation/entries.js.map +1 -0
- package/lib/module/ai-components/conversation/fromStreamMessage.js +66 -0
- package/lib/module/ai-components/conversation/fromStreamMessage.js.map +1 -0
- package/lib/module/ai-components/conversation/index.js +48 -0
- package/lib/module/ai-components/conversation/index.js.map +1 -0
- package/lib/module/ai-components/conversation/list/AIChatList.js +224 -0
- package/lib/module/ai-components/conversation/list/AIChatList.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useChatListController.js +78 -0
- package/lib/module/ai-components/conversation/list/useChatListController.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useEndInView.js +51 -0
- package/lib/module/ai-components/conversation/list/useEndInView.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useKeyboardOverlap.js +54 -0
- package/lib/module/ai-components/conversation/list/useKeyboardOverlap.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useLoadOlder.js +73 -0
- package/lib/module/ai-components/conversation/list/useLoadOlder.js.map +1 -0
- package/lib/module/ai-components/conversation/list/usePinnedAnchor.js +84 -0
- package/lib/module/ai-components/conversation/list/usePinnedAnchor.js.map +1 -0
- package/lib/module/ai-components/conversation/types.js +4 -0
- package/lib/module/ai-components/conversation/types.js.map +1 -0
- package/lib/module/ai-components/conversation/useConversationRows.js +117 -0
- package/lib/module/ai-components/conversation/useConversationRows.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIAction.js +30 -0
- package/lib/module/ai-components/generative-ui/AIUIAction.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIArguments.js +128 -0
- package/lib/module/ai-components/generative-ui/AIUIArguments.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIComponent.js +50 -0
- package/lib/module/ai-components/generative-ui/AIUIComponent.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIComponentDefinition.js +134 -0
- package/lib/module/ai-components/generative-ui/AIUIComponentDefinition.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIDocument.js +32 -0
- package/lib/module/ai-components/generative-ui/AIUIDocument.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIEntrance.js +193 -0
- package/lib/module/ai-components/generative-ui/AIUIEntrance.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIErrorBoundary.js +30 -0
- package/lib/module/ai-components/generative-ui/AIUIErrorBoundary.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIHelpers.js +54 -0
- package/lib/module/ai-components/generative-ui/AIUIHelpers.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIHost.js +259 -0
- package/lib/module/ai-components/generative-ui/AIUIHost.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIMedia.js +24 -0
- package/lib/module/ai-components/generative-ui/AIUIMedia.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIRenderer.js +10 -0
- package/lib/module/ai-components/generative-ui/AIUIRenderer.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIView.js +57 -0
- package/lib/module/ai-components/generative-ui/AIUIView.js.map +1 -0
- package/lib/module/ai-components/generative-ui/index.js +181 -0
- package/lib/module/ai-components/generative-ui/index.js.map +1 -0
- package/lib/module/ai-components/icons.js +44 -0
- package/lib/module/ai-components/icons.js.map +1 -0
- package/lib/module/ai-components/index.js +96 -0
- package/lib/module/ai-components/index.js.map +1 -1
- package/lib/module/ai-components/internal/Shimmer.js +36 -0
- package/lib/module/ai-components/internal/Shimmer.js.map +1 -0
- package/lib/module/ai-components/internal/format.js +66 -0
- package/lib/module/ai-components/internal/format.js.map +1 -0
- package/lib/module/ai-components/internal/hooks/useBottomSafeArea.js +12 -0
- package/lib/module/ai-components/internal/hooks/useBottomSafeArea.js.map +1 -0
- package/lib/module/ai-components/internal/icons/AgentIcons.js +74 -0
- package/lib/module/ai-components/internal/icons/AgentIcons.js.map +1 -0
- package/lib/module/ai-components/internal/tokens.js +11 -0
- package/lib/module/ai-components/internal/tokens.js.map +1 -0
- package/lib/module/ai-components/internal/uuid.js +21 -0
- package/lib/module/ai-components/internal/uuid.js.map +1 -0
- package/lib/module/ai-components/markdown/components/CodeBlock.js +4 -2
- package/lib/module/ai-components/markdown/components/CodeBlock.js.map +1 -1
- package/lib/module/ai-components/markdown/components/InlineCode.js +1 -0
- package/lib/module/ai-components/markdown/components/InlineCode.js.map +1 -1
- package/lib/module/ai-components/markdown/components/Text.js +11 -2
- package/lib/module/ai-components/markdown/components/Text.js.map +1 -1
- package/lib/module/ai-components/markdown/styles.js +27 -29
- package/lib/module/ai-components/markdown/styles.js.map +1 -1
- package/lib/module/ai-components/message/AIAssistantMessage.js +63 -0
- package/lib/module/ai-components/message/AIAssistantMessage.js.map +1 -0
- package/lib/module/ai-components/message/AIMessageAttachment.js +189 -0
- package/lib/module/ai-components/message/AIMessageAttachment.js.map +1 -0
- package/lib/module/ai-components/message/AIReplyActions.js +132 -0
- package/lib/module/ai-components/message/AIReplyActions.js.map +1 -0
- package/lib/module/ai-components/message/AIUserMessage.js +104 -0
- package/lib/module/ai-components/message/AIUserMessage.js.map +1 -0
- package/lib/module/ai-components/message/UserMessageMenu.js +150 -0
- package/lib/module/ai-components/message/UserMessageMenu.js.map +1 -0
- package/lib/module/ai-components/message/index.js +48 -0
- package/lib/module/ai-components/message/index.js.map +1 -0
- package/lib/module/ai-components/message-composer/ActionButton.js +2 -1
- package/lib/module/ai-components/message-composer/ActionButton.js.map +1 -1
- package/lib/module/ai-components/message-composer/ActionSheet.js +22 -6
- package/lib/module/ai-components/message-composer/ActionSheet.js.map +1 -1
- package/lib/module/ai-components/message-composer/AttachmentButton.js +5 -1
- package/lib/module/ai-components/message-composer/AttachmentButton.js.map +1 -1
- package/lib/module/ai-components/message-composer/ChatOptions.js +147 -0
- package/lib/module/ai-components/message-composer/ChatOptions.js.map +1 -0
- package/lib/module/ai-components/message-composer/ComposerView.js +136 -20
- package/lib/module/ai-components/message-composer/ComposerView.js.map +1 -1
- package/lib/module/ai-components/message-composer/EditingMessageChip.js +80 -0
- package/lib/module/ai-components/message-composer/EditingMessageChip.js.map +1 -0
- package/lib/module/ai-components/message-composer/MediaPreviewList.js +26 -1
- package/lib/module/ai-components/message-composer/MediaPreviewList.js.map +1 -1
- package/lib/module/ai-components/message-composer/index.js +11 -0
- package/lib/module/ai-components/message-composer/index.js.map +1 -1
- package/lib/module/ai-components/message-parts/AIMessageParts.js +110 -0
- package/lib/module/ai-components/message-parts/AIMessageParts.js.map +1 -0
- package/lib/module/ai-components/message-parts/AIToolApproval.js +197 -0
- package/lib/module/ai-components/message-parts/AIToolApproval.js.map +1 -0
- package/lib/module/ai-components/message-parts/AIToolAuthorization.js +250 -0
- package/lib/module/ai-components/message-parts/AIToolAuthorization.js.map +1 -0
- package/lib/module/ai-components/message-parts/AIToolCall.js +159 -0
- package/lib/module/ai-components/message-parts/AIToolCall.js.map +1 -0
- package/lib/module/ai-components/message-parts/callStates.js +54 -0
- package/lib/module/ai-components/message-parts/callStates.js.map +1 -0
- package/lib/module/ai-components/message-parts/index.js +70 -0
- package/lib/module/ai-components/message-parts/index.js.map +1 -0
- package/lib/module/ai-components/message-parts/parseMessageParts.js +126 -0
- package/lib/module/ai-components/message-parts/parseMessageParts.js.map +1 -0
- package/lib/module/ai-components/message-parts/types.js +2 -0
- package/lib/module/ai-components/message-parts/types.js.map +1 -0
- package/lib/module/ai-components/native-specs/NativeAIAgent.js +7 -0
- package/lib/module/ai-components/native-specs/NativeAIAgent.js.map +1 -0
- package/lib/module/ai-components/reasoning/AIReasoning.js +401 -0
- package/lib/module/ai-components/reasoning/AIReasoning.js.map +1 -0
- package/lib/module/ai-components/reasoning/index.js +26 -0
- package/lib/module/ai-components/reasoning/index.js.map +1 -0
- package/lib/module/ai-components/reasoning/thinkingClock.js +63 -0
- package/lib/module/ai-components/reasoning/thinkingClock.js.map +1 -0
- package/lib/module/ai-components/services/clipboard-service/expo.js +7 -2
- package/lib/module/ai-components/services/clipboard-service/expo.js.map +1 -1
- package/lib/module/ai-components/store/composer/store.js.map +1 -1
- package/lib/module/ai-components/store/composer/useComposerChatOption.js +18 -0
- package/lib/module/ai-components/store/composer/useComposerChatOption.js.map +1 -0
- package/lib/module/ai-components/store/composer/useComposerIsEditing.js +18 -0
- package/lib/module/ai-components/store/composer/useComposerIsEditing.js.map +1 -0
- package/lib/module/ai-components/store/index.js +22 -0
- package/lib/module/ai-components/store/index.js.map +1 -1
- package/lib/module/ai-components/suggestions/AISuggestions.js +66 -0
- package/lib/module/ai-components/suggestions/AISuggestions.js.map +1 -0
- package/lib/module/ai-components/suggestions/index.js +15 -0
- package/lib/module/ai-components/suggestions/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js +2 -1
- package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -1
- package/lib/module/ai-components/syntax-highlighting/utils/renderer.js +3 -2
- package/lib/module/ai-components/syntax-highlighting/utils/renderer.js.map +1 -1
- package/lib/module/ai-components/theme.js +137 -1
- package/lib/module/ai-components/theme.js.map +1 -1
- package/lib/module/ai-components/tool-calls/AIClientIdentity.js +22 -0
- package/lib/module/ai-components/tool-calls/AIClientIdentity.js.map +1 -0
- package/lib/module/ai-components/tool-calls/AIClientToolRunner.js +109 -0
- package/lib/module/ai-components/tool-calls/AIClientToolRunner.js.map +1 -0
- package/lib/module/ai-components/tool-calls/AIToolApprover.js +23 -0
- package/lib/module/ai-components/tool-calls/AIToolApprover.js.map +1 -0
- package/lib/module/ai-components/tool-calls/authSessionAuthorizer.js +88 -0
- package/lib/module/ai-components/tool-calls/authSessionAuthorizer.js.map +1 -0
- package/lib/module/ai-components/tool-calls/index.js +48 -0
- package/lib/module/ai-components/tool-calls/index.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/glowShader.js.map +1 -1
- package/lib/module/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/utils/renderText.js.map +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +2 -2
- package/lib/module/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/module/i18n/ar.json +39 -1
- package/lib/module/i18n/en.json +39 -1
- package/lib/module/i18n/es.json +39 -1
- package/lib/module/i18n/fr.json +39 -1
- package/lib/module/i18n/he.json +39 -1
- package/lib/module/i18n/hi.json +39 -1
- package/lib/module/i18n/it.json +39 -1
- package/lib/module/i18n/ja.json +39 -1
- package/lib/module/i18n/ko.json +39 -1
- package/lib/module/i18n/nl.json +39 -1
- package/lib/module/i18n/pt-br.json +39 -1
- package/lib/module/i18n/ru.json +39 -1
- package/lib/module/i18n/tr.json +39 -1
- package/lib/module/mock-builders/a2ui/ohrid.js +84 -0
- package/lib/module/mock-builders/a2ui/ohrid.js.map +1 -0
- package/lib/module/utils/i18n/Streami18n.js +9 -4
- package/lib/module/utils/i18n/Streami18n.js.map +1 -1
- package/lib/module/utils/i18n/utils.js +7 -0
- package/lib/module/utils/i18n/utils.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/a11y/a11yUtils.d.ts +0 -1
- package/lib/typescript/a11y/a11yUtils.d.ts.map +1 -1
- package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts +2 -3
- package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts.map +1 -1
- package/lib/typescript/a2ui/A2UIContexts.d.ts +9 -0
- package/lib/typescript/a2ui/A2UIContexts.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIInstructions.d.ts +47 -0
- package/lib/typescript/a2ui/A2UIInstructions.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIPlaceholder.d.ts +4 -0
- package/lib/typescript/a2ui/A2UIPlaceholder.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIRenderer.d.ts +130 -0
- package/lib/typescript/a2ui/A2UIRenderer.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIStream.d.ts +23 -0
- package/lib/typescript/a2ui/A2UIStream.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UISurface.d.ts +19 -0
- package/lib/typescript/a2ui/A2UISurface.d.ts.map +1 -0
- package/lib/typescript/a2ui/basicFunctions.d.ts +10 -0
- package/lib/typescript/a2ui/basicFunctions.d.ts.map +1 -0
- package/lib/typescript/a2ui/catalogDocument.d.ts +56 -0
- package/lib/typescript/a2ui/catalogDocument.d.ts.map +1 -0
- package/lib/typescript/a2ui/catalogs.d.ts +42 -0
- package/lib/typescript/a2ui/catalogs.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/DateTimeInput.d.ts +44 -0
- package/lib/typescript/a2ui/components/DateTimeInput.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/Media.d.ts +27 -0
- package/lib/typescript/a2ui/components/Media.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/basicComponents.d.ts +4 -0
- package/lib/typescript/a2ui/components/basicComponents.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/iconPaths.d.ts +2 -0
- package/lib/typescript/a2ui/components/iconPaths.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/types.d.ts +23 -0
- package/lib/typescript/a2ui/components/types.d.ts.map +1 -0
- package/lib/typescript/a2ui/index.d.ts +8 -0
- package/lib/typescript/a2ui/index.d.ts.map +1 -0
- package/lib/typescript/a2ui/instructions.d.ts +39 -0
- package/lib/typescript/a2ui/instructions.d.ts.map +1 -0
- package/lib/typescript/a2ui/secrets.d.ts +20 -0
- package/lib/typescript/a2ui/secrets.d.ts.map +1 -0
- package/lib/typescript/a2ui/useReplyState.d.ts +4 -0
- package/lib/typescript/a2ui/useReplyState.d.ts.map +1 -0
- package/lib/typescript/ai-components/AITypingIndicatorView.d.ts.map +1 -1
- package/lib/typescript/ai-components/StreamingMessageView.d.ts +4 -1
- package/lib/typescript/ai-components/StreamingMessageView.d.ts.map +1 -1
- package/lib/typescript/ai-components/charts/components/PieLegend.d.ts.map +1 -1
- package/lib/typescript/ai-components/charts/components/VictoryChart.d.ts.map +1 -1
- package/lib/typescript/ai-components/charts/utils/format-time-label.d.ts +7 -0
- package/lib/typescript/ai-components/charts/utils/format-time-label.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts +8 -8
- package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/composer-context.d.ts +3 -0
- package/lib/typescript/ai-components/contexts/composer-context.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/index.d.ts +1 -0
- package/lib/typescript/ai-components/contexts/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/theme-context.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/translation-context.d.ts +19 -0
- package/lib/typescript/ai-components/contexts/translation-context.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/AIConversation.d.ts +130 -0
- package/lib/typescript/ai-components/conversation/AIConversation.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/AIAgentError.d.ts +10 -0
- package/lib/typescript/ai-components/conversation/controller/AIAgentError.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/AIConversationController.d.ts +173 -0
- package/lib/typescript/ai-components/conversation/controller/AIConversationController.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/AIConversationExchange.d.ts +23 -0
- package/lib/typescript/ai-components/conversation/controller/AIConversationExchange.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/index.d.ts +5 -0
- package/lib/typescript/ai-components/conversation/controller/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/offers.d.ts +23 -0
- package/lib/typescript/ai-components/conversation/controller/offers.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/types.d.ts +142 -0
- package/lib/typescript/ai-components/conversation/controller/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/controller/useAIConversationState.d.ts +9 -0
- package/lib/typescript/ai-components/conversation/controller/useAIConversationState.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/entries.d.ts +47 -0
- package/lib/typescript/ai-components/conversation/entries.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/fromStreamMessage.d.ts +25 -0
- package/lib/typescript/ai-components/conversation/fromStreamMessage.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/index.d.ts +6 -0
- package/lib/typescript/ai-components/conversation/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/AIChatList.d.ts +30 -0
- package/lib/typescript/ai-components/conversation/list/AIChatList.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useChatListController.d.ts +45 -0
- package/lib/typescript/ai-components/conversation/list/useChatListController.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useEndInView.d.ts +26 -0
- package/lib/typescript/ai-components/conversation/list/useEndInView.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useKeyboardOverlap.d.ts +17 -0
- package/lib/typescript/ai-components/conversation/list/useKeyboardOverlap.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useLoadOlder.d.ts +24 -0
- package/lib/typescript/ai-components/conversation/list/useLoadOlder.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/usePinnedAnchor.d.ts +26 -0
- package/lib/typescript/ai-components/conversation/list/usePinnedAnchor.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/types.d.ts +55 -0
- package/lib/typescript/ai-components/conversation/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/useConversationRows.d.ts +66 -0
- package/lib/typescript/ai-components/conversation/useConversationRows.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIAction.d.ts +48 -0
- package/lib/typescript/ai-components/generative-ui/AIUIAction.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIArguments.d.ts +15 -0
- package/lib/typescript/ai-components/generative-ui/AIUIArguments.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponent.d.ts +51 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponent.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponentDefinition.d.ts +84 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponentDefinition.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIDocument.d.ts +50 -0
- package/lib/typescript/ai-components/generative-ui/AIUIDocument.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIEntrance.d.ts +75 -0
- package/lib/typescript/ai-components/generative-ui/AIUIEntrance.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIErrorBoundary.d.ts +26 -0
- package/lib/typescript/ai-components/generative-ui/AIUIErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHelpers.d.ts +23 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHelpers.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHost.d.ts +160 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHost.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIMedia.d.ts +22 -0
- package/lib/typescript/ai-components/generative-ui/AIUIMedia.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIRenderer.d.ts +53 -0
- package/lib/typescript/ai-components/generative-ui/AIUIRenderer.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIView.d.ts +35 -0
- package/lib/typescript/ai-components/generative-ui/AIUIView.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/index.d.ts +11 -0
- package/lib/typescript/ai-components/generative-ui/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/icons.d.ts +66 -0
- package/lib/typescript/ai-components/icons.d.ts.map +1 -0
- package/lib/typescript/ai-components/index.d.ts +8 -0
- package/lib/typescript/ai-components/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/internal/Shimmer.d.ts +14 -0
- package/lib/typescript/ai-components/internal/Shimmer.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/format.d.ts +7 -0
- package/lib/typescript/ai-components/internal/format.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/hooks/useBottomSafeArea.d.ts +3 -0
- package/lib/typescript/ai-components/internal/hooks/useBottomSafeArea.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/AgentIcons.d.ts +31 -0
- package/lib/typescript/ai-components/internal/icons/AgentIcons.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/tokens.d.ts +2 -0
- package/lib/typescript/ai-components/internal/tokens.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/uuid.d.ts +2 -0
- package/lib/typescript/ai-components/internal/uuid.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/CodeBlock.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/components/InlineCode.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/components/Text.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/styles.d.ts +23 -4
- package/lib/typescript/ai-components/markdown/styles.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/types.d.ts +1 -0
- package/lib/typescript/ai-components/markdown/types.d.ts.map +1 -1
- package/lib/typescript/ai-components/message/AIAssistantMessage.d.ts +40 -0
- package/lib/typescript/ai-components/message/AIAssistantMessage.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/AIMessageAttachment.d.ts +33 -0
- package/lib/typescript/ai-components/message/AIMessageAttachment.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/AIReplyActions.d.ts +19 -0
- package/lib/typescript/ai-components/message/AIReplyActions.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/AIUserMessage.d.ts +17 -0
- package/lib/typescript/ai-components/message/AIUserMessage.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/UserMessageMenu.d.ts +31 -0
- package/lib/typescript/ai-components/message/UserMessageMenu.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/index.d.ts +5 -0
- package/lib/typescript/ai-components/message/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ActionButton.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts +2 -2
- package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/AttachmentButton.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/ChatOptions.d.ts +35 -0
- package/lib/typescript/ai-components/message-composer/ChatOptions.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts +34 -3
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/EditingMessageChip.d.ts +7 -0
- package/lib/typescript/ai-components/message-composer/EditingMessageChip.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/MediaPreviewList.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/index.d.ts +1 -0
- package/lib/typescript/ai-components/message-composer/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-parts/AIMessageParts.d.ts +38 -0
- package/lib/typescript/ai-components/message-parts/AIMessageParts.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/AIToolApproval.d.ts +38 -0
- package/lib/typescript/ai-components/message-parts/AIToolApproval.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/AIToolAuthorization.d.ts +48 -0
- package/lib/typescript/ai-components/message-parts/AIToolAuthorization.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/AIToolCall.d.ts +11 -0
- package/lib/typescript/ai-components/message-parts/AIToolCall.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/callStates.d.ts +9 -0
- package/lib/typescript/ai-components/message-parts/callStates.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/index.d.ts +7 -0
- package/lib/typescript/ai-components/message-parts/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/parseMessageParts.d.ts +47 -0
- package/lib/typescript/ai-components/message-parts/parseMessageParts.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/types.d.ts +137 -0
- package/lib/typescript/ai-components/message-parts/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/native-specs/NativeAIAgent.d.ts +22 -0
- package/lib/typescript/ai-components/native-specs/NativeAIAgent.d.ts.map +1 -0
- package/lib/typescript/ai-components/reasoning/AIReasoning.d.ts +63 -0
- package/lib/typescript/ai-components/reasoning/AIReasoning.d.ts.map +1 -0
- package/lib/typescript/ai-components/reasoning/index.d.ts +3 -0
- package/lib/typescript/ai-components/reasoning/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/reasoning/thinkingClock.d.ts +29 -0
- package/lib/typescript/ai-components/reasoning/thinkingClock.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/clipboard-service/expo.d.ts.map +1 -1
- package/lib/typescript/ai-components/store/composer/store.d.ts +8 -0
- package/lib/typescript/ai-components/store/composer/store.d.ts.map +1 -1
- package/lib/typescript/ai-components/store/composer/useComposerChatOption.d.ts +5 -0
- package/lib/typescript/ai-components/store/composer/useComposerChatOption.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/composer/useComposerIsEditing.d.ts +5 -0
- package/lib/typescript/ai-components/store/composer/useComposerIsEditing.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/index.d.ts +2 -0
- package/lib/typescript/ai-components/store/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/suggestions/AISuggestions.d.ts +13 -0
- package/lib/typescript/ai-components/suggestions/AISuggestions.d.ts.map +1 -0
- package/lib/typescript/ai-components/suggestions/index.d.ts +2 -0
- package/lib/typescript/ai-components/suggestions/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/flatten-nodes.d.ts.map +1 -1
- package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts +1 -1
- package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts.map +1 -1
- package/lib/typescript/ai-components/theme.d.ts +200 -0
- package/lib/typescript/ai-components/theme.d.ts.map +1 -1
- package/lib/typescript/ai-components/tool-calls/AIClientIdentity.d.ts +14 -0
- package/lib/typescript/ai-components/tool-calls/AIClientIdentity.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/AIClientToolRunner.d.ts +109 -0
- package/lib/typescript/ai-components/tool-calls/AIClientToolRunner.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/AIToolApprover.d.ts +48 -0
- package/lib/typescript/ai-components/tool-calls/AIToolApprover.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/authSessionAuthorizer.d.ts +57 -0
- package/lib/typescript/ai-components/tool-calls/authSessionAuthorizer.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/index.d.ts +5 -0
- package/lib/typescript/ai-components/tool-calls/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/glowShader.d.ts.map +1 -1
- package/lib/typescript/ai-components/voice-visualization/simplex.d.ts +1 -1
- package/lib/typescript/components/Accessibility/NotificationAnnouncer.d.ts +5 -5
- package/lib/typescript/components/Accessibility/hooks/useIncomingMessageAnnouncements.d.ts +1 -1
- package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts +0 -2
- package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/utils/renderText.d.ts.map +1 -1
- package/lib/typescript/contexts/translationContext/TranslationContext.d.ts +1 -1
- package/lib/typescript/contexts/translationContext/TranslationContext.d.ts.map +1 -1
- package/lib/typescript/i18n/ar.json +39 -1
- package/lib/typescript/i18n/en.json +39 -1
- package/lib/typescript/i18n/es.json +39 -1
- package/lib/typescript/i18n/fr.json +39 -1
- package/lib/typescript/i18n/he.json +39 -1
- package/lib/typescript/i18n/hi.json +39 -1
- package/lib/typescript/i18n/it.json +39 -1
- package/lib/typescript/i18n/ja.json +39 -1
- package/lib/typescript/i18n/ko.json +39 -1
- package/lib/typescript/i18n/nl.json +39 -1
- package/lib/typescript/i18n/pt-br.json +39 -1
- package/lib/typescript/i18n/ru.json +39 -1
- package/lib/typescript/i18n/tr.json +39 -1
- package/lib/typescript/utils/i18n/Streami18n.d.ts +40 -2
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/lib/typescript/utils/i18n/utils.d.ts +3 -0
- package/lib/typescript/utils/i18n/utils.d.ts.map +1 -0
- package/package.json +10 -2
- package/src/a11y/a11yUtils.ts +0 -1
- package/src/a11y/hooks/useResolvedModalAccessibilityProps.ts +2 -3
- package/src/a2ui/A2UIContexts.ts +15 -0
- package/src/a2ui/A2UIInstructions.ts +102 -0
- package/src/a2ui/A2UIPlaceholder.tsx +24 -0
- package/src/a2ui/A2UIRenderer.tsx +504 -0
- package/src/a2ui/A2UIStream.ts +105 -0
- package/src/a2ui/A2UISurface.tsx +241 -0
- package/src/a2ui/__tests__/A2UIInstructions.test.ts +233 -0
- package/src/a2ui/__tests__/A2UIRenderer.test.tsx +1514 -0
- package/src/a2ui/__tests__/conformance.test.ts +579 -0
- package/src/a2ui/basicCatalog.json +1206 -0
- package/src/a2ui/basicFunctions.ts +429 -0
- package/src/a2ui/catalogDocument.ts +119 -0
- package/src/a2ui/catalogs.ts +185 -0
- package/src/a2ui/components/DateTimeInput.tsx +381 -0
- package/src/a2ui/components/Media.tsx +278 -0
- package/src/a2ui/components/basicComponents.tsx +832 -0
- package/src/a2ui/components/iconPaths.ts +116 -0
- package/src/a2ui/components/types.ts +24 -0
- package/src/a2ui/index.ts +18 -0
- package/src/a2ui/instructions.ts +341 -0
- package/src/a2ui/secrets.ts +154 -0
- package/src/a2ui/useReplyState.ts +26 -0
- package/src/ai-components/AITypingIndicatorView.tsx +6 -22
- package/src/ai-components/README.md +55 -3
- package/src/ai-components/StreamingMessageView.tsx +27 -3
- package/src/ai-components/__tests__/ComposerView.test.tsx +227 -2
- package/src/ai-components/__tests__/Markdown.test.tsx +13 -0
- package/src/ai-components/__tests__/StreamingMessageView.test.tsx +69 -0
- package/src/ai-components/__tests__/charts.test.ts +75 -0
- package/src/ai-components/__tests__/clientToolRunner.test.ts +239 -0
- package/src/ai-components/__tests__/conversation.test.tsx +705 -0
- package/src/ai-components/__tests__/conversationController.test.ts +1561 -0
- package/src/ai-components/__tests__/conversationExchange.test.ts +187 -0
- package/src/ai-components/__tests__/conversationRows.test.ts +207 -0
- package/src/ai-components/__tests__/conversationUI.test.tsx +586 -0
- package/src/ai-components/__tests__/format.test.ts +32 -0
- package/src/ai-components/__tests__/generativeUI.test.ts +634 -0
- package/src/ai-components/__tests__/keyboard.test.ts +14 -0
- package/src/ai-components/__tests__/messagePartViews.test.tsx +343 -0
- package/src/ai-components/__tests__/messageParts.test.ts +336 -0
- package/src/ai-components/__tests__/messageViews.test.tsx +321 -0
- package/src/ai-components/__tests__/signIn.test.tsx +324 -0
- package/src/ai-components/__tests__/theme.test.tsx +18 -0
- package/src/ai-components/__tests__/translation.test.tsx +85 -0
- package/src/ai-components/__tests__/voiceDriver.test.ts +0 -3
- package/src/ai-components/__tests__/voicePalette.test.ts +1 -1
- package/src/ai-components/charts/components/PieLegend.tsx +2 -1
- package/src/ai-components/charts/components/VictoryChart.tsx +10 -2
- package/src/ai-components/charts/utils/format-time-label.ts +18 -0
- package/src/ai-components/charts/vega-lite/schema.ts +19 -2
- package/src/ai-components/contexts/composer-context.tsx +13 -5
- package/src/ai-components/contexts/index.ts +1 -0
- package/src/ai-components/contexts/theme-context.tsx +19 -4
- package/src/ai-components/contexts/translation-context.tsx +44 -0
- package/src/ai-components/conversation/AIConversation.tsx +590 -0
- package/src/ai-components/conversation/controller/AIAgentError.ts +14 -0
- package/src/ai-components/conversation/controller/AIConversationController.ts +623 -0
- package/src/ai-components/conversation/controller/AIConversationExchange.ts +132 -0
- package/src/ai-components/conversation/controller/index.ts +4 -0
- package/src/ai-components/conversation/controller/offers.ts +43 -0
- package/src/ai-components/conversation/controller/types.ts +154 -0
- package/src/ai-components/conversation/controller/useAIConversationState.ts +21 -0
- package/src/ai-components/conversation/entries.ts +177 -0
- package/src/ai-components/conversation/fromStreamMessage.ts +87 -0
- package/src/ai-components/conversation/index.ts +5 -0
- package/src/ai-components/conversation/list/AIChatList.tsx +227 -0
- package/src/ai-components/conversation/list/useChatListController.ts +91 -0
- package/src/ai-components/conversation/list/useEndInView.ts +61 -0
- package/src/ai-components/conversation/list/useKeyboardOverlap.ts +51 -0
- package/src/ai-components/conversation/list/useLoadOlder.ts +97 -0
- package/src/ai-components/conversation/list/usePinnedAnchor.ts +113 -0
- package/src/ai-components/conversation/types.ts +57 -0
- package/src/ai-components/conversation/useConversationRows.ts +230 -0
- package/src/ai-components/generative-ui/AIUIAction.ts +73 -0
- package/src/ai-components/generative-ui/AIUIArguments.ts +117 -0
- package/src/ai-components/generative-ui/AIUIComponent.tsx +106 -0
- package/src/ai-components/generative-ui/AIUIComponentDefinition.ts +163 -0
- package/src/ai-components/generative-ui/AIUIDocument.ts +77 -0
- package/src/ai-components/generative-ui/AIUIEntrance.tsx +223 -0
- package/src/ai-components/generative-ui/AIUIErrorBoundary.tsx +39 -0
- package/src/ai-components/generative-ui/AIUIHelpers.ts +86 -0
- package/src/ai-components/generative-ui/AIUIHost.ts +358 -0
- package/src/ai-components/generative-ui/AIUIMedia.ts +45 -0
- package/src/ai-components/generative-ui/AIUIRenderer.ts +60 -0
- package/src/ai-components/generative-ui/AIUIView.tsx +87 -0
- package/src/ai-components/generative-ui/index.ts +48 -0
- package/src/ai-components/icons.ts +101 -0
- package/src/ai-components/index.ts +10 -0
- package/src/ai-components/internal/Shimmer.tsx +40 -0
- package/src/ai-components/internal/format.ts +69 -0
- package/src/ai-components/internal/hooks/useBottomSafeArea.ts +6 -0
- package/src/ai-components/internal/icons/AgentIcons.tsx +138 -0
- package/src/ai-components/internal/tokens.ts +4 -0
- package/src/ai-components/internal/uuid.ts +17 -0
- package/src/ai-components/markdown/components/CodeBlock.tsx +13 -2
- package/src/ai-components/markdown/components/InlineCode.tsx +1 -0
- package/src/ai-components/markdown/components/Text.tsx +7 -2
- package/src/ai-components/markdown/styles.ts +29 -27
- package/src/ai-components/markdown/types.ts +1 -0
- package/src/ai-components/message/AIAssistantMessage.tsx +99 -0
- package/src/ai-components/message/AIMessageAttachment.tsx +245 -0
- package/src/ai-components/message/AIReplyActions.tsx +139 -0
- package/src/ai-components/message/AIUserMessage.tsx +121 -0
- package/src/ai-components/message/UserMessageMenu.tsx +149 -0
- package/src/ai-components/message/index.ts +4 -0
- package/src/ai-components/message-composer/ActionButton.tsx +5 -1
- package/src/ai-components/message-composer/ActionSheet.tsx +28 -6
- package/src/ai-components/message-composer/AttachmentButton.tsx +9 -1
- package/src/ai-components/message-composer/ChatOptions.tsx +144 -0
- package/src/ai-components/message-composer/ComposerView.tsx +179 -29
- package/src/ai-components/message-composer/EditingMessageChip.tsx +61 -0
- package/src/ai-components/message-composer/MediaPreviewList.tsx +34 -8
- package/src/ai-components/message-composer/index.ts +1 -0
- package/src/ai-components/message-parts/AIMessageParts.tsx +120 -0
- package/src/ai-components/message-parts/AIToolApproval.tsx +196 -0
- package/src/ai-components/message-parts/AIToolAuthorization.tsx +279 -0
- package/src/ai-components/message-parts/AIToolCall.tsx +117 -0
- package/src/ai-components/message-parts/callStates.ts +44 -0
- package/src/ai-components/message-parts/index.ts +6 -0
- package/src/ai-components/message-parts/parseMessageParts.ts +195 -0
- package/src/ai-components/message-parts/types.ts +157 -0
- package/src/ai-components/native-specs/NativeAIAgent.ts +25 -0
- package/src/ai-components/reasoning/AIReasoning.tsx +509 -0
- package/src/ai-components/reasoning/index.ts +2 -0
- package/src/ai-components/reasoning/thinkingClock.ts +109 -0
- package/src/ai-components/services/clipboard-service/expo.ts +18 -4
- package/src/ai-components/store/composer/store.ts +9 -0
- package/src/ai-components/store/composer/useComposerChatOption.ts +15 -0
- package/src/ai-components/store/composer/useComposerIsEditing.ts +15 -0
- package/src/ai-components/store/index.ts +2 -0
- package/src/ai-components/suggestions/AISuggestions.tsx +73 -0
- package/src/ai-components/suggestions/index.ts +1 -0
- package/src/ai-components/syntax-highlighting/utils/flatten-nodes.ts +2 -1
- package/src/ai-components/syntax-highlighting/utils/renderer.tsx +4 -2
- package/src/ai-components/theme.ts +334 -0
- package/src/ai-components/tool-calls/AIClientIdentity.ts +33 -0
- package/src/ai-components/tool-calls/AIClientToolRunner.ts +200 -0
- package/src/ai-components/tool-calls/AIToolApprover.tsx +60 -0
- package/src/ai-components/tool-calls/authSessionAuthorizer.ts +137 -0
- package/src/ai-components/tool-calls/index.ts +4 -0
- package/src/ai-components/voice-visualization/glowShader.ts +1 -3
- package/src/ai-components/voice-visualization/simplex.ts +1 -1
- package/src/components/Accessibility/NotificationAnnouncer.tsx +5 -5
- package/src/components/Accessibility/hooks/useIncomingMessageAnnouncements.ts +1 -1
- package/src/components/Accessibility/useAccessibilityAnnouncer.ts +0 -2
- package/src/components/Message/MessageItemView/utils/renderText.tsx +1 -2
- package/src/contexts/translationContext/TranslationContext.tsx +2 -2
- package/src/i18n/ar.json +39 -1
- package/src/i18n/en.json +39 -1
- package/src/i18n/es.json +39 -1
- package/src/i18n/fr.json +39 -1
- package/src/i18n/he.json +39 -1
- package/src/i18n/hi.json +39 -1
- package/src/i18n/it.json +39 -1
- package/src/i18n/ja.json +39 -1
- package/src/i18n/ko.json +39 -1
- package/src/i18n/nl.json +39 -1
- package/src/i18n/pt-br.json +39 -1
- package/src/i18n/ru.json +39 -1
- package/src/i18n/tr.json +39 -1
- package/src/mock-builders/a2ui/ohrid.ts +106 -0
- package/src/utils/i18n/Streami18n.ts +4 -1
- package/src/utils/i18n/utils.ts +3 -0
- package/src/version.json +1 -1
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import React, { type ReactElement } from 'react';
|
|
2
|
+
import { I18nManager } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { act, fireEvent, render, screen } from '@testing-library/react-native';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
AIMessagePart,
|
|
8
|
+
type AIMessagePartData,
|
|
9
|
+
AIMessageParts,
|
|
10
|
+
AIReasoning,
|
|
11
|
+
AIThinking,
|
|
12
|
+
AIToolApproval,
|
|
13
|
+
AIToolApprovalCard,
|
|
14
|
+
type AIToolApprover,
|
|
15
|
+
AIToolCall,
|
|
16
|
+
type AIToolCallPart,
|
|
17
|
+
parseMessagePart,
|
|
18
|
+
StreamTheme,
|
|
19
|
+
} from '../index';
|
|
20
|
+
import { forgetCallStates } from '../message-parts/callStates';
|
|
21
|
+
|
|
22
|
+
// Each test's questions start unanswered, though tests reuse calls.
|
|
23
|
+
afterEach(forgetCallStates);
|
|
24
|
+
|
|
25
|
+
const renderWithTheme = (ui: ReactElement) => {
|
|
26
|
+
const result = render(<StreamTheme>{ui}</StreamTheme>);
|
|
27
|
+
return {
|
|
28
|
+
...result,
|
|
29
|
+
rerender: (next: ReactElement) => result.rerender(<StreamTheme>{next}</StreamTheme>),
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const toolCall = (overrides: Partial<AIToolCallPart> = {}): AIToolCallPart => ({
|
|
34
|
+
executor: 'server',
|
|
35
|
+
id: 'call_1',
|
|
36
|
+
name: 'get_weather',
|
|
37
|
+
status: 'running',
|
|
38
|
+
...overrides,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('AIToolCall', () => {
|
|
42
|
+
it('names the call from its display title, else its name', () => {
|
|
43
|
+
const { rerender } = renderWithTheme(
|
|
44
|
+
<AIToolCall part={toolCall({ displayTitle: 'Checking the weather' })} />,
|
|
45
|
+
);
|
|
46
|
+
expect(screen.getByText('Checking the weather')).toBeTruthy();
|
|
47
|
+
rerender(<AIToolCall part={toolCall()} />);
|
|
48
|
+
expect(screen.getByText('get weather')).toBeTruthy();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it.each([
|
|
52
|
+
['awaiting_approval', 'Waiting for approval'],
|
|
53
|
+
['awaiting_authorization', 'Waiting for you to sign in'],
|
|
54
|
+
['awaiting_client', 'Waiting for the device'],
|
|
55
|
+
['failed', "Didn't complete"],
|
|
56
|
+
['cancelled', 'Cancelled'],
|
|
57
|
+
])('says what a %s call waits for', (status, detail) => {
|
|
58
|
+
renderWithTheme(<AIToolCall part={toolCall({ status })} />);
|
|
59
|
+
expect(screen.getByText(detail)).toBeTruthy();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('prefers the summary, and says a declined call was declined', () => {
|
|
63
|
+
const { rerender } = renderWithTheme(
|
|
64
|
+
<AIToolCall part={toolCall({ status: 'failed', summary: 'No network' })} />,
|
|
65
|
+
);
|
|
66
|
+
expect(screen.getByText('No network')).toBeTruthy();
|
|
67
|
+
rerender(
|
|
68
|
+
<AIToolCall
|
|
69
|
+
part={toolCall({
|
|
70
|
+
approval: { decision: 'declined', title: 'Share?' },
|
|
71
|
+
status: 'cancelled',
|
|
72
|
+
})}
|
|
73
|
+
/>,
|
|
74
|
+
);
|
|
75
|
+
expect(screen.getByText('Declined')).toBeTruthy();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('shows how long a finished call took', () => {
|
|
79
|
+
const { rerender } = renderWithTheme(
|
|
80
|
+
<AIToolCall part={toolCall({ durationMs: 420, status: 'completed' })} />,
|
|
81
|
+
);
|
|
82
|
+
expect(screen.getByText('0.4s')).toBeTruthy();
|
|
83
|
+
rerender(<AIToolCall part={toolCall({ durationMs: 65_000, status: 'completed' })} />);
|
|
84
|
+
expect(screen.getByText('1m 5s')).toBeTruthy();
|
|
85
|
+
rerender(<AIToolCall part={toolCall({ durationMs: 65_000, status: 'running' })} />);
|
|
86
|
+
expect(screen.queryByText('1m 5s')).toBeNull();
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
describe('AIToolApprovalCard', () => {
|
|
91
|
+
it('asks with the reason as a sentence and the agent’s own button titles', () => {
|
|
92
|
+
const onDecide = jest.fn();
|
|
93
|
+
renderWithTheme(
|
|
94
|
+
<AIToolApprovalCard
|
|
95
|
+
approval={{
|
|
96
|
+
allowTitle: 'Share',
|
|
97
|
+
message: 'Only your city is shared.',
|
|
98
|
+
reason: 'to check the local weather',
|
|
99
|
+
title: 'Share your location?',
|
|
100
|
+
}}
|
|
101
|
+
onDecide={onDecide}
|
|
102
|
+
/>,
|
|
103
|
+
);
|
|
104
|
+
expect(screen.getByText('To check the local weather.')).toBeTruthy();
|
|
105
|
+
expect(screen.getByText('Only your city is shared.')).toBeTruthy();
|
|
106
|
+
fireEvent.press(screen.getByRole('button', { name: 'Share' }));
|
|
107
|
+
fireEvent.press(screen.getByRole('button', { name: "Don't Allow" }));
|
|
108
|
+
expect(onDecide.mock.calls).toEqual([[true], [false]]);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe('AIToolApproval', () => {
|
|
113
|
+
const asking = toolCall({
|
|
114
|
+
approval: { title: 'Share your location?' },
|
|
115
|
+
executor: 'client',
|
|
116
|
+
status: 'awaiting_approval',
|
|
117
|
+
targetClientId: 'ios-1',
|
|
118
|
+
targetUserId: 'alex',
|
|
119
|
+
});
|
|
120
|
+
const approver = (decide: AIToolApprover['decide']): AIToolApprover => ({
|
|
121
|
+
clientId: 'ios-1',
|
|
122
|
+
decide,
|
|
123
|
+
userId: 'alex',
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('asks only the targeted person on the targeted install', () => {
|
|
127
|
+
const decide = jest.fn(() => Promise.resolve());
|
|
128
|
+
const { rerender } = renderWithTheme(<AIToolApproval part={asking} />);
|
|
129
|
+
expect(screen.queryByText('Share your location?')).toBeNull();
|
|
130
|
+
rerender(<AIToolApproval approver={{ ...approver(decide), userId: 'sam' }} part={asking} />);
|
|
131
|
+
expect(screen.queryByText('Share your location?')).toBeNull();
|
|
132
|
+
rerender(<AIToolApproval approver={approver(decide)} part={asking} />);
|
|
133
|
+
expect(screen.getByText('Share your location?')).toBeTruthy();
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('keeps an answer on its way when a list remounts or reuses the row', () => {
|
|
137
|
+
const decide = jest.fn(() => new Promise<void>(() => undefined));
|
|
138
|
+
const other = { ...asking, id: 'call-2' };
|
|
139
|
+
const { rerender, unmount } = renderWithTheme(
|
|
140
|
+
<AIToolApproval approver={approver(decide)} part={asking} />,
|
|
141
|
+
);
|
|
142
|
+
fireEvent.press(screen.getByRole('button', { name: 'Allow' }));
|
|
143
|
+
// The row now shows another call: its question starts unanswered.
|
|
144
|
+
rerender(<AIToolApproval approver={approver(decide)} part={other} />);
|
|
145
|
+
expect(screen.getByRole('button', { name: 'Allow' })).toBeEnabled();
|
|
146
|
+
unmount();
|
|
147
|
+
// The first call's row comes back: its answer is still on its way, so it can't be sent twice.
|
|
148
|
+
renderWithTheme(<AIToolApproval approver={approver(decide)} part={asking} />);
|
|
149
|
+
expect(screen.getByRole('button', { name: 'Allow' })).toBeDisabled();
|
|
150
|
+
fireEvent.press(screen.getByRole('button', { name: "Don't Allow" }));
|
|
151
|
+
expect(decide).toHaveBeenCalledTimes(1);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('sends the answer once, and lets the person answer again when it fails', async () => {
|
|
155
|
+
let fail: () => void = () => undefined;
|
|
156
|
+
const decide = jest.fn(
|
|
157
|
+
() =>
|
|
158
|
+
new Promise<void>((_, reject) => {
|
|
159
|
+
fail = () => reject(new Error('offline'));
|
|
160
|
+
}),
|
|
161
|
+
);
|
|
162
|
+
renderWithTheme(<AIToolApproval approver={approver(decide)} part={asking} />);
|
|
163
|
+
|
|
164
|
+
fireEvent.press(screen.getByRole('button', { name: 'Allow' }));
|
|
165
|
+
fireEvent.press(screen.getByRole('button', { name: 'Allow' }));
|
|
166
|
+
expect(decide).toHaveBeenCalledTimes(1);
|
|
167
|
+
expect(decide).toHaveBeenCalledWith(asking, true);
|
|
168
|
+
expect(screen.getByRole('button', { name: 'Allow' })).toBeDisabled();
|
|
169
|
+
|
|
170
|
+
await act(async () => {
|
|
171
|
+
fail();
|
|
172
|
+
await Promise.resolve();
|
|
173
|
+
});
|
|
174
|
+
expect(screen.getByText("Your answer couldn't be sent. Try again.")).toBeTruthy();
|
|
175
|
+
expect(screen.getByRole('button', { name: 'Allow' })).toBeEnabled();
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
describe('AIMessagePart', () => {
|
|
180
|
+
it('shows a placeholder for a step it cannot show', () => {
|
|
181
|
+
renderWithTheme(<AIMessagePart part={parseMessagePart({ id: 'x', type: 'ai_citation' })!} />);
|
|
182
|
+
expect(screen.getByText("A step this app version can't show")).toBeTruthy();
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
describe('AIReasoning', () => {
|
|
187
|
+
afterEach(() => {
|
|
188
|
+
jest.useRealTimers();
|
|
189
|
+
jest.restoreAllMocks();
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it('counts the seconds while thinking, and folds when done', () => {
|
|
193
|
+
jest.useFakeTimers();
|
|
194
|
+
const text = 'First thought.\n\n## Plan\nSecond thought.';
|
|
195
|
+
const { rerender } = renderWithTheme(<AIReasoning isThinking text={text} />);
|
|
196
|
+
expect(screen.getByRole('button', { expanded: true, name: /Thinking\.\.\./ })).toBeTruthy();
|
|
197
|
+
expect(screen.getByText('Plan')).toBeTruthy();
|
|
198
|
+
|
|
199
|
+
act(() => jest.advanceTimersByTime(7_000));
|
|
200
|
+
expect(screen.getByText('Thinking... 7s')).toBeTruthy();
|
|
201
|
+
|
|
202
|
+
rerender(
|
|
203
|
+
<AIReasoning duration={12} isThinking={false} summary='Planned the day' text={text} />,
|
|
204
|
+
);
|
|
205
|
+
expect(screen.getByRole('button', { expanded: false, name: /Thought for 12s/ })).toBeTruthy();
|
|
206
|
+
expect(screen.getByText('Planned the day')).toBeTruthy();
|
|
207
|
+
expect(screen.queryByText('Plan')).toBeNull();
|
|
208
|
+
|
|
209
|
+
fireEvent.press(screen.getByRole('button', { name: /Thought for 12s/ }));
|
|
210
|
+
expect(screen.getByRole('button', { expanded: true, name: /Thought for 12s/ })).toBeTruthy();
|
|
211
|
+
expect(screen.getByText('Plan')).toBeTruthy();
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it('shows a step’s live text, else its preview', () => {
|
|
215
|
+
const part = { durationMs: 2000, id: 'r1', preview: 'The opening', status: 'completed' };
|
|
216
|
+
const { rerender } = renderWithTheme(
|
|
217
|
+
<AIReasoning initiallyExpanded part={part} reasoningText={() => 'The whole thought'} />,
|
|
218
|
+
);
|
|
219
|
+
expect(screen.getByText('The whole thought')).toBeTruthy();
|
|
220
|
+
expect(screen.getByRole('button', { name: /Thought for 2s/ })).toBeTruthy();
|
|
221
|
+
rerender(<AIReasoning initiallyExpanded part={part} />);
|
|
222
|
+
expect(screen.getByText('The opening')).toBeTruthy();
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('starts afresh for another step, as when a list reuses the view', () => {
|
|
226
|
+
const step = (id: string, preview: string) => ({
|
|
227
|
+
durationMs: 3000,
|
|
228
|
+
id,
|
|
229
|
+
preview,
|
|
230
|
+
status: 'completed',
|
|
231
|
+
});
|
|
232
|
+
const { rerender } = renderWithTheme(
|
|
233
|
+
<AIReasoning part={step('r1', 'First')} stepKey='m1:r1' />,
|
|
234
|
+
);
|
|
235
|
+
fireEvent.press(screen.getByRole('button', { name: /Thought for 3s/ }));
|
|
236
|
+
expect(screen.getByText('First')).toBeTruthy();
|
|
237
|
+
|
|
238
|
+
// The same step id in another message is another step: folded until its reader opens it.
|
|
239
|
+
rerender(<AIReasoning part={step('r1', 'Second')} stepKey='m2:r1' />);
|
|
240
|
+
expect(screen.getByRole('button', { expanded: false, name: /Thought for 3s/ })).toBeTruthy();
|
|
241
|
+
expect(screen.queryByText('Second')).toBeNull();
|
|
242
|
+
|
|
243
|
+
// While the step stays the same, what its reader chose stays too.
|
|
244
|
+
fireEvent.press(screen.getByRole('button', { name: /Thought for 3s/ }));
|
|
245
|
+
rerender(<AIReasoning part={step('r1', 'Second, longer')} stepKey='m2:r1' />);
|
|
246
|
+
expect(screen.getByText('Second, longer')).toBeTruthy();
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it('keeps the chevron that turns for another step, folded', () => {
|
|
250
|
+
const step = (id: string, preview: string) => ({
|
|
251
|
+
durationMs: 3000,
|
|
252
|
+
id,
|
|
253
|
+
preview,
|
|
254
|
+
status: 'completed',
|
|
255
|
+
});
|
|
256
|
+
const turning = () =>
|
|
257
|
+
screen.UNSAFE_root.findAll(
|
|
258
|
+
(node) =>
|
|
259
|
+
typeof node.type !== 'string' &&
|
|
260
|
+
JSON.stringify(node.props?.style ?? '').includes('rotate'),
|
|
261
|
+
);
|
|
262
|
+
const { rerender } = renderWithTheme(
|
|
263
|
+
<AIReasoning part={step('r1', 'First')} stepKey='m1:r1' />,
|
|
264
|
+
);
|
|
265
|
+
expect(turning()).toHaveLength(0);
|
|
266
|
+
fireEvent.press(screen.getByRole('button', { name: /Thought for 3s/ }));
|
|
267
|
+
const [chevron] = turning();
|
|
268
|
+
expect(chevron).toBeTruthy();
|
|
269
|
+
|
|
270
|
+
rerender(<AIReasoning part={step('r1', 'Second')} stepKey='m2:r1' />);
|
|
271
|
+
expect(screen.getByRole('button', { expanded: false, name: /Thought for 3s/ })).toBeTruthy();
|
|
272
|
+
expect(screen.queryByText('Second')).toBeNull();
|
|
273
|
+
expect(turning()[0]).toBe(chevron);
|
|
274
|
+
|
|
275
|
+
// And it opens the other step as it did the first.
|
|
276
|
+
fireEvent.press(screen.getByRole('button', { name: /Thought for 3s/ }));
|
|
277
|
+
expect(screen.getByText('Second')).toBeTruthy();
|
|
278
|
+
expect(turning()[0]).toBe(chevron);
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
it('says Thinking... for thinking that shows nothing yet', () => {
|
|
282
|
+
renderWithTheme(<AIThinking />);
|
|
283
|
+
expect(screen.getByRole('button', { expanded: false, name: 'Thinking...' })).toBeTruthy();
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it('counts afresh for thinking that began later, in the same view', () => {
|
|
287
|
+
const { rerender } = renderWithTheme(<AIThinking since={Date.now() - 5000} />);
|
|
288
|
+
const view = screen.getByTestId('ai-reasoning');
|
|
289
|
+
expect(screen.getByRole('button', { name: 'Thinking... 5s' })).toBeTruthy();
|
|
290
|
+
|
|
291
|
+
rerender(<AIThinking since={Date.now()} />);
|
|
292
|
+
expect(screen.getByTestId('ai-reasoning')).toBe(view);
|
|
293
|
+
expect(screen.getByRole('button', { name: 'Thinking...' })).toBeTruthy();
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it('turns the open chevron the other way in RTL', () => {
|
|
297
|
+
const rotatedBy = (degrees: string) =>
|
|
298
|
+
screen.UNSAFE_root.findAll((node) =>
|
|
299
|
+
JSON.stringify(node.props?.style ?? '').includes(`"rotate":"${degrees}"`),
|
|
300
|
+
).length > 0;
|
|
301
|
+
const originalIsRTL = I18nManager.isRTL;
|
|
302
|
+
const setRTL = (value: boolean) =>
|
|
303
|
+
Object.defineProperty(I18nManager, 'isRTL', { configurable: true, value });
|
|
304
|
+
|
|
305
|
+
try {
|
|
306
|
+
setRTL(false);
|
|
307
|
+
const { unmount } = renderWithTheme(<AIReasoning initiallyExpanded text='A thought' />);
|
|
308
|
+
expect(rotatedBy('90deg')).toBe(true);
|
|
309
|
+
unmount();
|
|
310
|
+
|
|
311
|
+
setRTL(true);
|
|
312
|
+
renderWithTheme(<AIReasoning initiallyExpanded text='A thought' />);
|
|
313
|
+
expect(rotatedBy('-90deg')).toBe(true);
|
|
314
|
+
} finally {
|
|
315
|
+
setRTL(originalIsRTL);
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
describe('AIMessageParts', () => {
|
|
321
|
+
const reasoning = (id: string, preview: string): AIMessagePartData => ({
|
|
322
|
+
id,
|
|
323
|
+
kind: 'ai_reasoning',
|
|
324
|
+
payload: {},
|
|
325
|
+
reasoning: { durationMs: 3000, id, preview, status: 'completed' },
|
|
326
|
+
version: 1,
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
it('updates its views for another message’s steps, each starting afresh', () => {
|
|
330
|
+
const { rerender } = renderWithTheme(
|
|
331
|
+
<AIMessageParts messageId='m1' parts={[reasoning('r1', 'First')]} />,
|
|
332
|
+
);
|
|
333
|
+
const view = screen.getByTestId('ai-reasoning');
|
|
334
|
+
fireEvent.press(screen.getByRole('button', { name: /Thought for 3s/ }));
|
|
335
|
+
expect(screen.getByText('First')).toBeTruthy();
|
|
336
|
+
|
|
337
|
+
rerender(<AIMessageParts messageId='m2' parts={[reasoning('r1', 'Second')]} />);
|
|
338
|
+
// The same view, not one built again, showing the other step folded.
|
|
339
|
+
expect(screen.getByTestId('ai-reasoning')).toBe(view);
|
|
340
|
+
expect(screen.getByRole('button', { expanded: false, name: /Thought for 3s/ })).toBeTruthy();
|
|
341
|
+
expect(screen.queryByText('Second')).toBeNull();
|
|
342
|
+
});
|
|
343
|
+
});
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isAuthorizationExpired,
|
|
3
|
+
isAwaitingApproval,
|
|
4
|
+
isAwaitingAuthorization,
|
|
5
|
+
isAwaitingClient,
|
|
6
|
+
isDeclined,
|
|
7
|
+
isSupportedPart,
|
|
8
|
+
isToolCallFinished,
|
|
9
|
+
parseMessagePart,
|
|
10
|
+
parseMessageParts,
|
|
11
|
+
} from '../message-parts';
|
|
12
|
+
import type { AIToolCallPart } from '../message-parts';
|
|
13
|
+
|
|
14
|
+
// Shaped as the router writes them (acceleration/internal/conversation/parts.go).
|
|
15
|
+
const reasoning = {
|
|
16
|
+
duration_ms: 4200,
|
|
17
|
+
finished_at: '2026-11-02T10:00:04Z',
|
|
18
|
+
id: 'r1',
|
|
19
|
+
preview: 'Let me check the calendar first.',
|
|
20
|
+
started_at: '2026-11-02T10:00:00Z',
|
|
21
|
+
status: 'completed',
|
|
22
|
+
summary: 'Checked the calendar',
|
|
23
|
+
type: 'ai_reasoning',
|
|
24
|
+
v: 1,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const approvalCall = {
|
|
28
|
+
approval: {
|
|
29
|
+
allow_title: 'Share',
|
|
30
|
+
decline_title: 'Not now',
|
|
31
|
+
message: 'Only your city is shared.',
|
|
32
|
+
reason: 'to check the local weather',
|
|
33
|
+
title: 'Share your location?',
|
|
34
|
+
},
|
|
35
|
+
arguments: { reason: 'to check the local weather' },
|
|
36
|
+
display_title: 'Checking your location',
|
|
37
|
+
executor: 'client',
|
|
38
|
+
id: 'call_1',
|
|
39
|
+
name: 'get_location',
|
|
40
|
+
status: 'awaiting_approval',
|
|
41
|
+
target_client_id: 'ios-1',
|
|
42
|
+
target_user_id: 'alex',
|
|
43
|
+
type: 'ai_tool_call',
|
|
44
|
+
v: 1,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const authorizationCall = {
|
|
48
|
+
authorization: {
|
|
49
|
+
expires_at: '2026-11-02T10:10:00.123Z',
|
|
50
|
+
handoff_token: 'tok',
|
|
51
|
+
message: 'The agent needs your Linear account to file the issue.',
|
|
52
|
+
provider: 'linear',
|
|
53
|
+
provider_name: 'Linear',
|
|
54
|
+
title: 'Connect Linear',
|
|
55
|
+
type: 'oauth',
|
|
56
|
+
url: 'https://router.example.com/v1/agents/connectors/oauth/launch/abc',
|
|
57
|
+
},
|
|
58
|
+
display_title: 'Filing a Linear issue',
|
|
59
|
+
executor: 'server',
|
|
60
|
+
id: 'call_2',
|
|
61
|
+
name: 'linear_create_issue',
|
|
62
|
+
status: 'awaiting_authorization',
|
|
63
|
+
target_user_id: 'alex',
|
|
64
|
+
type: 'ai_tool_call',
|
|
65
|
+
v: 1,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const signInWithUrl = (url: string) =>
|
|
69
|
+
parseMessagePart({
|
|
70
|
+
...authorizationCall,
|
|
71
|
+
authorization: { ...authorizationCall.authorization, url },
|
|
72
|
+
})?.toolCall?.authorization;
|
|
73
|
+
|
|
74
|
+
describe('parseMessageParts', () => {
|
|
75
|
+
it('reads the steps in order and skips other attachments', () => {
|
|
76
|
+
const parts = parseMessageParts([
|
|
77
|
+
reasoning,
|
|
78
|
+
{ image_url: 'https://example.com/a.png', type: 'image' },
|
|
79
|
+
approvalCall,
|
|
80
|
+
authorizationCall,
|
|
81
|
+
]);
|
|
82
|
+
expect(parts.map((part) => part.id)).toEqual(['r1', 'call_1', 'call_2']);
|
|
83
|
+
expect(parts.map((part) => part.kind)).toEqual([
|
|
84
|
+
'ai_reasoning',
|
|
85
|
+
'ai_tool_call',
|
|
86
|
+
'ai_tool_call',
|
|
87
|
+
]);
|
|
88
|
+
expect(parts.every(isSupportedPart)).toBe(true);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('reads a reply as a local Vision-Agents router wrote it', () => {
|
|
92
|
+
// The attachments of one real reply, copied from the channel (2026-11-03, xai/grok-4.7).
|
|
93
|
+
const parts = parseMessageParts([
|
|
94
|
+
{
|
|
95
|
+
duration_ms: 2387,
|
|
96
|
+
finished_at: '2026-11-03T14:20:45.15695058Z',
|
|
97
|
+
id: 'r1',
|
|
98
|
+
preview: "Searching for today's top tech headline.",
|
|
99
|
+
started_at: '2026-11-03T14:20:45.156092748Z',
|
|
100
|
+
status: 'completed',
|
|
101
|
+
summary: "Searching for today's top tech headline.",
|
|
102
|
+
type: 'ai_reasoning',
|
|
103
|
+
v: 1,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
display_title: 'Searching the web',
|
|
107
|
+
duration_ms: 687,
|
|
108
|
+
executor: 'server',
|
|
109
|
+
finished_at: '2026-11-03T14:20:45.844631174Z',
|
|
110
|
+
id: 'call-b1352079-bc55-4229-ab07-8f9c2fc5d4d7-0',
|
|
111
|
+
name: 'search',
|
|
112
|
+
started_at: '2026-11-03T14:20:45.15688333Z',
|
|
113
|
+
status: 'completed',
|
|
114
|
+
type: 'ai_tool_call',
|
|
115
|
+
v: 1,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
duration_ms: 1884,
|
|
119
|
+
finished_at: '2026-11-03T14:20:47.729154697Z',
|
|
120
|
+
id: 'r2',
|
|
121
|
+
preview: "I will search for today's top tech headline and summarize it in one sentence.",
|
|
122
|
+
started_at: '2026-11-03T14:20:47.72908728Z',
|
|
123
|
+
status: 'completed',
|
|
124
|
+
summary: "I will search for today's top tech headline and summarize it in one sentence.",
|
|
125
|
+
type: 'ai_reasoning',
|
|
126
|
+
v: 1,
|
|
127
|
+
},
|
|
128
|
+
]);
|
|
129
|
+
expect(parts.map((part) => part.id)).toEqual([
|
|
130
|
+
'r1',
|
|
131
|
+
'call-b1352079-bc55-4229-ab07-8f9c2fc5d4d7-0',
|
|
132
|
+
'r2',
|
|
133
|
+
]);
|
|
134
|
+
expect(parts[0].reasoning).toEqual({
|
|
135
|
+
durationMs: 2387,
|
|
136
|
+
id: 'r1',
|
|
137
|
+
preview: "Searching for today's top tech headline.",
|
|
138
|
+
status: 'completed',
|
|
139
|
+
summary: "Searching for today's top tech headline.",
|
|
140
|
+
});
|
|
141
|
+
expect(parts[1].toolCall).toMatchObject({
|
|
142
|
+
displayTitle: 'Searching the web',
|
|
143
|
+
durationMs: 687,
|
|
144
|
+
executor: 'server',
|
|
145
|
+
name: 'search',
|
|
146
|
+
status: 'completed',
|
|
147
|
+
});
|
|
148
|
+
expect(parts.every(isSupportedPart)).toBe(true);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('reads a reasoning step', () => {
|
|
152
|
+
expect(parseMessagePart(reasoning)?.reasoning).toEqual({
|
|
153
|
+
durationMs: 4200,
|
|
154
|
+
id: 'r1',
|
|
155
|
+
preview: 'Let me check the calendar first.',
|
|
156
|
+
status: 'completed',
|
|
157
|
+
summary: 'Checked the calendar',
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('reads a tool call with its approval', () => {
|
|
162
|
+
const call = parseMessagePart(approvalCall)?.toolCall;
|
|
163
|
+
expect(call).toMatchObject({
|
|
164
|
+
approval: {
|
|
165
|
+
allowTitle: 'Share',
|
|
166
|
+
declineTitle: 'Not now',
|
|
167
|
+
message: 'Only your city is shared.',
|
|
168
|
+
reason: 'to check the local weather',
|
|
169
|
+
title: 'Share your location?',
|
|
170
|
+
},
|
|
171
|
+
arguments: { reason: 'to check the local weather' },
|
|
172
|
+
displayTitle: 'Checking your location',
|
|
173
|
+
executor: 'client',
|
|
174
|
+
id: 'call_1',
|
|
175
|
+
name: 'get_location',
|
|
176
|
+
status: 'awaiting_approval',
|
|
177
|
+
targetClientId: 'ios-1',
|
|
178
|
+
targetUserId: 'alex',
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('reads a tool call with its authorization', () => {
|
|
183
|
+
const call = parseMessagePart(authorizationCall)?.toolCall;
|
|
184
|
+
expect(call?.authorization).toEqual({
|
|
185
|
+
expiresAt: Date.parse('2026-11-02T10:10:00.123Z'),
|
|
186
|
+
handoffToken: 'tok',
|
|
187
|
+
message: 'The agent needs your Linear account to file the issue.',
|
|
188
|
+
provider: 'linear',
|
|
189
|
+
providerName: 'Linear',
|
|
190
|
+
status: undefined,
|
|
191
|
+
title: 'Connect Linear',
|
|
192
|
+
type: 'oauth',
|
|
193
|
+
url: 'https://router.example.com/v1/agents/connectors/oauth/launch/abc',
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('defaults missing fields', () => {
|
|
198
|
+
const part = parseMessagePart({ type: 'ai_tool_call' }, 3);
|
|
199
|
+
expect(part?.id).toBe('ai_tool_call-3');
|
|
200
|
+
expect(part?.version).toBe(1);
|
|
201
|
+
expect(part?.toolCall).toMatchObject({
|
|
202
|
+
executor: 'server',
|
|
203
|
+
name: '',
|
|
204
|
+
status: 'running',
|
|
205
|
+
});
|
|
206
|
+
expect(parseMessagePart({ type: 'ai_reasoning' })?.reasoning?.status).toBe('completed');
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it('reads fields of the wrong type as missing', () => {
|
|
210
|
+
const call = parseMessagePart({
|
|
211
|
+
approval: { message: 'no title' },
|
|
212
|
+
authorization: { title: 'Connect', url: 'ftp://example.com/launch' },
|
|
213
|
+
duration_ms: '12',
|
|
214
|
+
id: 7,
|
|
215
|
+
name: ['x'],
|
|
216
|
+
status: '',
|
|
217
|
+
type: 'ai_tool_call',
|
|
218
|
+
})?.toolCall;
|
|
219
|
+
expect(call).toMatchObject({ durationMs: undefined, id: 'ai_tool_call-0', name: '' });
|
|
220
|
+
expect(call?.status).toBe('running');
|
|
221
|
+
// a question with no title asks nothing, and a sign-in needs a web page
|
|
222
|
+
expect(call?.approval).toBeUndefined();
|
|
223
|
+
expect(call?.authorization).toBeUndefined();
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it('opens a sign-in only on a web page with a host', () => {
|
|
227
|
+
expect(
|
|
228
|
+
signInWithUrl('http://localhost:8080/v1/agents/connectors/oauth/launch/abc'),
|
|
229
|
+
).toBeDefined();
|
|
230
|
+
expect(signInWithUrl('HTTPS://router.example.com')).toBeDefined();
|
|
231
|
+
expect(signInWithUrl('https://user@router.example.com/launch')).toBeDefined();
|
|
232
|
+
expect(signInWithUrl('https://')).toBeUndefined();
|
|
233
|
+
expect(signInWithUrl('https:///launch')).toBeUndefined();
|
|
234
|
+
expect(signInWithUrl('javascript:alert(1)')).toBeUndefined();
|
|
235
|
+
expect(signInWithUrl('router.example.com/launch')).toBeUndefined();
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
it('reads a sign-in where URL does not implement protocol or host', () => {
|
|
239
|
+
// React Native before 0.80 throws "not implemented" from these getters.
|
|
240
|
+
const OriginalURL = globalThis.URL;
|
|
241
|
+
class LimitedURL {
|
|
242
|
+
get host(): string {
|
|
243
|
+
throw new Error('URL.host is not implemented');
|
|
244
|
+
}
|
|
245
|
+
get protocol(): string {
|
|
246
|
+
throw new Error('URL.protocol is not implemented');
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
globalThis.URL = LimitedURL as unknown as typeof URL;
|
|
250
|
+
try {
|
|
251
|
+
expect(parseMessagePart(authorizationCall)?.toolCall?.authorization).toBeDefined();
|
|
252
|
+
} finally {
|
|
253
|
+
globalThis.URL = OriginalURL;
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('keeps steps it cannot read, without a typed view', () => {
|
|
258
|
+
const newer = parseMessagePart({ id: 'x', type: 'ai_tool_call', v: 2 });
|
|
259
|
+
expect(newer?.toolCall).toBeUndefined();
|
|
260
|
+
expect(newer && isSupportedPart(newer)).toBe(false);
|
|
261
|
+
const custom = parseMessagePart({ id: 'c', type: 'ai_citation', url: 'u' });
|
|
262
|
+
expect(custom?.kind).toBe('ai_citation');
|
|
263
|
+
expect(custom?.payload).toMatchObject({ url: 'u' });
|
|
264
|
+
expect(custom && isSupportedPart(custom)).toBe(false);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('ignores what is not an AI step', () => {
|
|
268
|
+
expect(parseMessageParts(undefined)).toEqual([]);
|
|
269
|
+
expect(parseMessageParts([null, 'x', { type: 'file' }, {}])).toEqual([]);
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
describe('tool call addressing', () => {
|
|
274
|
+
const call = (overrides: Partial<AIToolCallPart>): AIToolCallPart => ({
|
|
275
|
+
...(parseMessagePart(approvalCall)?.toolCall as AIToolCallPart),
|
|
276
|
+
...overrides,
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
it('asks the targeted person on the targeted install', () => {
|
|
280
|
+
expect(isAwaitingApproval(call({}), 'alex', 'ios-1')).toBe(true);
|
|
281
|
+
expect(isAwaitingApproval(call({}), 'alex', 'android-2')).toBe(false);
|
|
282
|
+
expect(isAwaitingApproval(call({}), 'sam', 'ios-1')).toBe(false);
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
it('asks a server tool on any of the person’s installs', () => {
|
|
286
|
+
const server = call({ executor: 'server', targetClientId: undefined });
|
|
287
|
+
expect(isAwaitingApproval(server, 'alex', 'ios-1')).toBe(true);
|
|
288
|
+
expect(isAwaitingApproval(server, 'alex', 'android-9')).toBe(true);
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it('asks nothing once answered or without a question', () => {
|
|
292
|
+
expect(isAwaitingApproval(call({ status: 'running' }), 'alex', 'ios-1')).toBe(false);
|
|
293
|
+
expect(isAwaitingApproval(call({ approval: undefined }), 'alex', 'ios-1')).toBe(false);
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it('waits for this device to run a client tool', () => {
|
|
297
|
+
const device = call({ status: 'awaiting_client' });
|
|
298
|
+
expect(isAwaitingClient(device, 'alex', 'ios-1')).toBe(true);
|
|
299
|
+
expect(isAwaitingClient(device, 'alex', 'ios-2')).toBe(false);
|
|
300
|
+
expect(isAwaitingClient(call({ executor: 'server' }), 'alex', 'ios-1')).toBe(false);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it('asks the targeted person to sign in from any install', () => {
|
|
304
|
+
const signIn = parseMessagePart(authorizationCall)?.toolCall as AIToolCallPart;
|
|
305
|
+
expect(isAwaitingAuthorization(signIn, 'alex')).toBe(true);
|
|
306
|
+
expect(isAwaitingAuthorization(signIn, 'sam')).toBe(false);
|
|
307
|
+
expect(isAwaitingAuthorization({ ...signIn, status: 'completed' }, 'alex')).toBe(false);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it('knows a declined call', () => {
|
|
311
|
+
const declinedApproval = call({
|
|
312
|
+
approval: { decision: 'declined', title: 'Share?' },
|
|
313
|
+
status: 'cancelled',
|
|
314
|
+
});
|
|
315
|
+
expect(isDeclined(declinedApproval)).toBe(true);
|
|
316
|
+
const signIn = parseMessagePart(authorizationCall)?.toolCall as AIToolCallPart;
|
|
317
|
+
expect(
|
|
318
|
+
isDeclined({
|
|
319
|
+
...signIn,
|
|
320
|
+
authorization: { ...signIn.authorization!, status: 'declined' },
|
|
321
|
+
}),
|
|
322
|
+
).toBe(true);
|
|
323
|
+
expect(isDeclined(call({}))).toBe(false);
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it('knows finished statuses and expired sign-ins', () => {
|
|
327
|
+
expect(['completed', 'failed', 'cancelled'].every(isToolCallFinished)).toBe(true);
|
|
328
|
+
expect(isToolCallFinished('awaiting_client')).toBe(false);
|
|
329
|
+
const signIn = parseMessagePart(authorizationCall)?.toolCall?.authorization as NonNullable<
|
|
330
|
+
AIToolCallPart['authorization']
|
|
331
|
+
>;
|
|
332
|
+
expect(isAuthorizationExpired(signIn, signIn.expiresAt! - 1)).toBe(false);
|
|
333
|
+
expect(isAuthorizationExpired(signIn, signIn.expiresAt!)).toBe(true);
|
|
334
|
+
expect(isAuthorizationExpired({ ...signIn, status: 'connected' }, Infinity)).toBe(false);
|
|
335
|
+
});
|
|
336
|
+
});
|