@stack-spot/ai-chat-widget 0.11.0 → 1.0.0-dev.1768324407795
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/CHANGELOG.md +972 -0
- package/README.md +1 -0
- package/dist/StackspotAIWidget.d.ts +48 -7
- package/dist/StackspotAIWidget.d.ts.map +1 -1
- package/dist/StackspotAIWidget.js +22 -23
- package/dist/StackspotAIWidget.js.map +1 -1
- package/dist/app-metadata.json +175 -0
- package/dist/assets/placeholder.png +0 -0
- package/dist/chat-interceptors/CustomInputs.d.ts +4 -1
- package/dist/chat-interceptors/CustomInputs.d.ts.map +1 -1
- package/dist/chat-interceptors/CustomInputs.js +10 -1
- package/dist/chat-interceptors/CustomInputs.js.map +1 -1
- package/dist/chat-interceptors/quick-command-questions.d.ts +10 -0
- package/dist/chat-interceptors/quick-command-questions.d.ts.map +1 -1
- package/dist/chat-interceptors/quick-command-questions.js +12 -2
- package/dist/chat-interceptors/quick-command-questions.js.map +1 -1
- package/dist/chat-interceptors/quick-commands.d.ts +11 -0
- package/dist/chat-interceptors/quick-commands.d.ts.map +1 -1
- package/dist/chat-interceptors/quick-commands.js +241 -48
- package/dist/chat-interceptors/quick-commands.js.map +1 -1
- package/dist/chat-interceptors/send-message.d.ts +26 -1
- package/dist/chat-interceptors/send-message.d.ts.map +1 -1
- package/dist/chat-interceptors/send-message.js +227 -26
- package/dist/chat-interceptors/send-message.js.map +1 -1
- package/dist/components/AdaptiveTextArea.d.ts +15 -3
- package/dist/components/AdaptiveTextArea.d.ts.map +1 -1
- package/dist/components/AdaptiveTextArea.js +22 -10
- package/dist/components/AdaptiveTextArea.js.map +1 -1
- package/dist/components/AgentCard/AgentCardCreate.d.ts +4 -0
- package/dist/components/AgentCard/AgentCardCreate.d.ts.map +1 -0
- package/dist/components/AgentCard/AgentCardCreate.js +33 -0
- package/dist/components/AgentCard/AgentCardCreate.js.map +1 -0
- package/dist/components/AgentCard/dictionary.d.ts +23 -0
- package/dist/components/AgentCard/dictionary.d.ts.map +1 -0
- package/dist/components/AgentCard/dictionary.js +23 -0
- package/dist/components/AgentCard/dictionary.js.map +1 -0
- package/dist/components/AgentCard/index.d.ts +5 -0
- package/dist/components/AgentCard/index.d.ts.map +1 -0
- package/dist/components/AgentCard/index.js +55 -0
- package/dist/components/AgentCard/index.js.map +1 -0
- package/dist/components/AnimatedOpacity.d.ts +8 -0
- package/dist/components/AnimatedOpacity.d.ts.map +1 -0
- package/dist/components/AnimatedOpacity.js +46 -0
- package/dist/components/AnimatedOpacity.js.map +1 -0
- package/dist/components/AutoFocus.d.ts +23 -0
- package/dist/components/AutoFocus.d.ts.map +1 -0
- package/dist/components/AutoFocus.js +23 -0
- package/dist/components/AutoFocus.js.map +1 -0
- package/dist/components/ButtonFavorite.d.ts +40 -0
- package/dist/components/ButtonFavorite.d.ts.map +1 -0
- package/dist/components/ButtonFavorite.js +25 -0
- package/dist/components/ButtonFavorite.js.map +1 -0
- package/dist/components/Code.d.ts +2 -1
- package/dist/components/Code.d.ts.map +1 -1
- package/dist/components/Code.js +52 -24
- package/dist/components/Code.js.map +1 -1
- package/dist/components/ComponentNavigator.d.ts +38 -0
- package/dist/components/ComponentNavigator.d.ts.map +1 -0
- package/dist/components/ComponentNavigator.js +31 -0
- package/dist/components/ComponentNavigator.js.map +1 -0
- package/dist/components/Fading.d.ts +32 -0
- package/dist/components/Fading.d.ts.map +1 -0
- package/dist/components/Fading.js +33 -0
- package/dist/components/Fading.js.map +1 -0
- package/dist/components/FadingOverflow.d.ts +25 -0
- package/dist/components/FadingOverflow.d.ts.map +1 -1
- package/dist/components/FadingOverflow.js +16 -8
- package/dist/components/FadingOverflow.js.map +1 -1
- package/dist/components/FileDescription.d.ts +10 -0
- package/dist/components/FileDescription.d.ts.map +1 -0
- package/dist/components/FileDescription.js +84 -0
- package/dist/components/FileDescription.js.map +1 -0
- package/dist/components/HistoryList.d.ts +15 -0
- package/dist/components/HistoryList.d.ts.map +1 -1
- package/dist/components/HistoryList.js +6 -2
- package/dist/components/HistoryList.js.map +1 -1
- package/dist/components/ListResource.d.ts +29 -0
- package/dist/components/ListResource.d.ts.map +1 -0
- package/dist/components/ListResource.js +17 -0
- package/dist/components/ListResource.js.map +1 -0
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/Markdown.js +2 -2
- package/dist/components/Markdown.js.map +1 -1
- package/dist/components/Modal.d.ts +9 -0
- package/dist/components/Modal.d.ts.map +1 -0
- package/dist/components/Modal.js +56 -0
- package/dist/components/Modal.js.map +1 -0
- package/dist/components/QuickStartButton.d.ts +2 -4
- package/dist/components/QuickStartButton.d.ts.map +1 -1
- package/dist/components/QuickStartButton.js +7 -39
- package/dist/components/QuickStartButton.js.map +1 -1
- package/dist/components/RightPanelContentList.d.ts +10 -0
- package/dist/components/RightPanelContentList.d.ts.map +1 -0
- package/dist/components/RightPanelContentList.js +7 -0
- package/dist/components/RightPanelContentList.js.map +1 -0
- package/dist/components/RightPanelForm.d.ts +3 -0
- package/dist/components/RightPanelForm.d.ts.map +1 -1
- package/dist/components/RightPanelForm.js +57 -17
- package/dist/components/RightPanelForm.js.map +1 -1
- package/dist/components/RightPanelTabs.d.ts +4 -4
- package/dist/components/RightPanelTabs.d.ts.map +1 -1
- package/dist/components/RightPanelTabs.js +7 -16
- package/dist/components/RightPanelTabs.js.map +1 -1
- package/dist/components/Selector/index.d.ts +54 -0
- package/dist/components/Selector/index.d.ts.map +1 -0
- package/dist/components/Selector/index.js +143 -0
- package/dist/components/Selector/index.js.map +1 -0
- package/dist/components/Selector/styled.d.ts +4 -0
- package/dist/components/Selector/styled.d.ts.map +1 -0
- package/dist/components/Selector/styled.js +157 -0
- package/dist/components/Selector/styled.js.map +1 -0
- package/dist/components/StackedBadge.d.ts +14 -0
- package/dist/components/StackedBadge.d.ts.map +1 -0
- package/dist/components/StackedBadge.js +56 -0
- package/dist/components/StackedBadge.js.map +1 -0
- package/dist/components/TabManager.d.ts +6 -0
- package/dist/components/TabManager.d.ts.map +1 -1
- package/dist/components/TabManager.js +16 -28
- package/dist/components/TabManager.js.map +1 -1
- package/dist/components/ToolBadge.d.ts +9 -0
- package/dist/components/ToolBadge.d.ts.map +1 -0
- package/dist/components/ToolBadge.js +34 -0
- package/dist/components/ToolBadge.js.map +1 -0
- package/dist/components/WorkspaceTabNavigator.d.ts +17 -0
- package/dist/components/WorkspaceTabNavigator.d.ts.map +1 -0
- package/dist/components/WorkspaceTabNavigator.js +93 -0
- package/dist/components/WorkspaceTabNavigator.js.map +1 -0
- package/dist/components/form/DescribedCheckboxGroup.d.ts +30 -2
- package/dist/components/form/DescribedCheckboxGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedCheckboxGroup.js +75 -21
- package/dist/components/form/DescribedCheckboxGroup.js.map +1 -1
- package/dist/components/form/DescribedRadioGroup.d.ts +31 -2
- package/dist/components/form/DescribedRadioGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedRadioGroup.js +65 -16
- package/dist/components/form/DescribedRadioGroup.js.map +1 -1
- package/dist/components/form/dictionary.d.ts +19 -0
- package/dist/components/form/dictionary.d.ts.map +1 -0
- package/dist/components/form/dictionary.js +19 -0
- package/dist/components/form/dictionary.js.map +1 -0
- package/dist/components/form/styled.d.ts.map +1 -1
- package/dist/components/form/styled.js +1 -2
- package/dist/components/form/styled.js.map +1 -1
- package/dist/components/form/types.d.ts +42 -0
- package/dist/components/form/types.d.ts.map +1 -1
- package/dist/context/AIWidgetProvider.d.ts +19 -0
- package/dist/context/AIWidgetProvider.d.ts.map +1 -1
- package/dist/context/AIWidgetProvider.js +19 -0
- package/dist/context/AIWidgetProvider.js.map +1 -1
- package/dist/context/hooks.d.ts +61 -4
- package/dist/context/hooks.d.ts.map +1 -1
- package/dist/context/hooks.js +83 -13
- package/dist/context/hooks.js.map +1 -1
- package/dist/features.d.ts +72 -10
- package/dist/features.d.ts.map +1 -1
- package/dist/features.js +23 -8
- package/dist/features.js.map +1 -1
- package/dist/hooks/midnight-update-view.d.ts +5 -0
- package/dist/hooks/midnight-update-view.d.ts.map +1 -0
- package/dist/hooks/midnight-update-view.js +30 -0
- package/dist/hooks/midnight-update-view.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/layout.css +95 -28
- package/dist/regex.d.ts +3 -0
- package/dist/regex.d.ts.map +1 -0
- package/dist/regex.js +3 -0
- package/dist/regex.js.map +1 -0
- package/dist/right-panel/DefaultPanel.d.ts +3 -0
- package/dist/right-panel/DefaultPanel.d.ts.map +1 -1
- package/dist/right-panel/DefaultPanel.js +5 -4
- package/dist/right-panel/DefaultPanel.js.map +1 -1
- package/dist/right-panel/RightPanel.d.ts +3 -0
- package/dist/right-panel/RightPanel.d.ts.map +1 -1
- package/dist/right-panel/RightPanel.js +3 -0
- package/dist/right-panel/RightPanel.js.map +1 -1
- package/dist/right-panel/RightPanelProvider.d.ts +15 -0
- package/dist/right-panel/RightPanelProvider.d.ts.map +1 -1
- package/dist/right-panel/RightPanelProvider.js.map +1 -1
- package/dist/right-panel/constants.d.ts +2 -0
- package/dist/right-panel/constants.d.ts.map +1 -0
- package/dist/right-panel/constants.js +2 -0
- package/dist/right-panel/constants.js.map +1 -0
- package/dist/right-panel/hooks.d.ts +6 -0
- package/dist/right-panel/hooks.d.ts.map +1 -1
- package/dist/right-panel/hooks.js +8 -1
- package/dist/right-panel/hooks.js.map +1 -1
- package/dist/state/ChatEntry.d.ts +182 -8
- package/dist/state/ChatEntry.d.ts.map +1 -1
- package/dist/state/ChatEntry.js +26 -3
- package/dist/state/ChatEntry.js.map +1 -1
- package/dist/state/ChatState.d.ts +116 -14
- package/dist/state/ChatState.d.ts.map +1 -1
- package/dist/state/ChatState.js +49 -8
- package/dist/state/ChatState.js.map +1 -1
- package/dist/state/ChatTabsController.d.ts +50 -1
- package/dist/state/ChatTabsController.d.ts.map +1 -1
- package/dist/state/ChatTabsController.js +77 -8
- package/dist/state/ChatTabsController.js.map +1 -1
- package/dist/state/ObservableState.d.ts +14 -0
- package/dist/state/ObservableState.d.ts.map +1 -1
- package/dist/state/ObservableState.js +14 -0
- package/dist/state/ObservableState.js.map +1 -1
- package/dist/state/WidgetState.d.ts +62 -2
- package/dist/state/WidgetState.d.ts.map +1 -1
- package/dist/state/WidgetState.js +49 -2
- package/dist/state/WidgetState.js.map +1 -1
- package/dist/state/constants.d.ts +5 -0
- package/dist/state/constants.d.ts.map +1 -0
- package/dist/state/constants.js +10 -0
- package/dist/state/constants.js.map +1 -0
- package/dist/state/types.d.ts +10 -1
- package/dist/state/types.d.ts.map +1 -1
- package/dist/types.d.ts +20 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/chat.d.ts +11 -4
- package/dist/utils/chat.d.ts.map +1 -1
- package/dist/utils/chat.js +13 -11
- package/dist/utils/chat.js.map +1 -1
- package/dist/utils/check-is-trial.d.ts +2 -0
- package/dist/utils/check-is-trial.d.ts.map +1 -0
- package/dist/utils/check-is-trial.js +6 -0
- package/dist/utils/check-is-trial.js.map +1 -0
- package/dist/utils/copy-to-clipboard.d.ts +6 -0
- package/dist/utils/copy-to-clipboard.d.ts.map +1 -0
- package/dist/utils/copy-to-clipboard.js +30 -0
- package/dist/utils/copy-to-clipboard.js.map +1 -0
- package/dist/utils/date.d.ts +26 -2
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +28 -3
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/download.d.ts +5 -0
- package/dist/utils/download.d.ts.map +1 -1
- package/dist/utils/download.js +5 -0
- package/dist/utils/download.js.map +1 -1
- package/dist/utils/error.d.ts +2 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +54 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/knowledge-source.d.ts +12 -2
- package/dist/utils/knowledge-source.d.ts.map +1 -1
- package/dist/utils/knowledge-source.js +16 -0
- package/dist/utils/knowledge-source.js.map +1 -1
- package/dist/utils/planning-tool.d.ts +17 -0
- package/dist/utils/planning-tool.d.ts.map +1 -0
- package/dist/utils/planning-tool.js +32 -0
- package/dist/utils/planning-tool.js.map +1 -0
- package/dist/utils/programming-languages.d.ts.map +1 -1
- package/dist/utils/programming-languages.js +10 -0
- package/dist/utils/programming-languages.js.map +1 -1
- package/dist/utils/string.d.ts +5 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +5 -1
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/tools.d.ts +23 -0
- package/dist/utils/tools.d.ts.map +1 -0
- package/dist/utils/tools.js +23 -0
- package/dist/utils/tools.js.map +1 -0
- package/dist/utils/update-tool-step.d.ts +3 -0
- package/dist/utils/update-tool-step.d.ts.map +1 -0
- package/dist/utils/update-tool-step.js +23 -0
- package/dist/utils/update-tool-step.js.map +1 -0
- package/dist/utils/upload/FileUpload.d.ts +21 -0
- package/dist/utils/upload/FileUpload.d.ts.map +1 -0
- package/dist/utils/upload/FileUpload.js +54 -0
- package/dist/utils/upload/FileUpload.js.map +1 -0
- package/dist/utils/upload/UploadManager.d.ts +42 -0
- package/dist/utils/upload/UploadManager.d.ts.map +1 -0
- package/dist/utils/upload/UploadManager.js +138 -0
- package/dist/utils/upload/UploadManager.js.map +1 -0
- package/dist/utils/upload/context.d.ts +15 -0
- package/dist/utils/upload/context.d.ts.map +1 -0
- package/dist/utils/upload/context.js +37 -0
- package/dist/utils/upload/context.js.map +1 -0
- package/dist/utils/upload/errors.d.ts +17 -0
- package/dist/utils/upload/errors.d.ts.map +1 -0
- package/dist/utils/upload/errors.js +27 -0
- package/dist/utils/upload/errors.js.map +1 -0
- package/dist/utils/upload/types.d.ts +7 -0
- package/dist/utils/upload/types.d.ts.map +1 -0
- package/dist/{components/Tooltip → utils/upload}/types.js.map +1 -1
- package/dist/utils/upload/use-paste-upload.d.ts +8 -0
- package/dist/utils/upload/use-paste-upload.d.ts.map +1 -0
- package/dist/utils/upload/use-paste-upload.js +19 -0
- package/dist/utils/upload/use-paste-upload.js.map +1 -0
- package/dist/utils/upload/utils.d.ts +4 -0
- package/dist/utils/upload/utils.d.ts.map +1 -0
- package/dist/utils/upload/utils.js +10 -0
- package/dist/utils/upload/utils.js.map +1 -0
- package/dist/utils/url.d.ts +2 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +8 -0
- package/dist/utils/url.js.map +1 -0
- package/dist/views/Agents/AgentDescription.d.ts +4 -0
- package/dist/views/Agents/AgentDescription.d.ts.map +1 -0
- package/dist/views/Agents/AgentDescription.js +38 -0
- package/dist/views/Agents/AgentDescription.js.map +1 -0
- package/dist/views/Agents/AgentsPanel.d.ts +5 -0
- package/dist/views/Agents/AgentsPanel.d.ts.map +1 -0
- package/dist/views/Agents/AgentsPanel.js +45 -0
- package/dist/views/Agents/AgentsPanel.js.map +1 -0
- package/dist/views/Agents/AgentsTab.d.ts +11 -0
- package/dist/views/Agents/AgentsTab.d.ts.map +1 -0
- package/dist/views/Agents/AgentsTab.js +82 -0
- package/dist/views/Agents/AgentsTab.js.map +1 -0
- package/dist/views/Agents/dictionary.d.ts +2 -0
- package/dist/views/Agents/dictionary.d.ts.map +1 -0
- package/dist/views/Agents/dictionary.js +43 -0
- package/dist/views/Agents/dictionary.js.map +1 -0
- package/dist/views/Agents/index.d.ts +5 -0
- package/dist/views/Agents/index.d.ts.map +1 -0
- package/dist/views/Agents/index.js +21 -0
- package/dist/views/Agents/index.js.map +1 -0
- package/dist/views/Agents/styled.d.ts +3 -0
- package/dist/views/Agents/styled.d.ts.map +1 -0
- package/dist/views/Agents/styled.js +68 -0
- package/dist/views/Agents/styled.js.map +1 -0
- package/dist/views/Agents/useAgentFavorites.d.ts +8 -0
- package/dist/views/Agents/useAgentFavorites.d.ts.map +1 -0
- package/dist/views/Agents/useAgentFavorites.js +59 -0
- package/dist/views/Agents/useAgentFavorites.js.map +1 -0
- package/dist/views/Chat/AgentInfo.d.ts +5 -1
- package/dist/views/Chat/AgentInfo.d.ts.map +1 -1
- package/dist/views/Chat/AgentInfo.js +6 -5
- package/dist/views/Chat/AgentInfo.js.map +1 -1
- package/dist/views/Chat/ButtonExecutionDetail.d.ts +5 -0
- package/dist/views/Chat/ButtonExecutionDetail.d.ts.map +1 -0
- package/dist/views/Chat/ButtonExecutionDetail.js +34 -0
- package/dist/views/Chat/ButtonExecutionDetail.js.map +1 -0
- package/dist/views/Chat/ChatMessage.d.ts +56 -4
- package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessage.js +160 -24
- package/dist/views/Chat/ChatMessage.js.map +1 -1
- package/dist/views/Chat/ChatMessages.d.ts +6 -2
- package/dist/views/Chat/ChatMessages.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessages.js +5 -2
- package/dist/views/Chat/ChatMessages.js.map +1 -1
- package/dist/views/Chat/StepsList.d.ts +14 -0
- package/dist/views/Chat/StepsList.d.ts.map +1 -0
- package/dist/views/Chat/StepsList.js +192 -0
- package/dist/views/Chat/StepsList.js.map +1 -0
- package/dist/views/Chat/chat-scroll.d.ts +1 -1
- package/dist/views/Chat/chat-scroll.js +1 -1
- package/dist/views/Chat/events.d.ts +22 -0
- package/dist/views/Chat/events.d.ts.map +1 -0
- package/dist/views/Chat/events.js +67 -0
- package/dist/views/Chat/events.js.map +1 -0
- package/dist/views/Chat/index.d.ts +9 -2
- package/dist/views/Chat/index.d.ts.map +1 -1
- package/dist/views/Chat/index.js +5 -2
- package/dist/views/Chat/index.js.map +1 -1
- package/dist/views/Chat/styled.d.ts +3 -1
- package/dist/views/Chat/styled.d.ts.map +1 -1
- package/dist/views/Chat/styled.js +152 -31
- package/dist/views/Chat/styled.js.map +1 -1
- package/dist/views/ChatHistory/ChatHistoryPanel.d.ts +4 -4
- package/dist/views/ChatHistory/ChatHistoryPanel.d.ts.map +1 -1
- package/dist/views/ChatHistory/ChatHistoryPanel.js +6 -2
- package/dist/views/ChatHistory/ChatHistoryPanel.js.map +1 -1
- package/dist/views/ChatHistory/HistoryItem.d.ts +4 -3
- package/dist/views/ChatHistory/HistoryItem.d.ts.map +1 -1
- package/dist/views/ChatHistory/HistoryItem.js +16 -37
- package/dist/views/ChatHistory/HistoryItem.js.map +1 -1
- package/dist/views/ChatHistory/dictionary.d.ts +1 -1
- package/dist/views/ChatHistory/index.d.ts +4 -4
- package/dist/views/ChatHistory/index.d.ts.map +1 -1
- package/dist/views/ChatHistory/index.js +6 -3
- package/dist/views/ChatHistory/index.js.map +1 -1
- package/dist/views/ChatHistory/styled.d.ts.map +1 -1
- package/dist/views/ChatHistory/styled.js +3 -5
- package/dist/views/ChatHistory/styled.js.map +1 -1
- package/dist/views/ChatHistory/utils.d.ts +17 -2
- package/dist/views/ChatHistory/utils.d.ts.map +1 -1
- package/dist/views/ChatHistory/utils.js +140 -9
- package/dist/views/ChatHistory/utils.js.map +1 -1
- package/dist/views/ChatTabSelection.d.ts +6 -4
- package/dist/views/ChatTabSelection.d.ts.map +1 -1
- package/dist/views/ChatTabSelection.js +40 -15
- package/dist/views/ChatTabSelection.js.map +1 -1
- package/dist/views/Editor.d.ts +3 -0
- package/dist/views/Editor.d.ts.map +1 -1
- package/dist/views/Editor.js +23 -16
- package/dist/views/Editor.js.map +1 -1
- package/dist/views/Home/BuiltInAgent.d.ts +6 -0
- package/dist/views/Home/BuiltInAgent.d.ts.map +1 -0
- package/dist/views/Home/BuiltInAgent.js +37 -0
- package/dist/views/Home/BuiltInAgent.js.map +1 -0
- package/dist/views/Home/CustomAgent.d.ts +5 -0
- package/dist/views/Home/CustomAgent.d.ts.map +1 -0
- package/dist/views/Home/CustomAgent.js +23 -0
- package/dist/views/Home/CustomAgent.js.map +1 -0
- package/dist/views/Home/index.d.ts +8 -0
- package/dist/views/Home/index.d.ts.map +1 -0
- package/dist/views/Home/index.js +34 -0
- package/dist/views/Home/index.js.map +1 -0
- package/dist/views/Home/styled.d.ts +2 -0
- package/dist/views/Home/styled.d.ts.map +1 -0
- package/dist/views/Home/styled.js +74 -0
- package/dist/views/Home/styled.js.map +1 -0
- package/dist/views/Home/types.d.ts +16 -0
- package/dist/views/Home/types.d.ts.map +1 -0
- package/dist/views/Home/types.js +2 -0
- package/dist/views/Home/types.js.map +1 -0
- package/dist/views/KSDocument.d.ts +3 -0
- package/dist/views/KSDocument.d.ts.map +1 -1
- package/dist/views/KSDocument.js +7 -4
- package/dist/views/KSDocument.js.map +1 -1
- package/dist/views/KnowledgeSources.d.ts +12 -0
- package/dist/views/KnowledgeSources.d.ts.map +1 -1
- package/dist/views/KnowledgeSources.js +123 -33
- package/dist/views/KnowledgeSources.js.map +1 -1
- package/dist/views/MessageInput/AgentSelector.d.ts +5 -0
- package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -0
- package/dist/views/MessageInput/AgentSelector.js +66 -0
- package/dist/views/MessageInput/AgentSelector.js.map +1 -0
- package/dist/views/MessageInput/ButtonAgent.d.ts +2 -0
- package/dist/views/MessageInput/ButtonAgent.d.ts.map +1 -0
- package/dist/views/MessageInput/ButtonAgent.js +35 -0
- package/dist/views/MessageInput/ButtonAgent.js.map +1 -0
- package/dist/views/MessageInput/ButtonBar.d.ts +13 -0
- package/dist/views/MessageInput/ButtonBar.d.ts.map +1 -0
- package/dist/views/MessageInput/ButtonBar.js +15 -0
- package/dist/views/MessageInput/ButtonBar.js.map +1 -0
- package/dist/views/MessageInput/ContextBar.d.ts +9 -0
- package/dist/views/MessageInput/ContextBar.d.ts.map +1 -0
- package/dist/views/MessageInput/ContextBar.js +51 -0
- package/dist/views/MessageInput/ContextBar.js.map +1 -0
- package/dist/views/MessageInput/ModelSwitcher/index.d.ts +2 -0
- package/dist/views/MessageInput/ModelSwitcher/index.d.ts.map +1 -0
- package/dist/views/MessageInput/ModelSwitcher/index.js +25 -0
- package/dist/views/MessageInput/ModelSwitcher/index.js.map +1 -0
- package/dist/views/MessageInput/ModelSwitcher/utils.d.ts +30 -0
- package/dist/views/MessageInput/ModelSwitcher/utils.d.ts.map +1 -0
- package/dist/views/MessageInput/ModelSwitcher/utils.js +91 -0
- package/dist/views/MessageInput/ModelSwitcher/utils.js.map +1 -0
- package/dist/views/MessageInput/QuickCommandSelector.d.ts +5 -0
- package/dist/views/MessageInput/QuickCommandSelector.d.ts.map +1 -0
- package/dist/views/MessageInput/QuickCommandSelector.js +104 -0
- package/dist/views/MessageInput/QuickCommandSelector.js.map +1 -0
- package/dist/views/MessageInput/SelectContent.d.ts +2 -0
- package/dist/views/MessageInput/SelectContent.d.ts.map +1 -0
- package/dist/views/MessageInput/SelectContent.js +84 -0
- package/dist/views/MessageInput/SelectContent.js.map +1 -0
- package/dist/views/MessageInput/UploadBar.d.ts +2 -0
- package/dist/views/MessageInput/UploadBar.d.ts.map +1 -0
- package/dist/views/MessageInput/UploadBar.js +74 -0
- package/dist/views/MessageInput/UploadBar.js.map +1 -0
- package/dist/views/MessageInput/UploadDragNDrop.d.ts +14 -0
- package/dist/views/MessageInput/UploadDragNDrop.d.ts.map +1 -0
- package/dist/views/MessageInput/UploadDragNDrop.js +51 -0
- package/dist/views/MessageInput/UploadDragNDrop.js.map +1 -0
- package/dist/views/MessageInput/chat-entry-history.d.ts +11 -0
- package/dist/views/MessageInput/chat-entry-history.d.ts.map +1 -0
- package/dist/views/MessageInput/chat-entry-history.js +78 -0
- package/dist/views/MessageInput/chat-entry-history.js.map +1 -0
- package/dist/views/MessageInput/dictionary.d.ts +1 -1
- package/dist/views/MessageInput/dictionary.d.ts.map +1 -1
- package/dist/views/MessageInput/dictionary.js +52 -10
- package/dist/views/MessageInput/dictionary.js.map +1 -1
- package/dist/views/MessageInput/index.d.ts +9 -6
- package/dist/views/MessageInput/index.d.ts.map +1 -1
- package/dist/views/MessageInput/index.js +112 -20
- package/dist/views/MessageInput/index.js.map +1 -1
- package/dist/views/MessageInput/styled.d.ts +13 -1
- package/dist/views/MessageInput/styled.d.ts.map +1 -1
- package/dist/views/MessageInput/styled.js +223 -85
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/dist/views/MinimizedHeader.d.ts +4 -0
- package/dist/views/MinimizedHeader.d.ts.map +1 -1
- package/dist/views/MinimizedHeader.js +9 -7
- package/dist/views/MinimizedHeader.js.map +1 -1
- package/dist/views/Resources.d.ts +2 -0
- package/dist/views/Resources.d.ts.map +1 -0
- package/dist/views/Resources.js +69 -0
- package/dist/views/Resources.js.map +1 -0
- package/dist/views/Stacks.d.ts +12 -0
- package/dist/views/Stacks.d.ts.map +1 -1
- package/dist/views/Stacks.js +117 -21
- package/dist/views/Stacks.js.map +1 -1
- package/dist/views/Steps/FlowChart/HandleGroup.d.ts +10 -0
- package/dist/views/Steps/FlowChart/HandleGroup.d.ts.map +1 -0
- package/dist/views/Steps/FlowChart/HandleGroup.js +4 -0
- package/dist/views/Steps/FlowChart/HandleGroup.js.map +1 -0
- package/dist/views/Steps/FlowChart/NodeDynamic.d.ts +15 -0
- package/dist/views/Steps/FlowChart/NodeDynamic.d.ts.map +1 -0
- package/dist/views/Steps/FlowChart/NodeDynamic.js +41 -0
- package/dist/views/Steps/FlowChart/NodeDynamic.js.map +1 -0
- package/dist/views/Steps/FlowChart/NodeStep.d.ts +10 -0
- package/dist/views/Steps/FlowChart/NodeStep.d.ts.map +1 -0
- package/dist/views/Steps/FlowChart/NodeStep.js +13 -0
- package/dist/views/Steps/FlowChart/NodeStep.js.map +1 -0
- package/dist/views/Steps/FlowChart/hooks.d.ts +7 -0
- package/dist/views/Steps/FlowChart/hooks.d.ts.map +1 -0
- package/dist/views/Steps/FlowChart/hooks.js +31 -0
- package/dist/views/Steps/FlowChart/hooks.js.map +1 -0
- package/dist/views/Steps/FlowChart/index.d.ts +12 -0
- package/dist/views/Steps/FlowChart/index.d.ts.map +1 -0
- package/dist/views/Steps/FlowChart/index.js +78 -0
- package/dist/views/Steps/FlowChart/index.js.map +1 -0
- package/dist/views/Steps/FlowChart/layout.d.ts +8 -0
- package/dist/views/Steps/FlowChart/layout.d.ts.map +1 -0
- package/dist/views/Steps/FlowChart/layout.js +59 -0
- package/dist/views/Steps/FlowChart/layout.js.map +1 -0
- package/dist/views/Steps/FlowChart/styled.d.ts +14 -0
- package/dist/views/Steps/FlowChart/styled.d.ts.map +1 -0
- package/dist/views/Steps/FlowChart/styled.js +156 -0
- package/dist/views/Steps/FlowChart/styled.js.map +1 -0
- package/dist/views/Steps/FlowChart/types.d.ts +25 -0
- package/dist/views/Steps/FlowChart/types.d.ts.map +1 -0
- package/dist/views/Steps/FlowChart/types.js +2 -0
- package/dist/views/Steps/FlowChart/types.js.map +1 -0
- package/dist/views/Steps/StepModal.d.ts +10 -0
- package/dist/views/Steps/StepModal.d.ts.map +1 -0
- package/dist/views/Steps/StepModal.js +139 -0
- package/dist/views/Steps/StepModal.js.map +1 -0
- package/dist/views/Steps/StepsPanel.d.ts +6 -0
- package/dist/views/Steps/StepsPanel.d.ts.map +1 -0
- package/dist/views/Steps/StepsPanel.js +18 -0
- package/dist/views/Steps/StepsPanel.js.map +1 -0
- package/dist/views/Steps/dictionary.d.ts +43 -0
- package/dist/views/Steps/dictionary.d.ts.map +1 -0
- package/dist/views/Steps/dictionary.js +45 -0
- package/dist/views/Steps/dictionary.js.map +1 -0
- package/dist/views/Steps/index.d.ts +5 -0
- package/dist/views/Steps/index.d.ts.map +1 -0
- package/dist/views/Steps/index.js +30 -0
- package/dist/views/Steps/index.js.map +1 -0
- package/dist/views/Steps/utils.d.ts +7 -0
- package/dist/views/Steps/utils.d.ts.map +1 -0
- package/dist/views/Steps/utils.js +32 -0
- package/dist/views/Steps/utils.js.map +1 -0
- package/dist/views/Tools.d.ts +2 -0
- package/dist/views/Tools.d.ts.map +1 -0
- package/dist/views/Tools.js +53 -0
- package/dist/views/Tools.js.map +1 -0
- package/dist/views/Workspaces/WorkspacesTab.d.ts +20 -0
- package/dist/views/Workspaces/WorkspacesTab.d.ts.map +1 -0
- package/dist/views/Workspaces/WorkspacesTab.js +61 -0
- package/dist/views/Workspaces/WorkspacesTab.js.map +1 -0
- package/dist/views/Workspaces/index.d.ts +5 -0
- package/dist/views/Workspaces/index.d.ts.map +1 -0
- package/dist/views/Workspaces/index.js +69 -0
- package/dist/views/Workspaces/index.js.map +1 -0
- package/package.dev.json +3 -0
- package/package.json +21 -13
- package/package.stg.json +4 -0
- package/src/StackspotAIWidget.tsx +96 -37
- package/src/app-metadata.json +175 -0
- package/src/assets/placeholder.png +0 -0
- package/src/chat-interceptors/CustomInputs.ts +14 -1
- package/src/chat-interceptors/quick-command-questions.ts +12 -2
- package/src/chat-interceptors/quick-commands.ts +286 -52
- package/src/chat-interceptors/send-message.ts +253 -25
- package/src/components/AdaptiveTextArea.tsx +36 -11
- package/src/components/AgentCard/AgentCardCreate.tsx +42 -0
- package/src/components/AgentCard/dictionary.ts +25 -0
- package/src/components/AgentCard/index.tsx +82 -0
- package/src/components/AnimatedOpacity.tsx +55 -0
- package/src/components/AutoFocus.tsx +42 -0
- package/src/components/ButtonFavorite.tsx +78 -0
- package/src/components/Code.tsx +94 -59
- package/src/components/ComponentNavigator.tsx +99 -0
- package/src/components/Fading.tsx +66 -0
- package/src/components/FadingOverflow.tsx +39 -12
- package/src/components/FileDescription.tsx +118 -0
- package/src/components/HistoryList.tsx +19 -2
- package/src/components/ListResource.tsx +60 -0
- package/src/components/Markdown.tsx +2 -1
- package/src/components/Modal.tsx +85 -0
- package/src/components/QuickStartButton.tsx +15 -47
- package/src/components/RightPanelContentList.tsx +15 -0
- package/src/components/RightPanelForm.tsx +64 -22
- package/src/components/RightPanelTabs.tsx +7 -32
- package/src/components/Selector/index.tsx +312 -0
- package/src/components/Selector/styled.ts +158 -0
- package/src/components/StackedBadge.tsx +77 -0
- package/src/components/TabManager.tsx +36 -36
- package/src/components/ToolBadge.tsx +67 -0
- package/src/components/WorkspaceTabNavigator.tsx +172 -0
- package/src/components/form/DescribedCheckboxGroup.tsx +135 -33
- package/src/components/form/DescribedRadioGroup.tsx +136 -32
- package/src/components/form/dictionary.ts +18 -0
- package/src/components/form/styled.ts +1 -2
- package/src/components/form/types.ts +45 -1
- package/src/context/AIWidgetProvider.tsx +19 -0
- package/src/context/hooks.ts +86 -16
- package/src/features.ts +90 -16
- package/src/hooks/midnight-update-view.ts +36 -0
- package/src/images.d.ts +5 -0
- package/src/index.ts +16 -0
- package/src/layout.css +95 -28
- package/src/regex.ts +2 -0
- package/src/right-panel/DefaultPanel.tsx +7 -7
- package/src/right-panel/RightPanel.tsx +3 -0
- package/src/right-panel/RightPanelProvider.tsx +15 -0
- package/src/right-panel/constants.ts +1 -0
- package/src/right-panel/hooks.tsx +8 -1
- package/src/state/ChatEntry.ts +189 -9
- package/src/state/ChatState.ts +131 -14
- package/src/state/ChatTabsController.ts +78 -8
- package/src/state/ObservableState.ts +14 -0
- package/src/state/WidgetState.ts +86 -3
- package/src/state/constants.ts +13 -0
- package/src/state/types.ts +12 -1
- package/src/types.ts +21 -4
- package/src/utils/chat.ts +15 -14
- package/src/utils/check-is-trial.ts +6 -0
- package/src/utils/copy-to-clipboard.ts +29 -0
- package/src/utils/date.ts +28 -4
- package/src/utils/download.ts +5 -0
- package/src/utils/error.ts +56 -0
- package/src/utils/knowledge-source.ts +18 -2
- package/src/utils/planning-tool.ts +41 -0
- package/src/utils/programming-languages.ts +10 -0
- package/src/utils/string.ts +5 -1
- package/src/utils/tools.ts +32 -0
- package/src/utils/update-tool-step.tsx +27 -0
- package/src/utils/upload/FileUpload.ts +63 -0
- package/src/utils/upload/UploadManager.ts +156 -0
- package/src/utils/upload/context.tsx +44 -0
- package/src/utils/upload/errors.ts +34 -0
- package/src/utils/upload/types.ts +7 -0
- package/src/utils/upload/use-paste-upload.tsx +30 -0
- package/src/utils/upload/utils.ts +12 -0
- package/src/utils/url.ts +8 -0
- package/src/views/Agents/AgentDescription.tsx +107 -0
- package/src/views/Agents/AgentsPanel.tsx +57 -0
- package/src/views/Agents/AgentsTab.tsx +126 -0
- package/src/views/Agents/dictionary.ts +45 -0
- package/src/views/Agents/index.tsx +26 -0
- package/src/views/Agents/styled.ts +69 -0
- package/src/views/Agents/useAgentFavorites.ts +63 -0
- package/src/views/Chat/AgentInfo.tsx +13 -8
- package/src/views/Chat/ButtonExecutionDetail.tsx +46 -0
- package/src/views/Chat/ChatMessage.tsx +465 -79
- package/src/views/Chat/ChatMessages.tsx +15 -4
- package/src/views/Chat/StepsList.tsx +394 -0
- package/src/views/Chat/chat-scroll.ts +1 -1
- package/src/views/Chat/events.ts +71 -0
- package/src/views/Chat/index.tsx +17 -3
- package/src/views/Chat/styled.ts +158 -32
- package/src/views/ChatHistory/ChatHistoryPanel.tsx +8 -5
- package/src/views/ChatHistory/HistoryItem.tsx +23 -44
- package/src/views/ChatHistory/index.tsx +6 -4
- package/src/views/ChatHistory/styled.ts +3 -5
- package/src/views/ChatHistory/utils.ts +144 -11
- package/src/views/ChatTabSelection.tsx +47 -20
- package/src/views/Editor.tsx +28 -18
- package/src/views/Home/BuiltInAgent.tsx +67 -0
- package/src/views/Home/CustomAgent.tsx +36 -0
- package/src/views/Home/index.tsx +48 -0
- package/src/views/Home/styled.ts +74 -0
- package/src/views/Home/types.ts +16 -0
- package/src/views/KSDocument.tsx +11 -8
- package/src/views/KnowledgeSources.tsx +169 -62
- package/src/views/MessageInput/AgentSelector.tsx +92 -0
- package/src/views/MessageInput/ButtonAgent.tsx +73 -0
- package/src/views/MessageInput/ButtonBar.tsx +57 -0
- package/src/views/MessageInput/ContextBar.tsx +117 -0
- package/src/views/MessageInput/ModelSwitcher/index.tsx +69 -0
- package/src/views/MessageInput/ModelSwitcher/utils.tsx +143 -0
- package/src/views/MessageInput/QuickCommandSelector.tsx +137 -0
- package/src/views/MessageInput/SelectContent.tsx +99 -0
- package/src/views/MessageInput/UploadBar.tsx +107 -0
- package/src/views/MessageInput/UploadDragNDrop.tsx +79 -0
- package/src/views/MessageInput/chat-entry-history.ts +97 -0
- package/src/views/MessageInput/dictionary.ts +52 -10
- package/src/views/MessageInput/index.tsx +154 -51
- package/src/views/MessageInput/styled.ts +226 -85
- package/src/views/MinimizedHeader.tsx +11 -10
- package/src/views/Resources.tsx +108 -0
- package/src/views/Stacks.tsx +152 -39
- package/src/views/Steps/FlowChart/HandleGroup.tsx +14 -0
- package/src/views/Steps/FlowChart/NodeDynamic.tsx +97 -0
- package/src/views/Steps/FlowChart/NodeStep.tsx +49 -0
- package/src/views/Steps/FlowChart/hooks.ts +41 -0
- package/src/views/Steps/FlowChart/index.tsx +111 -0
- package/src/views/Steps/FlowChart/layout.ts +73 -0
- package/src/views/Steps/FlowChart/styled.ts +157 -0
- package/src/views/Steps/FlowChart/types.ts +28 -0
- package/src/views/Steps/StepModal.tsx +233 -0
- package/src/views/Steps/StepsPanel.tsx +31 -0
- package/src/views/Steps/dictionary.ts +48 -0
- package/src/views/Steps/index.tsx +36 -0
- package/src/views/Steps/utils.tsx +34 -0
- package/src/views/Tools.tsx +77 -0
- package/src/views/Workspaces/WorkspacesTab.tsx +116 -0
- package/src/views/Workspaces/index.tsx +78 -0
- package/tsconfig.json +8 -3
- package/dist/components/Accordion.d.ts +0 -10
- package/dist/components/Accordion.d.ts.map +0 -1
- package/dist/components/Accordion.js +0 -46
- package/dist/components/Accordion.js.map +0 -1
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts +0 -30
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts.map +0 -1
- package/dist/components/FallbackBoundary/ErrorBoundary.js +0 -38
- package/dist/components/FallbackBoundary/ErrorBoundary.js.map +0 -1
- package/dist/components/FallbackBoundary/Loading.d.ts +0 -2
- package/dist/components/FallbackBoundary/Loading.d.ts.map +0 -1
- package/dist/components/FallbackBoundary/Loading.js +0 -12
- package/dist/components/FallbackBoundary/Loading.js.map +0 -1
- package/dist/components/FallbackBoundary/index.d.ts +0 -6
- package/dist/components/FallbackBoundary/index.d.ts.map +0 -1
- package/dist/components/FallbackBoundary/index.js +0 -9
- package/dist/components/FallbackBoundary/index.js.map +0 -1
- package/dist/components/IconInput.d.ts +0 -7
- package/dist/components/IconInput.d.ts.map +0 -1
- package/dist/components/IconInput.js +0 -58
- package/dist/components/IconInput.js.map +0 -1
- package/dist/components/OverlayMenu.d.ts +0 -10
- package/dist/components/OverlayMenu.d.ts.map +0 -1
- package/dist/components/OverlayMenu.js +0 -58
- package/dist/components/OverlayMenu.js.map +0 -1
- package/dist/components/ProgressBar.d.ts +0 -11
- package/dist/components/ProgressBar.d.ts.map +0 -1
- package/dist/components/ProgressBar.js +0 -126
- package/dist/components/ProgressBar.js.map +0 -1
- package/dist/components/Tooltip/Tooltip.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/components/Tooltip/Tooltip.js +0 -17
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/Tooltip/TooltipAPI.d.ts +0 -13
- package/dist/components/Tooltip/TooltipAPI.d.ts.map +0 -1
- package/dist/components/Tooltip/TooltipAPI.js +0 -90
- package/dist/components/Tooltip/TooltipAPI.js.map +0 -1
- package/dist/components/Tooltip/context.d.ts +0 -5
- package/dist/components/Tooltip/context.d.ts.map +0 -1
- package/dist/components/Tooltip/context.js +0 -18
- package/dist/components/Tooltip/context.js.map +0 -1
- package/dist/components/Tooltip/index.d.ts +0 -3
- package/dist/components/Tooltip/index.d.ts.map +0 -1
- package/dist/components/Tooltip/index.js +0 -3
- package/dist/components/Tooltip/index.js.map +0 -1
- package/dist/components/Tooltip/style.d.ts +0 -4
- package/dist/components/Tooltip/style.d.ts.map +0 -1
- package/dist/components/Tooltip/style.js +0 -22
- package/dist/components/Tooltip/style.js.map +0 -1
- package/dist/components/Tooltip/types.d.ts +0 -14
- package/dist/components/Tooltip/types.d.ts.map +0 -1
- package/dist/views/Agents.d.ts +0 -2
- package/dist/views/Agents.d.ts.map +0 -1
- package/dist/views/Agents.js +0 -143
- package/dist/views/Agents.js.map +0 -1
- package/dist/views/Home.d.ts +0 -6
- package/dist/views/Home.d.ts.map +0 -1
- package/dist/views/Home.js +0 -68
- package/dist/views/Home.js.map +0 -1
- package/dist/views/MessageInput/ButtonGroup.d.ts +0 -12
- package/dist/views/MessageInput/ButtonGroup.d.ts.map +0 -1
- package/dist/views/MessageInput/ButtonGroup.js +0 -24
- package/dist/views/MessageInput/ButtonGroup.js.map +0 -1
- package/dist/views/MessageInput/InfoBar.d.ts +0 -2
- package/dist/views/MessageInput/InfoBar.d.ts.map +0 -1
- package/dist/views/MessageInput/InfoBar.js +0 -35
- package/dist/views/MessageInput/InfoBar.js.map +0 -1
- package/dist/views/Workspaces.d.ts +0 -2
- package/dist/views/Workspaces.d.ts.map +0 -1
- package/dist/views/Workspaces.js +0 -62
- package/dist/views/Workspaces.js.map +0 -1
- package/src/components/Accordion.tsx +0 -64
- package/src/components/FallbackBoundary/ErrorBoundary.tsx +0 -48
- package/src/components/FallbackBoundary/Loading.tsx +0 -14
- package/src/components/FallbackBoundary/index.tsx +0 -15
- package/src/components/IconInput.tsx +0 -70
- package/src/components/OverlayMenu.tsx +0 -77
- package/src/components/ProgressBar.tsx +0 -153
- package/src/components/Tooltip/Tooltip.tsx +0 -36
- package/src/components/Tooltip/TooltipAPI.ts +0 -84
- package/src/components/Tooltip/context.tsx +0 -24
- package/src/components/Tooltip/index.ts +0 -2
- package/src/components/Tooltip/style.tsx +0 -24
- package/src/components/Tooltip/types.ts +0 -15
- package/src/views/Agents.tsx +0 -200
- package/src/views/Home.tsx +0 -109
- package/src/views/MessageInput/ButtonGroup.tsx +0 -91
- package/src/views/MessageInput/InfoBar.tsx +0 -82
- package/src/views/Workspaces.tsx +0 -92
- /package/dist/{components/Tooltip → utils/upload}/types.js +0 -0
|
@@ -1,18 +1,60 @@
|
|
|
1
1
|
import { WithStyle } from '@stack-spot/portal-theme';
|
|
2
2
|
interface RadioCheckProps<T> extends WithStyle {
|
|
3
|
+
/**
|
|
4
|
+
* The options available.
|
|
5
|
+
*/
|
|
3
6
|
options: T[];
|
|
7
|
+
/**
|
|
8
|
+
* A function that renders an option as a label. This can either return a string or a React Element.
|
|
9
|
+
*/
|
|
4
10
|
renderLabel: (option: T) => React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* A function that renders an option as a description. This can either return a string or a React Element.
|
|
13
|
+
*/
|
|
5
14
|
renderDescription: (option: T) => React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* A function that renders a element before the content
|
|
17
|
+
*/
|
|
18
|
+
renderBeforeElement?: (option: T) => React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* A function that renders a element after the content
|
|
21
|
+
*/
|
|
22
|
+
renderAfterElement?: (option: T) => React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* A function that gives a custom className to the rendered option.
|
|
25
|
+
*/
|
|
6
26
|
optionClassName?: (option: T) => string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* A function that gives a custom style to the rendered option.
|
|
29
|
+
*/
|
|
7
30
|
optionStyle?: (option: T) => React.CSSProperties | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* A function that generates a unique id for the option.
|
|
33
|
+
*/
|
|
8
34
|
keygen: (option: T) => React.Key;
|
|
9
35
|
}
|
|
10
36
|
export interface RadioProps<T> extends RadioCheckProps<T> {
|
|
37
|
+
/**
|
|
38
|
+
* The current value of the radio group. This is one of the options.
|
|
39
|
+
*
|
|
40
|
+
* Comparisons use the same-value-zero algorithm (`===`).
|
|
41
|
+
*/
|
|
11
42
|
value: T | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* A function to call whenever the value changes.
|
|
45
|
+
*/
|
|
12
46
|
onChange: (option: T) => void;
|
|
13
47
|
}
|
|
14
48
|
export interface CheckProps<T> extends RadioCheckProps<T> {
|
|
49
|
+
/**
|
|
50
|
+
* The current value of the checkbox group. This is sub-array of the array of options.
|
|
51
|
+
*
|
|
52
|
+
* Comparisons use the same-value-zero algorithm (`===`).
|
|
53
|
+
*/
|
|
15
54
|
value: T[];
|
|
55
|
+
/**
|
|
56
|
+
* A function to call whenever the value changes.
|
|
57
|
+
*/
|
|
16
58
|
onChange: (option: T[]) => void;
|
|
17
59
|
}
|
|
18
60
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/form/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,UAAU,eAAe,CAAC,CAAC,CAAE,SAAQ,SAAS;IAC5C,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC5C,iBAAiB,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAClD,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IAC7D,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/form/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,UAAU,eAAe,CAAC,CAAC,CAAE,SAAQ,SAAS;IAC5C;;OAEG;IACH,OAAO,EAAE,CAAC,EAAE,CAAC;IACb;;OAEG;IACH,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC5C;;OAEG;IACH,iBAAiB,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAClD;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACrD;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACpD;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IACpD;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IAC7D;;OAEG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC;CAIlC;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACvD;;;;OAIG;IACH,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACvD;;;;OAIG;IACH,KAAK,EAAE,CAAC,EAAE,CAAC;IACX;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;CACjC"}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { WidgetState } from '../state/WidgetState.js';
|
|
2
2
|
export declare const AIWidgetContext: import("react").Context<WidgetState | undefined>;
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new context for the AI Chat Widget.
|
|
5
|
+
*
|
|
6
|
+
* This is not required, but makes it much easier to control the chat and is the only way to have multiple instances of the chat model in
|
|
7
|
+
* the same application.
|
|
8
|
+
*
|
|
9
|
+
* To control the chat widget in any component descendant from the `AIWidgetProvider`, you can call the hook `useWidget()`.
|
|
10
|
+
*
|
|
11
|
+
* Example:
|
|
12
|
+
* ```
|
|
13
|
+
* const widget = useMemo(() => new WidgetState(), [])
|
|
14
|
+
*
|
|
15
|
+
* return (
|
|
16
|
+
* <AIWidgetProvider value={widget}>
|
|
17
|
+
* {children}
|
|
18
|
+
* </AIWidgetProvider>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
3
22
|
export declare const AIWidgetProvider: import("react").Provider<WidgetState | undefined>;
|
|
4
23
|
//# sourceMappingURL=AIWidgetProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIWidgetProvider.d.ts","sourceRoot":"","sources":["../../src/context/AIWidgetProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,eAAO,MAAM,eAAe,kDAAoD,CAAA;AAEhF,eAAO,MAAM,gBAAgB,mDAA2B,CAAA"}
|
|
1
|
+
{"version":3,"file":"AIWidgetProvider.d.ts","sourceRoot":"","sources":["../../src/context/AIWidgetProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,eAAO,MAAM,eAAe,kDAAoD,CAAA;AAEhF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,mDAA2B,CAAA"}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
export const AIWidgetContext = createContext(undefined);
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new context for the AI Chat Widget.
|
|
5
|
+
*
|
|
6
|
+
* This is not required, but makes it much easier to control the chat and is the only way to have multiple instances of the chat model in
|
|
7
|
+
* the same application.
|
|
8
|
+
*
|
|
9
|
+
* To control the chat widget in any component descendant from the `AIWidgetProvider`, you can call the hook `useWidget()`.
|
|
10
|
+
*
|
|
11
|
+
* Example:
|
|
12
|
+
* ```
|
|
13
|
+
* const widget = useMemo(() => new WidgetState(), [])
|
|
14
|
+
*
|
|
15
|
+
* return (
|
|
16
|
+
* <AIWidgetProvider value={widget}>
|
|
17
|
+
* {children}
|
|
18
|
+
* </AIWidgetProvider>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
3
22
|
export const AIWidgetProvider = AIWidgetContext.Provider;
|
|
4
23
|
//# sourceMappingURL=AIWidgetProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIWidgetProvider.js","sourceRoot":"","sources":["../../src/context/AIWidgetProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAGrC,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAA0B,SAAS,CAAC,CAAA;AAEhF,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"AIWidgetProvider.js","sourceRoot":"","sources":["../../src/context/AIWidgetProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAGrC,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAA0B,SAAS,CAAC,CAAA;AAEhF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAQ,CAAA"}
|
package/dist/context/hooks.d.ts
CHANGED
|
@@ -1,18 +1,75 @@
|
|
|
1
1
|
import { ChatEntry } from '../state/ChatEntry.js';
|
|
2
|
-
import { ChatProperties, ChatState
|
|
2
|
+
import { ChatProperties, ChatState } from '../state/ChatState.js';
|
|
3
|
+
import { ObservableState } from '../state/ObservableState.js';
|
|
3
4
|
import { WidgetProperties, WidgetState } from '../state/WidgetState.js';
|
|
5
|
+
/**
|
|
6
|
+
* Returns the closest instance of a WidgetState (React Context). If no context is available, uses a global instance of the chat widget.
|
|
7
|
+
*/
|
|
4
8
|
export declare function useWidget(): WidgetState;
|
|
9
|
+
/**
|
|
10
|
+
* Watches an ObservableState.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useObservableState<T, K extends keyof T>(state: ObservableState<T>, key: K): T[K];
|
|
13
|
+
/**
|
|
14
|
+
* Watches one of the widget states.
|
|
15
|
+
* @param key the key watch changes for.
|
|
16
|
+
* @returns the value of the state referred by the key.
|
|
17
|
+
*/
|
|
5
18
|
export declare function useWidgetState<K extends keyof WidgetProperties>(key: K): WidgetProperties[K];
|
|
19
|
+
/**
|
|
20
|
+
* Watches the tabs of a ChatState. The value is updated whenever a tab is added, removed or selected.
|
|
21
|
+
*/
|
|
6
22
|
export declare function useChatTabs(): {
|
|
7
23
|
chats: ChatState[];
|
|
8
|
-
active:
|
|
24
|
+
active: ChatState;
|
|
9
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Gets a chat according to its identifier (conversation id).
|
|
28
|
+
*
|
|
29
|
+
* An error is thrown if the id doesn't correspond to any chat currently opened.
|
|
30
|
+
*
|
|
31
|
+
* @returns the chat state.
|
|
32
|
+
*/
|
|
10
33
|
export declare function useChat(chatId: string): ChatState;
|
|
34
|
+
/**
|
|
35
|
+
* Watches the current chat (selected in the chat tabs.)
|
|
36
|
+
*
|
|
37
|
+
* The value changes whenever a new chat is selected.
|
|
38
|
+
*
|
|
39
|
+
* @returns the currently active chat.
|
|
40
|
+
*/
|
|
11
41
|
export declare function useCurrentChat(): ChatState;
|
|
42
|
+
/**
|
|
43
|
+
* Watches one of the chat states.
|
|
44
|
+
* @param chatId the id of chat to watch.
|
|
45
|
+
* @param key the key of the state to watch.
|
|
46
|
+
* @returns the value of the state referred by the key.
|
|
47
|
+
*/
|
|
12
48
|
export declare function useChatState<K extends keyof ChatProperties>(chatId: string, key: K): ChatProperties[K];
|
|
49
|
+
/**
|
|
50
|
+
* Watches one of the current chat states. This is the same as calling `useChatState` with the id of the current chat.
|
|
51
|
+
* @param key the key of the state to watch.
|
|
52
|
+
* @returns the value of the state referred by the key.
|
|
53
|
+
*/
|
|
13
54
|
export declare function useCurrentChatState<K extends keyof ChatProperties>(key: K): ChatProperties[K];
|
|
55
|
+
/**
|
|
56
|
+
* Watches a chat state for changes in the list of messages (chat entries).
|
|
57
|
+
* @param chatId the id of the chat to watch.
|
|
58
|
+
* @returns the list of messages in the chat.
|
|
59
|
+
*/
|
|
14
60
|
export declare function useChatMessages(chatId: string): ChatEntry[];
|
|
61
|
+
/**
|
|
62
|
+
* Watches the chat state currently active for changes in the list of messages (chat entries). This is the same as calling `useChatMessages`
|
|
63
|
+
* with the id of the current chat.
|
|
64
|
+
* @returns the list of messages in the chat.
|
|
65
|
+
*/
|
|
15
66
|
export declare function useCurrentChatMessages(): ChatEntry[];
|
|
16
|
-
|
|
17
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Watches a chat message (chat entry) for changes in its composition. This allows messages to be streamed: each part of the stream will
|
|
69
|
+
* change the current value of the entry.
|
|
70
|
+
* @param entry the message to watch.
|
|
71
|
+
* @returns the current value of the message.
|
|
72
|
+
*/
|
|
73
|
+
export declare function useChatEntry(entry: ChatEntry): import("../index.js").TextChatEntry;
|
|
74
|
+
export declare function useIsLastEntryInCurrentChat(id: number): boolean;
|
|
18
75
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/context/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/context/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAKpE;;GAEG;AACH,wBAAgB,SAAS,IAAI,WAAW,CAKvC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAOhG;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,gBAAgB,EAAE,GAAG,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAG5F;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI;IAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,CAQvE;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAKjD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,SAAS,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAGtG;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,cAAc,EAAE,GAAG,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAG7F;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAQ3D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,SAAS,EAAE,CAGpD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,8BAI5C;AAWD,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,MAAM,WAYrD"}
|
package/dist/context/hooks.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { last } from 'lodash';
|
|
2
2
|
import { useContext, useEffect, useState } from 'react';
|
|
3
3
|
import { WidgetState } from '../state/WidgetState.js';
|
|
4
|
-
import { createNewChat } from '../utils/chat.js';
|
|
5
4
|
import { AIWidgetContext } from './AIWidgetProvider.js';
|
|
6
5
|
let globalWidgetState;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the closest instance of a WidgetState (React Context). If no context is available, uses a global instance of the chat widget.
|
|
8
|
+
*/
|
|
7
9
|
export function useWidget() {
|
|
8
10
|
const fromContext = useContext(AIWidgetContext);
|
|
9
11
|
if (fromContext)
|
|
@@ -11,7 +13,10 @@ export function useWidget() {
|
|
|
11
13
|
globalWidgetState ??= new WidgetState();
|
|
12
14
|
return globalWidgetState;
|
|
13
15
|
}
|
|
14
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Watches an ObservableState.
|
|
18
|
+
*/
|
|
19
|
+
export function useObservableState(state, key) {
|
|
15
20
|
const [value, setValue] = useState(state.get(key));
|
|
16
21
|
useEffect(() => {
|
|
17
22
|
setValue(state.get(key));
|
|
@@ -19,38 +24,75 @@ function useObservableState(state, key) {
|
|
|
19
24
|
}, [state]);
|
|
20
25
|
return value;
|
|
21
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Watches one of the widget states.
|
|
29
|
+
* @param key the key watch changes for.
|
|
30
|
+
* @returns the value of the state referred by the key.
|
|
31
|
+
*/
|
|
22
32
|
export function useWidgetState(key) {
|
|
23
33
|
const widget = useWidget();
|
|
24
34
|
return useObservableState(widget, key);
|
|
25
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Watches the tabs of a ChatState. The value is updated whenever a tab is added, removed or selected.
|
|
38
|
+
*/
|
|
26
39
|
export function useChatTabs() {
|
|
27
40
|
const widget = useWidget();
|
|
28
41
|
const [tabs, setTabs] = useState({
|
|
29
42
|
chats: widget.chatTabs.getAll(),
|
|
30
|
-
active: widget.chatTabs.
|
|
43
|
+
active: widget.chatTabs.getActiveChat(),
|
|
31
44
|
});
|
|
32
45
|
useEffect(() => widget.chatTabs.onChange((chats, active) => setTabs({ chats, active })), []);
|
|
33
46
|
return tabs;
|
|
34
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets a chat according to its identifier (conversation id).
|
|
50
|
+
*
|
|
51
|
+
* An error is thrown if the id doesn't correspond to any chat currently opened.
|
|
52
|
+
*
|
|
53
|
+
* @returns the chat state.
|
|
54
|
+
*/
|
|
35
55
|
export function useChat(chatId) {
|
|
36
56
|
const widget = useWidget();
|
|
37
57
|
const chat = widget.chatTabs.get(chatId);
|
|
38
58
|
if (!chat)
|
|
39
|
-
throw new Error(`No chat with id ${chatId} was found. Maybe there are no chats opened
|
|
59
|
+
throw new Error(`No chat with id ${chatId} was found. Maybe there are no chats opened.`);
|
|
40
60
|
return chat;
|
|
41
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Watches the current chat (selected in the chat tabs.)
|
|
64
|
+
*
|
|
65
|
+
* The value changes whenever a new chat is selected.
|
|
66
|
+
*
|
|
67
|
+
* @returns the currently active chat.
|
|
68
|
+
*/
|
|
42
69
|
export function useCurrentChat() {
|
|
43
|
-
|
|
44
|
-
return useChat(active);
|
|
70
|
+
return useChatTabs().active;
|
|
45
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Watches one of the chat states.
|
|
74
|
+
* @param chatId the id of chat to watch.
|
|
75
|
+
* @param key the key of the state to watch.
|
|
76
|
+
* @returns the value of the state referred by the key.
|
|
77
|
+
*/
|
|
46
78
|
export function useChatState(chatId, key) {
|
|
47
79
|
const chat = useChat(chatId);
|
|
48
80
|
return useObservableState(chat, key);
|
|
49
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Watches one of the current chat states. This is the same as calling `useChatState` with the id of the current chat.
|
|
84
|
+
* @param key the key of the state to watch.
|
|
85
|
+
* @returns the value of the state referred by the key.
|
|
86
|
+
*/
|
|
50
87
|
export function useCurrentChatState(key) {
|
|
51
88
|
const chat = useCurrentChat();
|
|
52
89
|
return useObservableState(chat, key);
|
|
53
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Watches a chat state for changes in the list of messages (chat entries).
|
|
93
|
+
* @param chatId the id of the chat to watch.
|
|
94
|
+
* @returns the list of messages in the chat.
|
|
95
|
+
*/
|
|
54
96
|
export function useChatMessages(chatId) {
|
|
55
97
|
const chat = useChat(chatId);
|
|
56
98
|
const [entries, setEntries] = useState(chat.getMessages());
|
|
@@ -60,19 +102,47 @@ export function useChatMessages(chatId) {
|
|
|
60
102
|
}, [chat]);
|
|
61
103
|
return entries;
|
|
62
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Watches the chat state currently active for changes in the list of messages (chat entries). This is the same as calling `useChatMessages`
|
|
107
|
+
* with the id of the current chat.
|
|
108
|
+
* @returns the list of messages in the chat.
|
|
109
|
+
*/
|
|
63
110
|
export function useCurrentChatMessages() {
|
|
64
111
|
const { active } = useChatTabs();
|
|
65
|
-
return useChatMessages(active);
|
|
112
|
+
return useChatMessages(active.id);
|
|
66
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Watches a chat message (chat entry) for changes in its composition. This allows messages to be streamed: each part of the stream will
|
|
116
|
+
* change the current value of the entry.
|
|
117
|
+
* @param entry the message to watch.
|
|
118
|
+
* @returns the current value of the message.
|
|
119
|
+
*/
|
|
67
120
|
export function useChatEntry(entry) {
|
|
68
121
|
const [content, setContent] = useState(entry.getValue());
|
|
69
122
|
useEffect(() => entry.onChange(setContent), []);
|
|
70
123
|
return content;
|
|
71
124
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
125
|
+
/*
|
|
126
|
+
* An efficient hook that returns true when the current chat entry is the last entry and false when it's not.
|
|
127
|
+
*
|
|
128
|
+
* For efficiency purposes, this hook assumes that:
|
|
129
|
+
* - Any change to the list of messages makes it grow.
|
|
130
|
+
* - Once a message is no longer the last, it will never be the last entry again.
|
|
131
|
+
*
|
|
132
|
+
* @param id: the id of the entry.
|
|
133
|
+
**/
|
|
134
|
+
export function useIsLastEntryInCurrentChat(id) {
|
|
135
|
+
const chat = useCurrentChat();
|
|
136
|
+
const [isLast, setLast] = useState(last(chat.getMessages())?.id === id);
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
if (!isLast)
|
|
139
|
+
return;
|
|
140
|
+
const removeListener = chat.onChangeMessages(() => {
|
|
141
|
+
setLast(false);
|
|
142
|
+
removeListener();
|
|
143
|
+
});
|
|
144
|
+
return removeListener;
|
|
145
|
+
}, [chat]);
|
|
146
|
+
return isLast;
|
|
77
147
|
}
|
|
78
148
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/context/hooks.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/context/hooks.ts"],"names":[],"mappings":"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"}
|
package/dist/features.d.ts
CHANGED
|
@@ -1,13 +1,75 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export interface ChatFeatures {
|
|
2
|
+
/**
|
|
3
|
+
* Enables stack selection.
|
|
4
|
+
*/
|
|
5
|
+
stack: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Enables workspace selection.
|
|
8
|
+
*/
|
|
9
|
+
workspace: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Enables knowledge source selection.
|
|
12
|
+
*/
|
|
13
|
+
knowledgeSource: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Enables agent selection.
|
|
16
|
+
*/
|
|
17
|
+
agent: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Enables quick commands.
|
|
20
|
+
*/
|
|
21
|
+
quickCommands: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Enables the editor.
|
|
24
|
+
*/
|
|
25
|
+
editor: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Enables chat message. Default: true
|
|
28
|
+
*/
|
|
29
|
+
messageInput: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Enables file uploads.
|
|
32
|
+
*/
|
|
33
|
+
upload: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Enables the listing of sources when writing a chat response.
|
|
36
|
+
*/
|
|
37
|
+
showSourcesInResponse: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Enables streaming in chat responses.
|
|
40
|
+
*/
|
|
41
|
+
streaming: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Enables LLM select.
|
|
44
|
+
*/
|
|
45
|
+
showLLMSelect: boolean;
|
|
8
46
|
}
|
|
9
|
-
export
|
|
10
|
-
|
|
47
|
+
export type Scope = 'favorite' | 'builtin' | 'personal' | 'shared' | 'workspace' | 'account';
|
|
48
|
+
export interface GlobalFeatures {
|
|
49
|
+
/**
|
|
50
|
+
* Enables the chat history.
|
|
51
|
+
*/
|
|
52
|
+
chatHistory: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* When selecting a resource, they're separated by scope (account, personal, workspace, etc.).
|
|
55
|
+
*
|
|
56
|
+
* If this is set, only the scopes in this list will be enabled.
|
|
57
|
+
*/
|
|
58
|
+
scopes?: Scope[];
|
|
59
|
+
/**
|
|
60
|
+
* When set, only items(knowledge sources, agents, stacks ai, quick commands) from that workspace will be shown to the user.
|
|
61
|
+
*/
|
|
62
|
+
workspaceId?: string;
|
|
63
|
+
/**
|
|
64
|
+
* when set to false it does not show tab by scope, it shows a single list.
|
|
65
|
+
*/
|
|
66
|
+
groupResourcesByScope?: boolean;
|
|
11
67
|
}
|
|
12
|
-
export
|
|
68
|
+
export type AIWidgetFeatures = ChatFeatures & GlobalFeatures;
|
|
69
|
+
/**
|
|
70
|
+
* Receives a partial feature object and returns a full feature object, setting to true any missing property.
|
|
71
|
+
* @param features the partial features object.
|
|
72
|
+
* @returns a full features object.
|
|
73
|
+
*/
|
|
74
|
+
export declare function getFeaturesWithDefaults(features?: Partial<AIWidgetFeatures>): AIWidgetFeatures;
|
|
13
75
|
//# sourceMappingURL=features.d.ts.map
|
package/dist/features.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,qBAAqB,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;MAEE;IACF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAA;AAE5F,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB;;QAEI;IACJ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,cAAc,CAAA;AAE5D;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAiB9F"}
|
package/dist/features.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Receives a partial feature object and returns a full feature object, setting to true any missing property.
|
|
3
|
+
* @param features the partial features object.
|
|
4
|
+
* @returns a full features object.
|
|
5
|
+
*/
|
|
6
|
+
export function getFeaturesWithDefaults(features) {
|
|
7
|
+
return {
|
|
8
|
+
agent: true,
|
|
9
|
+
editor: true,
|
|
10
|
+
knowledgeSource: true,
|
|
11
|
+
quickCommands: true,
|
|
12
|
+
stack: true,
|
|
13
|
+
workspace: true,
|
|
14
|
+
chatHistory: true,
|
|
15
|
+
messageInput: true,
|
|
16
|
+
upload: true,
|
|
17
|
+
streaming: true,
|
|
18
|
+
showLLMSelect: true,
|
|
19
|
+
showSourcesInResponse: true,
|
|
20
|
+
groupResourcesByScope: true,
|
|
21
|
+
...features,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
9
24
|
//# sourceMappingURL=features.js.map
|
package/dist/features.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.js","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAwEA;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAoC;IAC1E,OAAO;QACL,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,eAAe,EAAE,IAAI;QACrB,aAAa,EAAE,IAAI;QACnB,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,IAAI;QACnB,qBAAqB,EAAE,IAAI;QAC3B,qBAAqB,EAAE,IAAI;QAC3B,GAAG,QAAQ;KACZ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midnight-update-view.d.ts","sourceRoot":"","sources":["../../src/hooks/midnight-update-view.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,wBAAgB,qBAAqB,SAmBpC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useManualRender } from '@stack-spot/portal-components';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the number of milliseconds remaining until the next midnight.
|
|
5
|
+
*/
|
|
6
|
+
function getTimeUntilMidnight() {
|
|
7
|
+
const now = new Date();
|
|
8
|
+
const midnight = new Date(now);
|
|
9
|
+
midnight.setHours(24, 0, 0, 0);
|
|
10
|
+
return midnight.getTime() - now.getTime();
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Hook that triggers a component re-render at midnight every day.
|
|
14
|
+
*/
|
|
15
|
+
export function useMidnightUpdateView() {
|
|
16
|
+
const { repaint } = useManualRender();
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
let timer;
|
|
19
|
+
const scheduleUpdate = () => {
|
|
20
|
+
const timeUntilMidnight = getTimeUntilMidnight();
|
|
21
|
+
timer = setTimeout(() => {
|
|
22
|
+
repaint();
|
|
23
|
+
scheduleUpdate();
|
|
24
|
+
}, timeUntilMidnight);
|
|
25
|
+
};
|
|
26
|
+
scheduleUpdate();
|
|
27
|
+
return () => { timer && clearTimeout(timer); };
|
|
28
|
+
}, []);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=midnight-update-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midnight-update-view.js","sourceRoot":"","sources":["../../src/hooks/midnight-update-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC;;GAEG;AACH,SAAS,oBAAoB;IAC3B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;IACtB,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAA;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9B,OAAO,QAAQ,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAAA;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,EAAE,CAAA;IAErC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAgD,CAAA;QAEpD,MAAM,cAAc,GAAG,GAAG,EAAE;YAC1B,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAA;YAEhD,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBACtB,OAAO,EAAE,CAAA;gBACT,cAAc,EAAE,CAAA;YAClB,CAAC,EAAE,iBAAiB,CAAC,CAAA;QACvB,CAAC,CAAA;QAED,cAAc,EAAE,CAAA;QAEhB,OAAO,GAAG,EAAE,GAAG,KAAK,IAAI,YAAY,CAAC,KAAK,CAAC,CAAA,CAAC,CAAC,CAAA;IAC/C,CAAC,EAAE,EAAE,CAAC,CAAA;AACR,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
export { createEntryValueFromChatResponse, helperSendMessage } from './chat-interceptors/send-message.js';
|
|
2
|
+
export { QuickStartButton } from './components/QuickStartButton.js';
|
|
1
3
|
export { AIWidgetProvider } from './context/AIWidgetProvider.js';
|
|
2
4
|
export * from './context/hooks.js';
|
|
5
|
+
export { getFeaturesWithDefaults } from './features.js';
|
|
6
|
+
export type { AIWidgetFeatures, ChatFeatures } from './features.js';
|
|
3
7
|
export { StackspotAIWidget } from './StackspotAIWidget.js';
|
|
4
8
|
export { ChatEntry } from './state/ChatEntry.js';
|
|
9
|
+
export type { ChatAction, TextChatEntry } from './state/ChatEntry.js';
|
|
5
10
|
export { ChatState } from './state/ChatState.js';
|
|
11
|
+
export type { MessageInterceptor } from './state/ChatState.js';
|
|
6
12
|
export { ChatTabsController } from './state/ChatTabsController.js';
|
|
13
|
+
export { acceptedFileTypes } from './state/constants.js';
|
|
7
14
|
export { ObservableState } from './state/ObservableState.js';
|
|
15
|
+
export type { Labeled, LabeledAgent, LabeledWithImage } from './state/types.js';
|
|
8
16
|
export { WidgetState } from './state/WidgetState.js';
|
|
17
|
+
export type { ButtonAction } from './types.js';
|
|
18
|
+
export { defaultLanguage, languages } from './utils/programming-languages.js';
|
|
19
|
+
export type { CustomRenderResult } from './views/Chat/ChatMessage.js';
|
|
20
|
+
export { loadChat } from './views/ChatHistory/utils.js';
|
|
9
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACpD,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
/* Attention: in order for the package "page" to work without linking the lib, we must export types separately, using the "type" keyword */
|
|
2
|
+
export { createEntryValueFromChatResponse, helperSendMessage } from './chat-interceptors/send-message.js';
|
|
3
|
+
export { QuickStartButton } from './components/QuickStartButton.js';
|
|
1
4
|
export { AIWidgetProvider } from './context/AIWidgetProvider.js';
|
|
2
5
|
export * from './context/hooks.js';
|
|
6
|
+
export { getFeaturesWithDefaults } from './features.js';
|
|
3
7
|
export { StackspotAIWidget } from './StackspotAIWidget.js';
|
|
4
8
|
export { ChatEntry } from './state/ChatEntry.js';
|
|
5
9
|
export { ChatState } from './state/ChatState.js';
|
|
6
10
|
export { ChatTabsController } from './state/ChatTabsController.js';
|
|
11
|
+
export { acceptedFileTypes } from './state/constants.js';
|
|
7
12
|
export { ObservableState } from './state/ObservableState.js';
|
|
8
13
|
export { WidgetState } from './state/WidgetState.js';
|
|
14
|
+
export { defaultLanguage, languages } from './utils/programming-languages.js';
|
|
15
|
+
export { loadChat } from './views/ChatHistory/utils.js';
|
|
9
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2IAA2I;AAG3I,OAAO,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA"}
|