@stack-spot/ai-chat-widget 1.28.1-beta.3 → 1.28.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/app-metadata.json +3 -3
  3. package/dist/components/AdaptiveTextArea.js +1 -1
  4. package/dist/components/AdaptiveTextArea.js.map +1 -1
  5. package/dist/components/AgentCard/dictionary.d.ts +2 -4
  6. package/dist/components/AgentCard/dictionary.d.ts.map +1 -1
  7. package/dist/components/AgentCard/dictionary.js +2 -4
  8. package/dist/components/AgentCard/dictionary.js.map +1 -1
  9. package/dist/components/Selector/index.d.ts +2 -2
  10. package/dist/components/Selector/index.d.ts.map +1 -1
  11. package/dist/components/Selector/index.js +3 -3
  12. package/dist/components/Selector/index.js.map +1 -1
  13. package/dist/components/Selector/styled.d.ts +1 -1
  14. package/dist/components/Selector/styled.d.ts.map +1 -1
  15. package/dist/components/Selector/styled.js +1 -1
  16. package/dist/components/Selector/styled.js.map +1 -1
  17. package/dist/layout.css +0 -17
  18. package/dist/state/types.d.ts +1 -1
  19. package/dist/state/types.d.ts.map +1 -1
  20. package/dist/utils/tools.d.ts +2 -2
  21. package/dist/utils/tools.d.ts.map +1 -1
  22. package/dist/utils/tools.js +6 -3
  23. package/dist/utils/tools.js.map +1 -1
  24. package/dist/utils/upload/UploadManager.d.ts +0 -2
  25. package/dist/utils/upload/UploadManager.d.ts.map +1 -1
  26. package/dist/utils/upload/UploadManager.js +25 -32
  27. package/dist/utils/upload/UploadManager.js.map +1 -1
  28. package/dist/views/Agents/AgentDescription.d.ts +9 -2
  29. package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
  30. package/dist/views/Agents/AgentDescription.js +9 -12
  31. package/dist/views/Agents/AgentDescription.js.map +1 -1
  32. package/dist/views/Agents/AgentsPanel.d.ts.map +1 -1
  33. package/dist/views/Agents/AgentsPanel.js +11 -11
  34. package/dist/views/Agents/AgentsPanel.js.map +1 -1
  35. package/dist/views/Agents/AgentsTab.d.ts +2 -2
  36. package/dist/views/Agents/AgentsTab.d.ts.map +1 -1
  37. package/dist/views/Agents/AgentsTab.js +6 -6
  38. package/dist/views/Agents/AgentsTab.js.map +1 -1
  39. package/dist/views/Agents/useAgentFavorites.d.ts +1 -1
  40. package/dist/views/Agents/useAgentFavorites.js +4 -4
  41. package/dist/views/Agents/useAgentFavorites.js.map +1 -1
  42. package/dist/views/Chat/ChatMessage.js +3 -3
  43. package/dist/views/Chat/ChatMessage.js.map +1 -1
  44. package/dist/views/ChatHistory/HistoryItem.d.ts.map +1 -1
  45. package/dist/views/ChatHistory/HistoryItem.js +5 -8
  46. package/dist/views/ChatHistory/HistoryItem.js.map +1 -1
  47. package/dist/views/ChatHistory/utils.d.ts +6 -0
  48. package/dist/views/ChatHistory/utils.d.ts.map +1 -1
  49. package/dist/views/ChatHistory/utils.js +16 -1
  50. package/dist/views/ChatHistory/utils.js.map +1 -1
  51. package/dist/views/Home/CustomAgent.js +3 -3
  52. package/dist/views/Home/CustomAgent.js.map +1 -1
  53. package/dist/views/MessageInput/AgentSelector.js +4 -4
  54. package/dist/views/MessageInput/AgentSelector.js.map +1 -1
  55. package/dist/views/MessageInput/ButtonAgent.js +2 -2
  56. package/dist/views/MessageInput/ButtonAgent.js.map +1 -1
  57. package/dist/views/MessageInput/dictionary.d.ts +1 -1
  58. package/dist/views/MessageInput/dictionary.d.ts.map +1 -1
  59. package/dist/views/MessageInput/dictionary.js +0 -9
  60. package/dist/views/MessageInput/dictionary.js.map +1 -1
  61. package/dist/views/MessageInput/index.d.ts.map +1 -1
  62. package/dist/views/MessageInput/index.js +1 -11
  63. package/dist/views/MessageInput/index.js.map +1 -1
  64. package/dist/views/MessageInput/styled.d.ts +1 -1
  65. package/dist/views/MessageInput/styled.js +1 -1
  66. package/dist/views/Tools.js +3 -3
  67. package/dist/views/Tools.js.map +1 -1
  68. package/dist/views/Workspaces/WorkspacesTab.js +1 -1
  69. package/package.json +2 -2
  70. package/src/app-metadata.json +3 -3
  71. package/src/components/AdaptiveTextArea.tsx +1 -1
  72. package/src/components/AgentCard/dictionary.ts +2 -4
  73. package/src/components/Selector/index.tsx +6 -5
  74. package/src/components/Selector/styled.ts +2 -2
  75. package/src/layout.css +0 -17
  76. package/src/state/types.ts +1 -1
  77. package/src/utils/tools.ts +7 -5
  78. package/src/utils/upload/UploadManager.ts +23 -32
  79. package/src/views/Agents/AgentDescription.tsx +25 -19
  80. package/src/views/Agents/AgentsPanel.tsx +12 -11
  81. package/src/views/Agents/AgentsTab.tsx +17 -12
  82. package/src/views/Agents/useAgentFavorites.ts +4 -4
  83. package/src/views/Chat/ChatMessage.tsx +3 -3
  84. package/src/views/ChatHistory/HistoryItem.tsx +5 -10
  85. package/src/views/ChatHistory/utils.ts +18 -1
  86. package/src/views/Home/CustomAgent.tsx +4 -4
  87. package/src/views/MessageInput/AgentSelector.tsx +4 -4
  88. package/src/views/MessageInput/ButtonAgent.tsx +2 -2
  89. package/src/views/MessageInput/dictionary.ts +0 -9
  90. package/src/views/MessageInput/index.tsx +1 -15
  91. package/src/views/MessageInput/styled.ts +1 -1
  92. package/src/views/Tools.tsx +3 -4
  93. package/src/views/Workspaces/WorkspacesTab.tsx +1 -1
  94. package/dist/utils/upload/use-paste-upload.d.ts +0 -8
  95. package/dist/utils/upload/use-paste-upload.d.ts.map +0 -1
  96. package/dist/utils/upload/use-paste-upload.js +0 -19
  97. package/dist/utils/upload/use-paste-upload.js.map +0 -1
  98. package/dist/views/MessageInput/UploadDragNDrop.d.ts +0 -14
  99. package/dist/views/MessageInput/UploadDragNDrop.d.ts.map +0 -1
  100. package/dist/views/MessageInput/UploadDragNDrop.js +0 -52
  101. package/dist/views/MessageInput/UploadDragNDrop.js.map +0 -1
  102. package/src/utils/upload/use-paste-upload.tsx +0 -30
  103. package/src/views/MessageInput/UploadDragNDrop.tsx +0 -83
@@ -9,7 +9,6 @@ import { quickCommandRegex } from '../../regex.js';
9
9
  import { ChatEntry } from '../../state/ChatEntry.js';
10
10
  import { checkIsTrial } from '../../utils/check-is-trial.js';
11
11
  import { UploadProvider } from '../../utils/upload/context.js';
12
- import { usePasteUpload } from '../../utils/upload/use-paste-upload.js';
13
12
  import { AgentSelector } from './AgentSelector.js';
14
13
  import { ButtonAgent } from './ButtonAgent.js';
15
14
  import { ButtonBar } from './ButtonBar.js';
@@ -19,7 +18,6 @@ import { useMessageInputDictionary } from './dictionary.js';
19
18
  import { QuickCommandSelector } from './QuickCommandSelector.js';
20
19
  import { MAX_INPUT_HEIGHT, MessageInputBox, MIN_INPUT_HEIGHT } from './styled.js';
21
20
  import { UploadBar } from './UploadBar.js';
22
- import { UploadDragNDrop, useUploadDragDrop } from './UploadDragNDrop.js';
23
21
  /**
24
22
  * This renders the MessageInput part of the layout which includes the progress bar, the actual textarea, the badges telling what is
25
23
  * going to be used for the question and the buttons to send, cancel, set the workspace, among others. This also includes the Quick
@@ -38,12 +36,6 @@ export const MessageInput = () => {
38
36
  const agentLabel = useCurrentChatState('agent')?.label;
39
37
  const { handleKeyDown, handleKeyUp } = useUserEntryHistoryShortcut();
40
38
  const isTrial = checkIsTrial();
41
- const { isDragging, handleDrop, handleDragLeave } = useUploadDragDrop();
42
- usePasteUpload({
43
- textAreaRef,
44
- onUploadFiles: files => chat.uploadManager.add(files),
45
- enabled: !isLoading,
46
- });
47
39
  const checkSendRequirements = useCallback(() => {
48
40
  if (chat.uploadManager.status === 'error') {
49
41
  chat.pushMessage(new ChatEntry({
@@ -104,8 +96,6 @@ export const MessageInput = () => {
104
96
  if (!isLoading)
105
97
  textAreaRef.current?.focus();
106
98
  }, [isLoading]);
107
- return (_jsxs(UploadProvider, { value: chat.uploadManager, children: [_jsxs(MessageInputBox, { "aria-busy": isLoading, className: "message-input", "$inputFocused": focused, children: [_jsxs("div", { className: "wrapper-action", children: [_jsx(QuickCommandSelector, { inputRef: textAreaRef, isTrial: isTrial }), _jsx(AgentSelector, { inputRef: textAreaRef, isTrial: isTrial }), _jsxs("div", { className: listToClass(['action-box', focused && 'focused', isLoading && 'disabled']), children: [_jsx(ButtonAgent, {}), _jsx(AdaptiveTextArea, { ref: textAreaRef, placeholder: agentLabel
108
- ? interpolate(t.placeholder, agentLabel)
109
- : t.typing, onChange: e => chat.set('nextMessage', e.target.value), value: value, onFocus: () => setFocused(true), onBlur: () => setFocused(false), onKeyDown: onKeyDown, onKeyUp: handleKeyUp, onIncreaseSize: () => setExpanded(false), onResetSize: () => !expansionLocked.current && setExpanded(true), maxHeight: isMinimized ? MIN_INPUT_HEIGHT : MAX_INPUT_HEIGHT })] })] }), _jsx(ProgressBar, { visible: true, animate: isLoading, backgroundColor: isLoading || !focused ? theme.color.light[500] : theme.color.primary[500] }), _jsx(ContextBar, {}), chat.get('features').upload && _jsx(UploadBar, {}), _jsx(ButtonBar, { onSend: onSend, isLoading: isLoading })] }), _jsx(UploadDragNDrop, { isDragging: isDragging, onDrop: handleDrop, onDragLeave: handleDragLeave })] }));
99
+ return (_jsx(UploadProvider, { value: chat.uploadManager, children: _jsxs(MessageInputBox, { "aria-busy": isLoading, className: "message-input", "$inputFocused": focused, children: [_jsxs("div", { className: "wrapper-action", children: [_jsx(QuickCommandSelector, { inputRef: textAreaRef, isTrial: isTrial }), _jsx(AgentSelector, { inputRef: textAreaRef, isTrial: isTrial }), _jsxs("div", { className: listToClass(['action-box', focused && 'focused', isLoading && 'disabled']), children: [_jsx(ButtonAgent, {}), _jsx(AdaptiveTextArea, { ref: textAreaRef, placeholder: agentLabel && interpolate(t.placeholder, agentLabel), onChange: e => chat.set('nextMessage', e.target.value), value: value, onFocus: () => setFocused(true), onBlur: () => setFocused(false), onKeyDown: onKeyDown, onKeyUp: handleKeyUp, onIncreaseSize: () => setExpanded(false), onResetSize: () => !expansionLocked.current && setExpanded(true), maxHeight: isMinimized ? MIN_INPUT_HEIGHT : MAX_INPUT_HEIGHT })] })] }), _jsx(ProgressBar, { visible: true, animate: isLoading, backgroundColor: isLoading || !focused ? theme.color.light[500] : theme.color.primary[500] }), _jsx(ContextBar, {}), chat.get('features').upload && _jsx(UploadBar, {}), _jsx(ButtonBar, { onSend: onSend, isLoading: isLoading })] }) }));
110
100
  };
111
101
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/MessageInput/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,C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EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAC/B,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAC/B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,WAAW,EACpB,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,EACxC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,EAChE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,GAC5D,IACE,IACF,EACN,KAAC,WAAW,IAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAC5C,eAAe,EAAE,SAAS,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAI,EAChG,KAAC,UAAU,KAAG,EACb,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,MAAM,IAAI,KAAC,SAAS,KAAG,EAC7C,KAAC,SAAS,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,IACnC,GACH,CAClB,CAAA;AACH,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- export declare const MAX_INPUT_HEIGHT = 300;
1
+ export declare const MAX_INPUT_HEIGHT = 200;
2
2
  export declare const MIN_INPUT_HEIGHT = 24;
3
3
  export declare const SelectionBarWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
4
  export declare const MessageInputBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
@@ -5,7 +5,7 @@ const CONTEXT_BAR_HEIGHT = 38;
5
5
  const CONTEXT_BAR_DISPLACEMENT = 4;
6
6
  const UPLOAD_BAR_HEIGHT = 60;
7
7
  const UPLOAD_BAR_DISPLACEMENT = 4;
8
- export const MAX_INPUT_HEIGHT = 300;
8
+ export const MAX_INPUT_HEIGHT = 200;
9
9
  export const MIN_INPUT_HEIGHT = 24;
10
10
  export const SelectionBarWrapper = styled.div `
11
11
  display: inline-flex;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { agentToolsClient } from '@stack-spot/portal-network';
2
+ import { agentClient } from '@stack-spot/portal-network';
3
3
  import { useTranslate } from '@stack-spot/portal-translate';
4
4
  import { useEffect, useMemo } from 'react';
5
5
  import styled from 'styled-components';
@@ -34,8 +34,8 @@ const ToolsPanel = () => {
34
34
  const chat = widget.chatTabs.getAll().find(c => c.id === chatId);
35
35
  return chat?.getMessages().find(m => m.id === messageId)?.getValue();
36
36
  }, [messageId]);
37
- const [toolKits] = agentToolsClient.tools.useStatefulQuery({}, { enabled: !!message?.agent?.id });
38
- const tools = useMemo(() => message?.tools?.map(id => toolById(id, toolKits) ?? { id }), [messageId, toolKits]);
37
+ const [agent] = agentClient.agent.useStatefulQuery({ agentId: message?.agent?.id ?? '' }, { enabled: !!message?.agent?.id });
38
+ const tools = useMemo(() => message?.tools?.map(id => toolById(id, agent?.toolkits) ?? { id }), [messageId, agent]);
39
39
  return !!tools?.length && (_jsx(ToolList, { children: tools.map((tool) => (_jsx("li", { children: _jsx(ToolBadge, { name: tool.name || tool.id, image: tool.image, description: tool.description, backgroundColor: "light.500" }) }, tool.id))) }));
40
40
  };
41
41
  const dictionary = {
@@ -1 +1 @@
1
- {"version":3,"file":"Tools.js","sourceRoot":"","sources":["../../src/views/Tools.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4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,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAEnH,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,IAAI,CACxB,KAAC,QAAQ,cACN,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,uBACE,KAAC,SAAS,IACR,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,EAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAC,WAAW,GAC3B,IANK,IAAI,CAAC,EAAE,CAOX,CACN,CAAC,GACO,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"}
@@ -28,7 +28,7 @@ export const WorkspaceResources = ({ workspaceId, allKS, agent, stack }) => {
28
28
  const handleNavigate = (resource) => {
29
29
  startTransition(() => {
30
30
  if (resource.resourceType === 'agent')
31
- navigate({ component: 'agent', props: { visibility: 'workspace', agent, workspaceId, showSubmitButton }, fullScreen: true });
31
+ navigate({ component: 'agent', props: { visibility: 'WORKSPACE', agent, workspaceId, showSubmitButton }, fullScreen: true });
32
32
  if (resource.resourceType === 'ks')
33
33
  navigate({ component: 'ks', props: { visibility: 'workspace', allKS, workspaceId, showSubmitButton }, fullScreen: true });
34
34
  if (resource.resourceType === 'stack')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.28.1-beta.3",
3
+ "version": "1.28.1",
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.22.1",
15
15
  "@citric/icons": "^5.13.0",
16
- "@stack-spot/portal-network": "0.149.0-beta.2",
16
+ "@stack-spot/portal-network": "^0.143.3",
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",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.28.1-beta.3",
4
- "date": "Thu Jul 03 2025 08:45:23 GMT-0300 (Brasilia Standard Time)",
3
+ "version": "1.28.1",
4
+ "date": "Thu Jul 03 2025 16:56:42 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.149.0-beta.2(@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)"
116
+ "version": "0.143.3(@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",
@@ -54,5 +54,5 @@ export const AdaptiveTextArea = forwardRef<HTMLTextAreaElement, Props>((
54
54
  }
55
55
  }, [value, maxHeight])
56
56
 
57
- return <Textarea {...props} ref={ref} value={value} style={{ ...style, maxHeight }} />
57
+ return <Textarea id="prompt-textarea" name="prompt-textarea" {...props} ref={ref} value={value} style={{ ...style, maxHeight }} />
58
58
  })
@@ -2,8 +2,7 @@ import { Dictionary } from '@stack-spot/portal-translate'
2
2
 
3
3
  export const dictionary = {
4
4
  en: {
5
- 'built_in': 'Built-in',
6
- workspace: 'Spot',
5
+ builtin: 'Built-in',
7
6
  personal: 'Personal',
8
7
  account: 'Account',
9
8
  shared: 'Shared',
@@ -11,8 +10,7 @@ export const dictionary = {
11
10
  create: 'Create',
12
11
  },
13
12
  pt: {
14
- 'built_in': 'Embutido',
15
- workspace: 'Spot',
13
+ builtin: 'Embutido',
16
14
  personal: 'Personal',
17
15
  account: 'Conta',
18
16
  shared: 'Compartilhado',
@@ -2,7 +2,7 @@ import { IconBox, Text } from '@citric/core'
2
2
  import { ExternalLink } from '@citric/icons'
3
3
  import { IconButton } from '@citric/ui'
4
4
  import { useKeyboardControls } from '@stack-spot/portal-components'
5
- import { AgentVisibilityLevel } from '@stack-spot/portal-network'
5
+ import { VisibilityLevelEnum } from '@stack-spot/portal-network/api/ai'
6
6
  import { Dictionary, interpolate, useTranslate } from '@stack-spot/portal-translate'
7
7
  import React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react'
8
8
  import { useCurrentChatState } from '../../context/hooks'
@@ -12,7 +12,8 @@ import { Fading } from '../Fading'
12
12
  import { FallbackBoundary } from '../FallbackBoundary'
13
13
  import { SelectorBox } from './styled'
14
14
 
15
- type SectionVisibility = AgentVisibilityLevel
15
+ type SectionVisibility = VisibilityLevelEnum | 'built-in'
16
+
16
17
  type SelectorShortcut = '/' | '@'
17
18
 
18
19
  interface Item {
@@ -247,7 +248,7 @@ export const Selector = <T, >({ inputRef, selectorConfig, favorite }: SelectorPr
247
248
  }, [shouldRender])
248
249
 
249
250
  return (
250
- <SelectorBox tabsCount={selectorConfig.sections.length}>
251
+ <SelectorBox $tabsCount={selectorConfig.sections.length}>
251
252
  <Fading visible={shouldRender} ref={selectorRef} className="box-selector">
252
253
  <SelectorContent
253
254
  favorite={favorite}
@@ -267,7 +268,7 @@ const dictionary = {
267
268
  personal: 'Personal',
268
269
  account: 'Account',
269
270
  shared: 'Shared',
270
- 'built_in': 'Built-in',
271
+ 'built-in': 'Built-in',
271
272
  workspace: 'Spot',
272
273
  error: 'Could not load the $0s.',
273
274
  noData: 'You don\'t have any $0 yet.',
@@ -281,7 +282,7 @@ const dictionary = {
281
282
  account: 'Conta',
282
283
  shared: 'Compartilhado',
283
284
  workspace: 'Spot',
284
- 'built_in': 'Embutido',
285
+ 'built-in': 'Embutido',
285
286
  error: 'Não foi possível carregar os $0s.',
286
287
  noData: 'Você ainda não possui $0s.',
287
288
  noResults: 'Não $0s para mostrar aqui.',
@@ -2,7 +2,7 @@ import { theme } from '@stack-spot/portal-theme'
2
2
  import { styled } from 'styled-components'
3
3
 
4
4
 
5
- export const SelectorBox = styled.div<{tabsCount: number}>`
5
+ export const SelectorBox = styled.div<{ $tabsCount: number }>`
6
6
  position: absolute;
7
7
  bottom: 0;
8
8
 
@@ -54,7 +54,7 @@ export const SelectorBox = styled.div<{tabsCount: number}>`
54
54
  flex-direction: row;
55
55
  align-items: center;
56
56
  align-items: flex-start;
57
- height: ${({ tabsCount }) => 34 + (tabsCount * 34)}px;
57
+ height: ${({ $tabsCount }) => 34 + ($tabsCount * 34)}px;
58
58
  }
59
59
 
60
60
  ul {
package/src/layout.css CHANGED
@@ -94,7 +94,6 @@
94
94
  }
95
95
 
96
96
  .chat-container {
97
- position: relative;
98
97
  padding: 20px;
99
98
  max-width: 1200px;
100
99
  width: calc(100% - 40px);
@@ -187,20 +186,4 @@
187
186
  border: 1px solid var(--primary-500);
188
187
  border-left: none;
189
188
  color: var(--light-contrastText);
190
- }
191
-
192
- .upload-drag-drop {
193
- display: flex;
194
- background: #00000090;
195
- position: absolute;
196
- width: 99%;
197
- height: 99%;
198
- top: 0;
199
- left: 0;
200
- flex-direction: column;
201
- justify-content: center;
202
- align-items: center;
203
- border: 2px dashed var(--secondary-500);
204
- z-index: 9999;
205
- pointer-events: auto;
206
189
  }
@@ -4,7 +4,7 @@ export interface Labeled {
4
4
  }
5
5
 
6
6
  export interface LabeledWithImage extends Labeled {
7
- image?: string | undefined | null,
7
+ image?: string,
8
8
  }
9
9
 
10
10
  export interface LabeledAgent extends LabeledWithImage {
@@ -1,9 +1,11 @@
1
- import { BuiltinToolkitResponse, BuiltinToolResponse } from '@stack-spot/portal-network/api/agent'
2
- import { keyBy } from 'lodash'
1
+ import { BuiltinToolResponse, ToolkitsInAgentResponse } from '@stack-spot/portal-network/api/agent'
3
2
 
4
3
  export type ToolWithImage = BuiltinToolResponse & { id: string, image?: string }
5
4
 
6
- export function toolById(id: string, toolkits: BuiltinToolkitResponse[] | undefined): ToolWithImage | undefined {
7
- const tools = toolkits?.map(({ image_url, tools }) => tools?.map((tool) => ({ ...tool, id: tool.id!, image: image_url! }))).flat()
8
- return keyBy(tools, 'id')[id]
5
+ export function toolById(id: string, toolkits: ToolkitsInAgentResponse | undefined): ToolWithImage | undefined {
6
+ for (const toolkit of toolkits?.builtins ?? []) {
7
+ for (const tool of toolkit.tools ?? []) {
8
+ if (tool.id === id) return { ...tool, id, image: toolkit.image_url }
9
+ }
10
+ }
9
11
  }
@@ -43,35 +43,31 @@ export class UploadManager {
43
43
  return this.value.some(f => id === f.id)
44
44
  }
45
45
 
46
- private processFiles(files: FileList | File[]) {
47
- const newFiles: FileUpload[] = []
48
- const errors: UploadError[] = []
49
- for (const f of files ?? []) {
50
- if (this.maxSize && f.size > this.maxSize.value * Math.pow(1024, unitPower[this.maxSize?.unit])) {
51
- errors.push(new FileIsTooLarge(f.name, this.maxSize))
52
- } else if (this.maxItems && this.value.length + newFiles.length === this.maxItems) {
53
- errors.push(new MaxFilesReached(f.name, this.maxItems))
54
- } else if (this.hasEquivalentFile(f)) {
55
- errors.push(new FileAlreadyExists(f.name))
56
- } else {
57
- const upload = new FileUpload(f)
58
- newFiles.push(upload)
59
- upload.onChange(() => this.runStatusListeners())
60
- }
61
- }
62
- if (newFiles.length) {
63
- this.value = [...this.value, ...newFiles]
64
- this.runChangeListeners()
65
- this.runStatusListeners()
66
- }
67
- if (errors.length) {
68
- this.errorListeners.forEach(l => l(errors))
69
- }
70
- }
71
-
72
46
  private attachEventListeners() {
73
47
  const handleChange = () => {
74
- this.processFiles(this.input?.files || [])
48
+ const newFiles: FileUpload[] = []
49
+ const errors: UploadError[] = []
50
+ for (const f of this.input?.files ?? []) {
51
+ if (this.maxSize && f.size > this.maxSize.value * Math.pow(1024, unitPower[this.maxSize?.unit])) {
52
+ errors.push(new FileIsTooLarge(f.name, this.maxSize))
53
+ } else if (this.maxItems && this.value.length + newFiles.length === this.maxItems) {
54
+ errors.push(new MaxFilesReached(f.name, this.maxItems))
55
+ } else if (this.hasEquivalentFile(f)) {
56
+ errors.push(new FileAlreadyExists(f.name))
57
+ } else {
58
+ const upload = new FileUpload(f)
59
+ newFiles.push(upload)
60
+ upload.onChange(() => this.runStatusListeners())
61
+ }
62
+ }
63
+ if (newFiles.length) {
64
+ this.value = [...this.value, ...newFiles]
65
+ this.runChangeListeners()
66
+ this.runStatusListeners()
67
+ }
68
+ if (errors.length) {
69
+ this.errorListeners.forEach(l => l(errors))
70
+ }
75
71
  this.destroy()
76
72
  }
77
73
  this.onDestroy = () => this.input?.removeEventListener('change', handleChange)
@@ -112,11 +108,6 @@ export class UploadManager {
112
108
  this.runChangeListeners()
113
109
  }
114
110
 
115
- add(files: File | File[] = []) {
116
- const fileList = Array.isArray(files) ? files : [files]
117
- this.processFiles(fileList)
118
- }
119
-
120
111
  remove(file: FileUpload) {
121
112
  file.destroy()
122
113
  this.value = this.value.filter(f => f !== file)
@@ -1,21 +1,29 @@
1
1
  import { Text } from '@citric/core'
2
2
  import { Badge, Skeleton } from '@citric/ui'
3
- import { agentToolsClient } from '@stack-spot/portal-network'
3
+ import { agentClient, AgentVisibilityLevel } from '@stack-spot/portal-network'
4
4
  import { useMemo } from 'react'
5
5
  import { ToolBadge } from '../../components/ToolBadge'
6
- import { toolById } from '../../utils/tools'
7
6
  import { useAgentsDictionary } from './dictionary'
8
7
  import { AgentDescriptionBox } from './styled'
9
8
 
10
- export const AgentDescription = ({ agentId }: { agentId?: string }) => {
9
+ interface Props {
10
+ agentId?: string,
11
+ llm?: string,
12
+ description?: string,
13
+ numberOfKnowledgeSources: number,
14
+ visibility: AgentVisibilityLevel,
15
+ }
16
+
17
+ export const AgentDescription = ({ agentId, llm, description, numberOfKnowledgeSources, visibility }: Props) => {
11
18
  const t = useAgentsDictionary()
12
- const [agent, , , { isLoading }] = agentToolsClient.agent.useStatefulQuery({ agentId: agentId! }, { enabled: !!agentId })
13
- const [toolKits, , , { isLoading: isLoadingToolKit }] = agentToolsClient.tools.useStatefulQuery({})
14
- const numberOfKnowledgeSources = agent?.knowledge_source_config?.knowledge_sources.length ?? 0
19
+ const [agent, , , { isLoading }] = agentClient.agentById.useStatefulQuery(
20
+ { agentId: agentId!, builtIn: visibility === 'BUILT-IN' },
21
+ { enabled: !!agentId },
22
+ )
15
23
 
16
24
  const knowledgeSources = useMemo(
17
- () => agent?.knowledge_source_config?.knowledge_sources?.map((ks, index) => (
18
- <li key={index}><Badge palette="teal" appearance="square">{ks}</Badge></li>
25
+ () => agent?.knowledge_sources_config?.knowledge_sources_details?.map((ks, index) => (
26
+ <li key={index}><Badge palette="teal" appearance="square">{ks.name}</Badge></li>
19
27
  )),
20
28
  [agent],
21
29
  )
@@ -28,33 +36,31 @@ export const AgentDescription = ({ agentId }: { agentId?: string }) => {
28
36
  }, [numberOfKnowledgeSources])
29
37
  const tools = useMemo(() => {
30
38
  const result: React.ReactElement[] = []
31
- const builtInTools = agent?.toolkits?.builtin_toolkits?.[0].tools
32
- for (const tool of builtInTools ?? []) {
33
- const toolWithImage = toolById(tool.id, toolKits)
34
- result.push(<li key={tool.id}>
35
- <ToolBadge name={toolWithImage?.name || toolWithImage?.id || 'unknown'} image={toolWithImage?.image} />
36
- </li>)
39
+ for (const kit of agent?.toolkits?.builtins ?? []) {
40
+ for (const tool of kit.tools ?? []) {
41
+ result.push(<li key={tool.id}><ToolBadge name={tool.name || tool.id || 'unknown'} image={kit.image_url} /></li>)
42
+ }
37
43
  }
38
44
  return result
39
45
  }, [agent])
40
46
 
41
47
  return (
42
48
  <AgentDescriptionBox>
43
- {agent?.description && <section>
49
+ {description && <section>
44
50
  <Text appearance="microtext1" className="title">{t.description}</Text>
45
- <Text>{agent?.description}</Text>
51
+ <Text>{description}</Text>
46
52
  </section>}
47
53
  {(!!numberOfKnowledgeSources || !!knowledgeSources?.length) && <section>
48
54
  <Text appearance="microtext1" className="title">Knowledge sources</Text>
49
- <ul>{isLoading || isLoadingToolKit ? skeleton : knowledgeSources}</ul>
55
+ <ul>{isLoading ? skeleton : knowledgeSources}</ul>
50
56
  </section>}
51
57
  {!!tools.length && <section>
52
58
  <Text appearance="microtext1" className="title">{t.tools}</Text>
53
59
  <ul>{tools}</ul>
54
60
  </section>}
55
- {agent?.model_name && <section>
61
+ {llm && <section>
56
62
  <Text appearance="microtext1" className="title">LLM</Text>
57
- <Badge palette="orange" appearance="square">{agent?.model_name}</Badge>
63
+ <Badge palette="orange" appearance="square">{llm}</Badge>
58
64
  </section>}
59
65
  </AgentDescriptionBox>
60
66
  )
@@ -1,4 +1,3 @@
1
- import { agentToolsClient } from '@stack-spot/portal-network'
2
1
  import { useEffect, useMemo, useRef } from 'react'
3
2
  import { RightPanelTabs } from '../../components/RightPanelTabs'
4
3
  import { useCurrentChat } from '../../context/hooks'
@@ -6,6 +5,8 @@ import { checkIsTrial } from '../../utils/check-is-trial'
6
5
  import { AgentsTab, AgentsTabWorkspace } from './AgentsTab'
7
6
  import { useAgentsDictionary } from './dictionary'
8
7
 
8
+ const agentDefaultSlug = 'stk_code_buddy'
9
+
9
10
  /**
10
11
  * Renders the Agent selection form in the Right Panel if this is the panel that is currently opened.
11
12
  */
@@ -16,22 +17,22 @@ export const AgentsPanel = () => {
16
17
  const agent = useRef(chat.get('agent'))
17
18
 
18
19
  useEffect(() => {
19
- if (agentToolsClient.agentDefaultSlug !== chat.get('agent')?.slug) {
20
+ if (agentDefaultSlug !== chat.get('agent')?.slug) {
20
21
  agent.current = chat.get('agent')
21
22
  }
22
23
  }, [chat])
23
24
 
24
25
  const tabs= useMemo(() => isTrial ? [
25
- { title: t.favorites, content: <AgentsTab key="favorite" visibility="favorite" agent={agent} /> },
26
- { title: t.builtin, content: <AgentsTab key="builtin" visibility="built_in" agent={agent} /> },
27
- { title: t.personal, content: <AgentsTab key="personal" visibility="personal" agent={agent} /> },
26
+ { title: t.favorites, content: <AgentsTab key="favorite" visibility="FAVORITE" agent={agent} /> },
27
+ { title: t.builtin, content: <AgentsTab key="builtin" visibility="BUILT-IN" agent={agent} /> },
28
+ { title: t.personal, content: <AgentsTab key="personal" visibility="PERSONAL" agent={agent} /> },
28
29
  ]: [
29
- { title: t.favorites, content: <AgentsTab key="favorite" visibility="favorite" agent={agent} /> },
30
- { title: t.builtin, content: <AgentsTab key="builtin" visibility="built_in" agent={agent} /> },
31
- { title: t.personal, content: <AgentsTab key="personal" visibility="personal" agent={agent} /> },
32
- { title: t.shared, content: <AgentsTab key="shared" visibility="shared" agent={agent} /> },
33
- { title: t.spots, content: <AgentsTabWorkspace key="workspace" visibility="workspace" agent={agent} /> },
34
- { title: t.account, content: <AgentsTab key="account" visibility="account" agent={agent} /> },
30
+ { title: t.favorites, content: <AgentsTab key="favorite" visibility="FAVORITE" agent={agent} /> },
31
+ { title: t.builtin, content: <AgentsTab key="builtin" visibility="BUILT-IN" agent={agent} /> },
32
+ { title: t.personal, content: <AgentsTab key="personal" visibility="PERSONAL" agent={agent} /> },
33
+ { title: t.shared, content: <AgentsTab key="shared" visibility="SHARED" agent={agent} /> },
34
+ { title: t.spots, content: <AgentsTabWorkspace key="workspace" visibility="WORKSPACE" agent={agent} /> },
35
+ { title: t.account, content: <AgentsTab key="account" visibility="ACCOUNT" agent={agent} /> },
35
36
 
36
37
  ], [t, isTrial, agent])
37
38
 
@@ -2,7 +2,8 @@ import { Button, IconBox, Text } from '@citric/core'
2
2
  import { Agent, Search } from '@citric/icons'
3
3
  import { Placeholder } from '@stack-spot/portal-components/Placeholder'
4
4
  import { MiniLogo } from '@stack-spot/portal-components/svg'
5
- import { AgentResponseWithBuiltIn, agentToolsClient, AgentVisibilityLevel, workspaceAiClient } from '@stack-spot/portal-network'
5
+ import { agentClient, AgentResponseWithBuiltIn, workspaceAiClient } from '@stack-spot/portal-network'
6
+ import { VisibilityLevel } from '@stack-spot/portal-network/api/agent'
6
7
  import { WorkspaceResponse } from '@stack-spot/portal-network/api/workspace-ai'
7
8
  import { useCallback, useMemo, useState } from 'react'
8
9
  import { ButtonFavorite } from '../../components/ButtonFavorite'
@@ -19,7 +20,7 @@ import { AgentLabel } from './styled'
19
20
  import { useAgentFavorites } from './useAgentFavorites'
20
21
 
21
22
  export interface AgentTabProps {
22
- visibility: AgentVisibilityLevel,
23
+ visibility: VisibilityLevel | 'BUILT-IN',
23
24
  workspaceId?: string,
24
25
  agent: React.MutableRefObject<ChatProperties['agent']>,
25
26
  showSubmitButton?: boolean,
@@ -32,15 +33,16 @@ export const AgentsTab = ({ visibility, workspaceId, agent, showSubmitButton = t
32
33
  const [filter, setFilter] = useState('')
33
34
  const { useFavorites, onAddFavorite, onRemoveFavorite } = useAgentFavorites()
34
35
  const listFavorites = useFavorites()
35
- const agentDefault = agentToolsClient.agentDefault.useQuery()
36
+ const agentDefault = agentClient.agentDefault.useQuery({})
36
37
  const agents = workspaceId
37
- ? workspaceAiClient.getAgentFromWorkspaceAi.useQuery({ workspaceId }) as AgentResponseWithBuiltIn[]
38
- : agentToolsClient.agents.useQuery({ visibility })
38
+ ? workspaceAiClient.getAgentFromWorkspaceAi.useQuery({ workspaceId })
39
+ : agentClient.allAgents.useQuery({ visibilities: [visibility] })
40
+
39
41
 
40
42
  const [value, setValue] = useState<AgentResponseWithBuiltIn | undefined>(
41
43
  agent.current
42
44
  ? agents.find(a => a.id === agent.current?.id)
43
- : chat.get('agent') ? agents.find(a => a.id === chat.get('agent')?.id) : agentDefault as unknown as AgentResponseWithBuiltIn,
45
+ : chat.get('agent') ? agents.find(a => a.id === chat.get('agent')?.id) : agentDefault,
44
46
  )
45
47
 
46
48
  const filtered = useMemo(
@@ -51,17 +53,14 @@ export const AgentsTab = ({ visibility, workspaceId, agent, showSubmitButton = t
51
53
 
52
54
  function submit() {
53
55
  if (value) {
54
- chat.set(
55
- 'agent',
56
- { id: value.id, label: value.name, image: value.avatar!, builtIn: value.visibility_level === 'built_in', slug: value.slug },
57
- )
56
+ chat.set('agent', { id: value.id, label: value.name, image: value.avatar, builtIn: !!value.builtIn, slug: value.slug })
58
57
  }
59
58
  close()
60
59
  }
61
60
 
62
61
  const onChange = useCallback((newValue: AgentResponseWithBuiltIn) => {
63
62
  setValue(newValue)
64
- agent.current = { ...newValue, label: newValue.name, builtIn: newValue.visibility_level === 'built_in' }
63
+ agent.current = { ...newValue, label: newValue.name, builtIn: !!newValue.builtIn }
65
64
  }, [])
66
65
 
67
66
  return (
@@ -84,7 +83,13 @@ export const AgentsTab = ({ visibility, workspaceId, agent, showSubmitButton = t
84
83
  <Text>{name}</Text>
85
84
  </AgentLabel>
86
85
  )}
87
- renderDescription={a => <AgentDescription agentId={a.id} />}
86
+ renderDescription={a => <AgentDescription
87
+ agentId={a.id}
88
+ visibility={visibility}
89
+ description={a.description}
90
+ llm={a.llm_config?.model_slug}
91
+ numberOfKnowledgeSources={a.knowledge_sources_config?.knowledge_sources?.length ?? 0}
92
+ />}
88
93
  optionClassName={a => (a === value && filter && !a.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
89
94
  ? 'filtered-out'
90
95
  : ''
@@ -1,15 +1,15 @@
1
1
  /* eslint-disable filenames/match-regex */
2
- import { agentClient, agentToolsClient } from '@stack-spot/portal-network'
2
+ import { agentClient } from '@stack-spot/portal-network'
3
3
 
4
4
  export function useAgentFavorites() {
5
- const useFavorites = () => agentToolsClient.agents.useQuery({ visibility: 'favorite' })
5
+ const useFavorites = () => agentClient.allAgents.useQuery({ visibilities: ['FAVORITE'] })
6
6
  const [addFavorite, pendingAddFav] = agentClient.addFavoriteAgent.useMutation()
7
7
  const [removeFavorite, pendingRemoveFav] = agentClient.removeFavoriteAgent.useMutation()
8
8
 
9
9
  const removeFavoriteAgent = async (idOrSlug?: string) => {
10
10
  try {
11
11
  await removeFavorite({ agentId: idOrSlug || '' })
12
- await agentToolsClient.agents.invalidate({ visibility: 'favorite' })
12
+ await agentClient.allAgents.invalidate({ visibilities: ['FAVORITE'] })
13
13
  } catch (error) {
14
14
  // eslint-disable-next-line no-console
15
15
  console.error(error)
@@ -19,7 +19,7 @@ export function useAgentFavorites() {
19
19
  const addFavoriteAgent = async (idOrSlug?: string) => {
20
20
  try {
21
21
  await addFavorite({ agentId: idOrSlug || '' })
22
- await agentToolsClient.agents.invalidate({ visibility: 'favorite' })
22
+ await agentClient.allAgents.invalidate({ visibilities: ['FAVORITE'] })
23
23
  } catch (error) {
24
24
  // eslint-disable-next-line no-console
25
25
  console.error(error)