stream-chat-react-native-core 9.12.1 → 9.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a2ui/package.json +6 -0
- package/ai-components/conversation/package.json +6 -0
- package/lib/commonjs/a11y/a11yUtils.js.map +1 -1
- package/lib/commonjs/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -1
- package/lib/commonjs/a2ui/A2UIContexts.js +8 -0
- package/lib/commonjs/a2ui/A2UIContexts.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIInstructions.js +49 -0
- package/lib/commonjs/a2ui/A2UIInstructions.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIPlaceholder.js +37 -0
- package/lib/commonjs/a2ui/A2UIPlaceholder.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIRenderer.js +363 -0
- package/lib/commonjs/a2ui/A2UIRenderer.js.map +1 -0
- package/lib/commonjs/a2ui/A2UIStream.js +91 -0
- package/lib/commonjs/a2ui/A2UIStream.js.map +1 -0
- package/lib/commonjs/a2ui/A2UISurface.js +237 -0
- package/lib/commonjs/a2ui/A2UISurface.js.map +1 -0
- package/lib/commonjs/a2ui/basicCatalog.json +1206 -0
- package/lib/commonjs/a2ui/basicFunctions.js +398 -0
- package/lib/commonjs/a2ui/basicFunctions.js.map +1 -0
- package/lib/commonjs/a2ui/catalogDocument.js +80 -0
- package/lib/commonjs/a2ui/catalogDocument.js.map +1 -0
- package/lib/commonjs/a2ui/catalogs.js +105 -0
- package/lib/commonjs/a2ui/catalogs.js.map +1 -0
- package/lib/commonjs/a2ui/components/DateTimeInput.js +445 -0
- package/lib/commonjs/a2ui/components/DateTimeInput.js.map +1 -0
- package/lib/commonjs/a2ui/components/Media.js +316 -0
- package/lib/commonjs/a2ui/components/Media.js.map +1 -0
- package/lib/commonjs/a2ui/components/basicComponents.js +975 -0
- package/lib/commonjs/a2ui/components/basicComponents.js.map +1 -0
- package/lib/commonjs/a2ui/components/iconPaths.js +66 -0
- package/lib/commonjs/a2ui/components/iconPaths.js.map +1 -0
- package/lib/commonjs/a2ui/components/types.js +4 -0
- package/lib/commonjs/a2ui/components/types.js.map +1 -0
- package/lib/commonjs/a2ui/index.js +70 -0
- package/lib/commonjs/a2ui/index.js.map +1 -0
- package/lib/commonjs/a2ui/instructions.js +268 -0
- package/lib/commonjs/a2ui/instructions.js.map +1 -0
- package/lib/commonjs/a2ui/secrets.js +169 -0
- package/lib/commonjs/a2ui/secrets.js.map +1 -0
- package/lib/commonjs/a2ui/useReplyState.js +35 -0
- package/lib/commonjs/a2ui/useReplyState.js.map +1 -0
- package/lib/commonjs/ai-components/AITypingIndicatorView.js +8 -18
- package/lib/commonjs/ai-components/AITypingIndicatorView.js.map +1 -1
- package/lib/commonjs/ai-components/README.md +64 -3
- package/lib/commonjs/ai-components/StreamingMessageView.js +26 -0
- package/lib/commonjs/ai-components/StreamingMessageView.js.map +1 -1
- package/lib/commonjs/ai-components/charts/components/PieLegend.js +2 -1
- package/lib/commonjs/ai-components/charts/components/PieLegend.js.map +1 -1
- package/lib/commonjs/ai-components/charts/components/VictoryChart.js +7 -2
- package/lib/commonjs/ai-components/charts/components/VictoryChart.js.map +1 -1
- package/lib/commonjs/ai-components/charts/utils/format-time-label.js +15 -0
- package/lib/commonjs/ai-components/charts/utils/format-time-label.js.map +1 -0
- package/lib/commonjs/ai-components/charts/vega-lite/schema.js +17 -2
- package/lib/commonjs/ai-components/charts/vega-lite/schema.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/composer-context.js +13 -6
- package/lib/commonjs/ai-components/contexts/composer-context.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/index.js +11 -0
- package/lib/commonjs/ai-components/contexts/index.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/theme-context.js +33 -2
- package/lib/commonjs/ai-components/contexts/theme-context.js.map +1 -1
- package/lib/commonjs/ai-components/contexts/translation-context.js +29 -0
- package/lib/commonjs/ai-components/contexts/translation-context.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/AIConversation.js +374 -0
- package/lib/commonjs/ai-components/conversation/AIConversation.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/entries.js +98 -0
- package/lib/commonjs/ai-components/conversation/entries.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/index.js +15 -0
- package/lib/commonjs/ai-components/conversation/index.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/AIChatList.js +224 -0
- package/lib/commonjs/ai-components/conversation/list/AIChatList.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useChatListController.js +78 -0
- package/lib/commonjs/ai-components/conversation/list/useChatListController.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useEndInView.js +51 -0
- package/lib/commonjs/ai-components/conversation/list/useEndInView.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useKeyboardOverlap.js +53 -0
- package/lib/commonjs/ai-components/conversation/list/useKeyboardOverlap.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/useLoadOlder.js +73 -0
- package/lib/commonjs/ai-components/conversation/list/useLoadOlder.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/list/usePinnedAnchor.js +84 -0
- package/lib/commonjs/ai-components/conversation/list/usePinnedAnchor.js.map +1 -0
- package/lib/commonjs/ai-components/conversation/useConversationRows.js +117 -0
- package/lib/commonjs/ai-components/conversation/useConversationRows.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIAgentError.js +13 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIAgentError.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIConversationController.js +431 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIConversationController.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIConversationExchange.js +89 -0
- package/lib/commonjs/ai-components/conversation-state/controller/AIConversationExchange.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/index.js +48 -0
- package/lib/commonjs/ai-components/conversation-state/controller/index.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/offers.js +35 -0
- package/lib/commonjs/ai-components/conversation-state/controller/offers.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/types.js +13 -0
- package/lib/commonjs/ai-components/conversation-state/controller/types.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/controller/useAIConversationState.js +8 -0
- package/lib/commonjs/ai-components/conversation-state/controller/useAIConversationState.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/fromStreamMessage.js +67 -0
- package/lib/commonjs/ai-components/conversation-state/fromStreamMessage.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/index.js +37 -0
- package/lib/commonjs/ai-components/conversation-state/index.js.map +1 -0
- package/lib/commonjs/ai-components/conversation-state/types.js +4 -0
- package/lib/commonjs/ai-components/conversation-state/types.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIAction.js +30 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIAction.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIArguments.js +128 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIArguments.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponent.js +50 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponent.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponentDefinition.js +134 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIComponentDefinition.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIDocument.js +32 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIDocument.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIEntrance.js +197 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIEntrance.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIErrorBoundary.js +30 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIErrorBoundary.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHelpers.js +54 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHelpers.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHost.js +259 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIHost.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIMedia.js +24 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIMedia.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIRenderer.js +10 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIRenderer.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIView.js +57 -0
- package/lib/commonjs/ai-components/generative-ui/AIUIView.js.map +1 -0
- package/lib/commonjs/ai-components/generative-ui/index.js +181 -0
- package/lib/commonjs/ai-components/generative-ui/index.js.map +1 -0
- package/lib/commonjs/ai-components/icons.js +44 -0
- package/lib/commonjs/ai-components/icons.js.map +1 -0
- package/lib/commonjs/ai-components/index.js +96 -0
- package/lib/commonjs/ai-components/index.js.map +1 -1
- package/lib/commonjs/ai-components/internal/Shimmer.js +36 -0
- package/lib/commonjs/ai-components/internal/Shimmer.js.map +1 -0
- package/lib/commonjs/ai-components/internal/format.js +66 -0
- package/lib/commonjs/ai-components/internal/format.js.map +1 -0
- package/lib/commonjs/ai-components/internal/hooks/useBottomSafeArea.js +12 -0
- package/lib/commonjs/ai-components/internal/hooks/useBottomSafeArea.js.map +1 -0
- package/lib/commonjs/ai-components/internal/icons/AgentIcons.js +74 -0
- package/lib/commonjs/ai-components/internal/icons/AgentIcons.js.map +1 -0
- package/lib/commonjs/ai-components/internal/keyboard.js +40 -0
- package/lib/commonjs/ai-components/internal/keyboard.js.map +1 -0
- package/lib/commonjs/ai-components/internal/tokens.js +11 -0
- package/lib/commonjs/ai-components/internal/tokens.js.map +1 -0
- package/lib/commonjs/ai-components/internal/uuid.js +21 -0
- package/lib/commonjs/ai-components/internal/uuid.js.map +1 -0
- package/lib/commonjs/ai-components/markdown/components/CodeBlock.js +4 -2
- package/lib/commonjs/ai-components/markdown/components/CodeBlock.js.map +1 -1
- package/lib/commonjs/ai-components/markdown/components/InlineCode.js +1 -0
- package/lib/commonjs/ai-components/markdown/components/InlineCode.js.map +1 -1
- package/lib/commonjs/ai-components/markdown/components/Text.js +11 -2
- package/lib/commonjs/ai-components/markdown/components/Text.js.map +1 -1
- package/lib/commonjs/ai-components/markdown/styles.js +27 -29
- package/lib/commonjs/ai-components/markdown/styles.js.map +1 -1
- package/lib/commonjs/ai-components/message/AIAssistantMessage.js +64 -0
- package/lib/commonjs/ai-components/message/AIAssistantMessage.js.map +1 -0
- package/lib/commonjs/ai-components/message/AIMessageAttachment.js +189 -0
- package/lib/commonjs/ai-components/message/AIMessageAttachment.js.map +1 -0
- package/lib/commonjs/ai-components/message/AIReplyActions.js +132 -0
- package/lib/commonjs/ai-components/message/AIReplyActions.js.map +1 -0
- package/lib/commonjs/ai-components/message/AIUserMessage.js +104 -0
- package/lib/commonjs/ai-components/message/AIUserMessage.js.map +1 -0
- package/lib/commonjs/ai-components/message/UserMessageMenu.js +150 -0
- package/lib/commonjs/ai-components/message/UserMessageMenu.js.map +1 -0
- package/lib/commonjs/ai-components/message/index.js +48 -0
- package/lib/commonjs/ai-components/message/index.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ActionButton.js +4 -2
- package/lib/commonjs/ai-components/message-composer/ActionButton.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/ActionSheet.js +22 -6
- package/lib/commonjs/ai-components/message-composer/ActionSheet.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/AttachmentButton.js +5 -1
- package/lib/commonjs/ai-components/message-composer/AttachmentButton.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/ChatOptions.js +147 -0
- package/lib/commonjs/ai-components/message-composer/ChatOptions.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/ComposerView.js +146 -20
- package/lib/commonjs/ai-components/message-composer/ComposerView.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/EditingMessageChip.js +81 -0
- package/lib/commonjs/ai-components/message-composer/EditingMessageChip.js.map +1 -0
- package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js +26 -1
- package/lib/commonjs/ai-components/message-composer/MediaPreviewList.js.map +1 -1
- package/lib/commonjs/ai-components/message-composer/index.js +11 -0
- package/lib/commonjs/ai-components/message-composer/index.js.map +1 -1
- package/lib/commonjs/ai-components/message-parts/AIMessageParts.js +133 -0
- package/lib/commonjs/ai-components/message-parts/AIMessageParts.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/AIToolApproval.js +197 -0
- package/lib/commonjs/ai-components/message-parts/AIToolApproval.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/AIToolAuthorization.js +250 -0
- package/lib/commonjs/ai-components/message-parts/AIToolAuthorization.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/AIToolCall.js +159 -0
- package/lib/commonjs/ai-components/message-parts/AIToolCall.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/callStates.js +54 -0
- package/lib/commonjs/ai-components/message-parts/callStates.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/index.js +70 -0
- package/lib/commonjs/ai-components/message-parts/index.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/parseMessageParts.js +126 -0
- package/lib/commonjs/ai-components/message-parts/parseMessageParts.js.map +1 -0
- package/lib/commonjs/ai-components/message-parts/types.js +2 -0
- package/lib/commonjs/ai-components/message-parts/types.js.map +1 -0
- package/lib/commonjs/ai-components/native-specs/NativeAIAgent.js +7 -0
- package/lib/commonjs/ai-components/native-specs/NativeAIAgent.js.map +1 -0
- package/lib/commonjs/ai-components/reasoning/AIReasoning.js +401 -0
- package/lib/commonjs/ai-components/reasoning/AIReasoning.js.map +1 -0
- package/lib/commonjs/ai-components/reasoning/index.js +26 -0
- package/lib/commonjs/ai-components/reasoning/index.js.map +1 -0
- package/lib/commonjs/ai-components/reasoning/thinkingClock.js +63 -0
- package/lib/commonjs/ai-components/reasoning/thinkingClock.js.map +1 -0
- package/lib/commonjs/ai-components/services/clipboard-service/expo.js +7 -2
- package/lib/commonjs/ai-components/services/clipboard-service/expo.js.map +1 -1
- package/lib/commonjs/ai-components/store/composer/store.js.map +1 -1
- package/lib/commonjs/ai-components/store/composer/useComposerChatOption.js +18 -0
- package/lib/commonjs/ai-components/store/composer/useComposerChatOption.js.map +1 -0
- package/lib/commonjs/ai-components/store/composer/useComposerIsEditing.js +18 -0
- package/lib/commonjs/ai-components/store/composer/useComposerIsEditing.js.map +1 -0
- package/lib/commonjs/ai-components/store/index.js +22 -0
- package/lib/commonjs/ai-components/store/index.js.map +1 -1
- package/lib/commonjs/ai-components/suggestions/AISuggestions.js +66 -0
- package/lib/commonjs/ai-components/suggestions/AISuggestions.js.map +1 -0
- package/lib/commonjs/ai-components/suggestions/index.js +15 -0
- package/lib/commonjs/ai-components/suggestions/index.js.map +1 -0
- package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js +2 -1
- package/lib/commonjs/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -1
- package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js +3 -2
- package/lib/commonjs/ai-components/syntax-highlighting/utils/renderer.js.map +1 -1
- package/lib/commonjs/ai-components/theme.js +137 -1
- package/lib/commonjs/ai-components/theme.js.map +1 -1
- package/lib/commonjs/ai-components/tool-calls/AIClientIdentity.js +22 -0
- package/lib/commonjs/ai-components/tool-calls/AIClientIdentity.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/AIClientToolRunner.js +109 -0
- package/lib/commonjs/ai-components/tool-calls/AIClientToolRunner.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/AIToolApprover.js +23 -0
- package/lib/commonjs/ai-components/tool-calls/AIToolApprover.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/authSessionAuthorizer.js +88 -0
- package/lib/commonjs/ai-components/tool-calls/authSessionAuthorizer.js.map +1 -0
- package/lib/commonjs/ai-components/tool-calls/index.js +48 -0
- package/lib/commonjs/ai-components/tool-calls/index.js.map +1 -0
- package/lib/commonjs/ai-components/voice-visualization/glowShader.js.map +1 -1
- package/lib/commonjs/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -1
- package/lib/commonjs/components/Message/MessageItemView/utils/renderText.js.map +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +2 -2
- package/lib/commonjs/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/commonjs/i18n/ar.json +40 -1
- package/lib/commonjs/i18n/en.json +40 -1
- package/lib/commonjs/i18n/es.json +40 -1
- package/lib/commonjs/i18n/fr.json +40 -1
- package/lib/commonjs/i18n/he.json +40 -1
- package/lib/commonjs/i18n/hi.json +40 -1
- package/lib/commonjs/i18n/it.json +40 -1
- package/lib/commonjs/i18n/ja.json +40 -1
- package/lib/commonjs/i18n/ko.json +40 -1
- package/lib/commonjs/i18n/nl.json +40 -1
- package/lib/commonjs/i18n/pt-br.json +40 -1
- package/lib/commonjs/i18n/ru.json +40 -1
- package/lib/commonjs/i18n/tr.json +40 -1
- package/lib/commonjs/mock-builders/a2ui/ohrid.js +84 -0
- package/lib/commonjs/mock-builders/a2ui/ohrid.js.map +1 -0
- package/lib/commonjs/utils/i18n/Streami18n.js +9 -4
- package/lib/commonjs/utils/i18n/Streami18n.js.map +1 -1
- package/lib/commonjs/utils/i18n/utils.js +7 -0
- package/lib/commonjs/utils/i18n/utils.js.map +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/a11y/a11yUtils.js.map +1 -1
- package/lib/module/a11y/hooks/useResolvedModalAccessibilityProps.js.map +1 -1
- package/lib/module/a2ui/A2UIContexts.js +8 -0
- package/lib/module/a2ui/A2UIContexts.js.map +1 -0
- package/lib/module/a2ui/A2UIInstructions.js +49 -0
- package/lib/module/a2ui/A2UIInstructions.js.map +1 -0
- package/lib/module/a2ui/A2UIPlaceholder.js +37 -0
- package/lib/module/a2ui/A2UIPlaceholder.js.map +1 -0
- package/lib/module/a2ui/A2UIRenderer.js +363 -0
- package/lib/module/a2ui/A2UIRenderer.js.map +1 -0
- package/lib/module/a2ui/A2UIStream.js +91 -0
- package/lib/module/a2ui/A2UIStream.js.map +1 -0
- package/lib/module/a2ui/A2UISurface.js +237 -0
- package/lib/module/a2ui/A2UISurface.js.map +1 -0
- package/lib/module/a2ui/basicCatalog.json +1206 -0
- package/lib/module/a2ui/basicFunctions.js +398 -0
- package/lib/module/a2ui/basicFunctions.js.map +1 -0
- package/lib/module/a2ui/catalogDocument.js +80 -0
- package/lib/module/a2ui/catalogDocument.js.map +1 -0
- package/lib/module/a2ui/catalogs.js +105 -0
- package/lib/module/a2ui/catalogs.js.map +1 -0
- package/lib/module/a2ui/components/DateTimeInput.js +445 -0
- package/lib/module/a2ui/components/DateTimeInput.js.map +1 -0
- package/lib/module/a2ui/components/Media.js +316 -0
- package/lib/module/a2ui/components/Media.js.map +1 -0
- package/lib/module/a2ui/components/basicComponents.js +975 -0
- package/lib/module/a2ui/components/basicComponents.js.map +1 -0
- package/lib/module/a2ui/components/iconPaths.js +66 -0
- package/lib/module/a2ui/components/iconPaths.js.map +1 -0
- package/lib/module/a2ui/components/types.js +4 -0
- package/lib/module/a2ui/components/types.js.map +1 -0
- package/lib/module/a2ui/index.js +70 -0
- package/lib/module/a2ui/index.js.map +1 -0
- package/lib/module/a2ui/instructions.js +268 -0
- package/lib/module/a2ui/instructions.js.map +1 -0
- package/lib/module/a2ui/secrets.js +169 -0
- package/lib/module/a2ui/secrets.js.map +1 -0
- package/lib/module/a2ui/useReplyState.js +35 -0
- package/lib/module/a2ui/useReplyState.js.map +1 -0
- package/lib/module/ai-components/AITypingIndicatorView.js +8 -18
- package/lib/module/ai-components/AITypingIndicatorView.js.map +1 -1
- package/lib/module/ai-components/README.md +64 -3
- package/lib/module/ai-components/StreamingMessageView.js +26 -0
- package/lib/module/ai-components/StreamingMessageView.js.map +1 -1
- package/lib/module/ai-components/charts/components/PieLegend.js +2 -1
- package/lib/module/ai-components/charts/components/PieLegend.js.map +1 -1
- package/lib/module/ai-components/charts/components/VictoryChart.js +7 -2
- package/lib/module/ai-components/charts/components/VictoryChart.js.map +1 -1
- package/lib/module/ai-components/charts/utils/format-time-label.js +15 -0
- package/lib/module/ai-components/charts/utils/format-time-label.js.map +1 -0
- package/lib/module/ai-components/charts/vega-lite/schema.js +17 -2
- package/lib/module/ai-components/charts/vega-lite/schema.js.map +1 -1
- package/lib/module/ai-components/contexts/composer-context.js +13 -6
- package/lib/module/ai-components/contexts/composer-context.js.map +1 -1
- package/lib/module/ai-components/contexts/index.js +11 -0
- package/lib/module/ai-components/contexts/index.js.map +1 -1
- package/lib/module/ai-components/contexts/theme-context.js +33 -2
- package/lib/module/ai-components/contexts/theme-context.js.map +1 -1
- package/lib/module/ai-components/contexts/translation-context.js +29 -0
- package/lib/module/ai-components/contexts/translation-context.js.map +1 -0
- package/lib/module/ai-components/conversation/AIConversation.js +374 -0
- package/lib/module/ai-components/conversation/AIConversation.js.map +1 -0
- package/lib/module/ai-components/conversation/entries.js +98 -0
- package/lib/module/ai-components/conversation/entries.js.map +1 -0
- package/lib/module/ai-components/conversation/index.js +15 -0
- package/lib/module/ai-components/conversation/index.js.map +1 -0
- package/lib/module/ai-components/conversation/list/AIChatList.js +224 -0
- package/lib/module/ai-components/conversation/list/AIChatList.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useChatListController.js +78 -0
- package/lib/module/ai-components/conversation/list/useChatListController.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useEndInView.js +51 -0
- package/lib/module/ai-components/conversation/list/useEndInView.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useKeyboardOverlap.js +53 -0
- package/lib/module/ai-components/conversation/list/useKeyboardOverlap.js.map +1 -0
- package/lib/module/ai-components/conversation/list/useLoadOlder.js +73 -0
- package/lib/module/ai-components/conversation/list/useLoadOlder.js.map +1 -0
- package/lib/module/ai-components/conversation/list/usePinnedAnchor.js +84 -0
- package/lib/module/ai-components/conversation/list/usePinnedAnchor.js.map +1 -0
- package/lib/module/ai-components/conversation/useConversationRows.js +117 -0
- package/lib/module/ai-components/conversation/useConversationRows.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/AIAgentError.js +13 -0
- package/lib/module/ai-components/conversation-state/controller/AIAgentError.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/AIConversationController.js +431 -0
- package/lib/module/ai-components/conversation-state/controller/AIConversationController.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/AIConversationExchange.js +89 -0
- package/lib/module/ai-components/conversation-state/controller/AIConversationExchange.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/index.js +48 -0
- package/lib/module/ai-components/conversation-state/controller/index.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/offers.js +35 -0
- package/lib/module/ai-components/conversation-state/controller/offers.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/types.js +13 -0
- package/lib/module/ai-components/conversation-state/controller/types.js.map +1 -0
- package/lib/module/ai-components/conversation-state/controller/useAIConversationState.js +8 -0
- package/lib/module/ai-components/conversation-state/controller/useAIConversationState.js.map +1 -0
- package/lib/module/ai-components/conversation-state/fromStreamMessage.js +67 -0
- package/lib/module/ai-components/conversation-state/fromStreamMessage.js.map +1 -0
- package/lib/module/ai-components/conversation-state/index.js +37 -0
- package/lib/module/ai-components/conversation-state/index.js.map +1 -0
- package/lib/module/ai-components/conversation-state/types.js +4 -0
- package/lib/module/ai-components/conversation-state/types.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIAction.js +30 -0
- package/lib/module/ai-components/generative-ui/AIUIAction.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIArguments.js +128 -0
- package/lib/module/ai-components/generative-ui/AIUIArguments.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIComponent.js +50 -0
- package/lib/module/ai-components/generative-ui/AIUIComponent.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIComponentDefinition.js +134 -0
- package/lib/module/ai-components/generative-ui/AIUIComponentDefinition.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIDocument.js +32 -0
- package/lib/module/ai-components/generative-ui/AIUIDocument.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIEntrance.js +197 -0
- package/lib/module/ai-components/generative-ui/AIUIEntrance.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIErrorBoundary.js +30 -0
- package/lib/module/ai-components/generative-ui/AIUIErrorBoundary.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIHelpers.js +54 -0
- package/lib/module/ai-components/generative-ui/AIUIHelpers.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIHost.js +259 -0
- package/lib/module/ai-components/generative-ui/AIUIHost.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIMedia.js +24 -0
- package/lib/module/ai-components/generative-ui/AIUIMedia.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIRenderer.js +10 -0
- package/lib/module/ai-components/generative-ui/AIUIRenderer.js.map +1 -0
- package/lib/module/ai-components/generative-ui/AIUIView.js +57 -0
- package/lib/module/ai-components/generative-ui/AIUIView.js.map +1 -0
- package/lib/module/ai-components/generative-ui/index.js +181 -0
- package/lib/module/ai-components/generative-ui/index.js.map +1 -0
- package/lib/module/ai-components/icons.js +44 -0
- package/lib/module/ai-components/icons.js.map +1 -0
- package/lib/module/ai-components/index.js +96 -0
- package/lib/module/ai-components/index.js.map +1 -1
- package/lib/module/ai-components/internal/Shimmer.js +36 -0
- package/lib/module/ai-components/internal/Shimmer.js.map +1 -0
- package/lib/module/ai-components/internal/format.js +66 -0
- package/lib/module/ai-components/internal/format.js.map +1 -0
- package/lib/module/ai-components/internal/hooks/useBottomSafeArea.js +12 -0
- package/lib/module/ai-components/internal/hooks/useBottomSafeArea.js.map +1 -0
- package/lib/module/ai-components/internal/icons/AgentIcons.js +74 -0
- package/lib/module/ai-components/internal/icons/AgentIcons.js.map +1 -0
- package/lib/module/ai-components/internal/keyboard.js +40 -0
- package/lib/module/ai-components/internal/keyboard.js.map +1 -0
- package/lib/module/ai-components/internal/tokens.js +11 -0
- package/lib/module/ai-components/internal/tokens.js.map +1 -0
- package/lib/module/ai-components/internal/uuid.js +21 -0
- package/lib/module/ai-components/internal/uuid.js.map +1 -0
- package/lib/module/ai-components/markdown/components/CodeBlock.js +4 -2
- package/lib/module/ai-components/markdown/components/CodeBlock.js.map +1 -1
- package/lib/module/ai-components/markdown/components/InlineCode.js +1 -0
- package/lib/module/ai-components/markdown/components/InlineCode.js.map +1 -1
- package/lib/module/ai-components/markdown/components/Text.js +11 -2
- package/lib/module/ai-components/markdown/components/Text.js.map +1 -1
- package/lib/module/ai-components/markdown/styles.js +27 -29
- package/lib/module/ai-components/markdown/styles.js.map +1 -1
- package/lib/module/ai-components/message/AIAssistantMessage.js +64 -0
- package/lib/module/ai-components/message/AIAssistantMessage.js.map +1 -0
- package/lib/module/ai-components/message/AIMessageAttachment.js +189 -0
- package/lib/module/ai-components/message/AIMessageAttachment.js.map +1 -0
- package/lib/module/ai-components/message/AIReplyActions.js +132 -0
- package/lib/module/ai-components/message/AIReplyActions.js.map +1 -0
- package/lib/module/ai-components/message/AIUserMessage.js +104 -0
- package/lib/module/ai-components/message/AIUserMessage.js.map +1 -0
- package/lib/module/ai-components/message/UserMessageMenu.js +150 -0
- package/lib/module/ai-components/message/UserMessageMenu.js.map +1 -0
- package/lib/module/ai-components/message/index.js +48 -0
- package/lib/module/ai-components/message/index.js.map +1 -0
- package/lib/module/ai-components/message-composer/ActionButton.js +4 -2
- package/lib/module/ai-components/message-composer/ActionButton.js.map +1 -1
- package/lib/module/ai-components/message-composer/ActionSheet.js +22 -6
- package/lib/module/ai-components/message-composer/ActionSheet.js.map +1 -1
- package/lib/module/ai-components/message-composer/AttachmentButton.js +5 -1
- package/lib/module/ai-components/message-composer/AttachmentButton.js.map +1 -1
- package/lib/module/ai-components/message-composer/ChatOptions.js +147 -0
- package/lib/module/ai-components/message-composer/ChatOptions.js.map +1 -0
- package/lib/module/ai-components/message-composer/ComposerView.js +146 -20
- package/lib/module/ai-components/message-composer/ComposerView.js.map +1 -1
- package/lib/module/ai-components/message-composer/EditingMessageChip.js +81 -0
- package/lib/module/ai-components/message-composer/EditingMessageChip.js.map +1 -0
- package/lib/module/ai-components/message-composer/MediaPreviewList.js +26 -1
- package/lib/module/ai-components/message-composer/MediaPreviewList.js.map +1 -1
- package/lib/module/ai-components/message-composer/index.js +11 -0
- package/lib/module/ai-components/message-composer/index.js.map +1 -1
- package/lib/module/ai-components/message-parts/AIMessageParts.js +133 -0
- package/lib/module/ai-components/message-parts/AIMessageParts.js.map +1 -0
- package/lib/module/ai-components/message-parts/AIToolApproval.js +197 -0
- package/lib/module/ai-components/message-parts/AIToolApproval.js.map +1 -0
- package/lib/module/ai-components/message-parts/AIToolAuthorization.js +250 -0
- package/lib/module/ai-components/message-parts/AIToolAuthorization.js.map +1 -0
- package/lib/module/ai-components/message-parts/AIToolCall.js +159 -0
- package/lib/module/ai-components/message-parts/AIToolCall.js.map +1 -0
- package/lib/module/ai-components/message-parts/callStates.js +54 -0
- package/lib/module/ai-components/message-parts/callStates.js.map +1 -0
- package/lib/module/ai-components/message-parts/index.js +70 -0
- package/lib/module/ai-components/message-parts/index.js.map +1 -0
- package/lib/module/ai-components/message-parts/parseMessageParts.js +126 -0
- package/lib/module/ai-components/message-parts/parseMessageParts.js.map +1 -0
- package/lib/module/ai-components/message-parts/types.js +2 -0
- package/lib/module/ai-components/message-parts/types.js.map +1 -0
- package/lib/module/ai-components/native-specs/NativeAIAgent.js +7 -0
- package/lib/module/ai-components/native-specs/NativeAIAgent.js.map +1 -0
- package/lib/module/ai-components/reasoning/AIReasoning.js +401 -0
- package/lib/module/ai-components/reasoning/AIReasoning.js.map +1 -0
- package/lib/module/ai-components/reasoning/index.js +26 -0
- package/lib/module/ai-components/reasoning/index.js.map +1 -0
- package/lib/module/ai-components/reasoning/thinkingClock.js +63 -0
- package/lib/module/ai-components/reasoning/thinkingClock.js.map +1 -0
- package/lib/module/ai-components/services/clipboard-service/expo.js +7 -2
- package/lib/module/ai-components/services/clipboard-service/expo.js.map +1 -1
- package/lib/module/ai-components/store/composer/store.js.map +1 -1
- package/lib/module/ai-components/store/composer/useComposerChatOption.js +18 -0
- package/lib/module/ai-components/store/composer/useComposerChatOption.js.map +1 -0
- package/lib/module/ai-components/store/composer/useComposerIsEditing.js +18 -0
- package/lib/module/ai-components/store/composer/useComposerIsEditing.js.map +1 -0
- package/lib/module/ai-components/store/index.js +22 -0
- package/lib/module/ai-components/store/index.js.map +1 -1
- package/lib/module/ai-components/suggestions/AISuggestions.js +66 -0
- package/lib/module/ai-components/suggestions/AISuggestions.js.map +1 -0
- package/lib/module/ai-components/suggestions/index.js +15 -0
- package/lib/module/ai-components/suggestions/index.js.map +1 -0
- package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js +2 -1
- package/lib/module/ai-components/syntax-highlighting/utils/flatten-nodes.js.map +1 -1
- package/lib/module/ai-components/syntax-highlighting/utils/renderer.js +3 -2
- package/lib/module/ai-components/syntax-highlighting/utils/renderer.js.map +1 -1
- package/lib/module/ai-components/theme.js +137 -1
- package/lib/module/ai-components/theme.js.map +1 -1
- package/lib/module/ai-components/tool-calls/AIClientIdentity.js +22 -0
- package/lib/module/ai-components/tool-calls/AIClientIdentity.js.map +1 -0
- package/lib/module/ai-components/tool-calls/AIClientToolRunner.js +109 -0
- package/lib/module/ai-components/tool-calls/AIClientToolRunner.js.map +1 -0
- package/lib/module/ai-components/tool-calls/AIToolApprover.js +23 -0
- package/lib/module/ai-components/tool-calls/AIToolApprover.js.map +1 -0
- package/lib/module/ai-components/tool-calls/authSessionAuthorizer.js +88 -0
- package/lib/module/ai-components/tool-calls/authSessionAuthorizer.js.map +1 -0
- package/lib/module/ai-components/tool-calls/index.js +48 -0
- package/lib/module/ai-components/tool-calls/index.js.map +1 -0
- package/lib/module/ai-components/voice-visualization/glowShader.js.map +1 -1
- package/lib/module/components/Accessibility/useAccessibilityAnnouncer.js.map +1 -1
- package/lib/module/components/Message/MessageItemView/utils/renderText.js.map +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +2 -2
- package/lib/module/contexts/translationContext/TranslationContext.js.map +1 -1
- package/lib/module/i18n/ar.json +40 -1
- package/lib/module/i18n/en.json +40 -1
- package/lib/module/i18n/es.json +40 -1
- package/lib/module/i18n/fr.json +40 -1
- package/lib/module/i18n/he.json +40 -1
- package/lib/module/i18n/hi.json +40 -1
- package/lib/module/i18n/it.json +40 -1
- package/lib/module/i18n/ja.json +40 -1
- package/lib/module/i18n/ko.json +40 -1
- package/lib/module/i18n/nl.json +40 -1
- package/lib/module/i18n/pt-br.json +40 -1
- package/lib/module/i18n/ru.json +40 -1
- package/lib/module/i18n/tr.json +40 -1
- package/lib/module/mock-builders/a2ui/ohrid.js +84 -0
- package/lib/module/mock-builders/a2ui/ohrid.js.map +1 -0
- package/lib/module/utils/i18n/Streami18n.js +9 -4
- package/lib/module/utils/i18n/Streami18n.js.map +1 -1
- package/lib/module/utils/i18n/utils.js +7 -0
- package/lib/module/utils/i18n/utils.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/a11y/a11yUtils.d.ts +0 -1
- package/lib/typescript/a11y/a11yUtils.d.ts.map +1 -1
- package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts +2 -3
- package/lib/typescript/a11y/hooks/useResolvedModalAccessibilityProps.d.ts.map +1 -1
- package/lib/typescript/a2ui/A2UIContexts.d.ts +9 -0
- package/lib/typescript/a2ui/A2UIContexts.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIInstructions.d.ts +47 -0
- package/lib/typescript/a2ui/A2UIInstructions.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIPlaceholder.d.ts +4 -0
- package/lib/typescript/a2ui/A2UIPlaceholder.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIRenderer.d.ts +130 -0
- package/lib/typescript/a2ui/A2UIRenderer.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UIStream.d.ts +23 -0
- package/lib/typescript/a2ui/A2UIStream.d.ts.map +1 -0
- package/lib/typescript/a2ui/A2UISurface.d.ts +19 -0
- package/lib/typescript/a2ui/A2UISurface.d.ts.map +1 -0
- package/lib/typescript/a2ui/basicFunctions.d.ts +10 -0
- package/lib/typescript/a2ui/basicFunctions.d.ts.map +1 -0
- package/lib/typescript/a2ui/catalogDocument.d.ts +56 -0
- package/lib/typescript/a2ui/catalogDocument.d.ts.map +1 -0
- package/lib/typescript/a2ui/catalogs.d.ts +42 -0
- package/lib/typescript/a2ui/catalogs.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/DateTimeInput.d.ts +44 -0
- package/lib/typescript/a2ui/components/DateTimeInput.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/Media.d.ts +27 -0
- package/lib/typescript/a2ui/components/Media.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/basicComponents.d.ts +4 -0
- package/lib/typescript/a2ui/components/basicComponents.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/iconPaths.d.ts +2 -0
- package/lib/typescript/a2ui/components/iconPaths.d.ts.map +1 -0
- package/lib/typescript/a2ui/components/types.d.ts +23 -0
- package/lib/typescript/a2ui/components/types.d.ts.map +1 -0
- package/lib/typescript/a2ui/index.d.ts +8 -0
- package/lib/typescript/a2ui/index.d.ts.map +1 -0
- package/lib/typescript/a2ui/instructions.d.ts +39 -0
- package/lib/typescript/a2ui/instructions.d.ts.map +1 -0
- package/lib/typescript/a2ui/secrets.d.ts +20 -0
- package/lib/typescript/a2ui/secrets.d.ts.map +1 -0
- package/lib/typescript/a2ui/useReplyState.d.ts +4 -0
- package/lib/typescript/a2ui/useReplyState.d.ts.map +1 -0
- package/lib/typescript/ai-components/AITypingIndicatorView.d.ts.map +1 -1
- package/lib/typescript/ai-components/StreamingMessageView.d.ts +4 -1
- package/lib/typescript/ai-components/StreamingMessageView.d.ts.map +1 -1
- package/lib/typescript/ai-components/charts/components/PieLegend.d.ts.map +1 -1
- package/lib/typescript/ai-components/charts/components/VictoryChart.d.ts.map +1 -1
- package/lib/typescript/ai-components/charts/utils/format-time-label.d.ts +7 -0
- package/lib/typescript/ai-components/charts/utils/format-time-label.d.ts.map +1 -0
- package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts +8 -8
- package/lib/typescript/ai-components/charts/vega-lite/schema.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/composer-context.d.ts +3 -0
- package/lib/typescript/ai-components/contexts/composer-context.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/index.d.ts +1 -0
- package/lib/typescript/ai-components/contexts/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/theme-context.d.ts.map +1 -1
- package/lib/typescript/ai-components/contexts/translation-context.d.ts +19 -0
- package/lib/typescript/ai-components/contexts/translation-context.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/AIConversation.d.ts +133 -0
- package/lib/typescript/ai-components/conversation/AIConversation.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/entries.d.ts +47 -0
- package/lib/typescript/ai-components/conversation/entries.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/index.d.ts +3 -0
- package/lib/typescript/ai-components/conversation/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/AIChatList.d.ts +30 -0
- package/lib/typescript/ai-components/conversation/list/AIChatList.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useChatListController.d.ts +45 -0
- package/lib/typescript/ai-components/conversation/list/useChatListController.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useEndInView.d.ts +26 -0
- package/lib/typescript/ai-components/conversation/list/useEndInView.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useKeyboardOverlap.d.ts +17 -0
- package/lib/typescript/ai-components/conversation/list/useKeyboardOverlap.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/useLoadOlder.d.ts +24 -0
- package/lib/typescript/ai-components/conversation/list/useLoadOlder.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/list/usePinnedAnchor.d.ts +26 -0
- package/lib/typescript/ai-components/conversation/list/usePinnedAnchor.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation/useConversationRows.d.ts +66 -0
- package/lib/typescript/ai-components/conversation/useConversationRows.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIAgentError.d.ts +10 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIAgentError.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIConversationController.d.ts +173 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIConversationController.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIConversationExchange.d.ts +23 -0
- package/lib/typescript/ai-components/conversation-state/controller/AIConversationExchange.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/index.d.ts +5 -0
- package/lib/typescript/ai-components/conversation-state/controller/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/offers.d.ts +25 -0
- package/lib/typescript/ai-components/conversation-state/controller/offers.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/types.d.ts +142 -0
- package/lib/typescript/ai-components/conversation-state/controller/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/controller/useAIConversationState.d.ts +9 -0
- package/lib/typescript/ai-components/conversation-state/controller/useAIConversationState.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/fromStreamMessage.d.ts +25 -0
- package/lib/typescript/ai-components/conversation-state/fromStreamMessage.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/index.d.ts +4 -0
- package/lib/typescript/ai-components/conversation-state/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/conversation-state/types.d.ts +55 -0
- package/lib/typescript/ai-components/conversation-state/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIAction.d.ts +48 -0
- package/lib/typescript/ai-components/generative-ui/AIUIAction.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIArguments.d.ts +15 -0
- package/lib/typescript/ai-components/generative-ui/AIUIArguments.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponent.d.ts +51 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponent.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponentDefinition.d.ts +84 -0
- package/lib/typescript/ai-components/generative-ui/AIUIComponentDefinition.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIDocument.d.ts +50 -0
- package/lib/typescript/ai-components/generative-ui/AIUIDocument.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIEntrance.d.ts +76 -0
- package/lib/typescript/ai-components/generative-ui/AIUIEntrance.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIErrorBoundary.d.ts +26 -0
- package/lib/typescript/ai-components/generative-ui/AIUIErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHelpers.d.ts +23 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHelpers.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHost.d.ts +160 -0
- package/lib/typescript/ai-components/generative-ui/AIUIHost.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIMedia.d.ts +22 -0
- package/lib/typescript/ai-components/generative-ui/AIUIMedia.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIRenderer.d.ts +53 -0
- package/lib/typescript/ai-components/generative-ui/AIUIRenderer.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/AIUIView.d.ts +35 -0
- package/lib/typescript/ai-components/generative-ui/AIUIView.d.ts.map +1 -0
- package/lib/typescript/ai-components/generative-ui/index.d.ts +11 -0
- package/lib/typescript/ai-components/generative-ui/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/icons.d.ts +66 -0
- package/lib/typescript/ai-components/icons.d.ts.map +1 -0
- package/lib/typescript/ai-components/index.d.ts +8 -0
- package/lib/typescript/ai-components/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/internal/Shimmer.d.ts +14 -0
- package/lib/typescript/ai-components/internal/Shimmer.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/format.d.ts +7 -0
- package/lib/typescript/ai-components/internal/format.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/hooks/useBottomSafeArea.d.ts +3 -0
- package/lib/typescript/ai-components/internal/hooks/useBottomSafeArea.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/icons/AgentIcons.d.ts +31 -0
- package/lib/typescript/ai-components/internal/icons/AgentIcons.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/keyboard.d.ts +9 -0
- package/lib/typescript/ai-components/internal/keyboard.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/tokens.d.ts +2 -0
- package/lib/typescript/ai-components/internal/tokens.d.ts.map +1 -0
- package/lib/typescript/ai-components/internal/uuid.d.ts +2 -0
- package/lib/typescript/ai-components/internal/uuid.d.ts.map +1 -0
- package/lib/typescript/ai-components/markdown/components/CodeBlock.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/components/InlineCode.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/components/Text.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/styles.d.ts +23 -4
- package/lib/typescript/ai-components/markdown/styles.d.ts.map +1 -1
- package/lib/typescript/ai-components/markdown/types.d.ts +1 -0
- package/lib/typescript/ai-components/markdown/types.d.ts.map +1 -1
- package/lib/typescript/ai-components/message/AIAssistantMessage.d.ts +40 -0
- package/lib/typescript/ai-components/message/AIAssistantMessage.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/AIMessageAttachment.d.ts +33 -0
- package/lib/typescript/ai-components/message/AIMessageAttachment.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/AIReplyActions.d.ts +19 -0
- package/lib/typescript/ai-components/message/AIReplyActions.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/AIUserMessage.d.ts +17 -0
- package/lib/typescript/ai-components/message/AIUserMessage.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/UserMessageMenu.d.ts +31 -0
- package/lib/typescript/ai-components/message/UserMessageMenu.d.ts.map +1 -0
- package/lib/typescript/ai-components/message/index.d.ts +5 -0
- package/lib/typescript/ai-components/message/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ActionButton.d.ts +1 -1
- package/lib/typescript/ai-components/message-composer/ActionButton.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts +2 -2
- package/lib/typescript/ai-components/message-composer/ActionSheet.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/AttachmentButton.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/ChatOptions.d.ts +35 -0
- package/lib/typescript/ai-components/message-composer/ChatOptions.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts +39 -3
- package/lib/typescript/ai-components/message-composer/ComposerView.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/EditingMessageChip.d.ts +7 -0
- package/lib/typescript/ai-components/message-composer/EditingMessageChip.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-composer/MediaPreviewList.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-composer/index.d.ts +1 -0
- package/lib/typescript/ai-components/message-composer/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/message-parts/AIMessageParts.d.ts +40 -0
- package/lib/typescript/ai-components/message-parts/AIMessageParts.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/AIToolApproval.d.ts +38 -0
- package/lib/typescript/ai-components/message-parts/AIToolApproval.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/AIToolAuthorization.d.ts +48 -0
- package/lib/typescript/ai-components/message-parts/AIToolAuthorization.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/AIToolCall.d.ts +11 -0
- package/lib/typescript/ai-components/message-parts/AIToolCall.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/callStates.d.ts +9 -0
- package/lib/typescript/ai-components/message-parts/callStates.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/index.d.ts +7 -0
- package/lib/typescript/ai-components/message-parts/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/parseMessageParts.d.ts +47 -0
- package/lib/typescript/ai-components/message-parts/parseMessageParts.d.ts.map +1 -0
- package/lib/typescript/ai-components/message-parts/types.d.ts +137 -0
- package/lib/typescript/ai-components/message-parts/types.d.ts.map +1 -0
- package/lib/typescript/ai-components/native-specs/NativeAIAgent.d.ts +22 -0
- package/lib/typescript/ai-components/native-specs/NativeAIAgent.d.ts.map +1 -0
- package/lib/typescript/ai-components/reasoning/AIReasoning.d.ts +63 -0
- package/lib/typescript/ai-components/reasoning/AIReasoning.d.ts.map +1 -0
- package/lib/typescript/ai-components/reasoning/index.d.ts +3 -0
- package/lib/typescript/ai-components/reasoning/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/reasoning/thinkingClock.d.ts +29 -0
- package/lib/typescript/ai-components/reasoning/thinkingClock.d.ts.map +1 -0
- package/lib/typescript/ai-components/services/clipboard-service/expo.d.ts.map +1 -1
- package/lib/typescript/ai-components/store/composer/store.d.ts +8 -0
- package/lib/typescript/ai-components/store/composer/store.d.ts.map +1 -1
- package/lib/typescript/ai-components/store/composer/useComposerChatOption.d.ts +5 -0
- package/lib/typescript/ai-components/store/composer/useComposerChatOption.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/composer/useComposerIsEditing.d.ts +5 -0
- package/lib/typescript/ai-components/store/composer/useComposerIsEditing.d.ts.map +1 -0
- package/lib/typescript/ai-components/store/index.d.ts +2 -0
- package/lib/typescript/ai-components/store/index.d.ts.map +1 -1
- package/lib/typescript/ai-components/suggestions/AISuggestions.d.ts +13 -0
- package/lib/typescript/ai-components/suggestions/AISuggestions.d.ts.map +1 -0
- package/lib/typescript/ai-components/suggestions/index.d.ts +2 -0
- package/lib/typescript/ai-components/suggestions/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/syntax-highlighting/utils/flatten-nodes.d.ts.map +1 -1
- package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts +1 -1
- package/lib/typescript/ai-components/syntax-highlighting/utils/renderer.d.ts.map +1 -1
- package/lib/typescript/ai-components/theme.d.ts +200 -0
- package/lib/typescript/ai-components/theme.d.ts.map +1 -1
- package/lib/typescript/ai-components/tool-calls/AIClientIdentity.d.ts +14 -0
- package/lib/typescript/ai-components/tool-calls/AIClientIdentity.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/AIClientToolRunner.d.ts +109 -0
- package/lib/typescript/ai-components/tool-calls/AIClientToolRunner.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/AIToolApprover.d.ts +48 -0
- package/lib/typescript/ai-components/tool-calls/AIToolApprover.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/authSessionAuthorizer.d.ts +57 -0
- package/lib/typescript/ai-components/tool-calls/authSessionAuthorizer.d.ts.map +1 -0
- package/lib/typescript/ai-components/tool-calls/index.d.ts +5 -0
- package/lib/typescript/ai-components/tool-calls/index.d.ts.map +1 -0
- package/lib/typescript/ai-components/voice-visualization/glowShader.d.ts.map +1 -1
- package/lib/typescript/ai-components/voice-visualization/simplex.d.ts +1 -1
- package/lib/typescript/components/Accessibility/NotificationAnnouncer.d.ts +5 -5
- package/lib/typescript/components/Accessibility/hooks/useIncomingMessageAnnouncements.d.ts +1 -1
- package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts +0 -2
- package/lib/typescript/components/Accessibility/useAccessibilityAnnouncer.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageItemView/utils/renderText.d.ts.map +1 -1
- package/lib/typescript/contexts/translationContext/TranslationContext.d.ts +1 -1
- package/lib/typescript/contexts/translationContext/TranslationContext.d.ts.map +1 -1
- package/lib/typescript/i18n/ar.json +40 -1
- package/lib/typescript/i18n/en.json +40 -1
- package/lib/typescript/i18n/es.json +40 -1
- package/lib/typescript/i18n/fr.json +40 -1
- package/lib/typescript/i18n/he.json +40 -1
- package/lib/typescript/i18n/hi.json +40 -1
- package/lib/typescript/i18n/it.json +40 -1
- package/lib/typescript/i18n/ja.json +40 -1
- package/lib/typescript/i18n/ko.json +40 -1
- package/lib/typescript/i18n/nl.json +40 -1
- package/lib/typescript/i18n/pt-br.json +40 -1
- package/lib/typescript/i18n/ru.json +40 -1
- package/lib/typescript/i18n/tr.json +40 -1
- package/lib/typescript/utils/i18n/Streami18n.d.ts +41 -2
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/lib/typescript/utils/i18n/utils.d.ts +3 -0
- package/lib/typescript/utils/i18n/utils.d.ts.map +1 -0
- package/package.json +10 -2
- package/src/a11y/a11yUtils.ts +0 -1
- package/src/a11y/hooks/useResolvedModalAccessibilityProps.ts +2 -3
- package/src/a2ui/A2UIContexts.ts +15 -0
- package/src/a2ui/A2UIInstructions.ts +102 -0
- package/src/a2ui/A2UIPlaceholder.tsx +24 -0
- package/src/a2ui/A2UIRenderer.tsx +504 -0
- package/src/a2ui/A2UIStream.ts +105 -0
- package/src/a2ui/A2UISurface.tsx +270 -0
- package/src/a2ui/__tests__/A2UIInstructions.test.ts +233 -0
- package/src/a2ui/__tests__/A2UIRenderer.test.tsx +1559 -0
- package/src/a2ui/__tests__/conformance.test.ts +579 -0
- package/src/a2ui/basicCatalog.json +1206 -0
- package/src/a2ui/basicFunctions.ts +429 -0
- package/src/a2ui/catalogDocument.ts +119 -0
- package/src/a2ui/catalogs.ts +185 -0
- package/src/a2ui/components/DateTimeInput.tsx +381 -0
- package/src/a2ui/components/Media.tsx +278 -0
- package/src/a2ui/components/basicComponents.tsx +832 -0
- package/src/a2ui/components/iconPaths.ts +116 -0
- package/src/a2ui/components/types.ts +24 -0
- package/src/a2ui/index.ts +18 -0
- package/src/a2ui/instructions.ts +341 -0
- package/src/a2ui/secrets.ts +154 -0
- package/src/a2ui/useReplyState.ts +26 -0
- package/src/ai-components/AITypingIndicatorView.tsx +6 -22
- package/src/ai-components/README.md +64 -3
- package/src/ai-components/StreamingMessageView.tsx +27 -3
- package/src/ai-components/__tests__/ComposerView.test.tsx +247 -2
- package/src/ai-components/__tests__/Markdown.test.tsx +13 -0
- package/src/ai-components/__tests__/StreamingMessageView.test.tsx +69 -0
- package/src/ai-components/__tests__/charts.test.ts +75 -0
- package/src/ai-components/__tests__/clientToolRunner.test.ts +239 -0
- package/src/ai-components/__tests__/conversation.test.tsx +787 -0
- package/src/ai-components/__tests__/conversationController.test.ts +1561 -0
- package/src/ai-components/__tests__/conversationExchange.test.ts +187 -0
- package/src/ai-components/__tests__/conversationRows.test.ts +207 -0
- package/src/ai-components/__tests__/conversationUI.test.tsx +606 -0
- package/src/ai-components/__tests__/format.test.ts +32 -0
- package/src/ai-components/__tests__/generativeUI.test.ts +634 -0
- package/src/ai-components/__tests__/keyboard.test.ts +14 -0
- package/src/ai-components/__tests__/messagePartViews.test.tsx +385 -0
- package/src/ai-components/__tests__/messageParts.test.ts +336 -0
- package/src/ai-components/__tests__/messageViews.test.tsx +321 -0
- package/src/ai-components/__tests__/signIn.test.tsx +324 -0
- package/src/ai-components/__tests__/theme.test.tsx +18 -0
- package/src/ai-components/__tests__/translation.test.tsx +85 -0
- package/src/ai-components/__tests__/voiceDriver.test.ts +0 -3
- package/src/ai-components/__tests__/voicePalette.test.ts +1 -1
- package/src/ai-components/__tests__/withoutKeyboardController.test.tsx +60 -0
- package/src/ai-components/charts/components/PieLegend.tsx +2 -1
- package/src/ai-components/charts/components/VictoryChart.tsx +10 -2
- package/src/ai-components/charts/utils/format-time-label.ts +18 -0
- package/src/ai-components/charts/vega-lite/schema.ts +19 -2
- package/src/ai-components/contexts/composer-context.tsx +13 -5
- package/src/ai-components/contexts/index.ts +1 -0
- package/src/ai-components/contexts/theme-context.tsx +19 -4
- package/src/ai-components/contexts/translation-context.tsx +44 -0
- package/src/ai-components/conversation/AIConversation.tsx +612 -0
- package/src/ai-components/conversation/entries.ts +177 -0
- package/src/ai-components/conversation/index.ts +2 -0
- package/src/ai-components/conversation/list/AIChatList.tsx +227 -0
- package/src/ai-components/conversation/list/useChatListController.ts +91 -0
- package/src/ai-components/conversation/list/useEndInView.ts +61 -0
- package/src/ai-components/conversation/list/useKeyboardOverlap.ts +52 -0
- package/src/ai-components/conversation/list/useLoadOlder.ts +97 -0
- package/src/ai-components/conversation/list/usePinnedAnchor.ts +113 -0
- package/src/ai-components/conversation/useConversationRows.ts +231 -0
- package/src/ai-components/conversation-state/controller/AIAgentError.ts +14 -0
- package/src/ai-components/conversation-state/controller/AIConversationController.ts +628 -0
- package/src/ai-components/conversation-state/controller/AIConversationExchange.ts +132 -0
- package/src/ai-components/conversation-state/controller/index.ts +4 -0
- package/src/ai-components/conversation-state/controller/offers.ts +53 -0
- package/src/ai-components/conversation-state/controller/types.ts +154 -0
- package/src/ai-components/conversation-state/controller/useAIConversationState.ts +21 -0
- package/src/ai-components/conversation-state/fromStreamMessage.ts +89 -0
- package/src/ai-components/conversation-state/index.ts +3 -0
- package/src/ai-components/conversation-state/types.ts +57 -0
- package/src/ai-components/generative-ui/AIUIAction.ts +73 -0
- package/src/ai-components/generative-ui/AIUIArguments.ts +117 -0
- package/src/ai-components/generative-ui/AIUIComponent.tsx +106 -0
- package/src/ai-components/generative-ui/AIUIComponentDefinition.ts +163 -0
- package/src/ai-components/generative-ui/AIUIDocument.ts +77 -0
- package/src/ai-components/generative-ui/AIUIEntrance.tsx +229 -0
- package/src/ai-components/generative-ui/AIUIErrorBoundary.tsx +39 -0
- package/src/ai-components/generative-ui/AIUIHelpers.ts +86 -0
- package/src/ai-components/generative-ui/AIUIHost.ts +358 -0
- package/src/ai-components/generative-ui/AIUIMedia.ts +45 -0
- package/src/ai-components/generative-ui/AIUIRenderer.ts +60 -0
- package/src/ai-components/generative-ui/AIUIView.tsx +87 -0
- package/src/ai-components/generative-ui/index.ts +48 -0
- package/src/ai-components/icons.ts +101 -0
- package/src/ai-components/index.ts +10 -0
- package/src/ai-components/internal/Shimmer.tsx +40 -0
- package/src/ai-components/internal/format.ts +69 -0
- package/src/ai-components/internal/hooks/useBottomSafeArea.ts +6 -0
- package/src/ai-components/internal/icons/AgentIcons.tsx +138 -0
- package/src/ai-components/internal/keyboard.tsx +34 -0
- package/src/ai-components/internal/tokens.ts +4 -0
- package/src/ai-components/internal/uuid.ts +17 -0
- package/src/ai-components/markdown/components/CodeBlock.tsx +13 -2
- package/src/ai-components/markdown/components/InlineCode.tsx +1 -0
- package/src/ai-components/markdown/components/Text.tsx +7 -2
- package/src/ai-components/markdown/styles.ts +29 -27
- package/src/ai-components/markdown/types.ts +1 -0
- package/src/ai-components/message/AIAssistantMessage.tsx +100 -0
- package/src/ai-components/message/AIMessageAttachment.tsx +245 -0
- package/src/ai-components/message/AIReplyActions.tsx +139 -0
- package/src/ai-components/message/AIUserMessage.tsx +121 -0
- package/src/ai-components/message/UserMessageMenu.tsx +149 -0
- package/src/ai-components/message/index.ts +4 -0
- package/src/ai-components/message-composer/ActionButton.tsx +10 -5
- package/src/ai-components/message-composer/ActionSheet.tsx +28 -6
- package/src/ai-components/message-composer/AttachmentButton.tsx +9 -1
- package/src/ai-components/message-composer/ChatOptions.tsx +144 -0
- package/src/ai-components/message-composer/ComposerView.tsx +194 -30
- package/src/ai-components/message-composer/EditingMessageChip.tsx +62 -0
- package/src/ai-components/message-composer/MediaPreviewList.tsx +34 -8
- package/src/ai-components/message-composer/index.ts +1 -0
- package/src/ai-components/message-parts/AIMessageParts.tsx +145 -0
- package/src/ai-components/message-parts/AIToolApproval.tsx +196 -0
- package/src/ai-components/message-parts/AIToolAuthorization.tsx +279 -0
- package/src/ai-components/message-parts/AIToolCall.tsx +117 -0
- package/src/ai-components/message-parts/callStates.ts +44 -0
- package/src/ai-components/message-parts/index.ts +6 -0
- package/src/ai-components/message-parts/parseMessageParts.ts +195 -0
- package/src/ai-components/message-parts/types.ts +157 -0
- package/src/ai-components/native-specs/NativeAIAgent.ts +25 -0
- package/src/ai-components/reasoning/AIReasoning.tsx +509 -0
- package/src/ai-components/reasoning/index.ts +2 -0
- package/src/ai-components/reasoning/thinkingClock.ts +109 -0
- package/src/ai-components/services/clipboard-service/expo.ts +18 -4
- package/src/ai-components/store/composer/store.ts +9 -0
- package/src/ai-components/store/composer/useComposerChatOption.ts +15 -0
- package/src/ai-components/store/composer/useComposerIsEditing.ts +15 -0
- package/src/ai-components/store/index.ts +2 -0
- package/src/ai-components/suggestions/AISuggestions.tsx +73 -0
- package/src/ai-components/suggestions/index.ts +1 -0
- package/src/ai-components/syntax-highlighting/utils/flatten-nodes.ts +2 -1
- package/src/ai-components/syntax-highlighting/utils/renderer.tsx +4 -2
- package/src/ai-components/theme.ts +334 -0
- package/src/ai-components/tool-calls/AIClientIdentity.ts +33 -0
- package/src/ai-components/tool-calls/AIClientToolRunner.ts +200 -0
- package/src/ai-components/tool-calls/AIToolApprover.tsx +60 -0
- package/src/ai-components/tool-calls/authSessionAuthorizer.ts +137 -0
- package/src/ai-components/tool-calls/index.ts +4 -0
- package/src/ai-components/voice-visualization/glowShader.ts +1 -3
- package/src/ai-components/voice-visualization/simplex.ts +1 -1
- package/src/components/Accessibility/NotificationAnnouncer.tsx +5 -5
- package/src/components/Accessibility/hooks/useIncomingMessageAnnouncements.ts +1 -1
- package/src/components/Accessibility/useAccessibilityAnnouncer.ts +0 -2
- package/src/components/Message/MessageItemView/utils/renderText.tsx +1 -2
- package/src/contexts/translationContext/TranslationContext.tsx +2 -2
- package/src/i18n/ar.json +40 -1
- package/src/i18n/en.json +40 -1
- package/src/i18n/es.json +40 -1
- package/src/i18n/fr.json +40 -1
- package/src/i18n/he.json +40 -1
- package/src/i18n/hi.json +40 -1
- package/src/i18n/it.json +40 -1
- package/src/i18n/ja.json +40 -1
- package/src/i18n/ko.json +40 -1
- package/src/i18n/nl.json +40 -1
- package/src/i18n/pt-br.json +40 -1
- package/src/i18n/ru.json +40 -1
- package/src/i18n/tr.json +40 -1
- package/src/mock-builders/a2ui/ohrid.ts +106 -0
- package/src/utils/i18n/Streami18n.ts +4 -1
- package/src/utils/i18n/utils.ts +3 -0
- package/src/version.json +1 -1
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
memo,
|
|
3
|
+
type ReactNode,
|
|
4
|
+
useEffect,
|
|
5
|
+
useLayoutEffect,
|
|
6
|
+
useMemo,
|
|
7
|
+
useRef,
|
|
8
|
+
useState,
|
|
9
|
+
} from 'react';
|
|
10
|
+
import {
|
|
11
|
+
I18nManager,
|
|
12
|
+
type NativeScrollEvent,
|
|
13
|
+
type NativeSyntheticEvent,
|
|
14
|
+
Pressable,
|
|
15
|
+
ScrollView,
|
|
16
|
+
StyleSheet,
|
|
17
|
+
Text,
|
|
18
|
+
View,
|
|
19
|
+
} from 'react-native';
|
|
20
|
+
import Animated, {
|
|
21
|
+
makeMutable,
|
|
22
|
+
runOnJS,
|
|
23
|
+
type SharedValue,
|
|
24
|
+
useAnimatedStyle,
|
|
25
|
+
useSharedValue,
|
|
26
|
+
withSpring,
|
|
27
|
+
} from 'react-native-reanimated';
|
|
28
|
+
|
|
29
|
+
import { FINISHED_REASONING_SHOWN_MS, useAIThinkingTurn } from './thinkingClock';
|
|
30
|
+
|
|
31
|
+
import type { ScrollViewRef } from '../../types/react-native-compat';
|
|
32
|
+
import { type DeepPartial, StreamTheme, useAITranslation, useTheme } from '../contexts';
|
|
33
|
+
import { useAIIcons } from '../icons';
|
|
34
|
+
import { formatMinutesAndSeconds, useNow } from '../internal/format';
|
|
35
|
+
import { Shimmer } from '../internal/Shimmer';
|
|
36
|
+
import { primitives } from '../internal/tokens';
|
|
37
|
+
import { Markdown } from '../markdown';
|
|
38
|
+
import type { AIReasoningPart } from '../message-parts/types';
|
|
39
|
+
import type { Theme } from '../theme';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Splits reasoning at blank lines. Reasoning only grows at its end, so a paragraph's position
|
|
43
|
+
* is a stable identity.
|
|
44
|
+
*/
|
|
45
|
+
export const splitReasoningParagraphs = (text: string) =>
|
|
46
|
+
text
|
|
47
|
+
.split('\n\n')
|
|
48
|
+
.map((paragraph) => paragraph.trim())
|
|
49
|
+
.filter(Boolean);
|
|
50
|
+
|
|
51
|
+
// A heading reads as a bold line, since a paragraph of thinking has no document to structure.
|
|
52
|
+
const headingsAsBold = (paragraph: string) =>
|
|
53
|
+
paragraph
|
|
54
|
+
.split('\n')
|
|
55
|
+
.map((line) => {
|
|
56
|
+
const heading = /^ *#+\s*(.*)$/.exec(line)?.[1]?.trim();
|
|
57
|
+
return heading ? `**${heading}**` : line;
|
|
58
|
+
})
|
|
59
|
+
.join('\n');
|
|
60
|
+
|
|
61
|
+
const ReasoningParagraph = memo(({ text }: { text: string }) => (
|
|
62
|
+
<Markdown>{headingsAsBold(text)}</Markdown>
|
|
63
|
+
));
|
|
64
|
+
ReasoningParagraph.displayName = 'ReasoningParagraph';
|
|
65
|
+
|
|
66
|
+
// Reveals text that grows a little at a time, a sixth of the backlog every frame at 30 fps, as
|
|
67
|
+
// new thoughts arrive about that often. Text that is replaced, or not animated, shows at once.
|
|
68
|
+
const useTextReveal = (text: string, animated: boolean) => {
|
|
69
|
+
const [shown, setShown] = useState(text);
|
|
70
|
+
const shownRef = useRef(text);
|
|
71
|
+
const targetRef = useRef(text);
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const grows = animated && text.startsWith(shownRef.current);
|
|
75
|
+
targetRef.current = text;
|
|
76
|
+
if (!grows) {
|
|
77
|
+
shownRef.current = text;
|
|
78
|
+
setShown(text);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const timer = setInterval(() => {
|
|
82
|
+
const target = targetRef.current;
|
|
83
|
+
const current = shownRef.current;
|
|
84
|
+
if (current.length >= target.length) {
|
|
85
|
+
clearInterval(timer);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
let end = current.length + Math.max(1, Math.floor((target.length - current.length) / 6));
|
|
89
|
+
// never split a surrogate pair
|
|
90
|
+
const code = target.charCodeAt(end - 1);
|
|
91
|
+
if (code >= 0xd800 && code <= 0xdbff) end += 1;
|
|
92
|
+
shownRef.current = target.slice(0, end);
|
|
93
|
+
setShown(shownRef.current);
|
|
94
|
+
}, 1000 / 30);
|
|
95
|
+
return () => clearInterval(timer);
|
|
96
|
+
}, [animated, text]);
|
|
97
|
+
|
|
98
|
+
return shown;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const ReasoningPanel = ({
|
|
102
|
+
isLive,
|
|
103
|
+
maxHeight,
|
|
104
|
+
text,
|
|
105
|
+
}: {
|
|
106
|
+
isLive: boolean;
|
|
107
|
+
maxHeight: number;
|
|
108
|
+
text: string;
|
|
109
|
+
}) => {
|
|
110
|
+
const shown = useTextReveal(text, isLive);
|
|
111
|
+
const scrollerRef = useRef<ScrollViewRef>(null);
|
|
112
|
+
// Whether the reader is at the end, so new thoughts keep it there. A finished trace opens at
|
|
113
|
+
// its start.
|
|
114
|
+
const following = useRef(isLive);
|
|
115
|
+
const {
|
|
116
|
+
theme: { messageParts },
|
|
117
|
+
} = useTheme();
|
|
118
|
+
|
|
119
|
+
const onScroll = ({ nativeEvent }: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
120
|
+
const { contentOffset, contentSize, layoutMeasurement } = nativeEvent;
|
|
121
|
+
following.current = contentOffset.y + layoutMeasurement.height >= contentSize.height - 24;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<ScrollView
|
|
126
|
+
nestedScrollEnabled
|
|
127
|
+
onContentSizeChange={() => {
|
|
128
|
+
if (following.current) scrollerRef.current?.scrollToEnd({ animated: false });
|
|
129
|
+
}}
|
|
130
|
+
onScroll={onScroll}
|
|
131
|
+
ref={scrollerRef}
|
|
132
|
+
scrollEventThrottle={32}
|
|
133
|
+
style={[{ maxHeight }, messageParts?.reasoning?.panel]}
|
|
134
|
+
>
|
|
135
|
+
{splitReasoningParagraphs(shown).map((paragraph, index) => (
|
|
136
|
+
<ReasoningParagraph key={index} text={paragraph} />
|
|
137
|
+
))}
|
|
138
|
+
</ScrollView>
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export type AIReasoningProps = {
|
|
143
|
+
/** How long the model has thought, in seconds, shown as "Thought for 12s" once it is done. */
|
|
144
|
+
duration?: number;
|
|
145
|
+
/** A note under the open reasoning, such as how long it is kept. */
|
|
146
|
+
footnote?: ReactNode;
|
|
147
|
+
/** Whether the reasoning is open once the model is done. Defaults to `false`. */
|
|
148
|
+
initiallyExpanded?: boolean;
|
|
149
|
+
/** Whether the model is still thinking. Defaults to whether `part` is streaming. */
|
|
150
|
+
isThinking?: boolean;
|
|
151
|
+
/** How tall the reasoning grows, in points, before it scrolls. Defaults to 260. */
|
|
152
|
+
maxExpandedHeight?: number;
|
|
153
|
+
/** A reasoning step, whose preview, summary, status and duration it shows. */
|
|
154
|
+
part?: AIReasoningPart;
|
|
155
|
+
/**
|
|
156
|
+
* The whole of a reasoning step's thinking when the app has it, such as from live updates.
|
|
157
|
+
* Read on every render; without it, the step shows its own preview.
|
|
158
|
+
*/
|
|
159
|
+
reasoningText?: (stepId: string) => string | undefined;
|
|
160
|
+
/** Whether the reasoning is open while the model thinks. Defaults to `true`. */
|
|
161
|
+
showsLiveReasoning?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Which step this is, across a conversation: when it changes, the view starts afresh, as for
|
|
164
|
+
* another reply's step when a list reuses it. Defaults to `part.id`, which is only unique within
|
|
165
|
+
* a message: `AIMessageParts` passes the message's id with it.
|
|
166
|
+
*/
|
|
167
|
+
stepKey?: string;
|
|
168
|
+
/** When the thinking began (`Date.now()`), for a header that counts from before it appeared. */
|
|
169
|
+
since?: number;
|
|
170
|
+
/** A one-line summary shown beside the header once the model is done. */
|
|
171
|
+
summary?: string;
|
|
172
|
+
/**
|
|
173
|
+
* The reasoning so far. Blank lines separate paragraphs, and Markdown is rendered. Defaults to
|
|
174
|
+
* `reasoningText(part.id)`, else the step's preview or summary.
|
|
175
|
+
*/
|
|
176
|
+
text?: string;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// A spring with a response of 0.45 and a damping fraction of 0.95: a stiffness of
|
|
180
|
+
// (2π / 0.45)² and a damping of 2 × 0.95 × √stiffness. With Reduce Motion it folds at once.
|
|
181
|
+
const FOLD_SPRING = { damping: 26.5, mass: 1, stiffness: 195 };
|
|
182
|
+
|
|
183
|
+
// The chevron turns with the fold.
|
|
184
|
+
const FoldChevron = ({
|
|
185
|
+
children,
|
|
186
|
+
progress,
|
|
187
|
+
}: {
|
|
188
|
+
children: ReactNode;
|
|
189
|
+
progress: SharedValue<number>;
|
|
190
|
+
}) => {
|
|
191
|
+
const style = useAnimatedStyle(() => ({
|
|
192
|
+
transform: [{ rotate: `${progress.value * (I18nManager.isRTL ? -90 : 90)}deg` }],
|
|
193
|
+
}));
|
|
194
|
+
return <Animated.View style={style}>{children}</Animated.View>;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// The open reasoning, which springs open and folded with `progress`, and says when it has folded.
|
|
198
|
+
const Fold = ({
|
|
199
|
+
children,
|
|
200
|
+
expanded,
|
|
201
|
+
onFolded,
|
|
202
|
+
progress,
|
|
203
|
+
step,
|
|
204
|
+
}: {
|
|
205
|
+
children: ReactNode;
|
|
206
|
+
expanded: boolean;
|
|
207
|
+
onFolded: (mounted: false) => void;
|
|
208
|
+
progress: SharedValue<number>;
|
|
209
|
+
step: string | undefined;
|
|
210
|
+
}) => {
|
|
211
|
+
const panelHeight = useSharedValue(0);
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
progress.value = withSpring(expanded ? 1 : 0, FOLD_SPRING, (finished) => {
|
|
214
|
+
if (finished && !expanded) runOnJS(onFolded)(false);
|
|
215
|
+
});
|
|
216
|
+
}, [expanded, onFolded, progress, step]);
|
|
217
|
+
const style = useAnimatedStyle(() => ({
|
|
218
|
+
height: panelHeight.value * progress.value,
|
|
219
|
+
opacity: progress.value,
|
|
220
|
+
}));
|
|
221
|
+
return (
|
|
222
|
+
<Animated.View
|
|
223
|
+
accessibilityElementsHidden={!expanded}
|
|
224
|
+
importantForAccessibility={expanded ? 'auto' : 'no-hide-descendants'}
|
|
225
|
+
style={[styles.fold, style]}
|
|
226
|
+
>
|
|
227
|
+
<View
|
|
228
|
+
onLayout={({ nativeEvent }) => {
|
|
229
|
+
panelHeight.value = nativeEvent.layout.height;
|
|
230
|
+
}}
|
|
231
|
+
style={styles.panel}
|
|
232
|
+
>
|
|
233
|
+
{children}
|
|
234
|
+
</View>
|
|
235
|
+
</Animated.View>
|
|
236
|
+
);
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
const opensByDefault = (
|
|
240
|
+
isThinking: boolean,
|
|
241
|
+
showsLiveReasoning: boolean,
|
|
242
|
+
initiallyExpanded: boolean,
|
|
243
|
+
) => (isThinking ? showsLiveReasoning : initiallyExpanded);
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* A round of the model's reasoning: a header that counts the seconds while it thinks ("Thinking...
|
|
247
|
+
* 7s") and says how long it thought once done ("Thought for 12s"), over the reasoning itself,
|
|
248
|
+
* which streams into view while the model thinks and folds away when it is done. Pressing the
|
|
249
|
+
* header opens or folds it.
|
|
250
|
+
*
|
|
251
|
+
* Inside an `AIConversation` that showed the agent thinking, the reply's first reasoning step
|
|
252
|
+
* takes over that thinking: its seconds count from when the question was asked.
|
|
253
|
+
*/
|
|
254
|
+
export const AIReasoning = ({
|
|
255
|
+
duration: durationProp,
|
|
256
|
+
footnote,
|
|
257
|
+
initiallyExpanded = false,
|
|
258
|
+
isThinking: isThinkingProp,
|
|
259
|
+
maxExpandedHeight = 260,
|
|
260
|
+
part,
|
|
261
|
+
reasoningText,
|
|
262
|
+
showsLiveReasoning = true,
|
|
263
|
+
since,
|
|
264
|
+
stepKey: stepKeyProp,
|
|
265
|
+
summary: summaryProp,
|
|
266
|
+
text: textProp,
|
|
267
|
+
}: AIReasoningProps) => {
|
|
268
|
+
const { t, userLanguage } = useAITranslation();
|
|
269
|
+
const { theme } = useTheme();
|
|
270
|
+
const { Chevron, Reasoning } = useAIIcons();
|
|
271
|
+
const { colors, messageParts } = theme;
|
|
272
|
+
const reasoningStyle = messageParts?.reasoning;
|
|
273
|
+
const turn = useAIThinkingTurn();
|
|
274
|
+
|
|
275
|
+
const text =
|
|
276
|
+
textProp ??
|
|
277
|
+
(part ? (reasoningText?.(part.id) ?? part.preview ?? part.summary) : undefined) ??
|
|
278
|
+
'';
|
|
279
|
+
const isThinking = isThinkingProp ?? part?.status === 'streaming';
|
|
280
|
+
const ownDuration =
|
|
281
|
+
durationProp ?? (part?.durationMs !== undefined ? part.durationMs / 1000 : undefined);
|
|
282
|
+
const summary = summaryProp ?? part?.summary;
|
|
283
|
+
|
|
284
|
+
// The turn whose thinking this step takes over, when it is the first step of a turn that was
|
|
285
|
+
// seen thinking.
|
|
286
|
+
const thinkingTurn =
|
|
287
|
+
part && turn && turn.firstStepId === part.id && turn.clock.start(turn.key) !== undefined
|
|
288
|
+
? turn
|
|
289
|
+
: undefined;
|
|
290
|
+
const clock = thinkingTurn?.clock;
|
|
291
|
+
const turnKey = thinkingTurn?.key;
|
|
292
|
+
useEffect(() => {
|
|
293
|
+
if (isThinking && clock && turnKey !== undefined) clock.firstStepStreams(turnKey);
|
|
294
|
+
}, [clock, isThinking, turnKey]);
|
|
295
|
+
|
|
296
|
+
const opensFirst = () => opensByDefault(isThinking, showsLiveReasoning, initiallyExpanded);
|
|
297
|
+
// A conversation's first step that arrived done, with the answer, shows its reasoning before
|
|
298
|
+
// it folds: the model sent none of it while it thought.
|
|
299
|
+
const showsWhenFinished = () =>
|
|
300
|
+
!isThinking &&
|
|
301
|
+
text !== '' &&
|
|
302
|
+
!!thinkingTurn &&
|
|
303
|
+
thinkingTurn.clock.showsFirstStep(thinkingTurn.key);
|
|
304
|
+
|
|
305
|
+
// What the reader chose by pressing the header. Until they do, the reasoning is open while
|
|
306
|
+
// the model thinks and folded once it is done.
|
|
307
|
+
const [choice, setChoice] = useState<boolean | null>(null);
|
|
308
|
+
const [open, setOpen] = useState(opensFirst);
|
|
309
|
+
const [thinkingSince, setThinkingSince] = useState(() => since ?? Date.now());
|
|
310
|
+
const [thoughtFor, setThoughtFor] = useState<number>();
|
|
311
|
+
const [showsFinished, setShowsFinished] = useState(showsWhenFinished);
|
|
312
|
+
// The panel shrinks in place as it folds, so what is below it glides up rather than jumps, and
|
|
313
|
+
// goes once folded. Live reasoning joins at no height and unfolds; a finished trace that opens
|
|
314
|
+
// with the step shows at once.
|
|
315
|
+
const [mounted, setMounted] = useState(() => opensFirst() && text !== '');
|
|
316
|
+
// How far the fold is open, made the first time the step opens: most steps, such as those of
|
|
317
|
+
// replies from history, are never opened, and a list that scrolls fast mounts them all the time.
|
|
318
|
+
const [startsOpen, setStartsOpen] = useState(() => opensFirst() && text !== '' && !isThinking);
|
|
319
|
+
const progressRef = useRef<SharedValue<number>>(undefined);
|
|
320
|
+
const wasThinking = useRef(isThinking);
|
|
321
|
+
|
|
322
|
+
// Another step, such as another reply's when a list reuses this view: everything above starts
|
|
323
|
+
// again from it, as a view mounted for it would.
|
|
324
|
+
const stepKey = stepKeyProp ?? part?.id;
|
|
325
|
+
const [shownStep, setShownStep] = useState(stepKey);
|
|
326
|
+
const isNewStep = shownStep !== stepKey;
|
|
327
|
+
if (isNewStep) {
|
|
328
|
+
const opens = opensFirst() && text !== '';
|
|
329
|
+
setShownStep(stepKey);
|
|
330
|
+
setChoice(null);
|
|
331
|
+
setOpen(opensFirst());
|
|
332
|
+
setThinkingSince(since ?? Date.now());
|
|
333
|
+
setThoughtFor(undefined);
|
|
334
|
+
setShowsFinished(showsWhenFinished());
|
|
335
|
+
setMounted(opens);
|
|
336
|
+
setStartsOpen(opens && !isThinking);
|
|
337
|
+
wasThinking.current = isThinking;
|
|
338
|
+
}
|
|
339
|
+
useLayoutEffect(() => {
|
|
340
|
+
if (progressRef.current) progressRef.current.value = startsOpen ? 1 : 0;
|
|
341
|
+
}, [shownStep, startsOpen]);
|
|
342
|
+
|
|
343
|
+
useEffect(() => {
|
|
344
|
+
if (!showsFinished) return;
|
|
345
|
+
setOpen(true);
|
|
346
|
+
const timer = setTimeout(() => setOpen(false), FINISHED_REASONING_SHOWN_MS);
|
|
347
|
+
return () => clearTimeout(timer);
|
|
348
|
+
}, [showsFinished, shownStep]);
|
|
349
|
+
|
|
350
|
+
useEffect(() => {
|
|
351
|
+
if (wasThinking.current === isThinking) return;
|
|
352
|
+
wasThinking.current = isThinking;
|
|
353
|
+
if (isThinking) {
|
|
354
|
+
setThinkingSince(Date.now());
|
|
355
|
+
} else {
|
|
356
|
+
if (clock && turnKey !== undefined) clock.firstStepDone(turnKey, ownDuration);
|
|
357
|
+
setThoughtFor(Math.max(ownDuration ?? 0, (Date.now() - thinkingSince) / 1000));
|
|
358
|
+
}
|
|
359
|
+
setOpen(choice ?? opensByDefault(isThinking, showsLiveReasoning, initiallyExpanded));
|
|
360
|
+
}, [
|
|
361
|
+
choice,
|
|
362
|
+
clock,
|
|
363
|
+
initiallyExpanded,
|
|
364
|
+
isThinking,
|
|
365
|
+
ownDuration,
|
|
366
|
+
showsLiveReasoning,
|
|
367
|
+
thinkingSince,
|
|
368
|
+
turnKey,
|
|
369
|
+
]);
|
|
370
|
+
|
|
371
|
+
const start = since ?? (thinkingTurn ? thinkingTurn.clock.start(thinkingTurn.key) : undefined);
|
|
372
|
+
const now = useNow(isThinking);
|
|
373
|
+
const elapsed = Math.max(ownDuration ?? 0, (now - (start ?? thinkingSince)) / 1000);
|
|
374
|
+
const measured =
|
|
375
|
+
!isThinking && thinkingTurn
|
|
376
|
+
? thinkingTurn.clock.durationOfFirstStep(thinkingTurn.key, ownDuration)
|
|
377
|
+
: undefined;
|
|
378
|
+
const thought = measured ?? ownDuration ?? thoughtFor;
|
|
379
|
+
|
|
380
|
+
const title = isThinking
|
|
381
|
+
? elapsed >= 1
|
|
382
|
+
? t('Thinking... {{ duration }}', {
|
|
383
|
+
duration: formatMinutesAndSeconds(elapsed, userLanguage),
|
|
384
|
+
})
|
|
385
|
+
: t('Thinking...')
|
|
386
|
+
: thought !== undefined
|
|
387
|
+
? t('Thought for {{ duration }}', {
|
|
388
|
+
duration: formatMinutesAndSeconds(Math.max(1, thought), userLanguage),
|
|
389
|
+
})
|
|
390
|
+
: t('Thought process');
|
|
391
|
+
|
|
392
|
+
// Live reasoning is open before any of it arrives, but there is nothing to show until then.
|
|
393
|
+
const expanded = open && text !== '';
|
|
394
|
+
|
|
395
|
+
// Not while this render is for the step shown before: it renders again for the new one at once.
|
|
396
|
+
if (!isNewStep && expanded && !mounted) setMounted(true);
|
|
397
|
+
if (!isNewStep && mounted && !progressRef.current) {
|
|
398
|
+
progressRef.current = makeMutable(startsOpen ? 1 : 0);
|
|
399
|
+
}
|
|
400
|
+
const progress = progressRef.current;
|
|
401
|
+
|
|
402
|
+
// The reasoning reads in the secondary colour, a little smaller than an answer.
|
|
403
|
+
const panelStyle = useMemo<DeepPartial<Theme>>(
|
|
404
|
+
() => ({
|
|
405
|
+
markdown: {
|
|
406
|
+
paragraph: { marginBottom: 4, marginTop: 4 },
|
|
407
|
+
text: {
|
|
408
|
+
color: colors.grey,
|
|
409
|
+
fontSize: primitives.typographyFontSizeSm,
|
|
410
|
+
lineHeight: primitives.typographyLineHeightNormal,
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
}),
|
|
414
|
+
[colors.grey],
|
|
415
|
+
);
|
|
416
|
+
|
|
417
|
+
return (
|
|
418
|
+
<View
|
|
419
|
+
style={[
|
|
420
|
+
styles.container,
|
|
421
|
+
{ borderStartColor: isThinking ? colors.accent_blue : colors.grey_gainsboro },
|
|
422
|
+
reasoningStyle?.container,
|
|
423
|
+
]}
|
|
424
|
+
testID='ai-reasoning'
|
|
425
|
+
>
|
|
426
|
+
<Pressable
|
|
427
|
+
accessibilityRole='button'
|
|
428
|
+
accessibilityState={{ expanded }}
|
|
429
|
+
onPress={() => {
|
|
430
|
+
setChoice(!expanded);
|
|
431
|
+
setOpen(!expanded);
|
|
432
|
+
}}
|
|
433
|
+
style={[styles.header, reasoningStyle?.header]}
|
|
434
|
+
>
|
|
435
|
+
<Shimmer active={isThinking} style={styles.lead}>
|
|
436
|
+
<Reasoning color={colors.black} />
|
|
437
|
+
<Text style={[styles.title, { color: colors.black }, reasoningStyle?.title]}>
|
|
438
|
+
{title}
|
|
439
|
+
</Text>
|
|
440
|
+
</Shimmer>
|
|
441
|
+
{summary && !isThinking && !expanded ? (
|
|
442
|
+
<Text
|
|
443
|
+
numberOfLines={1}
|
|
444
|
+
style={[styles.summary, { color: colors.grey }, reasoningStyle?.summary]}
|
|
445
|
+
>
|
|
446
|
+
{summary}
|
|
447
|
+
</Text>
|
|
448
|
+
) : null}
|
|
449
|
+
{progress ? (
|
|
450
|
+
<FoldChevron progress={progress}>
|
|
451
|
+
<Chevron color={colors.grey} size={12} />
|
|
452
|
+
</FoldChevron>
|
|
453
|
+
) : (
|
|
454
|
+
<Chevron color={colors.grey} size={12} />
|
|
455
|
+
)}
|
|
456
|
+
</Pressable>
|
|
457
|
+
{progress && mounted && text !== '' ? (
|
|
458
|
+
<Fold expanded={expanded} onFolded={setMounted} progress={progress} step={shownStep}>
|
|
459
|
+
<StreamTheme style={panelStyle} theme={theme}>
|
|
460
|
+
<ReasoningPanel isLive={isThinking} maxHeight={maxExpandedHeight} text={text} />
|
|
461
|
+
{footnote && !isThinking && (choice === true || initiallyExpanded) ? footnote : null}
|
|
462
|
+
</StreamTheme>
|
|
463
|
+
</Fold>
|
|
464
|
+
) : null}
|
|
465
|
+
</View>
|
|
466
|
+
);
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
export type AIThinkingProps = {
|
|
470
|
+
/** When the thinking began (`Date.now()`). Inside an `AIConversation`, when the question was asked. */
|
|
471
|
+
since?: number;
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* The agent thinking before its reply shows anything: a header that counts the seconds. In an
|
|
476
|
+
* `AIConversation`, the reply's first reasoning step takes over its seconds.
|
|
477
|
+
*/
|
|
478
|
+
export const AIThinking = ({ since }: AIThinkingProps) => {
|
|
479
|
+
const turn = useAIThinkingTurn();
|
|
480
|
+
const start = since ?? (turn ? turn.clock.start(turn.key) : undefined);
|
|
481
|
+
return (
|
|
482
|
+
<AIReasoning
|
|
483
|
+
isThinking
|
|
484
|
+
since={start}
|
|
485
|
+
stepKey={start === undefined ? undefined : `thinking:${start}`}
|
|
486
|
+
text=''
|
|
487
|
+
/>
|
|
488
|
+
);
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
const styles = StyleSheet.create({
|
|
492
|
+
container: { borderStartWidth: 2, paddingStart: 12 },
|
|
493
|
+
fold: { overflow: 'hidden' },
|
|
494
|
+
header: {
|
|
495
|
+
alignItems: 'center',
|
|
496
|
+
alignSelf: 'flex-start',
|
|
497
|
+
flexDirection: 'row',
|
|
498
|
+
gap: 6,
|
|
499
|
+
maxWidth: '100%',
|
|
500
|
+
},
|
|
501
|
+
lead: { alignItems: 'center', flexDirection: 'row', gap: 6 },
|
|
502
|
+
panel: { left: 0, paddingTop: 4, position: 'absolute', right: 0, top: 0 },
|
|
503
|
+
summary: { flexShrink: 1, fontSize: primitives.typographyFontSizeSm },
|
|
504
|
+
title: {
|
|
505
|
+
fontSize: primitives.typographyFontSizeSm,
|
|
506
|
+
fontVariant: ['tabular-nums'],
|
|
507
|
+
fontWeight: '500',
|
|
508
|
+
},
|
|
509
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
/** How long a first step that arrived done stays open, showing its reasoning, before it folds. */
|
|
4
|
+
export const FINISHED_REASONING_SHOWN_MS = 1600;
|
|
5
|
+
/** How long the reasoning takes to fold. */
|
|
6
|
+
export const REASONING_FOLD_MS = 450;
|
|
7
|
+
// How soon after a turn stops thinking its first step has to arrive, done, to open and show its
|
|
8
|
+
// reasoning: it came with the reply that ended the thinking.
|
|
9
|
+
const ARRIVAL_WINDOW_MS = 1000;
|
|
10
|
+
|
|
11
|
+
type Turn = {
|
|
12
|
+
start: number;
|
|
13
|
+
end?: number;
|
|
14
|
+
// How long the first step thought, once it was done, in seconds.
|
|
15
|
+
firstStepDuration?: number;
|
|
16
|
+
firstStepStreamed: boolean;
|
|
17
|
+
// Whether a reply of the turn showed.
|
|
18
|
+
hadReplies: boolean;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Times each turn's thinking, so the reply's first reasoning step takes over the seconds the
|
|
23
|
+
* conversation counted while it showed the agent thinking.
|
|
24
|
+
*
|
|
25
|
+
* It is written only from effects (`update`, `firstStepStreams`, `firstStepDone`) and read
|
|
26
|
+
* during render, so a render React throws away changes nothing.
|
|
27
|
+
*/
|
|
28
|
+
export class AIThinkingClock {
|
|
29
|
+
private turns = new Map<string, Turn>();
|
|
30
|
+
|
|
31
|
+
// A turn's thinking starts the first time it is the latest turn and thinking, and ends when it
|
|
32
|
+
// stops. Thinking that resumes before the first step shows carries on. A turn whose replies were
|
|
33
|
+
// taken away starts thinking afresh.
|
|
34
|
+
update(
|
|
35
|
+
latest: string | undefined,
|
|
36
|
+
isThinking: boolean,
|
|
37
|
+
hasReplies: boolean,
|
|
38
|
+
hasFirstStep: boolean,
|
|
39
|
+
now = Date.now(),
|
|
40
|
+
) {
|
|
41
|
+
if (latest === undefined) return;
|
|
42
|
+
const timed = this.turns.get(latest);
|
|
43
|
+
if (!timed || (isThinking && timed.hadReplies && !hasReplies)) {
|
|
44
|
+
if (isThinking) {
|
|
45
|
+
this.turns.set(latest, {
|
|
46
|
+
firstStepStreamed: false,
|
|
47
|
+
hadReplies: false,
|
|
48
|
+
start: now,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (hasReplies) timed.hadReplies = true;
|
|
54
|
+
if (isThinking) {
|
|
55
|
+
if (!hasFirstStep) timed.end = undefined;
|
|
56
|
+
} else if (timed.end === undefined) {
|
|
57
|
+
timed.end = now;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
start(turn: string) {
|
|
62
|
+
return this.turns.get(turn)?.start;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
firstStepStreams(turn: string) {
|
|
66
|
+
const timed = this.turns.get(turn);
|
|
67
|
+
if (timed) timed.firstStepStreamed = true;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// The first step stopped streaming: it thought from when the turn started thinking until now,
|
|
71
|
+
// or for its own time when that is longer.
|
|
72
|
+
firstStepDone(turn: string, own: number | undefined, now = Date.now()) {
|
|
73
|
+
const timed = this.turns.get(turn);
|
|
74
|
+
if (timed && timed.firstStepDuration === undefined) {
|
|
75
|
+
timed.firstStepDuration = Math.max(own ?? 0, (now - timed.start) / 1000);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// How long a turn's first step thought, in seconds. One that arrived done thought until the
|
|
80
|
+
// turn stopped thinking, which with no end yet is the render it arrives in; one that streamed,
|
|
81
|
+
// until `firstStepDone`.
|
|
82
|
+
durationOfFirstStep(turn: string, own: number | undefined, now = Date.now()) {
|
|
83
|
+
const timed = this.turns.get(turn);
|
|
84
|
+
if (!timed) return own;
|
|
85
|
+
if (timed.firstStepDuration !== undefined) return timed.firstStepDuration;
|
|
86
|
+
if (timed.firstStepStreamed) return own;
|
|
87
|
+
return Math.max(own ?? 0, ((timed.end ?? now) - timed.start) / 1000);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Whether a turn's first step, which arrived done with the reply that ends the thinking, opens
|
|
91
|
+
// to show its reasoning before it folds and the answer starts. The thinking's end is noted
|
|
92
|
+
// after the render the step arrives in, so no end yet counts as ending now.
|
|
93
|
+
showsFirstStep(turn: string, now = Date.now()) {
|
|
94
|
+
const timed = this.turns.get(turn);
|
|
95
|
+
if (!timed || timed.firstStepStreamed) return false;
|
|
96
|
+
return timed.end === undefined || now - timed.end < ARRIVAL_WINDOW_MS;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** A turn's clock, and the id of its first reasoning step: the one that takes over its thinking. */
|
|
101
|
+
export type AIThinkingTurn = {
|
|
102
|
+
clock: AIThinkingClock;
|
|
103
|
+
key: string;
|
|
104
|
+
firstStepId?: string;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const AIThinkingTurnContext = createContext<AIThinkingTurn | undefined>(undefined);
|
|
108
|
+
|
|
109
|
+
export const useAIThinkingTurn = () => useContext(AIThinkingTurnContext);
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
let Clipboard:
|
|
1
|
+
let Clipboard:
|
|
2
|
+
| {
|
|
3
|
+
setString?: (string: string) => void;
|
|
4
|
+
setStringAsync?: (string: string) => Promise<boolean>;
|
|
5
|
+
}
|
|
6
|
+
| undefined;
|
|
2
7
|
|
|
3
8
|
try {
|
|
4
9
|
Clipboard = require('expo-clipboard');
|
|
@@ -6,6 +11,15 @@ try {
|
|
|
6
11
|
// do nothing
|
|
7
12
|
}
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
// `expo-clipboard` removed the synchronous `setString` in favour of `setStringAsync`; older
|
|
15
|
+
// versions only have `setString`.
|
|
16
|
+
export const setClipboardString =
|
|
17
|
+
Clipboard && (Clipboard.setStringAsync || Clipboard.setString)
|
|
18
|
+
? (string: string) => {
|
|
19
|
+
if (Clipboard?.setStringAsync) {
|
|
20
|
+
Clipboard.setStringAsync(string).catch(() => undefined);
|
|
21
|
+
} else {
|
|
22
|
+
Clipboard?.setString?.(string);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
: undefined;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { StateStore } from '@stream-io/state-store';
|
|
2
2
|
|
|
3
|
+
import type { AIChatOption } from '../../message-composer/ChatOptions';
|
|
4
|
+
|
|
3
5
|
export type ComposerState = {
|
|
4
6
|
text: string;
|
|
7
|
+
/** The chat option picked for the next message. It stays picked after a message is sent. */
|
|
8
|
+
chatOption?: AIChatOption | null;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the person is editing a message they sent. The composer says so above the text field,
|
|
11
|
+
* with a button that cancels it, and focuses the text field.
|
|
12
|
+
*/
|
|
13
|
+
isEditing?: boolean;
|
|
5
14
|
custom?: Record<string, unknown>;
|
|
6
15
|
};
|
|
7
16
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useStateStore } from '@stream-io/state-store/react-bindings';
|
|
2
|
+
|
|
3
|
+
import { type ComposerState } from './store';
|
|
4
|
+
|
|
5
|
+
import { useMessageComposerContext } from '../../contexts';
|
|
6
|
+
|
|
7
|
+
const selector = ({ chatOption }: ComposerState) => ({
|
|
8
|
+
chatOption,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
/** The chat option picked for the next message, if any. */
|
|
12
|
+
export const useComposerChatOption = () => {
|
|
13
|
+
const { state } = useMessageComposerContext();
|
|
14
|
+
return useStateStore(state, selector);
|
|
15
|
+
};
|