@stack-spot/ai-chat-widget 1.36.1-beta.1 → 1.36.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 +31 -20
- package/dist/app-metadata.json +4 -4
- package/dist/chat-interceptors/quick-commands.d.ts.map +1 -1
- package/dist/chat-interceptors/quick-commands.js +9 -3
- package/dist/chat-interceptors/quick-commands.js.map +1 -1
- package/dist/components/FileDescription.js +1 -1
- package/dist/components/FileDescription.js.map +1 -1
- 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/constants.js +2 -2
- package/dist/state/constants.js.map +1 -1
- package/dist/utils/tools.d.ts +2 -1
- package/dist/utils/tools.d.ts.map +1 -1
- package/dist/utils/tools.js +12 -1
- package/dist/utils/tools.js.map +1 -1
- package/dist/utils/upload/FileUpload.d.ts.map +1 -1
- package/dist/utils/upload/FileUpload.js +1 -2
- package/dist/utils/upload/FileUpload.js.map +1 -1
- package/dist/views/Agents/AgentDescription.js +2 -2
- package/dist/views/Agents/AgentDescription.js.map +1 -1
- package/dist/views/MessageInput/ContextBar.js +1 -1
- package/dist/views/MessageInput/ContextBar.js.map +1 -1
- package/dist/views/MessageInput/SelectContent.d.ts.map +1 -1
- package/dist/views/MessageInput/SelectContent.js +8 -8
- package/dist/views/MessageInput/SelectContent.js.map +1 -1
- package/dist/views/MessageInput/UploadBar.d.ts.map +1 -1
- package/dist/views/MessageInput/UploadBar.js +0 -5
- package/dist/views/MessageInput/UploadBar.js.map +1 -1
- package/dist/views/MessageInput/dictionary.d.ts +1 -1
- package/dist/views/MessageInput/dictionary.d.ts.map +1 -1
- package/dist/views/MessageInput/dictionary.js +2 -0
- package/dist/views/MessageInput/dictionary.js.map +1 -1
- package/dist/views/MessageInput/styled.js +8 -8
- package/dist/views/Tools.js +4 -2
- package/dist/views/Tools.js.map +1 -1
- package/package.json +3 -3
- package/src/app-metadata.json +4 -4
- package/src/chat-interceptors/quick-commands.ts +11 -5
- package/src/components/FileDescription.tsx +1 -1
- package/src/index.ts +1 -2
- package/src/layout.css +1 -1
- package/src/state/constants.ts +2 -2
- package/src/utils/tools.ts +23 -2
- package/src/utils/upload/FileUpload.ts +1 -2
- package/src/views/Agents/AgentDescription.tsx +2 -2
- package/src/views/MessageInput/ContextBar.tsx +1 -1
- package/src/views/MessageInput/SelectContent.tsx +10 -11
- package/src/views/MessageInput/UploadBar.tsx +3 -9
- package/src/views/MessageInput/dictionary.ts +2 -0
- package/src/views/MessageInput/styled.ts +8 -8
- package/src/views/Tools.tsx +19 -13
|
@@ -63,11 +63,6 @@ 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
|
-
}
|
|
71
66
|
});
|
|
72
67
|
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 }) }) })] }));
|
|
73
68
|
};
|
|
@@ -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;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AAC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const useMessageInputDictionary: () => Record<"code" | "placeholder" | "selected" | "send" | "cancel" | "stack" | "knowledgeSource" | "agent" | "upload" | "remove" | "collapse" | "spot" | "typing" | "removeConfig" | "removeStack" | "removeWorkspace" | "removeKS" | "removeSelection" | "expand" | "uploadSizeError" | "uploadItemLimitError" | "uploadError" | "uploadDragging" | "uploadDragDropTitle" | "uploadDragDropDescription" | "unknownUploadError" | "cantSendBecauseOfUploadError" | "cantSendBecauseOfUploadProgress" | "cantSendBecauseOfEmptyContent" | "cantSendBecausePromptMaxLength" | "chatAgent" | "uploadSuccessStatus", string>;
|
|
1
|
+
export declare const useMessageInputDictionary: () => Record<"code" | "placeholder" | "selected" | "send" | "cancel" | "stack" | "knowledgeSource" | "agent" | "upload" | "remove" | "collapse" | "spot" | "typing" | "removeConfig" | "removeStack" | "removeWorkspace" | "removeKS" | "removeSelection" | "expand" | "uploadSizeError" | "uploadItemLimitError" | "uploadError" | "uploadDragging" | "uploadDragDropTitle" | "uploadDragDropDescription" | "unknownUploadError" | "cantSendBecauseOfUploadError" | "cantSendBecauseOfUploadProgress" | "cantSendBecauseOfEmptyContent" | "cantSendBecausePromptMaxLength" | "chatAgent" | "uploadSuccessStatus" | "chatViewMenu", string>;
|
|
2
2
|
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"AA2EA,eAAO,MAAM,yBAAyB,6mBAAiC,CAAA"}
|
|
@@ -33,6 +33,7 @@ const dictionary = {
|
|
|
33
33
|
cantSendBecausePromptMaxLength: 'You can\'t send messages longer than $0 characters. Please, shorten your message.',
|
|
34
34
|
chatAgent: 'Agents',
|
|
35
35
|
uploadSuccessStatus: 'File sent successfully',
|
|
36
|
+
chatViewMenu: 'Chat options menu',
|
|
36
37
|
},
|
|
37
38
|
pt: {
|
|
38
39
|
stack: 'Selecionar stack',
|
|
@@ -67,6 +68,7 @@ const dictionary = {
|
|
|
67
68
|
cantSendBecausePromptMaxLength: 'Você não pode enviar mensagens com mais de $0 caracteres. Por favor, reduza sua mensagem.',
|
|
68
69
|
chatAgent: 'Agentes',
|
|
69
70
|
uploadSuccessStatus: 'Arquivo anexado com sucesso',
|
|
71
|
+
chatViewMenu: 'Menu de opções do chat',
|
|
70
72
|
},
|
|
71
73
|
};
|
|
72
74
|
export const useMessageInputDictionary = () => useTranslate(dictionary);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEvE,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,aAAa;QACnB,eAAe,EAAE,0BAA0B;QAC3C,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,gDAAgD;QAC7D,MAAM,EAAE,sBAAsB;QAC9B,MAAM,EAAE,QAAQ;QAChB,YAAY,EAAE,8BAA8B;QAC5C,WAAW,EAAE,8BAA8B;QAC3C,eAAe,EAAE,6BAA6B;QAC9C,QAAQ,EAAE,kCAAkC;QAC5C,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,+BAA+B;QAChD,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,gBAAgB;QACxB,QAAQ,EAAE,kBAAkB;QAC5B,eAAe,EAAE,wFAAwF;QACzG,oBAAoB,EAAE,6FAA6F;QACnH,WAAW,EAAE,kDAAkD;QAC/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65
65
|
> .aria-live {
|
|
66
66
|
position: absolute;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
width: 1px;
|
|
68
|
+
height: 1px;
|
|
69
|
+
margin: -1px;
|
|
70
|
+
padding: 0;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
clip: rect(0 0 0 0);
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
border: 0;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
> .space {
|
package/dist/views/Tools.js
CHANGED
|
@@ -35,8 +35,10 @@ const ToolsPanel = () => {
|
|
|
35
35
|
return chat?.getMessages().find(m => m.id === messageId)?.getValue();
|
|
36
36
|
}, [messageId]);
|
|
37
37
|
const [toolKits] = agentToolsClient.tools.useStatefulQuery({}, { enabled: !!message?.agent?.id });
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const [agent] = agentToolsClient.agent.useStatefulQuery({ agentId: message?.agent?.id || '' }, { enabled: !!message?.agent?.id });
|
|
39
|
+
const tools = useMemo(() => message?.tools?.map(id => toolById(id, toolKits)), [messageId, toolKits]);
|
|
40
|
+
const customTools = useMemo(() => message?.tools?.map(id => toolById(id, agent?.toolkits?.custom_toolkits)), [messageId, agent?.toolkits?.custom_toolkits]);
|
|
41
|
+
return !!(tools?.length || customTools?.length) && (_jsx(ToolList, { children: [...(tools || []), ...(customTools || [])].map((tool) => tool && (_jsx("li", { children: _jsx(ToolBadge, { name: tool.name || tool.id, image: tool.image ?? '', description: tool.description ?? '', backgroundColor: "light.500" }) }, tool.id))) }));
|
|
40
42
|
};
|
|
41
43
|
const dictionary = {
|
|
42
44
|
en: {
|
package/dist/views/Tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tools.js","sourceRoot":"","sources":["../../src/views/Tools.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE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G,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAC7C,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,IAAI,CACN,uBACE,KAAC,SAAS,IACR,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,EAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,EACvB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,EAAE,EACnC,eAAe,EAAC,WAAW,GAC3B,IANK,IAAI,CAAC,EAAE,CAOX,CACN,CACJ,GACQ,CACZ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,wCAAwC;KACtD;IACD,EAAE,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,8CAA8C;KAC5D;CACmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.36.1
|
|
3
|
+
"version": "1.36.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"@citric/core": "^6.4.0",
|
|
14
|
-
"@stack-spot/portal-components": "^2.
|
|
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.169.0",
|
|
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",
|
package/src/app-metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.36.1
|
|
4
|
-
"date": "
|
|
3
|
+
"version": "1.36.1",
|
|
4
|
+
"date": "Mon Aug 18 2025 15:03:09 GMT+0000 (Coordinated Universal Time)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
|
@@ -109,11 +109,11 @@
|
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
"name": "@stack-spot/portal-components",
|
|
112
|
-
"version": "2.
|
|
112
|
+
"version": "2.25.5(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.13.0(react@18.2.0))(@citric/ui@6.10.2(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.13.0(react@18.2.0))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@stack-spot/portal-theme@1.1.0(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(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))(@types/react@18.3.11)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"name": "@stack-spot/portal-network",
|
|
116
|
-
"version": "0.
|
|
116
|
+
"version": "0.169.0(@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",
|
|
@@ -74,25 +74,31 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
74
74
|
*/
|
|
75
75
|
async function runRouterStep(
|
|
76
76
|
ctx: QCContext,
|
|
77
|
-
stepIndex: number, iteration: number
|
|
77
|
+
stepIndex: number, iteration: Record<string, number>,
|
|
78
78
|
progress: { update: (index: number) => void, remove: () => void },
|
|
79
79
|
) {
|
|
80
80
|
const { qc: { slug, steps }, code, resultMap, customInputs } = ctx
|
|
81
81
|
const step = steps![stepIndex]
|
|
82
82
|
const inputData = Object.keys(customInputs).length > 0 && code ? { ...customInputs, [code]: code } : code ?? customInputs
|
|
83
83
|
try {
|
|
84
|
+
if (step.slug in iteration) {
|
|
85
|
+
iteration[step.slug] = iteration[step.slug] + 1
|
|
86
|
+
} else {
|
|
87
|
+
iteration[step.slug] = 1
|
|
88
|
+
}
|
|
89
|
+
|
|
84
90
|
const { next_step_slug } = await aiClient.calculateNextStep.mutate({
|
|
85
91
|
stepSlug: step.slug,
|
|
86
92
|
slug: slug,
|
|
87
93
|
quickCommandEvaluateStepRouterRequest: {
|
|
88
|
-
executions_count: iteration
|
|
94
|
+
executions_count: iteration[step.slug],
|
|
89
95
|
input_data: inputData,
|
|
90
96
|
slugs_executions: resultMap,
|
|
91
97
|
},
|
|
92
98
|
})
|
|
93
99
|
|
|
94
100
|
if (next_step_slug === step.slug) {
|
|
95
|
-
return runStepsRecursively(stepIndex, progress, ctx, iteration
|
|
101
|
+
return runStepsRecursively(stepIndex, progress, ctx, iteration)
|
|
96
102
|
}
|
|
97
103
|
const nextStepIndex = steps?.findIndex((step) => step.slug === next_step_slug)
|
|
98
104
|
|
|
@@ -222,7 +228,7 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
222
228
|
}
|
|
223
229
|
|
|
224
230
|
async function runStepsRecursively(currentIndex: number, progress: { update: (index: number) => void, remove: () => void },
|
|
225
|
-
ctx: QCContext, iteration: number) {
|
|
231
|
+
ctx: QCContext, iteration: Record<string, number>) {
|
|
226
232
|
const { qc } = ctx
|
|
227
233
|
if (!qc.steps || currentIndex >= qc.steps?.length) return
|
|
228
234
|
progress.update(currentIndex)
|
|
@@ -245,7 +251,7 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
245
251
|
async function runSteps(ctx: QCContext) {
|
|
246
252
|
const progress = showProgressMessage(ctx)
|
|
247
253
|
try {
|
|
248
|
-
await runStepsRecursively(0, progress, ctx,
|
|
254
|
+
await runStepsRecursively(0, progress, ctx, {})
|
|
249
255
|
} finally {
|
|
250
256
|
progress.remove()
|
|
251
257
|
}
|
|
@@ -91,7 +91,7 @@ export const FileDescription = ({ fileName, icon, status, onRemove, onRetry }: F
|
|
|
91
91
|
<Text appearance="microtext1" className="name" title={name}>{name}</Text>
|
|
92
92
|
<Text appearance="microtext1" colorScheme="light.700">{extension.toUpperCase()}</Text>
|
|
93
93
|
</div>
|
|
94
|
-
{onRemove && <IconButton onClick={onRemove} title={t.remove}
|
|
94
|
+
{onRemove && <IconButton onClick={onRemove} title={t.remove} aria-label={`${t.remove} ${name}`}>
|
|
95
95
|
<TimesMini />
|
|
96
96
|
</IconButton>}
|
|
97
97
|
</Styled>
|
package/src/index.ts
CHANGED
|
@@ -12,9 +12,8 @@ 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'
|
|
16
15
|
export { ObservableState } from './state/ObservableState'
|
|
17
16
|
export type { Labeled, LabeledAgent, LabeledWithImage } from './state/types'
|
|
18
17
|
export { WidgetState } from './state/WidgetState'
|
|
19
18
|
export { defaultLanguage, languages } from './utils/programming-languages'
|
|
20
|
-
|
|
19
|
+
export { acceptedFileTypes } from './state/constants'
|
package/src/layout.css
CHANGED
package/src/state/constants.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FileSize } from './types'
|
|
2
2
|
|
|
3
3
|
export const acceptedFileTypes = [
|
|
4
|
-
'json', 'yaml', 'txt', 'md', 'json', 'yaml', 'pdf', /*'xls'
|
|
4
|
+
'json', 'yaml', 'txt', 'md', 'json', 'yaml', 'pdf', /*'xls',*/ 'xlsx', 'csv', 'cbl', 'cpp', 'cxx', 'cc', 'c', 'hpp', 'hxx', 'hh', 'h',
|
|
5
5
|
'cs', 'go', 'html', 'htm', 'kt', 'kts', 'md', 'php', 'proto', 'py', 'java', 'js', 'jsx', 'ts', 'tsx', 'rst', 'rb', 'rs', 'scala', 'swift',
|
|
6
6
|
'sql', 'yaml', 'yml', 'tf', 'sh', 'ps1', 'psd1', 'psm1', 'bat', 'cmd', 'rego', 'f', 'for', 'r', 'pl', 'vb', 'dart', 'hs', 'lua',
|
|
7
|
-
'asm', 'groovy', 'gvy', 'gy', 'mat', 'clj', 'lisp', 'm', 'cls', 'css', 'scss', 'json', 'jpg', 'jpeg', 'png',
|
|
7
|
+
'asm', 'groovy', 'gvy', 'gy', 'mat', 'clj', 'lisp', 'm', 'cls', 'css', 'scss', 'json', 'jpg', 'jpeg', 'png', 'docx', 'pptx',
|
|
8
8
|
]
|
|
9
9
|
|
|
10
10
|
export const maxFileSize: FileSize = { value: 10, unit: 'MB' }
|
package/src/utils/tools.ts
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import { BuiltinToolkitResponse, BuiltinToolResponse } from '@stack-spot/portal-network/api/agent'
|
|
2
|
+
import { CustomToolkitDto } from '@stack-spot/portal-network/api/agent-tools'
|
|
2
3
|
import { keyBy } from 'lodash'
|
|
3
4
|
|
|
4
5
|
export type ToolWithImage = BuiltinToolResponse & { id: string, image?: string }
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
function isBuiltinToolkit(
|
|
8
|
+
toolkit: BuiltinToolkitResponse | CustomToolkitDto,
|
|
9
|
+
): toolkit is BuiltinToolkitResponse {
|
|
10
|
+
return 'image_url' in toolkit
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export function toolById(
|
|
15
|
+
id: string,
|
|
16
|
+
toolkits: (BuiltinToolkitResponse | CustomToolkitDto)[] | undefined,
|
|
17
|
+
): ToolWithImage | undefined {
|
|
18
|
+
const tools = toolkits
|
|
19
|
+
?.map((toolkit) =>
|
|
20
|
+
toolkit.tools?.map((tool) => ({
|
|
21
|
+
...tool,
|
|
22
|
+
id: tool.id!,
|
|
23
|
+
image: isBuiltinToolkit(toolkit)
|
|
24
|
+
? toolkit.image_url ?? undefined
|
|
25
|
+
: (toolkit as CustomToolkitDto).avatar ?? undefined,
|
|
26
|
+
})),
|
|
27
|
+
)
|
|
28
|
+
.flat()
|
|
8
29
|
return keyBy(tools, 'id')[id]
|
|
9
30
|
}
|
|
@@ -2,7 +2,6 @@ import { dataIntegrationClient } from '@stack-spot/portal-network'
|
|
|
2
2
|
import { FileUploadType } from '@stack-spot/portal-network/api/dataIntegration'
|
|
3
3
|
import { pull } from 'lodash'
|
|
4
4
|
import { FileUploadStatus } from './types'
|
|
5
|
-
import { getFileId } from './utils'
|
|
6
5
|
|
|
7
6
|
export type FileUploadChangeListener = (status: FileUploadStatus) => void
|
|
8
7
|
|
|
@@ -18,8 +17,8 @@ export class FileUpload {
|
|
|
18
17
|
|
|
19
18
|
constructor(file: File, type: FileUploadType = 'CONTEXT') {
|
|
20
19
|
this.file = file
|
|
21
|
-
this.id = getFileId(file)
|
|
22
20
|
this.type = type
|
|
21
|
+
this.id = `${Date.now()}-${Math.random()}`
|
|
23
22
|
this.upload()
|
|
24
23
|
}
|
|
25
24
|
|
|
@@ -11,10 +11,10 @@ export const AgentDescription = ({ agentId }: { agentId?: string }) => {
|
|
|
11
11
|
const t = useAgentsDictionary()
|
|
12
12
|
const [agent, , , { isLoading }] = agentToolsClient.agent.useStatefulQuery({ agentId: agentId! }, { enabled: !!agentId })
|
|
13
13
|
const [toolKits, , , { isLoading: isLoadingToolKit }] = agentToolsClient.tools.useStatefulQuery({})
|
|
14
|
-
const numberOfKnowledgeSources = agent?.
|
|
14
|
+
const numberOfKnowledgeSources = agent?.knowledge_sources_config?.knowledge_sources.length ?? 0
|
|
15
15
|
|
|
16
16
|
const knowledgeSources = useMemo(
|
|
17
|
-
() => agent?.
|
|
17
|
+
() => agent?.knowledge_sources_config?.knowledge_sources_details?.map((ks, index) => (
|
|
18
18
|
<li key={index}><Badge palette="teal" appearance="square">{ks.name}</Badge></li>
|
|
19
19
|
)),
|
|
20
20
|
[agent],
|
|
@@ -19,7 +19,7 @@ const ContextBadge = ({ label, color, dismiss, onDismiss }: ContextBadgeProps) =
|
|
|
19
19
|
<Badge appearance="square" palette={color} className="context-badge"
|
|
20
20
|
afterElement={
|
|
21
21
|
onDismiss &&
|
|
22
|
-
<IconButton appearance="square" colorIcon={`${color}.800`} onClick={onDismiss} title={dismiss}
|
|
22
|
+
<IconButton appearance="square" colorIcon={`${color}.800`} onClick={onDismiss} title={dismiss} aria-label={dismiss}>
|
|
23
23
|
<TimesMini />
|
|
24
24
|
</IconButton>
|
|
25
25
|
}>
|
|
@@ -20,53 +20,53 @@ export const SelectContent = () => {
|
|
|
20
20
|
|
|
21
21
|
const itemConfigs = [
|
|
22
22
|
{
|
|
23
|
+
role: 'button',
|
|
23
24
|
key: 'agent',
|
|
24
25
|
label: t.chatAgent,
|
|
25
26
|
icon: <Agent />,
|
|
26
|
-
'aria-label': 'Botão de agent',
|
|
27
27
|
onClick: (event?: React.MouseEvent) => {
|
|
28
28
|
event?.stopPropagation()
|
|
29
29
|
chat.set('nextMessage', '@')
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
+
role: 'button',
|
|
33
34
|
key: 'quickCommands',
|
|
34
35
|
label: 'Quick Commands',
|
|
35
36
|
icon: <QuickCommand />,
|
|
36
|
-
'aria-label': 'Botão de quickCommands',
|
|
37
37
|
onClick: (event?: React.MouseEvent) => {
|
|
38
38
|
event?.stopPropagation()
|
|
39
39
|
chat.set('nextMessage', '/')
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
+
role: 'button',
|
|
43
44
|
key: 'knowledgeSource',
|
|
44
45
|
label: 'Knowledge Sources',
|
|
45
46
|
icon: <KnowledgeSource />,
|
|
46
|
-
'aria-label': 'Botão de knowledgeSource',
|
|
47
47
|
panel: 'ks',
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
+
role: 'button',
|
|
50
51
|
key: 'stack',
|
|
51
52
|
label: 'Stacks AI',
|
|
52
53
|
icon: <Stack />,
|
|
53
|
-
'aria-label': 'Botão de stack',
|
|
54
54
|
panel: 'stack',
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
|
+
role: 'button',
|
|
57
58
|
key: 'workspace',
|
|
58
59
|
label: 'Spots',
|
|
59
60
|
icon: <Spaces />,
|
|
60
|
-
'aria-label': 'Botão de workspace',
|
|
61
61
|
panel: 'workspace',
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
+
role: 'button',
|
|
64
65
|
key: 'upload',
|
|
65
66
|
label: t.upload,
|
|
66
67
|
onClick: () => uploadManager.open(),
|
|
67
68
|
className: 'upload-item',
|
|
68
69
|
icon: <DocumentUpload />,
|
|
69
|
-
'aria-label': 'Botão de upload de arquivos',
|
|
70
70
|
},
|
|
71
71
|
]
|
|
72
72
|
|
|
@@ -80,7 +80,7 @@ export const SelectContent = () => {
|
|
|
80
80
|
widget.set('panel', chatFeatures.panel as ChatPanel)
|
|
81
81
|
setVisibleMenu(false)
|
|
82
82
|
}) : chatFeatures.onClick,
|
|
83
|
-
|
|
83
|
+
role: chatFeatures.role,
|
|
84
84
|
})), [features, widget])
|
|
85
85
|
|
|
86
86
|
if (!hasFeatureButtons) return null
|
|
@@ -91,10 +91,9 @@ export const SelectContent = () => {
|
|
|
91
91
|
id="button-content-select"
|
|
92
92
|
color="light"
|
|
93
93
|
appearance="square"
|
|
94
|
-
|
|
95
|
-
title={visibleMenu ? t.collapse : t.expand}
|
|
94
|
+
title={t.chatViewMenu}
|
|
96
95
|
data-test-hint="button-options"
|
|
97
|
-
aria-label={
|
|
96
|
+
aria-label={t.chatViewMenu}
|
|
98
97
|
aria-controls="chatMessageMenu"
|
|
99
98
|
aria-expanded={visibleMenu}
|
|
100
99
|
onClick={() => setVisibleMenu(state => !state)}>
|
|
@@ -106,7 +105,7 @@ export const SelectContent = () => {
|
|
|
106
105
|
visible={visibleMenu}
|
|
107
106
|
onHide={() => setVisibleMenu(false)}
|
|
108
107
|
items={listItems}
|
|
109
|
-
aria-label=
|
|
108
|
+
aria-label={t.chatViewMenu}
|
|
110
109
|
/>
|
|
111
110
|
</>
|
|
112
111
|
) : (
|
|
@@ -22,6 +22,7 @@ const UploadItem = ({ upload }: UploadedFileProps) => {
|
|
|
22
22
|
const uploadManager = useUploadManager()
|
|
23
23
|
const icon = upload.file.type.toLowerCase().startsWith('image/') ? createImageFromFile(upload.file) : undefined
|
|
24
24
|
const status = useUploadStatus(upload)
|
|
25
|
+
|
|
25
26
|
return <FileDescription
|
|
26
27
|
fileName={upload.file.name}
|
|
27
28
|
icon={icon}
|
|
@@ -39,7 +40,7 @@ export const UploadBar = () => {
|
|
|
39
40
|
const visible = !!uploads.length
|
|
40
41
|
const [ariaMessage, setAriaMessage] = useState('')
|
|
41
42
|
const prevUploadsRef = useRef<FileUpload[]>([])
|
|
42
|
-
const announcedUploadsRef = useRef
|
|
43
|
+
const announcedUploadsRef = useRef(new Set())
|
|
43
44
|
|
|
44
45
|
useEffect(() => {
|
|
45
46
|
const prevUploads = prevUploadsRef.current
|
|
@@ -79,15 +80,8 @@ export const UploadBar = () => {
|
|
|
79
80
|
setAriaMessage(lines.join(' '))
|
|
80
81
|
setTimeout(() => setAriaMessage(''), 2000)
|
|
81
82
|
chat.pushMessage(new ChatEntry({ agentType: 'system', type: 'md', content: lines.join('\n\n') }))
|
|
82
|
-
|
|
83
|
-
if (lines.length) {
|
|
84
|
-
setAriaMessage(lines.join(' '))
|
|
85
|
-
setTimeout(() => setAriaMessage(''), 2000)
|
|
86
|
-
chat.pushMessage(new ChatEntry({ agentType: 'system', type: 'md', content: lines.join('\n\n') }))
|
|
87
|
-
}
|
|
88
83
|
})
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
|
|
91
85
|
return (
|
|
92
86
|
<div className={listToClass(['info-bar', 'upload-bar', visible && 'visible'])}>
|
|
93
87
|
<div className="aria-live"
|
|
@@ -34,6 +34,7 @@ const dictionary = {
|
|
|
34
34
|
cantSendBecausePromptMaxLength: 'You can\'t send messages longer than $0 characters. Please, shorten your message.',
|
|
35
35
|
chatAgent: 'Agents',
|
|
36
36
|
uploadSuccessStatus: 'File sent successfully',
|
|
37
|
+
chatViewMenu: 'Chat options menu',
|
|
37
38
|
},
|
|
38
39
|
pt: {
|
|
39
40
|
stack: 'Selecionar stack',
|
|
@@ -68,6 +69,7 @@ const dictionary = {
|
|
|
68
69
|
cantSendBecausePromptMaxLength: 'Você não pode enviar mensagens com mais de $0 caracteres. Por favor, reduza sua mensagem.',
|
|
69
70
|
chatAgent: 'Agentes',
|
|
70
71
|
uploadSuccessStatus: 'Arquivo anexado com sucesso',
|
|
72
|
+
chatViewMenu: 'Menu de opções do chat',
|
|
71
73
|
},
|
|
72
74
|
} satisfies Dictionary
|
|
73
75
|
|
|
@@ -67,14 +67,14 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
|
|
|
67
67
|
|
|
68
68
|
> .aria-live {
|
|
69
69
|
position: absolute;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
width: 1px;
|
|
71
|
+
height: 1px;
|
|
72
|
+
margin: -1px;
|
|
73
|
+
padding: 0;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
clip: rect(0 0 0 0);
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
border: 0;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
> .space {
|
package/src/views/Tools.tsx
CHANGED
|
@@ -42,20 +42,26 @@ const ToolsPanel = () => {
|
|
|
42
42
|
}, [messageId])
|
|
43
43
|
|
|
44
44
|
const [toolKits] = agentToolsClient.tools.useStatefulQuery({}, { enabled: !!message?.agent?.id })
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const [agent] = agentToolsClient.agent.useStatefulQuery({ agentId: message?.agent?.id || '' },
|
|
46
|
+
{ enabled: !!message?.agent?.id })
|
|
47
|
+
const tools = useMemo(() => message?.tools?.map(id => toolById(id, toolKits)), [messageId, toolKits])
|
|
48
|
+
const customTools = useMemo(() => message?.tools?.map(id => toolById(id, agent?.toolkits?.custom_toolkits)),
|
|
49
|
+
[messageId, agent?.toolkits?.custom_toolkits])
|
|
50
|
+
return !!(tools?.length || customTools?.length) && (
|
|
48
51
|
<ToolList>
|
|
49
|
-
{tools
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
{[...(tools || []), ...(customTools || [])].map(
|
|
53
|
+
(tool) =>
|
|
54
|
+
tool && (
|
|
55
|
+
<li key={tool.id}>
|
|
56
|
+
<ToolBadge
|
|
57
|
+
name={tool.name || tool.id}
|
|
58
|
+
image={tool.image ?? ''}
|
|
59
|
+
description={tool.description ?? ''}
|
|
60
|
+
backgroundColor="light.500"
|
|
61
|
+
/>
|
|
62
|
+
</li>
|
|
63
|
+
),
|
|
64
|
+
)}
|
|
59
65
|
</ToolList>
|
|
60
66
|
)
|
|
61
67
|
}
|