@stack-spot/ai-chat-widget 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/views/Agents.d.ts.map +1 -1
- package/dist/views/Agents.js +19 -6
- package/dist/views/Agents.js.map +1 -1
- package/package.json +1 -1
- package/src/views/Agents.tsx +20 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agents.d.ts","sourceRoot":"","sources":["../../src/views/Agents.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Agents.d.ts","sourceRoot":"","sources":["../../src/views/Agents.tsx"],"names":[],"mappings":"AAoEA,eAAO,MAAM,MAAM,YAclB,CAAA"}
|
package/dist/views/Agents.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Button, Text } from '@citric/core';
|
|
|
3
3
|
import { Search } from '@citric/icons';
|
|
4
4
|
import { Badge } from '@citric/ui';
|
|
5
5
|
import { Placeholder } from '@stack-spot/portal-components/Placeholder';
|
|
6
|
+
import { MiniLogo } from '@stack-spot/portal-components/svg';
|
|
6
7
|
import { agentClient } from '@stack-spot/portal-network';
|
|
7
8
|
import { theme } from '@stack-spot/portal-theme';
|
|
8
9
|
import { useTranslate } from '@stack-spot/portal-translate';
|
|
@@ -19,7 +20,7 @@ const AgentLabel = styled.div `
|
|
|
19
20
|
align-items: center;
|
|
20
21
|
gap: 6px;
|
|
21
22
|
|
|
22
|
-
img {
|
|
23
|
+
img, svg {
|
|
23
24
|
width: 20px;
|
|
24
25
|
height: 20px;
|
|
25
26
|
border-radius: 50%;
|
|
@@ -77,8 +78,8 @@ const AgentsPanel = () => {
|
|
|
77
78
|
const t = useTranslate(dictionary);
|
|
78
79
|
const chat = useCurrentChat();
|
|
79
80
|
return _jsx(RightPanelTabs, { tabs: [
|
|
80
|
-
{ title: t.personal, content: _jsx(AgentsTab, { visibility: "PERSONAL" }, "personal") },
|
|
81
81
|
{ title: t.builtin, content: _jsx(AgentsTab, { visibility: "BUILT-IN" }, "builtin") },
|
|
82
|
+
{ title: t.personal, content: _jsx(AgentsTab, { visibility: "PERSONAL" }, "personal") },
|
|
82
83
|
{ title: t.shared, content: _jsx(AgentsTab, { visibility: "SHARED" }, "shared") },
|
|
83
84
|
{ title: t.account, content: _jsx(AgentsTab, { visibility: "ACCOUNT" }, "account") },
|
|
84
85
|
] }, chat.id);
|
|
@@ -88,15 +89,23 @@ const AgentsTab = ({ visibility }) => {
|
|
|
88
89
|
const { close } = useRightPanel();
|
|
89
90
|
const chat = useCurrentChat();
|
|
90
91
|
const [filter, setFilter] = useState('');
|
|
92
|
+
const defaultAgent = useMemo(() => ({
|
|
93
|
+
name: t.defaultAgentName,
|
|
94
|
+
description: t.defaultAgentDescription,
|
|
95
|
+
llm_config: { model_slug: 'gpt4o' },
|
|
96
|
+
}), []);
|
|
91
97
|
const agents = visibility === 'BUILT-IN' ? agentClient.publicAgents.useQuery({}) : agentClient.agents.useQuery({ visibility });
|
|
92
|
-
const [value, setValue] = useState(agents.find(a => a.id === chat.get('agent')?.id));
|
|
93
|
-
const filtered = useMemo(() =>
|
|
98
|
+
const [value, setValue] = useState(agents.find(a => a.id === chat.get('agent')?.id) ?? defaultAgent);
|
|
99
|
+
const filtered = useMemo(() => {
|
|
100
|
+
const ags = visibility === 'BUILT-IN' ? [defaultAgent, ...agents] : agents;
|
|
101
|
+
return filter ? ags.filter(a => a === value || a.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : ags;
|
|
102
|
+
}, [agents, filter, value]);
|
|
94
103
|
function submit() {
|
|
95
104
|
if (value)
|
|
96
|
-
chat.set('agent', { id: value.id, label: value.name, image: value.avatar });
|
|
105
|
+
chat.set('agent', value.id ? { id: value.id, label: value.name, image: value.avatar } : undefined);
|
|
97
106
|
close();
|
|
98
107
|
}
|
|
99
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "content", children: [_jsx(IconInput, { icon: _jsx(Search, {}), value: filter, onChange: setFilter, className: "search" }), !!filtered.length && _jsx(DescribedRadioGroup, { options: filtered, keygen: a => a.id, value: value, onChange: setValue, renderLabel: ({ name, avatar }) => (_jsxs(AgentLabel, { children: [avatar && _jsx("img", { src: avatar }), _jsx(Text, { children: name })] })), renderDescription: ({ description, llm_config: llmc, knowledge_sources_config: ksc }) => (_jsxs(AgentDescription, { children: [description && _jsxs("section", { children: [_jsx(Text, { appearance: "microtext1", className: "title", children: "Description" }), _jsx(Text, { children: description })] }), !!ksc?.knowledge_sources?.length && _jsxs("section", { children: [_jsx(Text, { appearance: "microtext1", className: "title", children: "Knowledge sources" }), _jsx("ul", { children: ksc.knowledge_sources.map((ks, index) => _jsx("li", { children: _jsx(Badge, { palette: "teal", appearance: "square", children: ks }) }, index)) })] }), llmc?.model_slug && _jsxs("section", { children: [_jsx(Text, { appearance: "microtext1", className: "title", children: "LLM" }), _jsx(Badge, { palette: "orange", appearance: "square", children: llmc.model_slug })] })] })), optionClassName: a => (a === value && filter && !a.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
|
|
108
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "content", children: [_jsx(IconInput, { icon: _jsx(Search, {}), value: filter, onChange: setFilter, className: "search" }), !!filtered.length && _jsx(DescribedRadioGroup, { options: filtered, keygen: a => a.id, value: value, onChange: setValue, renderLabel: ({ name, avatar, id }) => (_jsxs(AgentLabel, { children: [id ? (avatar && _jsx("img", { src: avatar })) : _jsx(MiniLogo, {}), _jsx(Text, { children: name })] })), renderDescription: ({ description, llm_config: llmc, knowledge_sources_config: ksc }) => (_jsxs(AgentDescription, { children: [description && _jsxs("section", { children: [_jsx(Text, { appearance: "microtext1", className: "title", children: "Description" }), _jsx(Text, { children: description })] }), !!ksc?.knowledge_sources?.length && _jsxs("section", { children: [_jsx(Text, { appearance: "microtext1", className: "title", children: "Knowledge sources" }), _jsx("ul", { children: ksc.knowledge_sources.map((ks, index) => _jsx("li", { children: _jsx(Badge, { palette: "teal", appearance: "square", children: ks }) }, index)) })] }), llmc?.model_slug && _jsxs("section", { children: [_jsx(Text, { appearance: "microtext1", className: "title", children: "LLM" }), _jsx(Badge, { palette: "orange", appearance: "square", children: llmc.model_slug })] })] })), optionClassName: a => (a === value && filter && !a.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
|
|
100
109
|
? 'filtered-out'
|
|
101
110
|
: '', className: "option-list" }), !!agents.length && !filtered.length && _jsx(Placeholder, { title: t.noSearchResults, description: t.noSearchResultsDescription }), !agents.length && _jsx(Placeholder, { title: t.noData, description: t.noDataDescription })] }), _jsx(Button, { onClick: submit, disabled: !value, children: t.apply })] }));
|
|
102
111
|
};
|
|
@@ -113,6 +122,8 @@ const dictionary = {
|
|
|
113
122
|
noSearchResultsDescription: 'Please, try another search term.',
|
|
114
123
|
noData: 'There are no agents in this category yet.',
|
|
115
124
|
noDataDescription: 'Use the tabs above to try other categories or use the AI portal to create new agents.',
|
|
125
|
+
defaultAgentName: 'Stackspot AI (default)',
|
|
126
|
+
defaultAgentDescription: 'The StackSpot CodeGen is an advanced artificial intelligence agent designed to optimize and accelerate software development. Integrated directly into your integrated development environment, StackSpot CodeGen offers real-time code suggestions, helping developers write high-quality code more efficiently. With robust features such as creating Stacks AI, customized knowledge sources, and quick commands, StackSpot CodeGen contextualizes your development needs to provide the best answers and code suggestions.',
|
|
116
127
|
},
|
|
117
128
|
pt: {
|
|
118
129
|
title: 'Agentes',
|
|
@@ -126,6 +137,8 @@ const dictionary = {
|
|
|
126
137
|
noSearchResultsDescription: 'Por favor, tente outra busca.',
|
|
127
138
|
noData: 'Ainda não há agentes nesta categoria.',
|
|
128
139
|
noDataDescription: 'Use as abas acima para tentar outras categorias ou use o Portal AI para criar novos agentes.',
|
|
140
|
+
defaultAgentName: 'Stackspot AI (padrão)',
|
|
141
|
+
defaultAgentDescription: 'O StackSpot CodeGen é um agente de inteligência artificial avançado projetado para otimizar e acelerar o desenvolvimento de software. Integrado diretamente ao seu ambiente de desenvolvimento, o StackSpot CodeGen oferece sugestões de código em tempo real, ajudando os desenvolvedores a escreverem código de alta qualidade de forma mais eficiente. Com recursos robustos, como a criação de Stacks AI, Knowledge Sources personalizadas e comandos rápidos, o StackSpot CodeGen contextualiza suas necessidades de desenvolvimento para fornecer as melhores respostas e sugestões de código.',
|
|
129
142
|
},
|
|
130
143
|
};
|
|
131
144
|
//# sourceMappingURL=Agents.js.map
|
package/dist/views/Agents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agents.js","sourceRoot":"","sources":["../../src/views/Agents.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;CAY5B,CAAA;AAED,MAAM,gBA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EAAE,CAAC,KAAK,YAAG,CAAC,CAAC,KAAK,GAAU,IAC5D,CACJ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,sEAAsE;QACnF,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,UAAU;QACnB,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,mCAAmC;QACpD,0BAA0B,EAAE,kCAAkC;QAC9D,MAAM,EAAE,2CAA2C;QACnD,iBAAiB,EAAE,uFAAuF;QAC1G,gBAAgB,EAAE,wBAAwB;QAC1C,uBAAuB,EAAE,+fAA+f;KACzhB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,uEAAuE;QACpF,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,UAAU;QACnB,MAAM,EAAE,eAAe;QACvB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,SAAS;QAChB,eAAe,EAAE,oCAAoC;QACrD,0BAA0B,EAAE,+BAA+B;QAC3D,MAAM,EAAE,uCAAuC;QAC/C,iBAAiB,EAAE,8FAA8F;QACjH,gBAAgB,EAAE,uBAAuB;QACzC,uBAAuB,EAAE,skBAAskB;KAChmB;CACmB,CAAA"}
|
package/package.json
CHANGED
package/src/views/Agents.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { Button, Text } from '@citric/core'
|
|
|
2
2
|
import { Search } from '@citric/icons'
|
|
3
3
|
import { Badge } from '@citric/ui'
|
|
4
4
|
import { Placeholder } from '@stack-spot/portal-components/Placeholder'
|
|
5
|
+
import { MiniLogo } from '@stack-spot/portal-components/svg'
|
|
5
6
|
import { agentClient } from '@stack-spot/portal-network'
|
|
6
7
|
import { AgentResponse, VisibilityLevel } from '@stack-spot/portal-network/api/agent'
|
|
7
8
|
import { theme } from '@stack-spot/portal-theme'
|
|
@@ -20,7 +21,7 @@ const AgentLabel = styled.div`
|
|
|
20
21
|
align-items: center;
|
|
21
22
|
gap: 6px;
|
|
22
23
|
|
|
23
|
-
img {
|
|
24
|
+
img, svg {
|
|
24
25
|
width: 20px;
|
|
25
26
|
height: 20px;
|
|
26
27
|
border-radius: 50%;
|
|
@@ -86,8 +87,8 @@ const AgentsPanel = () => {
|
|
|
86
87
|
const chat = useCurrentChat()
|
|
87
88
|
|
|
88
89
|
return <RightPanelTabs key={chat.id} tabs={[
|
|
89
|
-
{ title: t.personal, content: <AgentsTab key="personal" visibility="PERSONAL" /> },
|
|
90
90
|
{ title: t.builtin, content: <AgentsTab key="builtin" visibility="BUILT-IN" /> },
|
|
91
|
+
{ title: t.personal, content: <AgentsTab key="personal" visibility="PERSONAL" /> },
|
|
91
92
|
{ title: t.shared, content: <AgentsTab key="shared" visibility="SHARED" /> },
|
|
92
93
|
{ title: t.account, content: <AgentsTab key="account" visibility="ACCOUNT" /> },
|
|
93
94
|
]} />
|
|
@@ -98,15 +99,23 @@ const AgentsTab = ({ visibility }: { visibility: VisibilityLevel | 'BUILT-IN' })
|
|
|
98
99
|
const { close } = useRightPanel()
|
|
99
100
|
const chat = useCurrentChat()
|
|
100
101
|
const [filter, setFilter] = useState('')
|
|
102
|
+
const defaultAgent = useMemo(() => ({
|
|
103
|
+
name: t.defaultAgentName,
|
|
104
|
+
description: t.defaultAgentDescription,
|
|
105
|
+
llm_config: { model_slug: 'gpt4o' },
|
|
106
|
+
} as AgentResponse), [])
|
|
101
107
|
const agents = visibility === 'BUILT-IN' ? agentClient.publicAgents.useQuery({}) : agentClient.agents.useQuery({ visibility })
|
|
102
|
-
const [value, setValue] = useState<AgentResponse | undefined>(agents.find(a => a.id === chat.get('agent')?.id))
|
|
108
|
+
const [value, setValue] = useState<AgentResponse | undefined>(agents.find(a => a.id === chat.get('agent')?.id) ?? defaultAgent)
|
|
103
109
|
const filtered = useMemo(
|
|
104
|
-
() =>
|
|
110
|
+
() => {
|
|
111
|
+
const ags = visibility === 'BUILT-IN' ? [defaultAgent as AgentResponse, ...agents] : agents
|
|
112
|
+
return filter ? ags.filter(a => a === value || a.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : ags
|
|
113
|
+
},
|
|
105
114
|
[agents, filter, value],
|
|
106
115
|
)
|
|
107
116
|
|
|
108
117
|
function submit() {
|
|
109
|
-
if (value) chat.set('agent', { id: value.id, label: value.name, image: value.avatar })
|
|
118
|
+
if (value) chat.set('agent', value.id ? { id: value.id, label: value.name, image: value.avatar } : undefined)
|
|
110
119
|
close()
|
|
111
120
|
}
|
|
112
121
|
|
|
@@ -119,9 +128,9 @@ const AgentsTab = ({ visibility }: { visibility: VisibilityLevel | 'BUILT-IN' })
|
|
|
119
128
|
keygen={a => a.id}
|
|
120
129
|
value={value}
|
|
121
130
|
onChange={setValue}
|
|
122
|
-
renderLabel={({ name, avatar }) => (
|
|
131
|
+
renderLabel={({ name, avatar, id }) => (
|
|
123
132
|
<AgentLabel>
|
|
124
|
-
{avatar && <img src={avatar} />}
|
|
133
|
+
{id ? (avatar && <img src={avatar} />) : <MiniLogo />}
|
|
125
134
|
<Text>{name}</Text>
|
|
126
135
|
</AgentLabel>
|
|
127
136
|
)}
|
|
@@ -170,6 +179,8 @@ const dictionary = {
|
|
|
170
179
|
noSearchResultsDescription: 'Please, try another search term.',
|
|
171
180
|
noData: 'There are no agents in this category yet.',
|
|
172
181
|
noDataDescription: 'Use the tabs above to try other categories or use the AI portal to create new agents.',
|
|
182
|
+
defaultAgentName: 'Stackspot AI (default)',
|
|
183
|
+
defaultAgentDescription: 'The StackSpot CodeGen is an advanced artificial intelligence agent designed to optimize and accelerate software development. Integrated directly into your integrated development environment, StackSpot CodeGen offers real-time code suggestions, helping developers write high-quality code more efficiently. With robust features such as creating Stacks AI, customized knowledge sources, and quick commands, StackSpot CodeGen contextualizes your development needs to provide the best answers and code suggestions.',
|
|
173
184
|
},
|
|
174
185
|
pt: {
|
|
175
186
|
title: 'Agentes',
|
|
@@ -183,5 +194,7 @@ const dictionary = {
|
|
|
183
194
|
noSearchResultsDescription: 'Por favor, tente outra busca.',
|
|
184
195
|
noData: 'Ainda não há agentes nesta categoria.',
|
|
185
196
|
noDataDescription: 'Use as abas acima para tentar outras categorias ou use o Portal AI para criar novos agentes.',
|
|
197
|
+
defaultAgentName: 'Stackspot AI (padrão)',
|
|
198
|
+
defaultAgentDescription: 'O StackSpot CodeGen é um agente de inteligência artificial avançado projetado para otimizar e acelerar o desenvolvimento de software. Integrado diretamente ao seu ambiente de desenvolvimento, o StackSpot CodeGen oferece sugestões de código em tempo real, ajudando os desenvolvedores a escreverem código de alta qualidade de forma mais eficiente. Com recursos robustos, como a criação de Stacks AI, Knowledge Sources personalizadas e comandos rápidos, o StackSpot CodeGen contextualiza suas necessidades de desenvolvimento para fornecer as melhores respostas e sugestões de código.',
|
|
186
199
|
},
|
|
187
200
|
} satisfies Dictionary
|