@stack-spot/ai-chat-widget 1.15.0 → 1.16.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 (55) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/StackspotAIWidget.d.ts +7 -1
  3. package/dist/StackspotAIWidget.d.ts.map +1 -1
  4. package/dist/StackspotAIWidget.js +3 -2
  5. package/dist/StackspotAIWidget.js.map +1 -1
  6. package/dist/app-metadata.json +2 -2
  7. package/dist/assets/placeholder.png +0 -0
  8. package/dist/components/AgentCard/dictionary.d.ts +17 -0
  9. package/dist/components/AgentCard/dictionary.d.ts.map +1 -0
  10. package/dist/components/AgentCard/dictionary.js +17 -0
  11. package/dist/components/AgentCard/dictionary.js.map +1 -0
  12. package/dist/components/AgentCard/index.d.ts +5 -0
  13. package/dist/components/AgentCard/index.d.ts.map +1 -0
  14. package/dist/components/AgentCard/index.js +56 -0
  15. package/dist/components/AgentCard/index.js.map +1 -0
  16. package/dist/state/types.d.ts +1 -0
  17. package/dist/state/types.d.ts.map +1 -1
  18. package/dist/views/Home/index.d.ts +1 -1
  19. package/dist/views/Home/index.d.ts.map +1 -1
  20. package/dist/views/Home/index.js +25 -3
  21. package/dist/views/Home/index.js.map +1 -1
  22. package/dist/views/Home/styled.js +1 -1
  23. package/dist/views/Home/types.d.ts +5 -0
  24. package/dist/views/Home/types.d.ts.map +1 -1
  25. package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
  26. package/dist/views/MessageInput/AgentSelector.js +2 -1
  27. package/dist/views/MessageInput/AgentSelector.js.map +1 -1
  28. package/dist/views/MessageInput/ButtonAgent.d.ts.map +1 -1
  29. package/dist/views/MessageInput/ButtonAgent.js +1 -0
  30. package/dist/views/MessageInput/ButtonAgent.js.map +1 -1
  31. package/dist/views/MessageInput/ButtonGroup.js +2 -2
  32. package/dist/views/MessageInput/ButtonGroup.js.map +1 -1
  33. package/dist/views/MessageInput/dictionary.d.ts +1 -1
  34. package/dist/views/MessageInput/dictionary.d.ts.map +1 -1
  35. package/dist/views/MessageInput/dictionary.js +0 -2
  36. package/dist/views/MessageInput/dictionary.js.map +1 -1
  37. package/dist/views/Workspaces.d.ts.map +1 -1
  38. package/dist/views/Workspaces.js +38 -49
  39. package/dist/views/Workspaces.js.map +1 -1
  40. package/package.json +2 -2
  41. package/src/StackspotAIWidget.tsx +10 -3
  42. package/src/app-metadata.json +2 -2
  43. package/src/assets/placeholder.png +0 -0
  44. package/src/components/AgentCard/dictionary.ts +19 -0
  45. package/src/components/AgentCard/index.tsx +82 -0
  46. package/src/images.d.ts +5 -0
  47. package/src/state/types.ts +1 -0
  48. package/src/views/Home/index.tsx +32 -2
  49. package/src/views/Home/styled.ts +1 -1
  50. package/src/views/Home/types.ts +6 -0
  51. package/src/views/MessageInput/AgentSelector.tsx +2 -1
  52. package/src/views/MessageInput/ButtonAgent.tsx +1 -0
  53. package/src/views/MessageInput/ButtonGroup.tsx +3 -3
  54. package/src/views/MessageInput/dictionary.ts +0 -2
  55. package/src/views/Workspaces.tsx +40 -51
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.16.1](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.16.0...ai-chat-widget@v1.16.1) (2025-04-25)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * agent list styling in Home page ([#123](https://github.com/stack-spot/portal-ai-chat-widget/issues/123)) ([af8b2e5](https://github.com/stack-spot/portal-ai-chat-widget/commit/af8b2e54a5b7a2505447b382ca2615d1d242e931))
9
+ * Revert "Change to space" ([#120](https://github.com/stack-spot/portal-ai-chat-widget/issues/120)) ([7229a0e](https://github.com/stack-spot/portal-ai-chat-widget/commit/7229a0eea605c62f09cd97706809b549b4066dc5))
10
+
11
+ ## [1.16.0](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.15.0...ai-chat-widget@v1.16.0) (2025-04-24)
12
+
13
+
14
+ ### Features
15
+
16
+ * Init default agents ([#116](https://github.com/stack-spot/portal-ai-chat-widget/issues/116)) ([95bffb9](https://github.com/stack-spot/portal-ai-chat-widget/commit/95bffb9b38ee1377e31c2b7b1d15243eb851bf2c))
17
+
3
18
  ## [1.15.0](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.14.8...ai-chat-widget@v1.15.0) (2025-04-24)
4
19
 
5
20
 
@@ -1,11 +1,17 @@
1
1
  import { WithStyle } from '@stack-spot/portal-theme';
2
2
  import './layout.css';
3
+ import { LabeledAgent } from './state/types.js';
3
4
  import { MinimizedActions } from './types.js';
4
5
  export interface AIWidgetProps extends WithStyle {
5
6
  /**
6
7
  * The name of the user currently logged in.
7
8
  */
8
9
  username: string;
10
+ /**
11
+ * Initial agents to show in the chat panel when there are still no messages (home).
12
+ * It doesn't make a difference if this component has children.
13
+ */
14
+ initialAgents?: LabeledAgent[];
9
15
  /**
10
16
  * A custom view to show when the chat has no messages to display.
11
17
  */
@@ -27,5 +33,5 @@ export interface AIWidgetProps extends WithStyle {
27
33
  * Renders a Chat Widget according to the closest model found in the React tree (AIWidgetProvider). If no model is found, a global version
28
34
  * of the Chat Widget will be instantiated and used.
29
35
  */
30
- export declare const StackspotAIWidget: ({ username, minimizedActions, prefix, children, className, style, hasHeader }: AIWidgetProps) => import("react/jsx-runtime").JSX.Element;
36
+ export declare const StackspotAIWidget: ({ username, initialAgents, minimizedActions, prefix, children, className, style, hasHeader }: AIWidgetProps) => import("react/jsx-runtime").JSX.Element;
31
37
  //# sourceMappingURL=StackspotAIWidget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StackspotAIWidget.d.ts","sourceRoot":"","sources":["../src/StackspotAIWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAKjE,OAAO,cAAc,CAAA;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAiB1C,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,kFAE5B,aAAa,4CA6Cd,CAAA"}
1
+ {"version":3,"file":"StackspotAIWidget.d.ts","sourceRoot":"","sources":["../src/StackspotAIWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAKjE,OAAO,cAAc,CAAA;AAGrB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAiB1C,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,iGAE5B,aAAa,4CA8Cd,CAAA"}
@@ -26,7 +26,7 @@ import { Workspaces } from './views/Workspaces.js';
26
26
  * Renders a Chat Widget according to the closest model found in the React tree (AIWidgetProvider). If no model is found, a global version
27
27
  * of the Chat Widget will be instantiated and used.
28
28
  */
29
- export const StackspotAIWidget = ({ username, minimizedActions = {}, prefix, children, className, style, hasHeader = true }) => {
29
+ export const StackspotAIWidget = ({ username, initialAgents, minimizedActions = {}, prefix, children, className, style, hasHeader = true }) => {
30
30
  const rightPanelRef = useRef(null);
31
31
  const chatWindowRef = useRef(null);
32
32
  const currentChat = useCurrentChatMessages();
@@ -36,6 +36,7 @@ export const StackspotAIWidget = ({ username, minimizedActions = {}, prefix, chi
36
36
  const features = useCurrentChatState('features');
37
37
  return useMemo(() => (_jsx(FallbackBoundary, { children: _jsx(TooltipProvider, { children: _jsx(RightPanelProvider, { chatWindow: chatWindowRef, panel: rightPanelRef, children: _jsxs("div", { className: listToClass(['ai-chat-widget', isMinimized && 'minimized', className]), translate: "no", style: style, children: [_jsxs("div", { className: "chat-window", ref: chatWindowRef, children: [hasHeader && _jsx(_Fragment, { children: isMinimized
38
38
  ? _jsx(MinimizedHeader, { ...minimizedActions })
39
- : _jsx(ChatTabSelection, {}) }), _jsxs("div", { className: "chat-container", children: [_jsxs("div", { className: "chat-content", children: [prefix, isCurrentChatEmpty ? (children ?? _jsx(Home, { username: username })) : _jsx(Chat, { username: username })] }), features.messageInput && _jsx(MessageInput, {})] })] }), _jsx(Stacks, {}), !isTrial && _jsx(Workspaces, {}), _jsx(KnowledgeSources, {}), _jsx(KSDocument, {}), _jsx(Agents, {}), _jsx(Editor, {}), _jsx(ChatHistory, {}), _jsx(Steps, {}), _jsx(Tools, {}), _jsx("div", { className: "chat-right-panel", ref: rightPanelRef, children: _jsx(RightPanel, {}) })] }) }) }) })), [isCurrentChatEmpty, username, isMinimized, children]);
39
+ : _jsx(ChatTabSelection, {}) }), _jsxs("div", { className: "chat-container", children: [_jsxs("div", { className: "chat-content", children: [prefix, isCurrentChatEmpty ? (children ?? _jsx(Home, { username: username, initialAgents: initialAgents })) :
40
+ _jsx(Chat, { username: username })] }), features.messageInput && _jsx(MessageInput, {})] })] }), _jsx(Stacks, {}), !isTrial && _jsx(Workspaces, {}), _jsx(KnowledgeSources, {}), _jsx(KSDocument, {}), _jsx(Agents, {}), _jsx(Editor, {}), _jsx(ChatHistory, {}), _jsx(Steps, {}), _jsx(Tools, {}), _jsx("div", { className: "chat-right-panel", ref: rightPanelRef, children: _jsx(RightPanel, {}) })] }) }) }) })), [isCurrentChatEmpty, username, isMinimized, children, initialAgents]);
40
41
  };
41
42
  //# sourceMappingURL=StackspotAIWidget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StackspotAIWidget.js","sourceRoot":"","sources":["../src/StackspotAIWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC7F,OAAO,cAAc,CAAA;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C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KAAC,KAAK,KAAG,EACT,KAAC,KAAK,KAAG,EACT,cAAK,SAAS,EAAC,kBAAkB,EAAC,GAAG,EAAE,aAAa,YAAE,KAAC,UAAU,KAAG,GAAM,IACtE,GACa,GACL,GACD,CACpB,EAAE,CAAC,kBAAkB,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAA;AAC1E,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.15.0",
4
- "date": "Thu Apr 24 2025 17:27:32 GMT+0000 (Coordinated Universal Time)",
3
+ "version": "1.16.1",
4
+ "date": "Fri Apr 25 2025 13:24:08 GMT+0000 (Coordinated Universal Time)",
5
5
  "dependencies": [
6
6
  {
7
7
  "name": "@stack-spot/app-metadata",
Binary file
@@ -0,0 +1,17 @@
1
+ export declare const dictionary: {
2
+ en: {
3
+ builtin: string;
4
+ personal: string;
5
+ account: string;
6
+ shared: string;
7
+ agent: string;
8
+ };
9
+ pt: {
10
+ builtin: string;
11
+ personal: string;
12
+ account: string;
13
+ shared: string;
14
+ agent: string;
15
+ };
16
+ };
17
+ //# sourceMappingURL=dictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/components/AgentCard/dictionary.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAeD,CAAA"}
@@ -0,0 +1,17 @@
1
+ export const dictionary = {
2
+ en: {
3
+ builtin: 'Built-in',
4
+ personal: 'Personal',
5
+ account: 'Account',
6
+ shared: 'Shared',
7
+ agent: 'Agent',
8
+ },
9
+ pt: {
10
+ builtin: 'Embutido',
11
+ personal: 'Personal',
12
+ account: 'Conta',
13
+ shared: 'Compartilhado',
14
+ agent: 'Agente',
15
+ },
16
+ };
17
+ //# sourceMappingURL=dictionary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../../../src/components/AgentCard/dictionary.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,EAAE,EAAE;QACF,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,OAAO;KACf;IACD,EAAE,EAAE;QACF,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,eAAe;QACvB,KAAK,EAAE,QAAQ;KAChB;CACmB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { LabeledAgent } from '../../state/types.js';
2
+ export declare const AgentCard: ({ agent }: {
3
+ agent: LabeledAgent;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AgentCard/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AA4ChD,eAAO,MAAM,SAAS,cAAe;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,4CA8B3D,CAAA"}
@@ -0,0 +1,56 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Image, Text } from '@citric/core';
3
+ import { Card } from '@citric/ui';
4
+ import { listToClass, theme } from '@stack-spot/portal-theme';
5
+ import { useTranslate } from '@stack-spot/portal-translate';
6
+ import { styled } from 'styled-components';
7
+ import placeholder from '../../assets/placeholder.png';
8
+ import { useCurrentChat, useCurrentChatState } from '../../context/hooks.js';
9
+ import { dictionary } from './dictionary.js';
10
+ const StyledCard = styled(Card) `
11
+ cursor: pointer;
12
+ border-radius: 8px;
13
+ transition: background-color 0.3s;
14
+ display: flex;
15
+ flex-direction: column;
16
+ gap: 12px;
17
+
18
+ &:hover {
19
+ background-color: ${theme.color.light[500]};
20
+ }
21
+
22
+ &.active {
23
+ background-color: ${theme.color.light[600]};
24
+ }
25
+
26
+ img {
27
+ width: 125px;
28
+ height: 130px;
29
+ border-radius: 8px;
30
+ }
31
+
32
+ h6 {
33
+ max-width: 125px;
34
+ white-space: nowrap;
35
+ overflow: hidden;
36
+ text-overflow: ellipsis;
37
+ }
38
+
39
+ .agent-type {
40
+ display: flex;
41
+ gap: 4px;
42
+ }
43
+
44
+ .text-box {
45
+ display: flex;
46
+ flex-direction: column;
47
+ gap: 2px;
48
+ }
49
+ `;
50
+ export const AgentCard = ({ agent }) => {
51
+ const t = useTranslate(dictionary);
52
+ const chat = useCurrentChat();
53
+ const currentAgent = useCurrentChatState('agent');
54
+ return (_jsxs(StyledCard, { onClick: () => chat.set('agent', agent), role: "button", tabIndex: 0, className: listToClass(['agent-card', currentAgent?.id === agent.id && 'active']), children: [_jsx(Image, { src: agent.image ? agent.image : placeholder }), _jsxs("div", { className: "text-box", children: [agent.visibility_level && (_jsxs("div", { className: "agent-type", children: [_jsx(Text, { appearance: "microtext1", colorScheme: "light.700", children: t[agent.visibility_level.toLowerCase()] }), _jsx(Text, { appearance: "microtext1", children: t.agent })] })), _jsx(Text, { appearance: "h6", children: agent.label })] })] }));
55
+ };
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/AgentCard/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,WAAW,MAAM,8BAA8B,CAAA;AACtD,O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CAAC,CAAC,KAAK,GACH,IACH,CACP,EACD,KAAC,IAAI,IAAC,UAAU,EAAC,IAAI,YAClB,KAAK,CAAC,KAAK,GACP,IACH,IACK,CACd,CAAA;AACH,CAAC,CAAA"}
@@ -8,5 +8,6 @@ export interface LabeledWithImage extends Labeled {
8
8
  export interface LabeledAgent extends LabeledWithImage {
9
9
  builtIn?: boolean;
10
10
  slug?: string;
11
+ visibility_level?: string;
11
12
  }
12
13
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,OAAO;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,OAAO;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
@@ -4,5 +4,5 @@ import { HomeProps } from './types.js';
4
4
  *
5
5
  * The home page can be replaced by providing children to the component `StackspotAIWidget`.
6
6
  */
7
- export declare const Home: (props: HomeProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const Home: ({ initialAgents, ...props }: HomeProps) => import("react/jsx-runtime").JSX.Element;
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC;;;;GAIG;AACH,eAAO,MAAM,IAAI,UAAW,SAAS,4CAQpC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAqBnC;;;;GAIG;AACH,eAAO,MAAM,IAAI,gCAAiC,SAAS,4CAgB1D,CAAA"}
@@ -1,15 +1,37 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { FadingOverflow } from '@stack-spot/portal-components/FadingOverflow';
3
+ import { styled } from 'styled-components';
4
+ import { AgentCard } from '../../components/AgentCard/index.js';
2
5
  import { FallbackBoundary } from '../../components/FallbackBoundary/index.js';
3
6
  import { useCurrentChatState } from '../../context/hooks.js';
4
7
  import { BuiltInAgent } from './BuiltInAgent.js';
5
8
  import { CustomAgent } from './CustomAgent.js';
9
+ const AgentList = styled.ul `
10
+ list-style: none;
11
+ margin: 0;
12
+ padding: 0;
13
+ display: flex;
14
+ align-items: center;
15
+ gap: 14px;
16
+
17
+ li {
18
+ flex-shrink: 0;
19
+ &:first-child {
20
+ margin-left: auto;
21
+ }
22
+ &:last-child {
23
+ margin-right: auto;
24
+ }
25
+ }
26
+ `;
6
27
  /**
7
28
  * Renders the default home page for the chat. This shows up when no message has been sent yet.
8
29
  *
9
30
  * The home page can be replaced by providing children to the component `StackspotAIWidget`.
10
31
  */
11
- export const Home = (props) => {
32
+ export const Home = ({ initialAgents, ...props }) => {
12
33
  const agent = useCurrentChatState('agent');
13
- return (_jsx(FallbackBoundary, { children: agent && !agent.builtIn ? _jsx(CustomAgent, {}) : _jsx(BuiltInAgent, { ...props }) }));
34
+ const isAgentEnabled = useCurrentChatState('features').agent;
35
+ return (_jsxs(FallbackBoundary, { children: [agent && !agent.builtIn ? _jsx(CustomAgent, {}) : _jsx(BuiltInAgent, { ...props }), !!initialAgents && isAgentEnabled && (_jsx(FadingOverflow, { enableHorizontalScrollWithVerticalWheel: true, sides: ['left', 'right'], scroll: "arrows", children: _jsx(AgentList, { className: "agent-list", children: initialAgents.map((agent) => _jsx("li", { children: _jsx(AgentCard, { agent: agent }) }, agent.id)) }) }))] }));
14
36
  };
15
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAG3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,KAAgB,EAAE,EAAE;IACvC,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAE1C,OAAO,CACL,KAAC,gBAAgB,cACd,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAC,WAAW,KAAG,CAAC,CAAC,CAAC,KAAC,YAAY,OAAK,KAAK,GAAI,GACvD,CACpB,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/Home/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAA;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAA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-family: 'San Francisco';
@@ -1,7 +1,12 @@
1
+ import { LabeledAgent } from '../../state/types.js';
1
2
  export interface HomeProps {
2
3
  /**
3
4
  * The name of the user currently logged in.
4
5
  */
5
6
  username: string;
7
+ /**
8
+ * Initial agents to show in home.
9
+ */
10
+ initialAgents?: LabeledAgent[];
6
11
  }
7
12
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/views/Home/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/views/Home/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AgentSelector.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/AgentSelector.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,aAAa,0BAA2B;IAAE,OAAO,EAAE,OAAO,CAAC;IACtE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;CAAE,4CAqDrE,CAAA"}
1
+ {"version":3,"file":"AgentSelector.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/AgentSelector.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,aAAa,0BAA2B;IAAE,OAAO,EAAE,OAAO,CAAC;IACtE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;CAAE,4CAsDrE,CAAA"}
@@ -22,7 +22,8 @@ export const AgentSelector = ({ inputRef, isTrial }) => {
22
22
  const newValue = `@${agent.slug}`;
23
23
  chat.set('nextMessage', undefined);
24
24
  const isBuiltIn = agent.visibility_level === 'builtIn' || builtInsAgents.some((builtInAgent) => builtInAgent.id === agent.id);
25
- chat.set('agent', { id: agent.id, label: agent.name, image: agent.avatar, slug: agent.slug, builtIn: isBuiltIn });
25
+ chat.set('agent', { id: agent.id, label: agent.name, image: agent.avatar, slug: agent.slug,
26
+ builtIn: isBuiltIn, visibility_level: agent.visibility_level });
26
27
  if (!inputRef.current)
27
28
  return;
28
29
  inputRef.current.value = newValue;
@@ -1 +1 @@
1
- {"version":3,"file":"AgentSelector.js","sourceRoot":"","sources":["../../../src/views/MessageInput/AgentSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAiB,EAAE,EAAE;IACpD,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,CAAC,KAAC,KAAK,IAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,GAAG,EAAE,MAAM,GAAI,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,YAAC,KAAC,KA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QAAQ,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,CAAA;YAC5E,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAA;QAC5E,CAAC;QAED,OAAO,MAAM,CAAC,CAAC,GAAG,cAAc,EAAE,GAAG,aAAa,EAAE,GAAG,YAAY,EAAE,GAAG,cAAc,CAAC,EAAE,IAAI,CAAC,CAAA;IAChG,CAAC,CAAA;IAED,OAAO,KAAC,QAAQ,IACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAC3D,cAAc,EAAE;YACd,YAAY,EAAE,OAAO;YACrB,QAAQ,EAAE,GAAG;YACb,IAAI,EAAE,KAAC,KAAK,KAAG;YACf,KAAK,EAAE,UAAU;YACjB,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,KAAK,EAAE,EAAE,EAAE;YAC7C,UAAU,EAAE,MAAM;YAClB,QAAQ,EAAG,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC;YACnH,mBAAmB,EAAE,SAAS;YAC9B,SAAS,EAAE,cAAc;YACzB,QAAQ,EAAE,YAAY;YACtB,OAAO,EAAE,SAAS;SACnB,GACD,CAAA;AACJ,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonAgent.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonAgent.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW,+CAiDvB,CAAA"}
1
+ {"version":3,"file":"ButtonAgent.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonAgent.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW,+CAkDvB,CAAA"}
@@ -23,6 +23,7 @@ export const ButtonAgent = () => {
23
23
  label: agentDefault.name,
24
24
  image: agentDefault.avatar,
25
25
  builtIn: true,
26
+ visibility_level: agentDefault.visibility_level,
26
27
  });
27
28
  };
28
29
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonAgent.js","sourceRoot":"","sources":["../../../src/views/MessageInput/ButtonAgent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAExD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,MAAM,CAAC,GAAG,yBAAyB,EAAE,CAAA;IACrC,MAAM,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAA;IACrE,MAAM,YAAY,GAAG,aAAa,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAC/E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,IAAI,GAAG,cAAc,EAAE,CAAA;IAC7B,MAAM,KAAK,GAAG,mB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EAAE,KAAK,CAAC,CAAC,CAAC,cAAK,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAC,OAAO,GAAG,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,SAAS,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,YAAC,KAAC,KAAK,KAAG,GAAU,EACtH,KAAC,IAAI,IAAC,SAAS,EAAC,aAAa,EAAC,YAAY,EAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,YACzE,KAAC,SAAS,KAAG,GACR,IACI,GACL,IAER,CACP,GACG,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { ChevronRight, Circle, Code, KnowledgeSource, Send, Stack, Times } from '@citric/icons';
2
+ import { ChevronRight, Code, KnowledgeSource, Send, Stack, Times, Workspace } from '@citric/icons';
3
3
  import { IconButton } from '@citric/ui';
4
4
  import { listToClass } from '@stack-spot/portal-theme';
5
5
  import { useEffect, useRef } from 'react';
@@ -29,6 +29,6 @@ export const ButtonGroup = ({ onSend, onCancel, expanded, setExpanded, isLoading
29
29
  },
30
30
  // don't use the whole features object here, it would make every chat tab change rerun this effect.
31
31
  [features.workspace, features.knowledgeSource, features.stack, features.editor]);
32
- return (_jsxs("div", { className: "button-group", children: [hasFeatureButtons && _jsxs(_Fragment, { children: [_jsxs("div", { ref: featureButtons, className: listToClass(['feature-buttons', expanded && 'expanded']), style: { width: expanded ? featureButtonsWidth.current : 0 }, children: [features.workspace && (_jsx(IconButton, { "aria-label": t.space, title: t.space, onClick: () => widget.set('panel', 'workspace'), children: _jsx(Circle, {}) })), features.knowledgeSource && (_jsx(IconButton, { "aria-label": t.knowledgeSource, title: t.knowledgeSource, onClick: () => widget.set('panel', 'ks'), children: _jsx(KnowledgeSource, {}) })), features.stack && (_jsx(IconButton, { "aria-label": t.stack, title: t.stack, onClick: () => widget.set('panel', 'stack'), children: _jsx(Stack, {}) })), features.editor && (_jsx(IconButton, { "aria-label": t.code, title: t.code, onClick: () => widget.set('panel', 'editor'), children: _jsx(Code, {}) }))] }), _jsx(IconButton, { title: expanded ? t.collapse : t.expand, className: listToClass(['expand', !expanded && 'collapsed']), "aria-label": expanded ? t.collapse : t.expand, onClick: () => setExpanded(v => !v), children: _jsx(ChevronRight, {}) })] }), isLoading ? (_jsx(IconButton, { "aria-label": t.cancel, onClick: onCancel, className: "send", title: t.cancel, children: _jsx(Times, {}) })) : (_jsx(IconButton, { "aria-label": t.send, onClick: onSend, className: "send", title: t.send, children: _jsx(Send, {}) }))] }));
32
+ return (_jsxs("div", { className: "button-group", children: [hasFeatureButtons && _jsxs(_Fragment, { children: [_jsxs("div", { ref: featureButtons, className: listToClass(['feature-buttons', expanded && 'expanded']), style: { width: expanded ? featureButtonsWidth.current : 0 }, children: [features.workspace && (_jsx(IconButton, { "aria-label": t.workspace, title: t.workspace, onClick: () => widget.set('panel', 'workspace'), children: _jsx(Workspace, {}) })), features.knowledgeSource && (_jsx(IconButton, { "aria-label": t.knowledgeSource, title: t.knowledgeSource, onClick: () => widget.set('panel', 'ks'), children: _jsx(KnowledgeSource, {}) })), features.stack && (_jsx(IconButton, { "aria-label": t.stack, title: t.stack, onClick: () => widget.set('panel', 'stack'), children: _jsx(Stack, {}) })), features.editor && (_jsx(IconButton, { "aria-label": t.code, title: t.code, onClick: () => widget.set('panel', 'editor'), children: _jsx(Code, {}) }))] }), _jsx(IconButton, { title: expanded ? t.collapse : t.expand, className: listToClass(['expand', !expanded && 'collapsed']), "aria-label": expanded ? t.collapse : t.expand, onClick: () => setExpanded(v => !v), children: _jsx(ChevronRight, {}) })] }), isLoading ? (_jsx(IconButton, { "aria-label": t.cancel, onClick: onCancel, className: "send", title: t.cancel, children: _jsx(Times, {}) })) : (_jsx(IconButton, { "aria-label": t.send, onClick: onSend, className: "send", title: t.send, children: _jsx(Send, {}) }))] }));
33
33
  };
34
34
  //# sourceMappingURL=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holder" | "selected" | "send" | "cancel" | "stack" | "workspace" | "knowledgeSource" | "agent" | "remove" | "space" | "collapse" | "expand" | "removeConfig" | "removeStack" | "removeWorkspace" | "removeKS" | "removeSelection", string>;
1
+ export declare const useMessageInputDictionary: () => Record<"code" | "placeholder" | "selected" | "send" | "cancel" | "stack" | "workspace" | "knowledgeSource" | "agent" | "remove" | "collapse" | "expand" | "removeConfig" | "removeStack" | "removeWorkspace" | "removeKS" | "removeSelection", 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":"AA6CA,eAAO,MAAM,yBAAyB,wQAAiC,CAAA"}
1
+ {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/dictionary.ts"],"names":[],"mappings":"AA2CA,eAAO,MAAM,yBAAyB,8PAAiC,CAAA"}
@@ -4,7 +4,6 @@ const dictionary = {
4
4
  stack: 'Select stack',
5
5
  code: 'Open code editor',
6
6
  workspace: 'Select workspace',
7
- space: 'Select space',
8
7
  knowledgeSource: 'Select knowledge sources',
9
8
  agent: 'Select agent',
10
9
  collapse: 'Hide buttons',
@@ -24,7 +23,6 @@ const dictionary = {
24
23
  stack: 'Selecionar stack',
25
24
  code: 'Abrir editor de código',
26
25
  workspace: 'Selecionar workspace',
27
- space: 'Select Space',
28
26
  knowledgeSource: 'Selecionar knowledge sources',
29
27
  agent: 'Selecionar agente',
30
28
  collapse: 'Esconder botões',
@@ -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,SAAS,EAAE,kBAAkB;Q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S,EAAE,kBAAkB;QAC7B,eAAe,EAAE,0BAA0B;QAC3C,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,cAAc;QACtB,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,eAAe;QAC5B,MAAM,EAAE,QAAQ;QAChB,YAAY,EAAE,8BAA8B;QAC5C,WAAW,EAAE,8BAA8B;QAC3C,eAAe,EAAE,kCAAkC;QACnD,QAAQ,EAAE,kCAAkC;QAC5C,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,+BAA+B;QAChD,MAAM,EAAE,QAAQ;KACjB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,wBAAwB;QAC9B,SAAS,EAAE,sBAAsB;QACjC,eAAe,EAAE,8BAA8B;QAC/C,KAAK,EAAE,mBAAmB;QAC1B,QAAQ,EAAE,iBAAiB;QAC3B,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,kBAAkB;QAC/B,MAAM,EAAE,UAAU;QAClB,YAAY,EAAE,gCAAgC;QAC9C,WAAW,EAAE,6BAA6B;QAC1C,eAAe,EAAE,iCAAiC;QAClD,QAAQ,EAAE,qCAAqC;QAC/C,QAAQ,EAAE,aAAa;QACvB,eAAe,EAAE,4BAA4B;QAC7C,MAAM,EAAE,SAAS;KAClB;CACmB,CAAA;AAEtB,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Workspaces.d.ts","sourceRoot":"","sources":["../../src/views/Workspaces.tsx"],"names":[],"mappings":"AAcA;;GAEG;AACH,eAAO,MAAM,UAAU,YActB,CAAA"}
1
+ {"version":3,"file":"Workspaces.d.ts","sourceRoot":"","sources":["../../src/views/Workspaces.tsx"],"names":[],"mappings":"AAaA;;GAEG;AACH,eAAO,MAAM,UAAU,YActB,CAAA"}
@@ -2,10 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { Button } from '@citric/core';
3
3
  import { Search } from '@citric/icons';
4
4
  import { Placeholder } from '@stack-spot/portal-components/Placeholder';
5
- import { workspaceAiClient } from '@stack-spot/portal-network';
5
+ import { workspaceClient } from '@stack-spot/portal-network';
6
6
  import { useTranslate } from '@stack-spot/portal-translate';
7
7
  import { useEffect, useMemo, useState } from 'react';
8
- import { ButtonFavorite } from '../components/ButtonFavorite.js';
9
8
  import { DescribedRadioGroup } from '../components/form/DescribedRadioGroup.js';
10
9
  import { IconInput } from '../components/IconInput.js';
11
10
  import { RightPanelTabs } from '../components/RightPanelTabs.js';
@@ -30,83 +29,73 @@ const WorkspacesPanel = () => {
30
29
  const t = useTranslate(dictionary);
31
30
  const chat = useCurrentChat();
32
31
  return _jsx(RightPanelTabs, { tabs: [
33
- { title: t.favorites, content: _jsx(WorkspaceSourcesTab, { visibility: "favorite" }, "favorite") },
34
- { title: t.all, content: _jsx(WorkspaceSourcesTab, { visibility: "all" }, "all") },
32
+ // { title: t.favorites, content: <WorkspaceSourcesTab key="favorite" visibility="favorite" /> },
33
+ { title: t.all, content: _jsx(WorkspaceSourcesTab, {}, "all") },
35
34
  ] }, chat.id);
36
35
  };
37
- const WorkspaceSourcesTab = ({ visibility }) => {
36
+ const WorkspaceSourcesTab = () => {
38
37
  const t = useTranslate(dictionary);
39
38
  const { close } = useRightPanel();
40
39
  const chat = useCurrentChat();
41
40
  const [filter, setFilter] = useState('');
42
- const workspaces = workspaceAiClient.workspacesAi.useQuery({ visibility });
41
+ // const workspaces = workspaceAiClient.workspacesAi.useQuery({ visibility })
42
+ // const [value, setValue] = useState<WorkspaceResponse | undefined>(workspaces.find(w => w.id === chat.get('workspace')?.id))
43
+ const workspaces = workspaceClient.workspaces.useQuery({ aclOnly: false });
43
44
  const [value, setValue] = useState(workspaces.find(w => w.id === chat.get('workspace')?.id));
44
- const listFavorites = workspaceAiClient.workspacesAi.useQuery({ visibility: 'favorite' });
45
- const [addFavorite, pendingAddFav] = workspaceAiClient.addFavoriteWorkspaceAi.useMutation();
46
- const [removeFavorite, pendingRemoveFav] = workspaceAiClient.removeFavoriteWorkspaceAi.useMutation();
47
- // eslint-disable-next-line no-async-promise-executor
48
- const onAddFavorite = async (idOrSlug) => new Promise(async (resolve, reject) => {
49
- try {
50
- await addFavorite({ workspaceId: idOrSlug });
51
- await workspaceAiClient.workspacesAi.invalidate();
52
- if (!pendingAddFav) {
53
- resolve(true);
54
- }
55
- }
56
- catch (error) {
57
- // eslint-disable-next-line no-console
58
- console.error(error);
59
- reject(error);
60
- }
61
- });
62
- // eslint-disable-next-line no-async-promise-executor
63
- const onRemoveFavorite = (idOrSlug) => new Promise(async (resolve, reject) => {
64
- try {
65
- await removeFavorite({ workspaceId: idOrSlug });
66
- await workspaceAiClient.workspacesAi.invalidate();
67
- if (!pendingRemoveFav) {
68
- resolve(true);
69
- }
70
- }
71
- catch (error) {
72
- // eslint-disable-next-line no-console
73
- console.error(error);
74
- reject(error);
75
- }
76
- });
45
+ // const listFavorites = workspaceAiClient.workspacesAi.useQuery({ visibility: 'favorite' })
46
+ // const [addFavorite, pendingAddFav] = workspaceAiClient.addFavoriteWorkspaceAi.useMutation()
47
+ // const [removeFavorite, pendingRemoveFav] = workspaceAiClient.removeFavoriteWorkspaceAi.useMutation()
48
+ // const onAddFavorite = async(idOrSlug: string) => {
49
+ // try {
50
+ // await addFavorite({ workspaceId: idOrSlug })
51
+ // await workspaceAiClient.workspacesAi.invalidate()
52
+ // } catch (error) {
53
+ // // eslint-disable-next-line no-console
54
+ // console.error(error)
55
+ // }
56
+ // }
57
+ // const onRemoveFavorite = async(idOrSlug: string) => {
58
+ // try {
59
+ // await removeFavorite({ workspaceId: idOrSlug })
60
+ // await workspaceAiClient.workspacesAi.invalidate()
61
+ // } catch (error) {
62
+ // // eslint-disable-next-line no-console
63
+ // console.error(error)
64
+ // }
65
+ // }
77
66
  const filtered = useMemo(
78
67
  // Recreate the list so that the favorites list is taken into account
79
- () => filter ? workspaces.filter(w => w === value || w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : [...workspaces], [workspaces, filter, value, listFavorites]);
68
+ () => filter ? workspaces.filter(w => w === value || w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : workspaces, [workspaces, filter, value]);
80
69
  function submit() {
81
70
  if (value)
82
71
  chat.set('workspace', { id: value.id, label: value.name });
83
72
  close();
84
73
  }
85
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "content", children: [_jsx(IconInput, { icon: _jsx(Search, {}), value: filter, onChange: setFilter, className: "search" }), !!filtered.length && _jsx(DescribedRadioGroup, { options: filtered, keygen: w => w.id, value: value, onChange: setValue, renderLabel: w => w.name, renderDescription: w => w.description, renderAfterElement: ({ id }) => _jsx(ButtonFavorite, { favorite: { idOrSlug: id, listFavorites, onAddFavorite, onRemoveFavorite } }), optionClassName: w => (w === value && filter && !w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
74
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "content", children: [_jsx(IconInput, { icon: _jsx(Search, {}), value: filter, onChange: setFilter, className: "search" }), !!filtered.length && _jsx(DescribedRadioGroup, { options: filtered, keygen: w => w.id, value: value, onChange: setValue, renderLabel: w => w.name, renderDescription: w => w.description, optionClassName: w => (w === value && filter && !w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
86
75
  ? 'filtered-out'
87
76
  : '', className: "option-list" }), !!workspaces.length && !filtered.length &&
88
77
  _jsx(Placeholder, { title: t.noSearchResults, description: t.noSearchResultsDescription, className: "no-data-placeholder" }), !workspaces.length && _jsx(Placeholder, { title: t.noData, description: t.noDataDescription })] }), !!filtered.length && _jsx(Button, { onClick: submit, disabled: !value, children: t.apply })] }));
89
78
  };
90
79
  const dictionary = {
91
80
  en: {
92
- title: 'Spaces',
93
- description: 'By selecting a space, its Knowledge Sources (KSs), Agents, Quick Commands and Stacks Ai will be consulted to generate the answers.',
81
+ title: 'Workspaces',
82
+ description: 'By selecting a workspace, its Knowledge Sources (KSs) will be consulted to generate the answers.',
94
83
  apply: 'Apply',
95
84
  noSearchResults: "Your search didn't yield results.",
96
85
  noSearchResultsDescription: 'Please, try another search term.',
97
- noData: 'There are no spaces yet.',
98
- noDataDescription: 'Use the AI portal to create new spaces.',
86
+ noData: 'There are no workspaces yet.',
87
+ noDataDescription: 'Use the AI portal to create new workspaces.',
99
88
  all: 'All',
100
89
  favorites: 'Favorites',
101
90
  },
102
91
  pt: {
103
- title: 'Spaces',
104
- description: 'Ao selecionar um space, seus Knowledge Sources (KSs), Agentes, Quick Commands e Stacks Ai serão consultados para gerar as respostas.',
92
+ title: 'Workspaces',
93
+ description: 'Ao selecionar um workspace, seus Knowledge Sources (KSs) serão consultados para gerar as respostas.',
105
94
  apply: 'Aplicar',
106
95
  noSearchResults: 'Sua busca não produziu resultados',
107
96
  noSearchResultsDescription: 'Por favor, tente outra busca.',
108
- noData: 'Ainda não há spaces.',
109
- noDataDescription: 'Use o Portal AI para criar novos spaces.',
97
+ noData: 'Ainda não há workspace.',
98
+ noDataDescription: 'Use o Portal AI para criar novos workspaces.',
110
99
  all: 'Todos',
111
100
  favorites: 'Favoritos',
112
101
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Workspaces.js","sourceRoot":"","sources":["../../src/views/Workspaces.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAE9D,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpD,OA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,SAAS,EAAE,WAAW;KACvB;CACmB,CAAA"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.15.0",
3
+ "version": "1.16.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
- "build": "rimraf dist && pnpm generate:metadata && tsc && tsc-esm-fix --target='dist' && cpy src/layout.css dist --flat",
8
+ "build": "rimraf dist && pnpm generate:metadata && tsc && tsc-esm-fix --target='dist' && cpy src/layout.css dist --flat && cpy src/assets/**/*.png dist/assets",
9
9
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10
10
  "generate:metadata": "pnpm app-metadata --lockfile ../../pnpm-lock.yaml --path packages/widget"
11
11
  },
@@ -6,6 +6,7 @@ import { useCurrentChatMessages, useCurrentChatState, useWidgetState } from './c
6
6
  import './layout.css'
7
7
  import { RightPanel } from './right-panel/RightPanel'
8
8
  import { RightPanelProvider } from './right-panel/RightPanelProvider'
9
+ import { LabeledAgent } from './state/types'
9
10
  import { MinimizedActions } from './types'
10
11
  import { checkIsTrial } from './utils/check-is-trial'
11
12
  import { Agents } from './views/Agents'
@@ -28,6 +29,11 @@ export interface AIWidgetProps extends WithStyle {
28
29
  * The name of the user currently logged in.
29
30
  */
30
31
  username: string,
32
+ /**
33
+ * Initial agents to show in the chat panel when there are still no messages (home).
34
+ * It doesn't make a difference if this component has children.
35
+ */
36
+ initialAgents?: LabeledAgent[],
31
37
  /**
32
38
  * A custom view to show when the chat has no messages to display.
33
39
  */
@@ -50,7 +56,7 @@ export interface AIWidgetProps extends WithStyle {
50
56
  * Renders a Chat Widget according to the closest model found in the React tree (AIWidgetProvider). If no model is found, a global version
51
57
  * of the Chat Widget will be instantiated and used.
52
58
  */
53
- export const StackspotAIWidget = ({ username, minimizedActions = {}, prefix,
59
+ export const StackspotAIWidget = ({ username, initialAgents, minimizedActions = {}, prefix,
54
60
  children, className, style, hasHeader = true }:
55
61
  AIWidgetProps) => {
56
62
  const rightPanelRef = useRef<HTMLDivElement>(null)
@@ -77,7 +83,8 @@ export const StackspotAIWidget = ({ username, minimizedActions = {}, prefix,
77
83
  <div className="chat-container">
78
84
  <div className="chat-content">
79
85
  {prefix}
80
- {isCurrentChatEmpty ? (children ?? <Home username={username} />) : <Chat username={username} />}
86
+ {isCurrentChatEmpty ? (children ?? <Home username={username} initialAgents={initialAgents}/>) :
87
+ <Chat username={username} />}
81
88
  </div>
82
89
  {features.messageInput && <MessageInput />}
83
90
  </div>
@@ -96,5 +103,5 @@ export const StackspotAIWidget = ({ username, minimizedActions = {}, prefix,
96
103
  </RightPanelProvider>
97
104
  </TooltipProvider>
98
105
  </FallbackBoundary>
99
- ), [isCurrentChatEmpty, username, isMinimized, children])
106
+ ), [isCurrentChatEmpty, username, isMinimized, children, initialAgents])
100
107
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.15.0",
4
- "date": "Thu Apr 24 2025 17:27:32 GMT+0000 (Coordinated Universal Time)",
3
+ "version": "1.16.1",
4
+ "date": "Fri Apr 25 2025 13:24:08 GMT+0000 (Coordinated Universal Time)",
5
5
  "dependencies": [
6
6
  {
7
7
  "name": "@stack-spot/app-metadata",
Binary file
@@ -0,0 +1,19 @@
1
+ import { Dictionary } from '@stack-spot/portal-translate'
2
+
3
+ export const dictionary = {
4
+ en: {
5
+ builtin: 'Built-in',
6
+ personal: 'Personal',
7
+ account: 'Account',
8
+ shared: 'Shared',
9
+ agent: 'Agent',
10
+ },
11
+ pt: {
12
+ builtin: 'Embutido',
13
+ personal: 'Personal',
14
+ account: 'Conta',
15
+ shared: 'Compartilhado',
16
+ agent: 'Agente',
17
+ },
18
+ } satisfies Dictionary
19
+
@@ -0,0 +1,82 @@
1
+ import { Image, Text } from '@citric/core'
2
+ import { Card } from '@citric/ui'
3
+ import { listToClass, theme } from '@stack-spot/portal-theme'
4
+ import { useTranslate } from '@stack-spot/portal-translate'
5
+ import { styled } from 'styled-components'
6
+ import placeholder from '../../assets/placeholder.png'
7
+ import { useCurrentChat, useCurrentChatState } from '../../context/hooks'
8
+ import { LabeledAgent } from '../../state/types'
9
+ import { dictionary } from './dictionary'
10
+
11
+ const StyledCard = styled(Card)`
12
+ cursor: pointer;
13
+ border-radius: 8px;
14
+ transition: background-color 0.3s;
15
+ display: flex;
16
+ flex-direction: column;
17
+ gap: 12px;
18
+
19
+ &:hover {
20
+ background-color: ${theme.color.light[500]};
21
+ }
22
+
23
+ &.active {
24
+ background-color: ${theme.color.light[600]};
25
+ }
26
+
27
+ img {
28
+ width: 125px;
29
+ height: 130px;
30
+ border-radius: 8px;
31
+ }
32
+
33
+ h6 {
34
+ max-width: 125px;
35
+ white-space: nowrap;
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ }
39
+
40
+ .agent-type {
41
+ display: flex;
42
+ gap: 4px;
43
+ }
44
+
45
+ .text-box {
46
+ display: flex;
47
+ flex-direction: column;
48
+ gap: 2px;
49
+ }
50
+ `
51
+
52
+ export const AgentCard = ({ agent }: { agent: LabeledAgent }) => {
53
+ const t = useTranslate(dictionary)
54
+ const chat = useCurrentChat()
55
+ const currentAgent = useCurrentChatState('agent')
56
+
57
+ return (
58
+ <StyledCard
59
+ onClick={() => chat.set('agent', agent)}
60
+ role="button"
61
+ tabIndex={0}
62
+ className={listToClass(['agent-card', currentAgent?.id === agent.id && 'active'])}
63
+ >
64
+ <Image src={agent.image ? agent.image : placeholder} />
65
+ <div className="text-box">
66
+ {agent.visibility_level && (
67
+ <div className="agent-type">
68
+ <Text appearance="microtext1" colorScheme="light.700">
69
+ {t[agent.visibility_level.toLowerCase() as keyof typeof t]}
70
+ </Text>
71
+ <Text appearance="microtext1">
72
+ {t.agent}
73
+ </Text>
74
+ </div>
75
+ )}
76
+ <Text appearance="h6">
77
+ {agent.label}
78
+ </Text>
79
+ </div>
80
+ </StyledCard>
81
+ )
82
+ }
@@ -0,0 +1,5 @@
1
+ declare module '*.png' {
2
+ const value: string
3
+ // eslint-disable-next-line import/no-default-export
4
+ export default value
5
+ }
@@ -10,4 +10,5 @@ export interface LabeledWithImage extends Labeled {
10
10
  export interface LabeledAgent extends LabeledWithImage {
11
11
  builtIn?: boolean,
12
12
  slug?: string,
13
+ visibility_level?: string,
13
14
  }
@@ -1,20 +1,50 @@
1
+ import { FadingOverflow } from '@stack-spot/portal-components/FadingOverflow'
2
+ import { styled } from 'styled-components'
3
+ import { AgentCard } from '../../components/AgentCard'
1
4
  import { FallbackBoundary } from '../../components/FallbackBoundary'
2
5
  import { useCurrentChatState } from '../../context/hooks'
3
6
  import { BuiltInAgent } from './BuiltInAgent'
4
7
  import { CustomAgent } from './CustomAgent'
5
8
  import { HomeProps } from './types'
6
9
 
10
+ const AgentList = styled.ul`
11
+ list-style: none;
12
+ margin: 0;
13
+ padding: 0;
14
+ display: flex;
15
+ align-items: center;
16
+ gap: 14px;
17
+
18
+ li {
19
+ flex-shrink: 0;
20
+ &:first-child {
21
+ margin-left: auto;
22
+ }
23
+ &:last-child {
24
+ margin-right: auto;
25
+ }
26
+ }
27
+ `
28
+
7
29
  /**
8
30
  * Renders the default home page for the chat. This shows up when no message has been sent yet.
9
31
  *
10
32
  * The home page can be replaced by providing children to the component `StackspotAIWidget`.
11
33
  */
12
- export const Home = (props: HomeProps) => {
34
+ export const Home = ({ initialAgents, ...props }: HomeProps) => {
13
35
  const agent = useCurrentChatState('agent')
14
-
36
+ const isAgentEnabled = useCurrentChatState('features').agent
37
+
15
38
  return (
16
39
  <FallbackBoundary>
17
40
  {agent && !agent.builtIn ? <CustomAgent /> : <BuiltInAgent {...props} />}
41
+ {!!initialAgents && isAgentEnabled && (
42
+ <FadingOverflow enableHorizontalScrollWithVerticalWheel sides={['left', 'right']} scroll="arrows">
43
+ <AgentList className="agent-list">
44
+ {initialAgents.map((agent) => <li key={agent.id}><AgentCard agent={agent} /></li>)}
45
+ </AgentList>
46
+ </FadingOverflow>
47
+ )}
18
48
  </FallbackBoundary>
19
49
  )
20
50
  }
@@ -1,7 +1,7 @@
1
1
  import { styled } from 'styled-components'
2
2
 
3
3
  export const HomeBox = styled.div`
4
- margin: auto;
4
+ margin: auto 0;
5
5
 
6
6
  .title, .subtitle {
7
7
  font-family: 'San Francisco';
@@ -1,6 +1,12 @@
1
+ import { LabeledAgent } from '../../state/types'
2
+
1
3
  export interface HomeProps {
2
4
  /**
3
5
  * The name of the user currently logged in.
4
6
  */
5
7
  username: string,
8
+ /**
9
+ * Initial agents to show in home.
10
+ */
11
+ initialAgents?: LabeledAgent[],
6
12
  }
@@ -33,7 +33,8 @@ export const AgentSelector = ({ inputRef, isTrial }: { isTrial: boolean,
33
33
  const isBuiltIn = agent.visibility_level === 'builtIn' || builtInsAgents.some((builtInAgent) => builtInAgent.id === agent.id)
34
34
  chat.set(
35
35
  'agent',
36
- { id: agent.id, label: agent.name, image: agent.avatar, slug: agent.slug, builtIn: isBuiltIn },
36
+ { id: agent.id, label: agent.name, image: agent.avatar, slug: agent.slug,
37
+ builtIn: isBuiltIn, visibility_level: agent.visibility_level },
37
38
  )
38
39
 
39
40
  if (!inputRef.current) return
@@ -26,6 +26,7 @@ export const ButtonAgent = () => {
26
26
  label: agentDefault.name,
27
27
  image: agentDefault.avatar,
28
28
  builtIn: true,
29
+ visibility_level: agentDefault.visibility_level,
29
30
  },
30
31
  )
31
32
  }
@@ -1,4 +1,4 @@
1
- import { ChevronRight, Circle, Code, KnowledgeSource, Send, Stack, Times } from '@citric/icons'
1
+ import { ChevronRight, Code, KnowledgeSource, Send, Stack, Times, Workspace } from '@citric/icons'
2
2
  import { IconButton } from '@citric/ui'
3
3
  import { listToClass } from '@stack-spot/portal-theme'
4
4
  import { useEffect, useRef } from 'react'
@@ -62,8 +62,8 @@ export const ButtonGroup = ({ onSend, onCancel, expanded, setExpanded, isLoading
62
62
  style={{ width: expanded ? featureButtonsWidth.current : 0 }}
63
63
  >
64
64
  {features.workspace && (
65
- <IconButton aria-label={t.space} title={t.space} onClick={() => widget.set('panel', 'workspace')}>
66
- <Circle />
65
+ <IconButton aria-label={t.workspace} title={t.workspace} onClick={() => widget.set('panel', 'workspace')}>
66
+ <Workspace />
67
67
  </IconButton>
68
68
  )}
69
69
  {features.knowledgeSource && (
@@ -5,7 +5,6 @@ const dictionary = {
5
5
  stack: 'Select stack',
6
6
  code: 'Open code editor',
7
7
  workspace: 'Select workspace',
8
- space: 'Select space',
9
8
  knowledgeSource: 'Select knowledge sources',
10
9
  agent: 'Select agent',
11
10
  collapse: 'Hide buttons',
@@ -25,7 +24,6 @@ const dictionary = {
25
24
  stack: 'Selecionar stack',
26
25
  code: 'Abrir editor de código',
27
26
  workspace: 'Selecionar workspace',
28
- space: 'Select Space',
29
27
  knowledgeSource: 'Selecionar knowledge sources',
30
28
  agent: 'Selecionar agente',
31
29
  collapse: 'Esconder botões',
@@ -1,11 +1,10 @@
1
1
  import { Button } from '@citric/core'
2
2
  import { Search } from '@citric/icons'
3
3
  import { Placeholder } from '@stack-spot/portal-components/Placeholder'
4
- import { workspaceAiClient } from '@stack-spot/portal-network'
5
- import { WorkspaceResponse, WorkspaceVisibilityLevelEnum } from '@stack-spot/portal-network/api/workspace-ai'
4
+ import { workspaceClient } from '@stack-spot/portal-network'
5
+ import { WorkspaceReadResponse } from '@stack-spot/portal-network/api/workspace'
6
6
  import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
7
7
  import { useEffect, useMemo, useState } from 'react'
8
- import { ButtonFavorite } from '../components/ButtonFavorite'
9
8
  import { DescribedRadioGroup } from '../components/form/DescribedRadioGroup'
10
9
  import { IconInput } from '../components/IconInput'
11
10
  import { RightPanelTabs } from '../components/RightPanelTabs'
@@ -36,58 +35,50 @@ const WorkspacesPanel = () => {
36
35
  const chat = useCurrentChat()
37
36
 
38
37
  return <RightPanelTabs key={chat.id} tabs={[
39
- { title: t.favorites, content: <WorkspaceSourcesTab key="favorite" visibility="favorite" /> },
40
- { title: t.all, content: <WorkspaceSourcesTab key="all" visibility="all" /> },
38
+ // { title: t.favorites, content: <WorkspaceSourcesTab key="favorite" visibility="favorite" /> },
39
+ { title: t.all, content: <WorkspaceSourcesTab key="all" /> },
41
40
  ]}
42
41
  />
43
42
  }
44
43
 
45
- const WorkspaceSourcesTab = ({ visibility }: {visibility: WorkspaceVisibilityLevelEnum}) => {
44
+ const WorkspaceSourcesTab = () => {
46
45
  const t = useTranslate(dictionary)
47
46
  const { close } = useRightPanel()
48
47
  const chat = useCurrentChat()
49
48
  const [filter, setFilter] = useState('')
50
- const workspaces = workspaceAiClient.workspacesAi.useQuery({ visibility })
51
- const [value, setValue] = useState<WorkspaceResponse | undefined>(workspaces.find(w => w.id === chat.get('workspace')?.id))
52
- const listFavorites = workspaceAiClient.workspacesAi.useQuery({ visibility: 'favorite' })
49
+ // const workspaces = workspaceAiClient.workspacesAi.useQuery({ visibility })
50
+ // const [value, setValue] = useState<WorkspaceResponse | undefined>(workspaces.find(w => w.id === chat.get('workspace')?.id))
51
+ const workspaces = workspaceClient.workspaces.useQuery({ aclOnly: false })
53
52
 
54
- const [addFavorite, pendingAddFav] = workspaceAiClient.addFavoriteWorkspaceAi.useMutation()
55
- const [removeFavorite, pendingRemoveFav] = workspaceAiClient.removeFavoriteWorkspaceAi.useMutation()
53
+ const [value, setValue] = useState<WorkspaceReadResponse | undefined>(workspaces.find(w => w.id === chat.get('workspace')?.id))
54
+ // const listFavorites = workspaceAiClient.workspacesAi.useQuery({ visibility: 'favorite' })
56
55
 
57
- // eslint-disable-next-line no-async-promise-executor
58
- const onAddFavorite = async(idOrSlug: string) => new Promise<boolean>(async (resolve, reject) => {
59
- try {
60
- await addFavorite({ workspaceId: idOrSlug })
61
- await workspaceAiClient.workspacesAi.invalidate()
62
- if (!pendingAddFav) {
63
- resolve(true)
64
- }
65
- } catch (error) {
66
- // eslint-disable-next-line no-console
67
- console.error(error)
68
- reject(error)
69
- }
70
- })
56
+ // const [addFavorite, pendingAddFav] = workspaceAiClient.addFavoriteWorkspaceAi.useMutation()
57
+ // const [removeFavorite, pendingRemoveFav] = workspaceAiClient.removeFavoriteWorkspaceAi.useMutation()
71
58
 
72
- // eslint-disable-next-line no-async-promise-executor
73
- const onRemoveFavorite = (idOrSlug: string) => new Promise<boolean>(async (resolve, reject) => {
74
- try {
75
- await removeFavorite({ workspaceId: idOrSlug })
76
- await workspaceAiClient.workspacesAi.invalidate()
77
- if (!pendingRemoveFav) {
78
- resolve(true)
79
- }
80
- } catch (error) {
81
- // eslint-disable-next-line no-console
82
- console.error(error)
83
- reject(error)
84
- }
85
- })
59
+ // const onAddFavorite = async(idOrSlug: string) => {
60
+ // try {
61
+ // await addFavorite({ workspaceId: idOrSlug })
62
+ // await workspaceAiClient.workspacesAi.invalidate()
63
+ // } catch (error) {
64
+ // // eslint-disable-next-line no-console
65
+ // console.error(error)
66
+ // }
67
+ // }
68
+ // const onRemoveFavorite = async(idOrSlug: string) => {
69
+ // try {
70
+ // await removeFavorite({ workspaceId: idOrSlug })
71
+ // await workspaceAiClient.workspacesAi.invalidate()
72
+ // } catch (error) {
73
+ // // eslint-disable-next-line no-console
74
+ // console.error(error)
75
+ // }
76
+ // }
86
77
 
87
78
  const filtered = useMemo(
88
79
  // Recreate the list so that the favorites list is taken into account
89
- () => filter ? workspaces.filter(w => w === value || w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : [...workspaces],
90
- [workspaces, filter, value, listFavorites],
80
+ () => filter ? workspaces.filter(w => w === value || w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : workspaces,
81
+ [workspaces, filter, value],
91
82
  )
92
83
 
93
84
  function submit() {
@@ -105,8 +96,6 @@ const WorkspaceSourcesTab = ({ visibility }: {visibility: WorkspaceVisibilityLev
105
96
  onChange={setValue}
106
97
  renderLabel={w => w.name}
107
98
  renderDescription={w => w.description}
108
- renderAfterElement={({ id }) =>
109
- <ButtonFavorite favorite={{ idOrSlug: id, listFavorites, onAddFavorite, onRemoveFavorite }} />}
110
99
  optionClassName={w => (w === value && filter && !w.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
111
100
  ? 'filtered-out'
112
101
  : ''
@@ -124,24 +113,24 @@ const WorkspaceSourcesTab = ({ visibility }: {visibility: WorkspaceVisibilityLev
124
113
 
125
114
  const dictionary = {
126
115
  en: {
127
- title: 'Spaces',
128
- description: 'By selecting a space, its Knowledge Sources (KSs), Agents, Quick Commands and Stacks Ai will be consulted to generate the answers.',
116
+ title: 'Workspaces',
117
+ description: 'By selecting a workspace, its Knowledge Sources (KSs) will be consulted to generate the answers.',
129
118
  apply: 'Apply',
130
119
  noSearchResults: "Your search didn't yield results.",
131
120
  noSearchResultsDescription: 'Please, try another search term.',
132
- noData: 'There are no spaces yet.',
133
- noDataDescription: 'Use the AI portal to create new spaces.',
121
+ noData: 'There are no workspaces yet.',
122
+ noDataDescription: 'Use the AI portal to create new workspaces.',
134
123
  all: 'All',
135
124
  favorites: 'Favorites',
136
125
  },
137
126
  pt: {
138
- title: 'Spaces',
139
- description: 'Ao selecionar um space, seus Knowledge Sources (KSs), Agentes, Quick Commands e Stacks Ai serão consultados para gerar as respostas.',
127
+ title: 'Workspaces',
128
+ description: 'Ao selecionar um workspace, seus Knowledge Sources (KSs) serão consultados para gerar as respostas.',
140
129
  apply: 'Aplicar',
141
130
  noSearchResults: 'Sua busca não produziu resultados',
142
131
  noSearchResultsDescription: 'Por favor, tente outra busca.',
143
- noData: 'Ainda não há spaces.',
144
- noDataDescription: 'Use o Portal AI para criar novos spaces.',
132
+ noData: 'Ainda não há workspace.',
133
+ noDataDescription: 'Use o Portal AI para criar novos workspaces.',
145
134
  all: 'Todos',
146
135
  favorites: 'Favoritos',
147
136
  },