@stack-spot/ai-chat-widget 1.0.0-dev.1771433237688 → 1.0.0-dev.1776445984345
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 +55 -0
- package/dist/StackspotAIWidget.d.ts.map +1 -1
- package/dist/StackspotAIWidget.js +2 -1
- package/dist/StackspotAIWidget.js.map +1 -1
- package/dist/app-metadata.json +25 -25
- package/dist/chat-interceptors/quick-commands.d.ts.map +1 -1
- package/dist/chat-interceptors/quick-commands.js +0 -1
- package/dist/chat-interceptors/quick-commands.js.map +1 -1
- package/dist/components/AgentCard/AgentCardCreate.d.ts.map +1 -1
- package/dist/components/AgentCard/index.d.ts.map +1 -1
- package/dist/components/ButtonFavorite.d.ts.map +1 -1
- package/dist/components/Code.d.ts.map +1 -1
- package/dist/components/FadingOverflow.d.ts.map +1 -1
- package/dist/components/FileDescription.d.ts.map +1 -1
- package/dist/components/FreemiumSensitiveDataInfo.d.ts +2 -0
- package/dist/components/FreemiumSensitiveDataInfo.d.ts.map +1 -0
- package/dist/components/FreemiumSensitiveDataInfo.js +24 -0
- package/dist/components/FreemiumSensitiveDataInfo.js.map +1 -0
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/QuickStartButton.d.ts.map +1 -1
- package/dist/components/RightPanelContentList.d.ts.map +1 -1
- package/dist/components/RightPanelForm.d.ts.map +1 -1
- package/dist/components/RightPanelTabs.d.ts.map +1 -1
- package/dist/components/Selector/SelectVersion.d.ts.map +1 -1
- package/dist/components/Selector/index.d.ts.map +1 -1
- package/dist/components/Selector/styled.d.ts.map +1 -1
- package/dist/components/Selector/styled.js +4 -0
- package/dist/components/Selector/styled.js.map +1 -1
- package/dist/components/StackedBadge.d.ts.map +1 -1
- package/dist/components/ToolBadge.d.ts.map +1 -1
- package/dist/components/WorkspaceTabNavigator.d.ts.map +1 -1
- package/dist/components/form/DescribedRadioGroup.d.ts.map +1 -1
- package/dist/components/form/DescribedRadioGroup.js +1 -3
- package/dist/components/form/DescribedRadioGroup.js.map +1 -1
- package/dist/hooks/enabled-feature-flags.d.ts.map +1 -1
- package/dist/right-panel/DefaultPanel.d.ts.map +1 -1
- package/dist/right-panel/RightPanelProvider.d.ts.map +1 -1
- package/dist/utils/update-tool-step.d.ts.map +1 -1
- package/dist/utils/upload/context.d.ts.map +1 -1
- package/dist/utils/upload/use-paste-upload.d.ts.map +1 -1
- package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
- package/dist/views/Agents/AgentsTab.d.ts.map +1 -1
- package/dist/views/Chat/AgentInfo.d.ts.map +1 -1
- package/dist/views/Chat/ButtonExecutionDetail.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessages.d.ts.map +1 -1
- package/dist/views/Chat/StepsList.d.ts.map +1 -1
- package/dist/views/Chat/index.d.ts.map +1 -1
- package/dist/views/ChatHistory/HistoryItem.d.ts.map +1 -1
- package/dist/views/ChatTabSelection.d.ts.map +1 -1
- package/dist/views/Home/BuiltInAgent.d.ts.map +1 -1
- package/dist/views/Home/index.d.ts.map +1 -1
- package/dist/views/KnowledgeSources.d.ts.map +1 -1
- package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonBar.d.ts.map +1 -1
- package/dist/views/MessageInput/ModelSwitcher/index.d.ts.map +1 -1
- package/dist/views/MessageInput/ModelSwitcher/index.js.map +1 -1
- package/dist/views/MessageInput/ModelSwitcher/utils.d.ts.map +1 -1
- package/dist/views/MessageInput/ModelSwitcher/utils.js +13 -3
- package/dist/views/MessageInput/ModelSwitcher/utils.js.map +1 -1
- package/dist/views/MessageInput/QuickCommandSelector.d.ts.map +1 -1
- package/dist/views/MessageInput/UploadDragNDrop.d.ts.map +1 -1
- package/dist/views/MessageInput/index.d.ts.map +1 -1
- package/dist/views/MinimizedHeader.d.ts.map +1 -1
- package/dist/views/Stacks.d.ts.map +1 -1
- package/dist/views/Steps/FlowChart/HandleGroup.d.ts.map +1 -1
- package/dist/views/Steps/FlowChart/NodeDynamic.d.ts.map +1 -1
- package/dist/views/Steps/FlowChart/NodeStep.d.ts.map +1 -1
- package/dist/views/Steps/FlowChart/hooks.d.ts.map +1 -1
- package/dist/views/Steps/FlowChart/index.d.ts.map +1 -1
- package/dist/views/Steps/StepModal.d.ts.map +1 -1
- package/dist/views/Steps/StepsPanel.d.ts.map +1 -1
- package/dist/views/Workspaces/WorkspacesTab.d.ts.map +1 -1
- package/package.json +32 -32
- package/src/StackspotAIWidget.tsx +4 -2
- package/src/app-metadata.json +25 -25
- package/src/chat-interceptors/quick-commands.ts +1 -2
- package/src/components/FreemiumSensitiveDataInfo.tsx +36 -0
- package/src/components/Selector/styled.ts +4 -0
- package/src/components/form/DescribedRadioGroup.tsx +1 -3
- package/src/views/MessageInput/ModelSwitcher/index.tsx +1 -2
- package/src/views/MessageInput/ModelSwitcher/utils.tsx +22 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Column, Icon, Link, Row, Text } from '@stack-spot/citric-react'
|
|
2
|
+
import { useTranslate } from '@stack-spot/portal-translate'
|
|
3
|
+
import { checkIsTrial } from '../utils/check-is-trial'
|
|
4
|
+
|
|
5
|
+
export const FreemiumSensitiveDataInfo = () => {
|
|
6
|
+
const isTrial = checkIsTrial()
|
|
7
|
+
const t = useTranslate(dictionary)
|
|
8
|
+
if (!isTrial) return
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<Row gap={8} pb={3} pt={3} w="100%" justifyContent="center" alignItems="center">
|
|
12
|
+
<Column>
|
|
13
|
+
<Icon icon="InfoCircle" color="light.700" />
|
|
14
|
+
</Column>
|
|
15
|
+
<div>
|
|
16
|
+
<Text style={{ lineHeight: '14px', marginRight: '2px' }} color="light.700" appearance="microtext1">{t.information}</Text>
|
|
17
|
+
<Link target="_blank" color="light.700" style={{ lineHeight: '14px' }} appearance="microtext1" href={t.policiesLink}>
|
|
18
|
+
{t.seePolices}
|
|
19
|
+
</Link>
|
|
20
|
+
</div>
|
|
21
|
+
</Row>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const dictionary = {
|
|
26
|
+
en: {
|
|
27
|
+
information: 'For personal use only. Avoid entering corporate or sensitive data.',
|
|
28
|
+
seePolices: 'View Terms and Conditions',
|
|
29
|
+
policiesLink: 'https://stackspot.com/en/stackspot-terms-and-conditions-ai',
|
|
30
|
+
},
|
|
31
|
+
pt: {
|
|
32
|
+
information: 'Conta para uso pessoal. Evite inserir dados corporativos ou sensíveis.',
|
|
33
|
+
seePolices: 'Ver Termos e Condições',
|
|
34
|
+
policiesLink: 'https://stackspot.com/pt/termos-e-condicoes-da-plataforma-stackspot-ai',
|
|
35
|
+
},
|
|
36
|
+
} as const
|
|
@@ -111,6 +111,10 @@ export const SelectorBox = styled.div<{ $tabsCount: number }>`
|
|
|
111
111
|
overflow-y: auto;
|
|
112
112
|
flex: 1;
|
|
113
113
|
|
|
114
|
+
.infinite-scroll-component, .infinite-scroll-component__outerdiv {
|
|
115
|
+
min-height: 272px;
|
|
116
|
+
}
|
|
117
|
+
|
|
114
118
|
li {
|
|
115
119
|
display: flex;
|
|
116
120
|
flex-direction: row;
|
|
@@ -55,7 +55,7 @@ export function DescribedRadioGroup<T>({ initialValue, options: opt, data, empty
|
|
|
55
55
|
|
|
56
56
|
useEffect(() => {
|
|
57
57
|
if (!isEqual(opt, options)) {
|
|
58
|
-
setOptions(opt)
|
|
58
|
+
setOptions([...opt])
|
|
59
59
|
}
|
|
60
60
|
}, [opt])
|
|
61
61
|
|
|
@@ -93,12 +93,10 @@ export function DescribedRadioGroup<T>({ initialValue, options: opt, data, empty
|
|
|
93
93
|
listFavorites,
|
|
94
94
|
onAddFavorite: async (...args) => {
|
|
95
95
|
const res = await onAddFavorite(...args)
|
|
96
|
-
setOptions([...options]) // forces options re-rendering
|
|
97
96
|
return res
|
|
98
97
|
},
|
|
99
98
|
onRemoveFavorite: async (...args) => {
|
|
100
99
|
const res = await onRemoveFavorite?.(...args)
|
|
101
|
-
setOptions([...options]) // forces options re-rendering
|
|
102
100
|
return res ?? false
|
|
103
101
|
},
|
|
104
102
|
}} />}
|
|
@@ -2,8 +2,7 @@ import { CitricIconOutline, CitricIconSocial } from '@stack-spot/citric-icons'
|
|
|
2
2
|
import { Button, Column, FieldGroup, Icon, Input, ProgressCircular, Row } from '@stack-spot/citric-react'
|
|
3
3
|
import { SelectionList } from '@stack-spot/portal-components/SelectionList'
|
|
4
4
|
import { agentToolsClient, genAiInferenceClient } from '@stack-spot/portal-network'
|
|
5
|
-
import { useMemo, useState } from 'react'
|
|
6
|
-
import { CSSProperties } from 'styled-components'
|
|
5
|
+
import { CSSProperties, useMemo, useState } from 'react'
|
|
7
6
|
import { useCurrentChat, useCurrentChatState } from '../../../context/hooks'
|
|
8
7
|
import { useMessageInputDictionary } from '../dictionary'
|
|
9
8
|
import { RowWrapperStyled, stylesModelSwitcher } from '../styled'
|
|
@@ -24,6 +24,26 @@ export const providerIcon: Record<string, CitricIconSocial | CitricIconOutline>
|
|
|
24
24
|
anthropic: 'Anthropic',
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
|
|
28
|
+
const getModelsList = (agent?: AgentCoreWithSingleVersionResponse2, models?: PaginatedResponseLlmModelsResponse) => {
|
|
29
|
+
if (agent?.visibility_level === 'built_in') {
|
|
30
|
+
return models?.items
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (agent?.version?.available_llm_models && agent?.version?.available_llm_models.length > 0) {
|
|
34
|
+
return models?.items.filter((model) =>
|
|
35
|
+
agent?.version?.available_llm_models?.find((modelAvailable) => modelAvailable.model_id === model.id))
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (agent?.version?.model_id) {
|
|
39
|
+
return models?.items.filter((model) => model.id === agent?.version?.model_id)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return models?.items.filter(model =>
|
|
43
|
+
model.resources.some(resource => resource.name === 'agents' && resource.is_default === true),
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
27
47
|
export function getListModelsData(
|
|
28
48
|
chat: ChatState,
|
|
29
49
|
setVisibleMenu: Dispatch<React.SetStateAction<boolean>>,
|
|
@@ -32,12 +52,11 @@ export function getListModelsData(
|
|
|
32
52
|
|
|
33
53
|
const chatSelectedModelId = chat.get('selected_model_id')
|
|
34
54
|
|
|
35
|
-
const listModelsToShow = agent
|
|
36
|
-
models?.items.filter((model) => agent?.version?.available_llm_models?.find((modelAvailable) => modelAvailable.model_id === model.id)) :
|
|
37
|
-
models?.items
|
|
55
|
+
const listModelsToShow = getModelsList(agent, models)
|
|
38
56
|
|
|
39
57
|
const modelAvailableDefault = agent?.version?.available_llm_models?.find((model) =>
|
|
40
58
|
(model.is_default || model.model_id === agent.version?.model_id))
|
|
59
|
+
|
|
41
60
|
const modelListData = parseModelList(chat, setVisibleMenu, listModelsToShow, modelAvailableDefault?.model_id)
|
|
42
61
|
|
|
43
62
|
if (agent?.visibility_level === 'built_in' || !agent?.version?.model_id) {
|