@stack-spot/ai-chat-widget 1.36.2 → 1.36.3
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 +7 -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 +3 -3
- package/dist/index.d.ts +1 -1
- 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 +1 -1
- package/dist/state/WidgetState.d.ts +1 -1
- package/dist/state/WidgetState.d.ts.map +1 -1
- package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
- package/dist/views/Agents/AgentDescription.js +26 -14
- package/dist/views/Agents/AgentDescription.js.map +1 -1
- package/dist/views/Agents/dictionary.d.ts +1 -1
- package/dist/views/Agents/dictionary.d.ts.map +1 -1
- package/dist/views/Agents/dictionary.js +2 -0
- package/dist/views/Agents/dictionary.js.map +1 -1
- package/dist/views/Agents/styled.d.ts.map +1 -1
- package/dist/views/Agents/styled.js +14 -3
- package/dist/views/Agents/styled.js.map +1 -1
- package/dist/views/Agents/useAgentFavorites.js +3 -3
- package/dist/views/Agents/useAgentFavorites.js.map +1 -1
- package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessage.js +15 -9
- package/dist/views/Chat/ChatMessage.js.map +1 -1
- package/dist/views/Chat/styled.d.ts.map +1 -1
- package/dist/views/Chat/styled.js +24 -0
- package/dist/views/Chat/styled.js.map +1 -1
- package/dist/views/MessageInput/UploadBar.d.ts.map +1 -1
- package/dist/views/MessageInput/UploadBar.js +5 -0
- package/dist/views/MessageInput/UploadBar.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 +56 -0
- package/dist/views/Resources.js.map +1 -0
- package/dist/views/Steps/dictionary.d.ts +1 -1
- package/package.json +2 -2
- package/src/StackspotAIWidget.tsx +2 -0
- package/src/app-metadata.json +3 -3
- package/src/index.ts +2 -1
- package/src/layout.css +1 -1
- package/src/state/WidgetState.ts +1 -1
- package/src/views/Agents/AgentDescription.tsx +64 -23
- package/src/views/Agents/dictionary.ts +2 -0
- package/src/views/Agents/styled.ts +14 -3
- package/src/views/Agents/useAgentFavorites.ts +3 -3
- package/src/views/Chat/ChatMessage.tsx +31 -19
- package/src/views/Chat/styled.ts +24 -0
- package/src/views/MessageInput/UploadBar.tsx +6 -0
- package/src/views/Resources.tsx +99 -0
|
@@ -63,6 +63,11 @@ export const UploadBar = () => {
|
|
|
63
63
|
setAriaMessage(lines.join(' '));
|
|
64
64
|
setTimeout(() => setAriaMessage(''), 2000);
|
|
65
65
|
chat.pushMessage(new ChatEntry({ agentType: 'system', type: 'md', content: lines.join('\n\n') }));
|
|
66
|
+
if (lines.length) {
|
|
67
|
+
setAriaMessage(lines.join(' '));
|
|
68
|
+
setTimeout(() => setAriaMessage(''), 2000);
|
|
69
|
+
chat.pushMessage(new ChatEntry({ agentType: 'system', type: 'md', content: lines.join('\n\n') }));
|
|
70
|
+
}
|
|
66
71
|
});
|
|
67
72
|
return (_jsxs("div", { className: listToClass(['info-bar', 'upload-bar', visible && 'visible']), children: [_jsx("div", { className: "aria-live", "aria-live": "polite", "aria-atomic": "true", children: ariaMessage }), _jsx("div", { className: "space" }), _jsx("div", { className: "content", children: _jsx(FadingOverflow, { className: "list-overflow", scroll: "arrows", enableHorizontalScrollWithVerticalWheel: true, children: _jsx("ul", { children: listItems }) }) })] }));
|
|
68
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadBar.js","sourceRoot":"","sources":["../../../src/views/MessageInput/UploadBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,O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AC,SAAS,EAAC,eAAe,EAAC,MAAM,EAAC,QAAQ,EAAC,uCAAuC,kBAC/F,uBAAK,SAAS,GAAM,GACL,GACb,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Resources.d.ts","sourceRoot":"","sources":["../../src/views/Resources.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS,YAerB,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Flex, IconBox, Text } from '@citric/core';
|
|
3
|
+
import { Agent } from '@citric/icons';
|
|
4
|
+
import { Avatar } from '@citric/ui';
|
|
5
|
+
import { agentToolsClient } from '@stack-spot/portal-network';
|
|
6
|
+
import { useTranslate } from '@stack-spot/portal-translate';
|
|
7
|
+
import { useEffect, useMemo } from 'react';
|
|
8
|
+
import { Accordion } from '../components/Accordion.js';
|
|
9
|
+
import { useWidget, useWidgetState } from '../context/hooks.js';
|
|
10
|
+
import { useRightPanel } from '../right-panel/hooks.js';
|
|
11
|
+
import { toolById } from '../utils/tools.js';
|
|
12
|
+
import { AgentDescription } from './Agents/AgentDescription.js';
|
|
13
|
+
export const Resources = () => {
|
|
14
|
+
const t = useTranslate(dictionary);
|
|
15
|
+
const panel = useWidgetState('panel');
|
|
16
|
+
const message = useWidgetState('currentMessageInPanel');
|
|
17
|
+
const { open } = useRightPanel();
|
|
18
|
+
const widget = useWidget();
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (panel === 'resources' && message)
|
|
21
|
+
open(_jsx(ResourcesPanel, {}, message.messageId), { title: t.title, description: t.description, onClose: () => widget.set('panel', undefined) });
|
|
22
|
+
}, [panel, t]);
|
|
23
|
+
return null;
|
|
24
|
+
};
|
|
25
|
+
const ResourcesPanel = () => {
|
|
26
|
+
const { chatId, messageId } = useWidgetState('currentMessageInPanel') ?? {};
|
|
27
|
+
const widget = useWidget();
|
|
28
|
+
const message = useMemo(() => {
|
|
29
|
+
const chat = widget.chatTabs.getAll().find(c => c.id === chatId);
|
|
30
|
+
return chat?.getMessages().find(m => m.id === messageId)?.getValue();
|
|
31
|
+
}, [messageId]);
|
|
32
|
+
const [toolKits] = agentToolsClient.tools.useStatefulQuery({}, { enabled: !!message?.agent?.id });
|
|
33
|
+
const [agent] = agentToolsClient.agent.useStatefulQuery({ agentId: message?.agent?.id || '' }, { enabled: !!message?.agent?.id });
|
|
34
|
+
const tools = useMemo(() => message?.tools?.map(id => toolById(id, toolKits)), [messageId, toolKits]);
|
|
35
|
+
const customTools = useMemo(() => message?.tools?.map(id => toolById(id, agent?.toolkits?.custom_toolkits)), [messageId, agent?.toolkits?.custom_toolkits]);
|
|
36
|
+
const [agentsTools] = agentToolsClient.agentsByIds.useStatefulQuery({ searchAgentsRequest: { ids: message?.tools || [] } });
|
|
37
|
+
const hasAgentTool = useMemo(() => message?.tools?.some(id => agentsTools?.find((agent) => agent.id === id)), [messageId, toolKits]);
|
|
38
|
+
const header = (image, label) => (_jsxs(Flex, { alignItems: "center", children: [image ? _jsx(Avatar, { size: "xxs", children: _jsx("img", { title: label, src: image }) }) :
|
|
39
|
+
_jsx(IconBox, { appearance: "circle", title: label, color: "gray", children: _jsx(Agent, {}) }), _jsx(Text, { ml: 3, children: label })] }));
|
|
40
|
+
return !!(tools?.length || customTools?.length) && (_jsxs(_Fragment, { children: [_jsx(_Fragment, { children: [...(tools || []), ...(customTools || [])].map((tool) => tool && (_jsx(Box, { mt: 3, children: _jsx(Accordion, { header: header(tool?.image, tool?.name), children: _jsx(Box, { sx: { backgroundColor: 'light.400', m: '-10px', p: '16px' }, children: tool?.description }) }) }, tool.id))) }), hasAgentTool &&
|
|
41
|
+
_jsx(_Fragment, { children: message?.tools?.map((id) => {
|
|
42
|
+
const agentTool = agentsTools?.find((agent) => agent.id === id);
|
|
43
|
+
return (_jsx(Box, { mt: 3, children: _jsx(Accordion, { header: header(agentTool?.avatar || undefined, agentTool?.name), children: _jsx(AgentDescription, { agentId: id }) }) }, id));
|
|
44
|
+
}) })] }));
|
|
45
|
+
};
|
|
46
|
+
const dictionary = {
|
|
47
|
+
en: {
|
|
48
|
+
title: 'Resources',
|
|
49
|
+
description: 'These are the resources used to generate this answer.',
|
|
50
|
+
},
|
|
51
|
+
pt: {
|
|
52
|
+
title: 'Recursos',
|
|
53
|
+
description: 'Esses são os recursos usados pra gerar essa resposta.',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=Resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Resources.js","sourceRoot":"","sources":["../../src/views/Resources.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,MAAM,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA;IAClC,MAAM,KAAK,GAAG,cAAc,CAAC,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O,CACL,KAAC,GAAG,IAAU,EAAE,EAAE,CAAC,YACjB,KAAC,SAAS,IAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,IAAI,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,YACxE,KAAC,gBAAgB,IAAE,OAAO,EAAE,EAAE,GAAI,GACxB,IAHJ,EAAE,CAIN,CAAC,CAAA;oBAAA,CAAC,CACX,GACA,IAEJ,CACJ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,uDAAuD;KACrE;IACD,EAAE,EAAE;QACF,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,uDAAuD;KACrE;CACmB,CAAA"}
|
|
@@ -34,6 +34,6 @@ export declare const dictionary: {
|
|
|
34
34
|
input: string;
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
export declare function useStepsDictionary(): Record<"input" | "step" | "pending" | "steps" | "tools" | "answer" | "
|
|
37
|
+
export declare function useStepsDictionary(): Record<"input" | "step" | "pending" | "steps" | "tools" | "answer" | "unknown" | "running" | "planning" | "stepsPanelDescription" | "response" | "executionTime" | "nextAttempt" | "previousAttempt", string>;
|
|
38
38
|
export type ToolsDictionary = typeof dictionary['en'];
|
|
39
39
|
//# sourceMappingURL=dictionary.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@citric/core": "^6.4.0",
|
|
14
14
|
"@stack-spot/portal-components": "^2.25.5",
|
|
15
15
|
"@citric/icons": "^5.13.0",
|
|
16
|
-
"@stack-spot/portal-network": "
|
|
16
|
+
"@stack-spot/portal-network": "0.173.1",
|
|
17
17
|
"@citric/ui": "^6.10.2",
|
|
18
18
|
"@stack-spot/portal-theme": "^1.0.0",
|
|
19
19
|
"@stack-spot/portal-translate": "^1.1.0",
|
|
@@ -20,6 +20,7 @@ import { KnowledgeSources } from './views/KnowledgeSources'
|
|
|
20
20
|
import { KSDocument } from './views/KSDocument'
|
|
21
21
|
import { MessageInput } from './views/MessageInput'
|
|
22
22
|
import { MinimizedHeader } from './views/MinimizedHeader'
|
|
23
|
+
import { Resources } from './views/Resources'
|
|
23
24
|
import { Stacks } from './views/Stacks'
|
|
24
25
|
import { Steps } from './views/Steps'
|
|
25
26
|
import { Tools } from './views/Tools'
|
|
@@ -117,6 +118,7 @@ export const StackspotAIWidget = (
|
|
|
117
118
|
<ChatHistory />
|
|
118
119
|
<Steps />
|
|
119
120
|
<Tools />
|
|
121
|
+
<Resources />
|
|
120
122
|
<div className="chat-right-panel" ref={rightPanelRef}><RightPanel /></div>
|
|
121
123
|
</div>
|
|
122
124
|
</RightPanelProvider>
|
package/src/app-metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.36.
|
|
4
|
-
"date": "Thu Aug 28 2025
|
|
3
|
+
"version": "1.36.3",
|
|
4
|
+
"date": "Thu Aug 28 2025 22:15:33 GMT+0000 (Coordinated Universal Time)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"name": "@stack-spot/portal-network",
|
|
116
|
-
"version": "0.
|
|
116
|
+
"version": "0.173.1(@stack-spot/auth@5.3.2)(@stack-spot/opa@2.5.0(@stack-spot/auth@5.3.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@stack-spot/portal-translate@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@tanstack/react-query@5.59.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"name": "@stack-spot/portal-theme",
|
package/src/index.ts
CHANGED
|
@@ -12,8 +12,9 @@ export type { ChatAction } from './state/ChatEntry'
|
|
|
12
12
|
export { ChatState } from './state/ChatState'
|
|
13
13
|
export type { MessageInterceptor } from './state/ChatState'
|
|
14
14
|
export { ChatTabsController } from './state/ChatTabsController'
|
|
15
|
+
export { acceptedFileTypes } from './state/constants'
|
|
15
16
|
export { ObservableState } from './state/ObservableState'
|
|
16
17
|
export type { Labeled, LabeledAgent, LabeledWithImage } from './state/types'
|
|
17
18
|
export { WidgetState } from './state/WidgetState'
|
|
18
19
|
export { defaultLanguage, languages } from './utils/programming-languages'
|
|
19
|
-
|
|
20
|
+
|
package/src/layout.css
CHANGED
package/src/state/WidgetState.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface WidgetProperties {
|
|
|
13
13
|
/**
|
|
14
14
|
* Current content of the right panel. Undefined for closed right panel.
|
|
15
15
|
*/
|
|
16
|
-
panel?: 'stack' | 'workspace' | 'agent' | 'ks' | 'editor' | 'history' | 'ks-details' | 'steps' | 'tools',
|
|
16
|
+
panel?: 'stack' | 'workspace' | 'agent' | 'ks' | 'editor' | 'history' | 'ks-details' | 'steps' | 'tools' | 'resources',
|
|
17
17
|
/**
|
|
18
18
|
* KS to use when the right panel "ks-details" is open.
|
|
19
19
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Text } from '@citric/core'
|
|
2
|
-
import {
|
|
1
|
+
import { Box, Flex, IconBox, Text } from '@citric/core'
|
|
2
|
+
import { Agent, Cog } from '@citric/icons'
|
|
3
|
+
import { Avatar, Badge, Skeleton } from '@citric/ui'
|
|
3
4
|
import { agentToolsClient } from '@stack-spot/portal-network'
|
|
4
5
|
import { useMemo } from 'react'
|
|
5
|
-
import { ToolBadge } from '../../components/ToolBadge'
|
|
6
6
|
import { toolById } from '../../utils/tools'
|
|
7
7
|
import { useAgentsDictionary } from './dictionary'
|
|
8
8
|
import { AgentDescriptionBox } from './styled'
|
|
@@ -15,43 +15,80 @@ export const AgentDescription = ({ agentId }: { agentId?: string }) => {
|
|
|
15
15
|
|
|
16
16
|
const knowledgeSources = useMemo(
|
|
17
17
|
() => agent?.knowledge_sources_config?.knowledge_sources_details?.map((ks, index) => (
|
|
18
|
-
<li key={index}
|
|
18
|
+
<li key={index}>
|
|
19
|
+
<Box className="card-agent-info">
|
|
20
|
+
<Flex alignItems="center" justifyContent="space-between" pl={2}>
|
|
21
|
+
<Text colorScheme="light.contrastText">{ks.name}</Text>
|
|
22
|
+
<Badge palette="gray" appearance="square">{ks.type}</Badge>
|
|
23
|
+
</Flex>
|
|
24
|
+
</Box>
|
|
25
|
+
</li>
|
|
19
26
|
)),
|
|
20
27
|
[agent],
|
|
21
28
|
)
|
|
22
29
|
const skeleton = useMemo(() => {
|
|
23
30
|
const loadingKS: React.ReactElement[] = []
|
|
24
31
|
for (let i = 0; i < numberOfKnowledgeSources; i++) {
|
|
25
|
-
loadingKS.push(<li key={i}><
|
|
32
|
+
loadingKS.push(<li key={i}><Skeleton className="ks-skeleton" /></li>)
|
|
26
33
|
}
|
|
27
34
|
return loadingKS
|
|
28
35
|
}, [numberOfKnowledgeSources])
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
36
|
+
|
|
37
|
+
const { tools, multiAgents } = useMemo(() => {
|
|
38
|
+
const tools: React.ReactElement[] = []
|
|
39
|
+
const multiAgents: React.ReactElement[] = []
|
|
40
|
+
const builtInTools = agent?.toolkits?.builtin_toolkits ?? []
|
|
32
41
|
const customToolkits = agent?.toolkits?.custom_toolkits ?? []
|
|
33
|
-
for (const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
for (const toolkit of builtInTools) {
|
|
43
|
+
for (const tool of toolkit.tools ?? []) {
|
|
44
|
+
if (toolkit.id == 'UTILITIES'){
|
|
45
|
+
const toolWithImage = toolById(tool.id, toolKits)
|
|
46
|
+
tools.push(
|
|
47
|
+
<li key={tool.id}>
|
|
48
|
+
<Box className="card-agent-info">
|
|
49
|
+
<Flex alignItems="center">
|
|
50
|
+
{toolWithImage?.image ?
|
|
51
|
+
<Avatar size="xxs" sx={{ mr: 3 }}> <img src={toolWithImage?.image} /></Avatar> :
|
|
52
|
+
<IconBox colorIcon="light" sx={{ mr: 3 }}><Cog /></IconBox>}
|
|
53
|
+
<Text colorScheme="light.contrastText">{toolWithImage?.name || toolWithImage?.id || 'unknown'}</Text>
|
|
54
|
+
</Flex>
|
|
55
|
+
</Box>
|
|
56
|
+
</li>,
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
if (toolkit.id == 'MULTI_AGENTS'){
|
|
60
|
+
multiAgents.push(
|
|
61
|
+
<li key={tool.id}>
|
|
62
|
+
<Box className="card-agent-info">
|
|
63
|
+
<Flex alignItems="center">
|
|
64
|
+
<IconBox colorIcon="light" sx={{ mr: 3 }}><Agent /></IconBox>
|
|
65
|
+
<Text colorScheme="light.contrastText">
|
|
66
|
+
{tool.name}
|
|
67
|
+
</Text>
|
|
68
|
+
</Flex>
|
|
69
|
+
</Box>
|
|
70
|
+
</li>,
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
44
74
|
}
|
|
45
75
|
for (const toolkit of customToolkits) {
|
|
46
76
|
for (const tool of toolkit.tools) {
|
|
47
|
-
|
|
77
|
+
tools.push(
|
|
48
78
|
<li key={tool.id}>
|
|
49
|
-
<
|
|
79
|
+
<Box className="card-agent-info">
|
|
80
|
+
<Flex alignItems="center">
|
|
81
|
+
{toolkit.avatar ?
|
|
82
|
+
<Avatar size="xxs" sx={{ mr: 3 }}><img src={toolkit.avatar} /></Avatar> :
|
|
83
|
+
<IconBox colorIcon="light" sx={{ mr: 3 }}><Cog /></IconBox>}
|
|
84
|
+
<Text colorScheme="light.contrastText">{tool.name}</Text>
|
|
85
|
+
</Flex>
|
|
86
|
+
</Box>
|
|
50
87
|
</li>,
|
|
51
88
|
)
|
|
52
89
|
}
|
|
53
90
|
}
|
|
54
|
-
return
|
|
91
|
+
return { tools, multiAgents }
|
|
55
92
|
}, [agent])
|
|
56
93
|
|
|
57
94
|
return (
|
|
@@ -64,10 +101,14 @@ export const AgentDescription = ({ agentId }: { agentId?: string }) => {
|
|
|
64
101
|
<Text appearance="microtext1" className="title">Knowledge sources</Text>
|
|
65
102
|
<ul>{isLoading || isLoadingToolKit ? skeleton : knowledgeSources}</ul>
|
|
66
103
|
</section>}
|
|
67
|
-
{!!tools
|
|
104
|
+
{!!tools?.length && <section>
|
|
68
105
|
<Text appearance="microtext1" className="title">{t.tools}</Text>
|
|
69
106
|
<ul>{tools}</ul>
|
|
70
107
|
</section>}
|
|
108
|
+
{!!multiAgents?.length && <section>
|
|
109
|
+
<Text appearance="microtext1" className="title">{t.multiAgent}</Text>
|
|
110
|
+
<ul>{multiAgents}</ul>
|
|
111
|
+
</section>}
|
|
71
112
|
{agent?.model_name && <section>
|
|
72
113
|
<Text appearance="microtext1" className="title">LLM</Text>
|
|
73
114
|
<Badge palette="orange" appearance="square">{agent?.model_name}</Badge>
|
|
@@ -18,6 +18,7 @@ const dictionary = {
|
|
|
18
18
|
favorites: 'Favorites',
|
|
19
19
|
tools: 'Tools',
|
|
20
20
|
spots: 'Spots',
|
|
21
|
+
multiAgent: 'Multi-agents',
|
|
21
22
|
},
|
|
22
23
|
pt: {
|
|
23
24
|
title: 'Agentes',
|
|
@@ -36,6 +37,7 @@ const dictionary = {
|
|
|
36
37
|
favorites: 'Favoritos',
|
|
37
38
|
tools: 'Ferramentas',
|
|
38
39
|
spots: 'Spots',
|
|
40
|
+
multiAgent: 'Multi-agents',
|
|
39
41
|
|
|
40
42
|
},
|
|
41
43
|
} satisfies Dictionary
|
|
@@ -18,9 +18,11 @@ export const AgentLabel = styled.div`
|
|
|
18
18
|
export const AgentDescriptionBox = styled.div`
|
|
19
19
|
color: ${theme.color.light[700]};
|
|
20
20
|
line-height: 18px;
|
|
21
|
+
background-color: ${theme.color.light[400]};
|
|
22
|
+
margin: -10px;
|
|
23
|
+
padding: 8px;
|
|
21
24
|
|
|
22
25
|
section {
|
|
23
|
-
border-bottom: 1px solid ${theme.color.light[600]};
|
|
24
26
|
padding-bottom: 10px;
|
|
25
27
|
margin-bottom: 10px;
|
|
26
28
|
|
|
@@ -34,6 +36,14 @@ export const AgentDescriptionBox = styled.div`
|
|
|
34
36
|
display: block;
|
|
35
37
|
margin-bottom: 6px;
|
|
36
38
|
}
|
|
39
|
+
|
|
40
|
+
.card-agent-info {
|
|
41
|
+
background-color: ${theme.color.light[500]};
|
|
42
|
+
border: 1px solid ${theme.color.light[600]};
|
|
43
|
+
border-radius: 3px;
|
|
44
|
+
padding: 4px;
|
|
45
|
+
width: 100%;
|
|
46
|
+
}
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
ul {
|
|
@@ -44,10 +54,11 @@ export const AgentDescriptionBox = styled.div`
|
|
|
44
54
|
flex-direction: row;
|
|
45
55
|
flex-wrap: wrap;
|
|
46
56
|
white-space: nowrap;
|
|
47
|
-
gap: 6px;
|
|
48
57
|
|
|
49
58
|
li {
|
|
50
|
-
margin: 3px
|
|
59
|
+
margin-bottom: 3px;
|
|
60
|
+
display: flex;
|
|
61
|
+
width: 100%;
|
|
51
62
|
}
|
|
52
63
|
}
|
|
53
64
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable filenames/match-regex */
|
|
2
|
-
import {
|
|
2
|
+
import { agentToolsClient } from '@stack-spot/portal-network'
|
|
3
3
|
|
|
4
4
|
export function useAgentFavorites() {
|
|
5
5
|
const useFavorites = () => agentToolsClient.agents.useQuery({ visibility: 'favorite' })
|
|
6
|
-
const [addFavorite, pendingAddFav] =
|
|
7
|
-
const [removeFavorite, pendingRemoveFav] =
|
|
6
|
+
const [addFavorite, pendingAddFav] = agentToolsClient.addFavorite.useMutation()
|
|
7
|
+
const [removeFavorite, pendingRemoveFav] = agentToolsClient.removeFavorite.useMutation()
|
|
8
8
|
|
|
9
9
|
const removeFavoriteAgent = async (idOrSlug?: string) => {
|
|
10
10
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box, Button, Checkbox, Flex, IconBox, Input, Label, Radio, Text } from '@citric/core'
|
|
2
|
-
import { Check, Cog, Copy, Dislike, DislikeFill, Like, LikeFill, TimesCircle } from '@citric/icons'
|
|
3
|
-
import { Badge, IconButton, Tooltip } from '@citric/ui'
|
|
2
|
+
import { Agent, Check, Cog, Copy, Dislike, DislikeFill, Like, LikeFill, TimesCircle } from '@citric/icons'
|
|
3
|
+
import { Avatar, AvatarGroup, Badge, IconButton, Tooltip } from '@citric/ui'
|
|
4
4
|
import { agentToolsClient } from '@stack-spot/portal-network'
|
|
5
5
|
import { listToClass } from '@stack-spot/portal-theme'
|
|
6
6
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
@@ -10,7 +10,6 @@ import { PhoneInput } from 'react-international-phone'
|
|
|
10
10
|
import 'react-international-phone/style.css'
|
|
11
11
|
import { FileDescription } from '../../components/FileDescription'
|
|
12
12
|
import { Markdown } from '../../components/Markdown'
|
|
13
|
-
import { StackedBadge } from '../../components/StackedBadge'
|
|
14
13
|
import { useChatEntry, useCurrentChat, useWidget } from '../../context/hooks'
|
|
15
14
|
import { useMidnightUpdateView } from '../../hooks/midnight-update-view'
|
|
16
15
|
import { ChatEntry, SerializableAction, TextChatEntry } from '../../state/ChatEntry'
|
|
@@ -195,6 +194,8 @@ export const ChatMessage = ({ message, isLast, beforeMessage, afterMessage }: Pr
|
|
|
195
194
|
const chat = useCurrentChat()
|
|
196
195
|
const agentId = entry.agent?.id ?? ''
|
|
197
196
|
const [toolKits] = agentToolsClient.tools.useStatefulQuery({}, { enabled: !!agentId })
|
|
197
|
+
const [agentsTools] = agentToolsClient.agentsByIds.useStatefulQuery(
|
|
198
|
+
{ searchAgentsRequest: { ids: entry.tools || [''] } }, { enabled: !!entry.tools })
|
|
198
199
|
const [copied, setCopied] = useState(false)
|
|
199
200
|
const [showUserButtonCopy, setShowUserButtonCopy] = useState(false)
|
|
200
201
|
|
|
@@ -309,12 +310,11 @@ export const ChatMessage = ({ message, isLast, beforeMessage, afterMessage }: Pr
|
|
|
309
310
|
</form>
|
|
310
311
|
}
|
|
311
312
|
|
|
312
|
-
function
|
|
313
|
+
function openResourcesPanel() {
|
|
313
314
|
widget.set('currentMessageInPanel', { chatId: chat.id, messageId: message.id })
|
|
314
|
-
widget.set('panel', '
|
|
315
|
+
widget.set('panel', 'resources')
|
|
315
316
|
}
|
|
316
317
|
|
|
317
|
-
|
|
318
318
|
return (entry.content || entry.error || !!entry.steps?.length || entry.upload?.length) && (
|
|
319
319
|
<li key={entry.messageId} className={entry.agentType} ref={ref}>
|
|
320
320
|
<div className="chat-message-container"
|
|
@@ -342,19 +342,7 @@ export const ChatMessage = ({ message, isLast, beforeMessage, afterMessage }: Pr
|
|
|
342
342
|
)}
|
|
343
343
|
</div>
|
|
344
344
|
{afterMessage && createElement(afterMessage, { message })}
|
|
345
|
-
|
|
346
|
-
aria-label={t.openToolsPanel}
|
|
347
|
-
title={t.openToolsPanel}
|
|
348
|
-
tabIndex={0}
|
|
349
|
-
role="button"
|
|
350
|
-
className="tools-badge"
|
|
351
|
-
label={t.tools}
|
|
352
|
-
images={entry.tools.slice(0, 3).map((id) => {
|
|
353
|
-
const tool = toolById(id, toolKits)
|
|
354
|
-
return { key: id, name: tool?.name || id, icon: <Cog />, url: tool?.image }
|
|
355
|
-
})}
|
|
356
|
-
onClick={openToolsPanel}
|
|
357
|
-
/>}
|
|
345
|
+
|
|
358
346
|
{!!entry.knowledgeSources?.length && <div className="ks-box">
|
|
359
347
|
<Text appearance="microtext1" colorScheme="light.700">Knowledge Sources:</Text>
|
|
360
348
|
<ul>{entry.knowledgeSources.map((ks, index) => (
|
|
@@ -363,6 +351,28 @@ export const ChatMessage = ({ message, isLast, beforeMessage, afterMessage }: Pr
|
|
|
363
351
|
</li>
|
|
364
352
|
))}</ul>
|
|
365
353
|
</div>}
|
|
354
|
+
|
|
355
|
+
{(!!agentsTools?.length || !!entry.tools?.length) && <div className="tools-box">
|
|
356
|
+
<AvatarGroup onClick={openResourcesPanel} aria-label={t.openResourcesPanel} role="button">
|
|
357
|
+
{agentsTools?.map((agent) => (
|
|
358
|
+
<Avatar size="xxs" key={agent.id} className="agent-info-avatar-resource">
|
|
359
|
+
{agent.avatar ?
|
|
360
|
+
<img alt={agent.name} aria-label={agent.name} title={agent.name} src={agent.avatar} /> :
|
|
361
|
+
<IconBox appearance="circle" aria-label={agent.name} title={agent.name} color="gray"><Agent /></IconBox>}
|
|
362
|
+
</Avatar>
|
|
363
|
+
))}
|
|
364
|
+
{entry.tools?.map((id) => {
|
|
365
|
+
const tool = toolById(id, toolKits)
|
|
366
|
+
return (
|
|
367
|
+
<Avatar size="xxs" key={id} className="agent-info-avatar-resource">
|
|
368
|
+
{tool?.image ?
|
|
369
|
+
<img alt={tool.name} aria-label={tool.name} title={tool.name} src={tool.image} /> :
|
|
370
|
+
<IconBox appearance="circle" aria-label={tool?.name} title={tool?.name} color="gray"><Cog /></IconBox>}
|
|
371
|
+
</Avatar>
|
|
372
|
+
)})}
|
|
373
|
+
|
|
374
|
+
</AvatarGroup>
|
|
375
|
+
</div>}
|
|
366
376
|
|
|
367
377
|
{shouldShowFooter && <div className="message-footer">
|
|
368
378
|
{entry.agentType === 'bot' && !entry.error && <div className="message-actions">
|
|
@@ -452,6 +462,7 @@ const dictionary = {
|
|
|
452
462
|
dislike: 'Dislike',
|
|
453
463
|
tools: 'Tools',
|
|
454
464
|
openToolsPanel: 'Open the tools panel to see more details.',
|
|
465
|
+
openResourcesPanel: 'Open the resources panel to see more details.',
|
|
455
466
|
copied: 'Copied',
|
|
456
467
|
},
|
|
457
468
|
pt: {
|
|
@@ -460,6 +471,7 @@ const dictionary = {
|
|
|
460
471
|
dislike: 'Não gostei',
|
|
461
472
|
tools: 'Ferramentas',
|
|
462
473
|
openToolsPanel: 'Abrir o painel de ferramentas para ver mais detalhes.',
|
|
474
|
+
openResourcesPanel: 'Abrir o painel de recursos para ver mais detalhes.',
|
|
463
475
|
copied: 'Copiado',
|
|
464
476
|
},
|
|
465
477
|
} satisfies Dictionary
|
package/src/views/Chat/styled.ts
CHANGED
|
@@ -219,6 +219,30 @@ export const ChatList: IStyledComponentBase<
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
+
.tools-box {
|
|
223
|
+
|
|
224
|
+
> ul {
|
|
225
|
+
display: flex;
|
|
226
|
+
flex-direction: row;
|
|
227
|
+
flex-wrap: wrap;
|
|
228
|
+
white-space: nowrap;
|
|
229
|
+
margin: 0;
|
|
230
|
+
margin-top: 8px;
|
|
231
|
+
padding: 0;
|
|
232
|
+
list-style: none;
|
|
233
|
+
gap: 6px;
|
|
234
|
+
|
|
235
|
+
&:hover{
|
|
236
|
+
cursor: pointer;
|
|
237
|
+
|
|
238
|
+
.agent-info-avatar-resource {
|
|
239
|
+
transition: margin-left 0.3s ease-in;
|
|
240
|
+
margin-left: 0px;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
222
246
|
.steps {
|
|
223
247
|
ul {
|
|
224
248
|
list-style: none;
|
|
@@ -80,6 +80,12 @@ export const UploadBar = () => {
|
|
|
80
80
|
setAriaMessage(lines.join(' '))
|
|
81
81
|
setTimeout(() => setAriaMessage(''), 2000)
|
|
82
82
|
chat.pushMessage(new ChatEntry({ agentType: 'system', type: 'md', content: lines.join('\n\n') }))
|
|
83
|
+
|
|
84
|
+
if (lines.length) {
|
|
85
|
+
setAriaMessage(lines.join(' '))
|
|
86
|
+
setTimeout(() => setAriaMessage(''), 2000)
|
|
87
|
+
chat.pushMessage(new ChatEntry({ agentType: 'system', type: 'md', content: lines.join('\n\n') }))
|
|
88
|
+
}
|
|
83
89
|
})
|
|
84
90
|
|
|
85
91
|
return (
|