@stack-spot/ai-chat-widget 1.38.2-beta.1 → 2.0.0-beta.1
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 +33 -32
- package/dist/StackspotAIWidget.d.ts +14 -2
- package/dist/StackspotAIWidget.d.ts.map +1 -1
- package/dist/StackspotAIWidget.js +7 -8
- package/dist/StackspotAIWidget.js.map +1 -1
- package/dist/app-metadata.json +13 -5
- package/dist/chat-interceptors/quick-commands.js +3 -3
- package/dist/chat-interceptors/quick-commands.js.map +1 -1
- package/dist/components/AdaptiveTextArea.d.ts +1 -1
- package/dist/components/AdaptiveTextArea.d.ts.map +1 -1
- package/dist/components/AdaptiveTextArea.js +1 -1
- package/dist/components/AdaptiveTextArea.js.map +1 -1
- package/dist/components/AgentCard/AgentCardCreate.d.ts.map +1 -1
- package/dist/components/AgentCard/AgentCardCreate.js +4 -5
- package/dist/components/AgentCard/AgentCardCreate.js.map +1 -1
- package/dist/components/AgentCard/index.d.ts.map +1 -1
- package/dist/components/AgentCard/index.js +5 -6
- package/dist/components/AgentCard/index.js.map +1 -1
- package/dist/components/ButtonFavorite.d.ts +8 -7
- package/dist/components/ButtonFavorite.d.ts.map +1 -1
- package/dist/components/ButtonFavorite.js +5 -14
- package/dist/components/ButtonFavorite.js.map +1 -1
- package/dist/components/Code.d.ts.map +1 -1
- package/dist/components/Code.js +11 -9
- package/dist/components/Code.js.map +1 -1
- package/dist/components/ComponentNavigator.d.ts.map +1 -1
- package/dist/components/ComponentNavigator.js +2 -4
- package/dist/components/ComponentNavigator.js.map +1 -1
- package/dist/components/FadingOverflow.d.ts.map +1 -1
- package/dist/components/FadingOverflow.js +3 -4
- package/dist/components/FadingOverflow.js.map +1 -1
- package/dist/components/FileDescription.d.ts.map +1 -1
- package/dist/components/FileDescription.js +3 -4
- package/dist/components/FileDescription.js.map +1 -1
- package/dist/components/HistoryList.d.ts.map +1 -1
- package/dist/components/HistoryList.js +3 -1
- package/dist/components/HistoryList.js.map +1 -1
- package/dist/components/ListResource.js +3 -3
- package/dist/components/ListResource.js.map +1 -1
- package/dist/components/Markdown.js +1 -1
- package/dist/components/Markdown.js.map +1 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Modal.js +2 -4
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/QuickStartButton.d.ts +2 -3
- package/dist/components/QuickStartButton.d.ts.map +1 -1
- package/dist/components/QuickStartButton.js +4 -3
- package/dist/components/QuickStartButton.js.map +1 -1
- package/dist/components/RightPanelForm.d.ts.map +1 -1
- package/dist/components/RightPanelForm.js +20 -13
- package/dist/components/RightPanelForm.js.map +1 -1
- package/dist/components/RightPanelTabs.d.ts +1 -4
- package/dist/components/RightPanelTabs.d.ts.map +1 -1
- package/dist/components/RightPanelTabs.js +4 -16
- package/dist/components/RightPanelTabs.js.map +1 -1
- package/dist/components/Selector/index.d.ts.map +1 -1
- package/dist/components/Selector/index.js +5 -8
- package/dist/components/Selector/index.js.map +1 -1
- package/dist/components/Selector/styled.d.ts.map +1 -1
- package/dist/components/Selector/styled.js +8 -5
- package/dist/components/Selector/styled.js.map +1 -1
- package/dist/components/StackedBadge.js +5 -5
- package/dist/components/StackedBadge.js.map +1 -1
- package/dist/components/TabManager.d.ts.map +1 -1
- package/dist/components/TabManager.js +9 -32
- package/dist/components/TabManager.js.map +1 -1
- package/dist/components/ToolBadge.d.ts +3 -8
- package/dist/components/ToolBadge.d.ts.map +1 -1
- package/dist/components/ToolBadge.js +23 -99
- package/dist/components/ToolBadge.js.map +1 -1
- package/dist/components/WorkspaceTabNavigator.d.ts.map +1 -1
- package/dist/components/WorkspaceTabNavigator.js +7 -9
- package/dist/components/WorkspaceTabNavigator.js.map +1 -1
- package/dist/components/form/DescribedCheckboxGroup.d.ts +24 -2
- package/dist/components/form/DescribedCheckboxGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedCheckboxGroup.js +46 -29
- package/dist/components/form/DescribedCheckboxGroup.js.map +1 -1
- package/dist/components/form/DescribedRadioGroup.d.ts +24 -4
- package/dist/components/form/DescribedRadioGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedRadioGroup.js +39 -18
- package/dist/components/form/DescribedRadioGroup.js.map +1 -1
- package/dist/context/hooks.d.ts +6 -1
- package/dist/context/hooks.d.ts.map +1 -1
- package/dist/context/hooks.js +4 -1
- package/dist/context/hooks.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 +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout.css +0 -26
- package/dist/right-panel/DefaultPanel.d.ts.map +1 -1
- package/dist/right-panel/DefaultPanel.js +2 -4
- package/dist/right-panel/DefaultPanel.js.map +1 -1
- package/dist/state/ChatEntry.d.ts +3 -4
- package/dist/state/ChatEntry.d.ts.map +1 -1
- package/dist/state/ChatEntry.js.map +1 -1
- package/dist/state/constants.d.ts.map +1 -1
- package/dist/state/constants.js +1 -0
- package/dist/state/constants.js.map +1 -1
- package/dist/types.d.ts +8 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/tools.d.ts +9 -3
- package/dist/utils/tools.d.ts.map +1 -1
- package/dist/utils/tools.js +1 -6
- package/dist/utils/tools.js.map +1 -1
- package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
- package/dist/views/Agents/AgentDescription.js +8 -13
- package/dist/views/Agents/AgentDescription.js.map +1 -1
- package/dist/views/Agents/AgentsPanel.d.ts.map +1 -1
- package/dist/views/Agents/AgentsPanel.js +7 -7
- package/dist/views/Agents/AgentsPanel.js.map +1 -1
- package/dist/views/Agents/AgentsTab.d.ts.map +1 -1
- package/dist/views/Agents/AgentsTab.js +30 -29
- package/dist/views/Agents/AgentsTab.js.map +1 -1
- package/dist/views/Agents/dictionary.d.ts +1 -1
- package/dist/views/Agents/useAgentFavorites.js +3 -3
- package/dist/views/Agents/useAgentFavorites.js.map +1 -1
- package/dist/views/Chat/AgentInfo.d.ts.map +1 -1
- package/dist/views/Chat/AgentInfo.js +3 -5
- package/dist/views/Chat/AgentInfo.js.map +1 -1
- package/dist/views/Chat/ChatMessage.d.ts +24 -2
- package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessage.js +36 -47
- package/dist/views/Chat/ChatMessage.js.map +1 -1
- package/dist/views/Chat/ChatMessages.d.ts +1 -1
- package/dist/views/Chat/ChatMessages.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessages.js +2 -2
- package/dist/views/Chat/ChatMessages.js.map +1 -1
- package/dist/views/Chat/StepsList.d.ts.map +1 -1
- package/dist/views/Chat/StepsList.js +10 -10
- package/dist/views/Chat/StepsList.js.map +1 -1
- package/dist/views/Chat/index.d.ts +1 -1
- package/dist/views/Chat/index.d.ts.map +1 -1
- package/dist/views/Chat/index.js +2 -2
- package/dist/views/Chat/index.js.map +1 -1
- package/dist/views/Chat/styled.d.ts.map +1 -1
- package/dist/views/Chat/styled.js +11 -16
- package/dist/views/Chat/styled.js.map +1 -1
- package/dist/views/ChatHistory/HistoryItem.d.ts.map +1 -1
- package/dist/views/ChatHistory/HistoryItem.js +10 -48
- package/dist/views/ChatHistory/HistoryItem.js.map +1 -1
- package/dist/views/ChatHistory/index.js +1 -1
- 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 +7 -0
- package/dist/views/ChatHistory/utils.d.ts.map +1 -1
- package/dist/views/ChatHistory/utils.js +40 -1
- package/dist/views/ChatHistory/utils.js.map +1 -1
- package/dist/views/ChatTabSelection.d.ts +6 -1
- package/dist/views/ChatTabSelection.d.ts.map +1 -1
- package/dist/views/ChatTabSelection.js +13 -8
- package/dist/views/ChatTabSelection.js.map +1 -1
- package/dist/views/Editor.d.ts.map +1 -1
- package/dist/views/Editor.js +6 -12
- package/dist/views/Editor.js.map +1 -1
- package/dist/views/Home/BuiltInAgent.d.ts.map +1 -1
- package/dist/views/Home/BuiltInAgent.js +2 -3
- package/dist/views/Home/BuiltInAgent.js.map +1 -1
- package/dist/views/Home/CustomAgent.js +3 -3
- package/dist/views/Home/CustomAgent.js.map +1 -1
- package/dist/views/Home/index.js +2 -2
- package/dist/views/Home/index.js.map +1 -1
- package/dist/views/Home/styled.d.ts.map +1 -1
- package/dist/views/Home/styled.js +21 -22
- package/dist/views/Home/styled.js.map +1 -1
- package/dist/views/KSDocument.d.ts.map +1 -1
- package/dist/views/KSDocument.js +3 -4
- package/dist/views/KSDocument.js.map +1 -1
- package/dist/views/KnowledgeSources.d.ts.map +1 -1
- package/dist/views/KnowledgeSources.js +14 -36
- package/dist/views/KnowledgeSources.js.map +1 -1
- package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
- package/dist/views/MessageInput/AgentSelector.js +7 -5
- package/dist/views/MessageInput/AgentSelector.js.map +1 -1
- package/dist/views/MessageInput/ButtonAgent.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonAgent.js +4 -5
- package/dist/views/MessageInput/ButtonAgent.js.map +1 -1
- package/dist/views/MessageInput/ButtonBar.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonBar.js +2 -4
- package/dist/views/MessageInput/ButtonBar.js.map +1 -1
- package/dist/views/MessageInput/ContextBar.d.ts.map +1 -1
- package/dist/views/MessageInput/ContextBar.js +3 -6
- package/dist/views/MessageInput/ContextBar.js.map +1 -1
- package/dist/views/MessageInput/QuickCommandSelector.js +2 -2
- package/dist/views/MessageInput/QuickCommandSelector.js.map +1 -1
- package/dist/views/MessageInput/SelectContent.d.ts.map +1 -1
- package/dist/views/MessageInput/SelectContent.js +30 -29
- package/dist/views/MessageInput/SelectContent.js.map +1 -1
- package/dist/views/MessageInput/UploadDragNDrop.d.ts.map +1 -1
- package/dist/views/MessageInput/UploadDragNDrop.js +2 -3
- package/dist/views/MessageInput/UploadDragNDrop.js.map +1 -1
- package/dist/views/MessageInput/dictionary.d.ts +1 -1
- package/dist/views/MessageInput/index.d.ts +2 -1
- package/dist/views/MessageInput/index.d.ts.map +1 -1
- package/dist/views/MessageInput/index.js +5 -6
- package/dist/views/MessageInput/index.js.map +1 -1
- package/dist/views/MessageInput/styled.d.ts +1 -3
- package/dist/views/MessageInput/styled.d.ts.map +1 -1
- package/dist/views/MessageInput/styled.js +11 -15
- package/dist/views/MessageInput/styled.js.map +1 -1
- package/dist/views/MinimizedHeader.d.ts.map +1 -1
- package/dist/views/MinimizedHeader.js +3 -4
- package/dist/views/MinimizedHeader.js.map +1 -1
- package/dist/views/Resources.d.ts.map +1 -1
- package/dist/views/Resources.js +11 -8
- package/dist/views/Resources.js.map +1 -1
- package/dist/views/Stacks.d.ts.map +1 -1
- package/dist/views/Stacks.js +23 -28
- package/dist/views/Stacks.js.map +1 -1
- package/dist/views/Steps/FlowChart/NodeStep.d.ts.map +1 -1
- package/dist/views/Steps/FlowChart/NodeStep.js +3 -3
- package/dist/views/Steps/FlowChart/NodeStep.js.map +1 -1
- package/dist/views/Steps/StepModal.d.ts.map +1 -1
- package/dist/views/Steps/StepModal.js +4 -6
- package/dist/views/Steps/StepModal.js.map +1 -1
- package/dist/views/Steps/dictionary.d.ts +1 -1
- package/dist/views/Steps/index.d.ts.map +1 -1
- package/dist/views/Steps/index.js +3 -4
- package/dist/views/Steps/index.js.map +1 -1
- package/dist/views/Steps/utils.d.ts +2 -1
- package/dist/views/Steps/utils.d.ts.map +1 -1
- package/dist/views/Steps/utils.js +8 -8
- package/dist/views/Steps/utils.js.map +1 -1
- package/dist/views/Tools.js +1 -1
- package/dist/views/Tools.js.map +1 -1
- package/dist/views/Workspaces/WorkspacesTab.d.ts.map +1 -1
- package/dist/views/Workspaces/WorkspacesTab.js +7 -10
- package/dist/views/Workspaces/WorkspacesTab.js.map +1 -1
- package/dist/views/Workspaces/index.js +4 -2
- package/dist/views/Workspaces/index.js.map +1 -1
- package/package.json +5 -3
- package/src/StackspotAIWidget.tsx +51 -37
- package/src/app-metadata.json +13 -5
- package/src/chat-interceptors/quick-commands.ts +3 -3
- package/src/components/AdaptiveTextArea.tsx +1 -1
- package/src/components/AgentCard/AgentCardCreate.tsx +4 -7
- package/src/components/AgentCard/index.tsx +7 -7
- package/src/components/ButtonFavorite.tsx +20 -47
- package/src/components/Code.tsx +31 -36
- package/src/components/ComponentNavigator.tsx +4 -8
- package/src/components/FadingOverflow.tsx +6 -7
- package/src/components/FileDescription.tsx +14 -10
- package/src/components/HistoryList.tsx +4 -1
- package/src/components/ListResource.tsx +5 -5
- package/src/components/Markdown.tsx +1 -1
- package/src/components/Modal.tsx +2 -4
- package/src/components/QuickStartButton.tsx +5 -4
- package/src/components/RightPanelForm.tsx +20 -13
- package/src/components/RightPanelTabs.tsx +4 -32
- package/src/components/Selector/index.tsx +17 -13
- package/src/components/Selector/styled.ts +8 -5
- package/src/components/StackedBadge.tsx +5 -5
- package/src/components/TabManager.tsx +31 -55
- package/src/components/ToolBadge.tsx +48 -129
- package/src/components/WorkspaceTabNavigator.tsx +22 -25
- package/src/components/form/DescribedCheckboxGroup.tsx +90 -65
- package/src/components/form/DescribedRadioGroup.tsx +78 -46
- package/src/context/hooks.ts +4 -1
- package/src/hooks/midnight-update-view.ts +36 -0
- package/src/index.ts +4 -2
- package/src/layout.css +0 -26
- package/src/right-panel/DefaultPanel.tsx +3 -7
- package/src/state/ChatEntry.ts +3 -4
- package/src/state/constants.ts +2 -1
- package/src/types.ts +9 -3
- package/src/utils/tools.ts +3 -12
- package/src/views/Agents/AgentDescription.tsx +20 -36
- package/src/views/Agents/AgentsPanel.tsx +11 -12
- package/src/views/Agents/AgentsTab.tsx +38 -57
- package/src/views/Agents/useAgentFavorites.ts +3 -3
- package/src/views/Chat/AgentInfo.tsx +7 -6
- package/src/views/Chat/ChatMessage.tsx +163 -145
- package/src/views/Chat/ChatMessages.tsx +2 -1
- package/src/views/Chat/StepsList.tsx +10 -11
- package/src/views/Chat/index.tsx +9 -2
- package/src/views/Chat/styled.ts +11 -16
- package/src/views/ChatHistory/HistoryItem.tsx +15 -54
- package/src/views/ChatHistory/index.tsx +1 -1
- package/src/views/ChatHistory/styled.ts +3 -5
- package/src/views/ChatHistory/utils.ts +43 -2
- package/src/views/ChatTabSelection.tsx +18 -10
- package/src/views/Editor.tsx +9 -14
- package/src/views/Home/BuiltInAgent.tsx +7 -8
- package/src/views/Home/CustomAgent.tsx +3 -3
- package/src/views/Home/index.tsx +2 -2
- package/src/views/Home/styled.ts +21 -22
- package/src/views/KSDocument.tsx +7 -8
- package/src/views/KnowledgeSources.tsx +24 -66
- package/src/views/MessageInput/AgentSelector.tsx +10 -8
- package/src/views/MessageInput/ButtonAgent.tsx +24 -12
- package/src/views/MessageInput/ButtonBar.tsx +25 -21
- package/src/views/MessageInput/ContextBar.tsx +16 -14
- package/src/views/MessageInput/QuickCommandSelector.tsx +2 -2
- package/src/views/MessageInput/SelectContent.tsx +39 -62
- package/src/views/MessageInput/UploadDragNDrop.tsx +2 -5
- package/src/views/MessageInput/index.tsx +8 -9
- package/src/views/MessageInput/styled.ts +12 -16
- package/src/views/MinimizedHeader.tsx +5 -7
- package/src/views/Resources.tsx +31 -30
- package/src/views/Stacks.tsx +31 -54
- package/src/views/Steps/FlowChart/NodeStep.tsx +6 -4
- package/src/views/Steps/StepModal.tsx +14 -18
- package/src/views/Steps/index.tsx +4 -5
- package/src/views/Steps/utils.tsx +9 -9
- package/src/views/Tools.tsx +0 -1
- package/src/views/Workspaces/WorkspacesTab.tsx +17 -21
- package/src/views/Workspaces/index.tsx +4 -2
- package/dist/components/Accordion.d.ts +0 -20
- package/dist/components/Accordion.d.ts.map +0 -1
- package/dist/components/Accordion.js +0 -51
- package/dist/components/Accordion.js.map +0 -1
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts +0 -33
- package/dist/components/FallbackBoundary/ErrorBoundary.d.ts.map +0 -1
- package/dist/components/FallbackBoundary/ErrorBoundary.js +0 -52
- 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 -17
- 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 -10
- package/dist/components/IconInput.d.ts.map +0 -1
- package/dist/components/IconInput.js +0 -61
- package/dist/components/IconInput.js.map +0 -1
- package/dist/components/OverlayMenu.d.ts +0 -21
- package/dist/components/OverlayMenu.d.ts.map +0 -1
- package/dist/components/OverlayMenu.js +0 -79
- package/dist/components/OverlayMenu.js.map +0 -1
- package/dist/components/ProgressBar.d.ts +0 -37
- package/dist/components/ProgressBar.d.ts.map +0 -1
- package/dist/components/ProgressBar.js +0 -131
- package/dist/components/ProgressBar.js.map +0 -1
- package/dist/components/Tooltip/Tooltip.d.ts +0 -37
- package/dist/components/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/components/Tooltip/Tooltip.js +0 -30
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/Tooltip/TooltipAPI.d.ts +0 -29
- package/dist/components/Tooltip/TooltipAPI.d.ts.map +0 -1
- package/dist/components/Tooltip/TooltipAPI.js +0 -107
- 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 -27
- package/dist/components/Tooltip/types.d.ts.map +0 -1
- package/dist/components/Tooltip/types.js +0 -2
- package/dist/components/Tooltip/types.js.map +0 -1
- package/src/components/Accordion.tsx +0 -75
- package/src/components/FallbackBoundary/ErrorBoundary.tsx +0 -71
- package/src/components/FallbackBoundary/Loading.tsx +0 -14
- package/src/components/FallbackBoundary/index.tsx +0 -26
- package/src/components/IconInput.tsx +0 -73
- package/src/components/OverlayMenu.tsx +0 -133
- package/src/components/ProgressBar.tsx +0 -183
- package/src/components/Tooltip/Tooltip.tsx +0 -78
- package/src/components/Tooltip/TooltipAPI.ts +0 -101
- 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 -28
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IconButton } from '@citric/ui'
|
|
2
1
|
import { theme } from '@stack-spot/portal-theme'
|
|
3
2
|
import { styled } from 'styled-components'
|
|
4
3
|
|
|
@@ -51,7 +50,7 @@ export const SelectionBarWrapper = styled.div`
|
|
|
51
50
|
}
|
|
52
51
|
`
|
|
53
52
|
|
|
54
|
-
export const MessageInputBox = styled.div
|
|
53
|
+
export const MessageInputBox = styled.div`
|
|
55
54
|
display: flex;
|
|
56
55
|
flex-direction: column;
|
|
57
56
|
|
|
@@ -127,7 +126,7 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
|
|
|
127
126
|
line-height: 0.75rem;
|
|
128
127
|
white-space: nowrap;
|
|
129
128
|
|
|
130
|
-
${IconButton} {
|
|
129
|
+
/* $ {IconButton} {
|
|
131
130
|
padding: 4px 0;
|
|
132
131
|
background: none;
|
|
133
132
|
border: none;
|
|
@@ -138,7 +137,7 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
|
|
|
138
137
|
width: auto;
|
|
139
138
|
height: 12px;
|
|
140
139
|
}
|
|
141
|
-
}
|
|
140
|
+
} */
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
|
|
@@ -175,18 +174,15 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
|
|
|
175
174
|
background-color: ${theme.color.light[300]};
|
|
176
175
|
padding: 10px 8px;
|
|
177
176
|
transition: border-color 0.3s, background-color 0.3s;
|
|
178
|
-
|
|
179
|
-
&.focused {
|
|
180
|
-
border: 2px solid ${theme.color.light[300]};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
&.disabled {
|
|
185
|
-
background-color: ${theme.color.light[300]};
|
|
186
|
-
}
|
|
187
177
|
}
|
|
188
178
|
}
|
|
189
179
|
|
|
180
|
+
[data-citric="progress-bar"] {
|
|
181
|
+
background-color: ${theme.color.light[500]};
|
|
182
|
+
border: 0;
|
|
183
|
+
padding: 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
190
186
|
.button-group {
|
|
191
187
|
display: flex;
|
|
192
188
|
flex-direction: row;
|
|
@@ -239,10 +235,10 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
|
|
|
239
235
|
}
|
|
240
236
|
}
|
|
241
237
|
|
|
242
|
-
${IconButton} {
|
|
238
|
+
/* $ {IconButton} {
|
|
243
239
|
width: 24px;
|
|
244
240
|
height: 24px;
|
|
245
|
-
}
|
|
241
|
+
} */
|
|
246
242
|
|
|
247
243
|
.group-agent {
|
|
248
244
|
display: flex;
|
|
@@ -302,7 +298,7 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
|
|
|
302
298
|
transition: height 0.3s;
|
|
303
299
|
background-color: transparent;
|
|
304
300
|
&:focus {
|
|
305
|
-
box-shadow: none;
|
|
301
|
+
box-shadow: none !important;
|
|
306
302
|
}
|
|
307
303
|
}
|
|
308
304
|
`
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Text } from '@citric
|
|
2
|
-
import { ChevronDown, Times } from '@citric/icons'
|
|
3
|
-
import { IconButton } from '@citric/ui'
|
|
1
|
+
import { IconButton, Text } from '@stack-spot/citric-react'
|
|
4
2
|
import { listToClass } from '@stack-spot/portal-theme'
|
|
5
3
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
6
4
|
import { useCallback, useRef, useState } from 'react'
|
|
@@ -24,6 +22,7 @@ const Header = styled.header`
|
|
|
24
22
|
white-space: nowrap;
|
|
25
23
|
max-width: calc(100% - 78px); // size of the button-group + gap
|
|
26
24
|
height: 15px; // fixes weird problem where the text has 14px instead of 15px of height
|
|
25
|
+
line-height: 1;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
.button-group {
|
|
@@ -69,14 +68,13 @@ export const MinimizedHeader = ({ onClose, onCollapse, onExpand }: MinimizedActi
|
|
|
69
68
|
<FadingOverflow className="title"><Text title={label}>{label}</Text></FadingOverflow>
|
|
70
69
|
{showButtons && <div className="button-group">
|
|
71
70
|
{(onExpand || onCollapse) && <IconButton
|
|
71
|
+
icon="ChevronDown"
|
|
72
72
|
title={collapsed ? t.expand : t.collapse}
|
|
73
73
|
aria-label={collapsed ? t.expand : t.collapse}
|
|
74
74
|
className={listToClass(['collapse', collapsed && 'collapsed'])}
|
|
75
75
|
onClick={toggleCollapsed}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
</IconButton>}
|
|
79
|
-
{onClose && <IconButton title={t.close} aria-label={t.close} onClick={onClose}><Times /></IconButton>}
|
|
76
|
+
/>}
|
|
77
|
+
{onClose && <IconButton icon="Times" title={t.close} aria-label={t.close} onClick={onClose} />}
|
|
80
78
|
</div>}
|
|
81
79
|
</Header>
|
|
82
80
|
)
|
package/src/views/Resources.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Agent } from '@citric/icons'
|
|
3
|
-
import { Avatar } from '@citric/ui'
|
|
1
|
+
import { Accordion, Icon, ImageBox, ImageWithFallback, Row, Text } from '@stack-spot/citric-react'
|
|
4
2
|
import { agentToolsClient } from '@stack-spot/portal-network'
|
|
3
|
+
import { theme } from '@stack-spot/portal-theme'
|
|
5
4
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
6
5
|
import { useEffect, useMemo } from 'react'
|
|
7
|
-
import {
|
|
6
|
+
import { styled } from 'styled-components'
|
|
8
7
|
import { useWidget, useWidgetState } from '../context/hooks'
|
|
9
8
|
import { useRightPanel } from '../right-panel/hooks'
|
|
10
9
|
import { toolById } from '../utils/tools'
|
|
@@ -27,6 +26,12 @@ export const Resources = () => {
|
|
|
27
26
|
return null
|
|
28
27
|
}
|
|
29
28
|
|
|
29
|
+
const StyledAccordion = styled(Accordion)`
|
|
30
|
+
&[data-citric="accordion"] {
|
|
31
|
+
background-color: ${theme.color.light[400]};
|
|
32
|
+
}
|
|
33
|
+
`
|
|
34
|
+
|
|
30
35
|
const ResourcesPanel = () => {
|
|
31
36
|
const { chatId, messageId } = useWidgetState('currentMessageInPanel') ?? {}
|
|
32
37
|
const widget = useWidget()
|
|
@@ -46,13 +51,12 @@ const ResourcesPanel = () => {
|
|
|
46
51
|
const hasAgentTool = useMemo(() => message?.tools?.some(id => agentsTools?.find((agent) => agent.id === id)), [messageId, toolKits])
|
|
47
52
|
|
|
48
53
|
const header = (image?: string, label?: string) => (
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
</
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</Flex>
|
|
54
|
+
<Row gap="10px">
|
|
55
|
+
<ImageBox>
|
|
56
|
+
<ImageWithFallback src={image} fallback={<Icon icon="Agent" />} aria-label={label} title={label} />
|
|
57
|
+
</ImageBox>
|
|
58
|
+
<Text>{label}</Text>
|
|
59
|
+
</Row>
|
|
56
60
|
)
|
|
57
61
|
|
|
58
62
|
return !!(tools?.length || customTools?.length) && (
|
|
@@ -61,28 +65,25 @@ const ResourcesPanel = () => {
|
|
|
61
65
|
{[...(tools || []), ...(customTools || [])].map(
|
|
62
66
|
(tool) =>
|
|
63
67
|
tool && (
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</Box>
|
|
69
|
-
</Accordion>
|
|
70
|
-
</Box>))}
|
|
68
|
+
<StyledAccordion key={tool.id} header={header(tool?.image, tool?.name)} appearance="card">
|
|
69
|
+
{tool?.description}
|
|
70
|
+
</StyledAccordion>
|
|
71
|
+
))}
|
|
71
72
|
</>
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<
|
|
73
|
+
{
|
|
74
|
+
hasAgentTool &&
|
|
75
|
+
<>
|
|
76
|
+
{message?.tools?.map((id) => {
|
|
77
|
+
const agentTool = agentsTools?.find((agent) => agent.id === id)
|
|
78
|
+
return (
|
|
79
|
+
<StyledAccordion key={id} header={header(agentTool?.avatar || undefined, agentTool?.name)}>
|
|
79
80
|
<AgentDescription agentId={id} />
|
|
80
|
-
</
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
</StyledAccordion>
|
|
82
|
+
)},
|
|
83
|
+
)}
|
|
84
|
+
</>
|
|
85
|
+
}
|
|
84
86
|
</>
|
|
85
|
-
|
|
86
87
|
)
|
|
87
88
|
}
|
|
88
89
|
|
package/src/views/Stacks.tsx
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { Button } from '@citric
|
|
2
|
-
import { Search } from '@citric/icons'
|
|
1
|
+
import { Button, Tab } from '@stack-spot/citric-react'
|
|
3
2
|
import { Placeholder } from '@stack-spot/portal-components/Placeholder'
|
|
4
3
|
import { aiClient, workspaceAiClient } from '@stack-spot/portal-network'
|
|
5
|
-
import {
|
|
4
|
+
import { VisibilityLevelEnum } from '@stack-spot/portal-network/api/ai'
|
|
6
5
|
import { WorkspaceResponse } from '@stack-spot/portal-network/api/workspace-ai'
|
|
7
6
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
8
|
-
import {
|
|
9
|
-
import { ButtonFavorite } from '../components/ButtonFavorite'
|
|
7
|
+
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
10
8
|
import { NavigationComponent } from '../components/ComponentNavigator'
|
|
11
9
|
import { DescribedRadioGroup } from '../components/form/DescribedRadioGroup'
|
|
12
|
-
import { IconInput } from '../components/IconInput'
|
|
13
10
|
import { RightPanelContentList } from '../components/RightPanelContentList'
|
|
14
11
|
import { RightPanelTabs } from '../components/RightPanelTabs'
|
|
15
12
|
import { WorkspaceTabNavigator } from '../components/WorkspaceTabNavigator'
|
|
@@ -19,8 +16,6 @@ import { useRightPanel } from '../right-panel/hooks'
|
|
|
19
16
|
import { ChatProperties } from '../state/ChatState'
|
|
20
17
|
import { checkIsTrial } from '../utils/check-is-trial'
|
|
21
18
|
|
|
22
|
-
type TabElement = { title: string, content: ReactElement }
|
|
23
|
-
|
|
24
19
|
/**
|
|
25
20
|
* Renders the Stack selection form in the Right Panel if this is the panel that is currently opened.
|
|
26
21
|
*/
|
|
@@ -54,12 +49,12 @@ const StacksPanel = () => {
|
|
|
54
49
|
stack.current = chat.get('stack')
|
|
55
50
|
}, [chat])
|
|
56
51
|
|
|
57
|
-
const allTabsMap: Partial<Record<Scope,
|
|
58
|
-
favorite: {
|
|
59
|
-
personal: {
|
|
60
|
-
shared: {
|
|
61
|
-
workspace: {
|
|
62
|
-
account: {
|
|
52
|
+
const allTabsMap: Partial<Record<Scope, Omit<Tab, 'key'>>> = {
|
|
53
|
+
favorite: { label: t.favorites, content: <StacksTab key="favorites" visibility="favorite" stack={stack} /> },
|
|
54
|
+
personal: { label: t.personal, content: <StacksTab key="personal" visibility="personal" stack={stack} /> },
|
|
55
|
+
shared: { label: t.shared, content: <StacksTab key="shared" visibility="shared" stack={stack} /> },
|
|
56
|
+
workspace: { label: t.spots, content: <StacksTabWorkspace key="workspace" visibility="workspace" stack={stack} /> },
|
|
57
|
+
account: { label: t.account, content: <StacksTab key="account" visibility="account" stack={stack} /> },
|
|
63
58
|
}
|
|
64
59
|
const defaultScopes: Scope[] = ['favorite', 'personal', 'shared', 'workspace', 'account']
|
|
65
60
|
|
|
@@ -70,8 +65,8 @@ const StacksPanel = () => {
|
|
|
70
65
|
: rawScopes
|
|
71
66
|
|
|
72
67
|
const tabs = scopesToRender
|
|
73
|
-
.map(scope => allTabsMap[scope])
|
|
74
|
-
.filter(Boolean) as
|
|
68
|
+
.map(scope => scope in allTabsMap ? { key: scope, ...allTabsMap[scope] } : undefined)
|
|
69
|
+
.filter(Boolean) as Tab[]
|
|
75
70
|
|
|
76
71
|
return (isGroupResourcesByScope ? (
|
|
77
72
|
<RightPanelTabs key={chat.id} tabs={tabs} />
|
|
@@ -91,11 +86,10 @@ export const StacksTab = ({ visibility, workspaceId, stack, showSubmitButton = t
|
|
|
91
86
|
const t = useTranslate(dictionary)
|
|
92
87
|
const { close } = useRightPanel()
|
|
93
88
|
const chat = useCurrentChat()
|
|
94
|
-
const [filter, setFilter] = useState('')
|
|
95
|
-
|
|
96
89
|
const listFavorites = aiClient.aiStacks.useQuery({ visibility: 'favorite' })
|
|
97
90
|
const [addFavorite, pendingAddFav] = aiClient.addFavoriteStackAi.useMutation()
|
|
98
91
|
const [removeFavorite, pendingRemoveFav] = aiClient.removeFavoriteStackAi.useMutation()
|
|
92
|
+
const [submitEnabled, setSubmitEnabled] = useState(false)
|
|
99
93
|
|
|
100
94
|
const removeFavoriteStack = async (idOrSlug: string) => {
|
|
101
95
|
try {
|
|
@@ -146,57 +140,40 @@ export const StacksTab = ({ visibility, workspaceId, stack, showSubmitButton = t
|
|
|
146
140
|
reject(error)
|
|
147
141
|
}
|
|
148
142
|
})
|
|
149
|
-
|
|
150
|
-
|
|
151
143
|
|
|
152
144
|
const stacks = workspaceId
|
|
153
145
|
? workspaceAiClient.getStackFromWorkspaceAi.useQuery({ workspaceId })
|
|
154
146
|
//@ts-ignore
|
|
155
147
|
: aiClient.aiStacks.useQuery({ visibility, order: 'a-to-z' })
|
|
156
148
|
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
[stacks
|
|
163
|
-
)
|
|
149
|
+
const initialValue = useMemo(() => {
|
|
150
|
+
const currentStackId = stack.current ? stack.current.id : chat.get('stack')?.id
|
|
151
|
+
const initial = stacks.find(s => s.id === currentStackId)
|
|
152
|
+
if (initial) setSubmitEnabled(true)
|
|
153
|
+
return initial
|
|
154
|
+
}, [stacks])
|
|
164
155
|
|
|
165
156
|
function submit() {
|
|
166
|
-
if (
|
|
157
|
+
if (stack.current) chat.set('stack', stack.current)
|
|
167
158
|
close()
|
|
168
159
|
}
|
|
169
160
|
|
|
170
|
-
const onChange = useCallback((newValue: GetAiStackResponse) => {
|
|
171
|
-
setValue(newValue)
|
|
172
|
-
stack.current = { ...newValue, label: newValue.name }
|
|
173
|
-
}, [])
|
|
174
|
-
|
|
175
161
|
return (
|
|
176
162
|
<>
|
|
177
163
|
<div className="content">
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
optionClassName={s => (s === value && filter && !s.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
|
|
190
|
-
? 'filtered-out'
|
|
191
|
-
: ''
|
|
192
|
-
}
|
|
193
|
-
className="option-list"
|
|
194
|
-
/>}
|
|
195
|
-
{!!stacks.length && !filtered.length &&
|
|
196
|
-
<Placeholder title={t.noSearchResults} description={t.noSearchResultsDescription} className="no-data-placeholder"/>}
|
|
197
|
-
{!stacks.length && <Placeholder title={t.noData} description={t.noDataDescription} />}
|
|
164
|
+
<DescribedRadioGroup
|
|
165
|
+
options={stacks}
|
|
166
|
+
initialValue={initialValue}
|
|
167
|
+
data={s => ({ idOrSlug: s.id, description: s.use_case, name: s.name, listFavorites, onAddFavorite, onRemoveFavorite })}
|
|
168
|
+
emptyResults={<Placeholder title={t.noSearchResults} description={t.noSearchResultsDescription} className="no-data-placeholder"/>}
|
|
169
|
+
emptyDataset={<Placeholder title={t.noData} description={t.noDataDescription} />}
|
|
170
|
+
onChange={(s) => {
|
|
171
|
+
stack.current = s ? { ...s, label: s.name } : undefined
|
|
172
|
+
setSubmitEnabled(true)
|
|
173
|
+
}}
|
|
174
|
+
/>
|
|
198
175
|
</div>
|
|
199
|
-
{!!
|
|
176
|
+
{!!stacks.length && showSubmitButton && <Button onClick={submit} disabled={!submitEnabled}>{t.apply}</Button>}
|
|
200
177
|
</>
|
|
201
178
|
)
|
|
202
179
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Icon } from '@stack-spot/citric-icons'
|
|
2
|
+
import { Text } from '@stack-spot/citric-react'
|
|
3
3
|
import { listToClass } from '@stack-spot/portal-theme'
|
|
4
4
|
import { StackedBadge } from '../../../components/StackedBadge'
|
|
5
5
|
import { useStepsDictionary } from '../dictionary'
|
|
@@ -24,7 +24,7 @@ export const NodeStep = ({ data: { step, index, nextStatus, onClick } }: Props)
|
|
|
24
24
|
aria-label={getTitle(t, step, index)}
|
|
25
25
|
>
|
|
26
26
|
<header>
|
|
27
|
-
<
|
|
27
|
+
<Icon {...getTypeIcon(step.type)} />
|
|
28
28
|
<Text className="step-index">{getTitle(t, step, index)}</Text>
|
|
29
29
|
{getStatusIcon(step.status)}
|
|
30
30
|
</header>
|
|
@@ -36,7 +36,9 @@ export const NodeStep = ({ data: { step, index, nextStatus, onClick } }: Props)
|
|
|
36
36
|
</Text>
|
|
37
37
|
{!!step.attempts[0].tools?.length && <StackedBadge
|
|
38
38
|
label={t.tools}
|
|
39
|
-
images={step.attempts[0].tools?.slice(0, 3).map(
|
|
39
|
+
images={step.attempts[0].tools?.slice(0, 3).map(
|
|
40
|
+
tool => ({ key: tool.id, name: tool.name, url: tool.image, icon: <Icon icon="Cog" /> }),
|
|
41
|
+
)}
|
|
40
42
|
/>}
|
|
41
43
|
</div>}
|
|
42
44
|
<HandleGroup renderSource={step.type !== 'answer'} renderTarget={step.type !== 'planning'} />
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChevronLeft, ChevronRight } from '@citric/icons'
|
|
3
|
-
import { Badge, IconButton } from '@citric/ui'
|
|
1
|
+
import { Badge, IconButton, Row, Text } from '@stack-spot/citric-react'
|
|
4
2
|
import { theme } from '@stack-spot/portal-theme'
|
|
5
3
|
import { useMemo, useState } from 'react'
|
|
6
4
|
import { styled } from 'styled-components'
|
|
@@ -131,18 +129,18 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
|
|
|
131
129
|
<div className="tool" key={tool.id}>
|
|
132
130
|
<ToolBadge name={tool.name} duration={tool.duration} image={tool.image} description={tool.description} />
|
|
133
131
|
{tool.input && <>
|
|
134
|
-
<Text appearance="microtext1"
|
|
132
|
+
<Text appearance="microtext1" color="light.700">{t.input}:</Text>
|
|
135
133
|
<Code language="json" className="tool-input" showLineNumbers={false} showActionBar>{tool.input}</Code>
|
|
136
134
|
</>}
|
|
137
135
|
{tool.output && <>
|
|
138
|
-
<Text appearance="microtext1"
|
|
136
|
+
<Text appearance="microtext1" color="light.700">{t.response}:</Text>
|
|
139
137
|
<Code language="json" className="tool-input" showLineNumbers={false} showActionBar>{tool.output}</Code>
|
|
140
138
|
</>}
|
|
141
139
|
</div>
|
|
142
140
|
)) : undefined
|
|
143
141
|
|
|
144
142
|
const title = (
|
|
145
|
-
<
|
|
143
|
+
<Row flex={1} justifyContent="space-between">
|
|
146
144
|
<Text appearance="h6">{getTitle(t, step, stepIndex)}</Text>
|
|
147
145
|
<ExecutionBox>
|
|
148
146
|
<Text className="time" appearance="microtext1">
|
|
@@ -153,28 +151,26 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
|
|
|
153
151
|
{step?.type === 'step' && step.attempts.length > 1 && <div className="navigator">
|
|
154
152
|
{attempt > 0 && (
|
|
155
153
|
<IconButton
|
|
154
|
+
icon="ChevronLeft"
|
|
156
155
|
size="xs"
|
|
157
156
|
title={t.previousAttempt}
|
|
158
157
|
aria-label={t.previousAttempt}
|
|
159
158
|
onClick={() => setAttempt(attempt - 1)}
|
|
160
|
-
|
|
161
|
-
<ChevronLeft />
|
|
162
|
-
</IconButton>
|
|
159
|
+
/>
|
|
163
160
|
)}
|
|
164
161
|
<Text appearance="microtext1">{attempt + 1}/{step.attempts.length}</Text>
|
|
165
162
|
{attempt < step.attempts.length - 1 && (
|
|
166
163
|
<IconButton
|
|
164
|
+
icon="ChevronRight"
|
|
167
165
|
size="xs"
|
|
168
166
|
title={t.nextAttempt}
|
|
169
167
|
aria-label={t.nextAttempt}
|
|
170
168
|
onClick={() => setAttempt(attempt + 1)}
|
|
171
|
-
|
|
172
|
-
<ChevronRight />
|
|
173
|
-
</IconButton>
|
|
169
|
+
/>
|
|
174
170
|
)}
|
|
175
171
|
</div>}
|
|
176
172
|
</ExecutionBox>
|
|
177
|
-
</
|
|
173
|
+
</Row>
|
|
178
174
|
)
|
|
179
175
|
|
|
180
176
|
return (
|
|
@@ -184,18 +180,18 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
|
|
|
184
180
|
</StyledSection>}
|
|
185
181
|
|
|
186
182
|
{step?.type === 'planning' && <StyledSection style={{ alignItems: 'stretch' }}>
|
|
187
|
-
<Badge appearance="square"
|
|
183
|
+
<Badge appearance="square" colorPalette="blue" style={{ alignSelf: 'start' }}>Prompt</Badge>
|
|
188
184
|
<Text>{step.goal}</Text>
|
|
189
185
|
<ul className="steps">
|
|
190
186
|
{entry.steps?.filter(s => s.type === 'step').map((s, index) => (
|
|
191
187
|
<li key={index}>
|
|
192
|
-
<
|
|
188
|
+
<Row mb={2}>
|
|
193
189
|
<Text>{t.step} {index + 1}: <span className="step-description">{s.input}</span></Text>
|
|
194
|
-
</
|
|
190
|
+
</Row>
|
|
195
191
|
{!!s.attempts[0].tools?.length && <ul className="side-by-side-tools">
|
|
196
192
|
{s.attempts[0].tools.map((tool) => (
|
|
197
193
|
<li key={tool.id}>
|
|
198
|
-
<ToolBadge name={tool.name} image={tool.image}
|
|
194
|
+
<ToolBadge name={tool.name} image={tool.image} />
|
|
199
195
|
</li>
|
|
200
196
|
))}
|
|
201
197
|
</ul>}
|
|
@@ -205,7 +201,7 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
|
|
|
205
201
|
</StyledSection>}
|
|
206
202
|
|
|
207
203
|
{step?.type === 'step' && step?.input && <StyledSection>
|
|
208
|
-
<Badge appearance="square"
|
|
204
|
+
<Badge appearance="square" colorPalette="blue">Prompt</Badge>
|
|
209
205
|
<Text>{step.input}</Text>
|
|
210
206
|
</StyledSection>}
|
|
211
207
|
{!!tools?.length && <StyledSection>{tools}</StyledSection>}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { lazy, Suspense, useEffect } from 'react'
|
|
1
|
+
import { FallbackBoundary } from '@stack-spot/citric-react'
|
|
2
|
+
import { lazy, useEffect } from 'react'
|
|
4
3
|
import { useWidget, useWidgetState } from '../../context/hooks'
|
|
5
4
|
import { useRightPanel } from '../../right-panel/hooks'
|
|
6
5
|
import { useStepsDictionary } from './dictionary'
|
|
@@ -19,9 +18,9 @@ export const Steps = () => {
|
|
|
19
18
|
|
|
20
19
|
useEffect(() => {
|
|
21
20
|
if (panel === 'steps' && message) open(
|
|
22
|
-
<
|
|
21
|
+
<FallbackBoundary>
|
|
23
22
|
<LazyStepsPanel key={message.messageId} chatId={message.chatId} messageId={message.messageId} />
|
|
24
|
-
</
|
|
23
|
+
</FallbackBoundary>,
|
|
25
24
|
{
|
|
26
25
|
title: t.steps,
|
|
27
26
|
description: t.stepsPanelDescription,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { LoadingCircular } from '@citric/ui'
|
|
1
|
+
import { Icon, WithIcon } from '@stack-spot/citric-icons'
|
|
2
|
+
import { ProgressCircular } from '@stack-spot/citric-react'
|
|
4
3
|
import { ChatStep } from '@stack-spot/portal-network'
|
|
4
|
+
import { theme } from '@stack-spot/portal-theme'
|
|
5
5
|
|
|
6
6
|
export function getStatusIcon(status: ChatStep['status']) {
|
|
7
7
|
switch (status) {
|
|
8
|
-
case 'success': return <
|
|
9
|
-
case 'error': return <
|
|
10
|
-
case 'running': return <
|
|
8
|
+
case 'success': return <Icon group="fill" icon="CheckCircle" style={{ color: theme.color.success[500] }} />
|
|
9
|
+
case 'error': return <Icon group="fill" icon="TimesCircle" style={{ color: theme.color.danger[500] }} />
|
|
10
|
+
case 'running': return <ProgressCircular colorScheme="inverse" size="xs" />
|
|
11
11
|
default: return null
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export function getTypeIcon(type: ChatStep['type']) {
|
|
15
|
+
export function getTypeIcon(type: ChatStep['type']): WithIcon {
|
|
16
16
|
switch (type) {
|
|
17
|
-
case 'planning': return
|
|
18
|
-
default: return
|
|
17
|
+
case 'planning': return { group: 'outline', icon: 'ListUnordered' }
|
|
18
|
+
default: return { group: 'fill', icon: 'Play' }
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
package/src/views/Tools.tsx
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Avatar } from '@citric/ui'
|
|
1
|
+
import { Icon } from '@stack-spot/citric-icons'
|
|
2
|
+
import { AsyncContent, Button, Center, Column, ImageBox, ImageWithFallback, Text } from '@stack-spot/citric-react'
|
|
4
3
|
import { workspaceAiClient } from '@stack-spot/portal-network'
|
|
5
4
|
import { WorkspaceResponse, WorkspaceVisibilityLevelEnum } from '@stack-spot/portal-network/api/workspace-ai'
|
|
6
5
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
7
6
|
import { useTransition } from 'react'
|
|
8
7
|
import { useComponentNavigation } from '../../components/ComponentNavigator'
|
|
9
|
-
import { Loading } from '../../components/FallbackBoundary/Loading'
|
|
10
8
|
import { ListResource } from '../../components/ListResource'
|
|
11
9
|
import { CardSpace, WorkspaceTabNavigator } from '../../components/WorkspaceTabNavigator'
|
|
12
10
|
import { ChatProperties } from '../../state/ChatState'
|
|
@@ -16,17 +14,15 @@ import { StacksTab } from '../Stacks'
|
|
|
16
14
|
|
|
17
15
|
const SpaceCard = ({ workspaceId }: { workspaceId: string }) => {
|
|
18
16
|
const workspace = workspaceAiClient.workspaceAi.useQuery({ id: workspaceId })
|
|
19
|
-
return <
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</Flex>
|
|
29
|
-
</Flex>
|
|
17
|
+
return <Column gap="4px">
|
|
18
|
+
<Center gap="8px">
|
|
19
|
+
<ImageBox size="sm" appearance="square">
|
|
20
|
+
<ImageWithFallback src={workspace.logo ?? ''} fallback={<Icon icon="Spaces" />} />
|
|
21
|
+
</ImageBox>
|
|
22
|
+
<Text appearance="body2" weight="medium">{workspace.name}</Text>
|
|
23
|
+
</Center>
|
|
24
|
+
<Text color="light.700">{workspace.description}</Text>
|
|
25
|
+
</Column>
|
|
30
26
|
}
|
|
31
27
|
|
|
32
28
|
export interface TabProps {
|
|
@@ -52,9 +48,9 @@ export const WorkspaceResources = ({ workspaceId, allKS, agent, stack }: Omit<Ta
|
|
|
52
48
|
const { navigate } = useComponentNavigation<typeof workspaceTabComponents>()
|
|
53
49
|
const [isPending, startTransition] = useTransition()
|
|
54
50
|
const resourceTypes: WorkspaceResource[] = [
|
|
55
|
-
{ id: 'agents', resourceType: 'agent', displayName: 'Agents', workspaceId, icon: <Agent /> },
|
|
56
|
-
{ id: 'ks', resourceType: 'ks', displayName: 'Knowledge Sources', workspaceId, icon: <KnowledgeSource /> },
|
|
57
|
-
{ id: 'stack', resourceType: 'stack', displayName: 'Stacks', workspaceId, icon: <Stack /> },
|
|
51
|
+
{ id: 'agents', resourceType: 'agent', displayName: 'Agents', workspaceId, icon: <Icon icon="Agent" /> },
|
|
52
|
+
{ id: 'ks', resourceType: 'ks', displayName: 'Knowledge Sources', workspaceId, icon: <Icon icon="KnowledgeSource" /> },
|
|
53
|
+
{ id: 'stack', resourceType: 'stack', displayName: 'Stacks', workspaceId, icon: <Icon icon="Stack" /> },
|
|
58
54
|
]
|
|
59
55
|
|
|
60
56
|
const handleNavigate = (resource: WorkspaceResource) => {
|
|
@@ -72,14 +68,14 @@ export const WorkspaceResources = ({ workspaceId, allKS, agent, stack }: Omit<Ta
|
|
|
72
68
|
|
|
73
69
|
return (<>
|
|
74
70
|
{workspaceId && <SpaceCard workspaceId={workspaceId} />}
|
|
75
|
-
{
|
|
71
|
+
{<AsyncContent loading={isPending}>
|
|
76
72
|
<ListResource
|
|
77
73
|
list={resourceTypes}
|
|
78
74
|
keygen={w => w.id}
|
|
79
75
|
renderLabel={r => <CardSpace name={r.displayName} icon={r.icon} onClick={() => handleNavigate(r)} />}
|
|
80
76
|
style={{ gap: '6px', display: 'flex', flexDirection: 'column' }}
|
|
81
77
|
/>
|
|
82
|
-
}
|
|
78
|
+
</AsyncContent>}
|
|
83
79
|
</>
|
|
84
80
|
)
|
|
85
81
|
}
|
|
@@ -105,7 +101,7 @@ export function WorkspacesTab({ visibility, allKS, agent, stack, onSubmit }: Tab
|
|
|
105
101
|
getNavigateParam={buildNavigateParams}
|
|
106
102
|
visibility={visibility}
|
|
107
103
|
/>
|
|
108
|
-
<Button className="workspace-submit" onClick={onSubmit}
|
|
104
|
+
<Button className="workspace-submit" onClick={onSubmit}>{t.apply}</Button>
|
|
109
105
|
</>
|
|
110
106
|
)
|
|
111
107
|
}
|
|
@@ -48,11 +48,13 @@ const WorkspacesPanel = () => {
|
|
|
48
48
|
|
|
49
49
|
return <RightPanelTabs key={chat.id} tabs={[
|
|
50
50
|
{
|
|
51
|
-
|
|
51
|
+
key: 'favorites',
|
|
52
|
+
label: t.favorites,
|
|
52
53
|
content: <WorkspacesTab key="favorite" visibility="favorite" allKS={allKS} agent={agent} stack={stack} onSubmit={onSubmit} />,
|
|
53
54
|
},
|
|
54
55
|
{
|
|
55
|
-
|
|
56
|
+
key: 'all',
|
|
57
|
+
label: t.all,
|
|
56
58
|
content: <WorkspacesTab key="all" visibility="all" allKS={allKS} agent={agent} stack={stack} onSubmit={onSubmit} />,
|
|
57
59
|
},
|
|
58
60
|
]}
|