@stack-spot/ai-chat-widget 1.20.1 → 1.20.2

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 +12 -0
  2. package/dist/app-metadata.json +5 -5
  3. package/dist/components/Selector/index.d.ts +1 -1
  4. package/dist/components/Selector/index.d.ts.map +1 -1
  5. package/dist/components/Selector/index.js +4 -4
  6. package/dist/components/Selector/index.js.map +1 -1
  7. package/dist/views/Agents/AgentDescription.d.ts +2 -2
  8. package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
  9. package/dist/views/Agents/AgentDescription.js +1 -3
  10. package/dist/views/Agents/AgentDescription.js.map +1 -1
  11. package/dist/views/Agents/AgentsPanel.d.ts.map +1 -1
  12. package/dist/views/Agents/AgentsPanel.js +2 -2
  13. package/dist/views/Agents/AgentsPanel.js.map +1 -1
  14. package/dist/views/Agents/AgentsTab.d.ts.map +1 -1
  15. package/dist/views/Agents/AgentsTab.js +5 -16
  16. package/dist/views/Agents/AgentsTab.js.map +1 -1
  17. package/dist/views/Agents/useAgentFavorites.d.ts +1 -1
  18. package/dist/views/Agents/useAgentFavorites.js +3 -3
  19. package/dist/views/Agents/useAgentFavorites.js.map +1 -1
  20. package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
  21. package/dist/views/Chat/ChatMessage.js +1 -3
  22. package/dist/views/Chat/ChatMessage.js.map +1 -1
  23. package/dist/views/ChatHistory/utils.d.ts.map +1 -1
  24. package/dist/views/ChatHistory/utils.js +3 -13
  25. package/dist/views/ChatHistory/utils.js.map +1 -1
  26. package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
  27. package/dist/views/MessageInput/AgentSelector.js +11 -19
  28. package/dist/views/MessageInput/AgentSelector.js.map +1 -1
  29. package/dist/views/MessageInput/ButtonAgent.d.ts.map +1 -1
  30. package/dist/views/MessageInput/ButtonAgent.js +3 -4
  31. package/dist/views/MessageInput/ButtonAgent.js.map +1 -1
  32. package/dist/views/MessageInput/InfoBar.d.ts.map +1 -1
  33. package/dist/views/MessageInput/InfoBar.js +3 -1
  34. package/dist/views/MessageInput/InfoBar.js.map +1 -1
  35. package/dist/views/Steps/StepModal.d.ts.map +1 -1
  36. package/dist/views/Steps/StepModal.js +1 -1
  37. package/dist/views/Steps/StepModal.js.map +1 -1
  38. package/package.json +3 -3
  39. package/src/app-metadata.json +5 -5
  40. package/src/components/Selector/index.tsx +6 -6
  41. package/src/views/Agents/AgentDescription.tsx +7 -7
  42. package/src/views/Agents/AgentsPanel.tsx +3 -2
  43. package/src/views/Agents/AgentsTab.tsx +12 -23
  44. package/src/views/Agents/useAgentFavorites.ts +3 -3
  45. package/src/views/Chat/ChatMessage.tsx +1 -3
  46. package/src/views/ChatHistory/utils.ts +3 -15
  47. package/src/views/MessageInput/AgentSelector.tsx +17 -27
  48. package/src/views/MessageInput/ButtonAgent.tsx +4 -4
  49. package/src/views/MessageInput/InfoBar.tsx +9 -3
  50. package/src/views/Steps/StepModal.tsx +0 -2
  51. package/dist/utils/agent.d.ts +0 -2
  52. package/dist/utils/agent.d.ts.map +0 -1
  53. package/dist/utils/agent.js +0 -2
  54. package/dist/utils/agent.js.map +0 -1
  55. package/src/utils/agent.ts +0 -1
@@ -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,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAE3E,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,OAA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sources":["../../../src/views/MessageInput/ButtonAgent.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,+CAmDvB,CAAA"}
@@ -6,12 +6,10 @@ import { MiniLogo } from '@stack-spot/portal-components/svg';
6
6
  import { agentClient } from '@stack-spot/portal-network';
7
7
  import { useEffect } from 'react';
8
8
  import { useCurrentChat, useCurrentChatState, useWidget } from '../../context/hooks.js';
9
- import { isAgentDefault } from '../../utils/agent.js';
10
9
  import { useMessageInputDictionary } from './dictionary.js';
11
10
  export const ButtonAgent = () => {
12
11
  const t = useMessageInputDictionary();
13
- const [agentsBuiltIn] = agentClient.publicAgents.useStatefulQuery({});
14
- const agentDefault = agentsBuiltIn?.find((agent) => isAgentDefault(agent.slug));
12
+ const agentDefault = agentClient.agentDefault.useQuery({});
15
13
  const widget = useWidget();
16
14
  const chat = useCurrentChat();
17
15
  const agent = useCurrentChatState('agent');
@@ -31,7 +29,8 @@ export const ButtonAgent = () => {
31
29
  setAgentDefault();
32
30
  }
33
31
  }, [agentDefault, agent]);
34
- return (_jsx("div", { className: "button-group", children: features.agent && (_jsxs("div", { className: "group-agent", children: [_jsx(IconButton, { "aria-label": t.agent, title: t.agent, className: "agent", onClick: () => widget.set('panel', 'agent'), children: agentDefault?.avatar ? _jsx("img", { src: agentDefault.avatar, className: "image" }) : _jsx(MiniLogo, {}) }), agent?.id && !isAgentDefault(agent?.slug) &&
32
+ const isAgentDefault = () => agent?.id === agentDefault?.id;
33
+ return (_jsx("div", { className: "button-group", children: features.agent && (_jsxs("div", { className: "group-agent", children: [_jsx(IconButton, { "aria-label": t.agent, title: t.agent, className: "agent", onClick: () => widget.set('panel', 'agent'), children: agentDefault?.avatar ? _jsx("img", { src: agentDefault.avatar, className: "image" }) : _jsx(MiniLogo, {}) }), agent?.id && !isAgentDefault() &&
35
34
  _jsx(Tooltip, { text: t.remove, children: _jsxs(IconButton, { "aria-label": t.remove, className: "agent agent-selected", onClick: setAgentDefault, children: [agent?.image ? _jsx("img", { src: agent.image, className: "image" }) : _jsx(IconBox, { className: "image", size: "xs", children: _jsx(Agent, {}) }), _jsx(Flex, { className: "icon-remove", alignContent: "center", justifyContent: "center", children: _jsx(TimesMini, {}) })] }) })] })) }));
36
35
  };
37
36
  //# sourceMappingURL=ButtonAgent.js.map
@@ -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,mBAAmB,CAAC,O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AC,OAAO,IAAC,IAAI,EAAE,CAAC,CAAC,MAAM,YACrB,MAAC,UAAU,kBAAa,CAAC,CAAC,MAAM,EAAE,SAAS,EAAC,sBAAsB,EAAC,OAAO,EAAE,eAAe,aACxF,KAAK,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 +1 @@
1
- {"version":3,"file":"InfoBar.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/InfoBar.tsx"],"names":[],"mappings":"AAuBA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,+CA0EnB,CAAA"}
1
+ {"version":3,"file":"InfoBar.d.ts","sourceRoot":"","sources":["../../../src/views/MessageInput/InfoBar.tsx"],"names":[],"mappings":"AA6BA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,+CA0EnB,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from '@citric/core';
2
3
  import { Times, TimesMini } from '@citric/icons';
3
4
  import { Badge, IconButton } from '@citric/ui';
4
5
  import { loader } from '@monaco-editor/react';
@@ -7,7 +8,8 @@ import { useCallback, useMemo } from 'react';
7
8
  import { FadingOverflow } from '../../components/FadingOverflow.js';
8
9
  import { useCurrentChat, useCurrentChatState } from '../../context/hooks.js';
9
10
  import { useMessageInputDictionary } from './dictionary.js';
10
- const InfoBadge = ({ label, color, dismiss, onDismiss }) => (_jsxs(Badge, { appearance: "square", palette: color, className: "info-badge", children: [label, onDismiss && _jsx(IconButton, { onClick: onDismiss, title: dismiss, "arial-label": dismiss, children: _jsx(TimesMini, {}) })] }));
11
+ const InfoBadge = ({ label, color, dismiss, onDismiss }) => (_jsx(Badge, { appearance: "square", palette: color, className: "info-badge", afterElement: onDismiss &&
12
+ _jsx(IconButton, { appearance: "square", colorIcon: `${color}.800`, onClick: onDismiss, title: dismiss, "arial-label": dismiss, children: _jsx(TimesMini, {}) }), children: _jsx(Text, { nowrapEllipsis: true, children: label }) }));
11
13
  /**
12
14
  * This renders the bar on top of the textarea to send the message. This tells:
13
15
  * - if there's any code selected in the editor;
@@ -1 +1 @@
1
- {"version":3,"file":"InfoBar.js","sourceRoot":"","sources":["../../../src/views/MessageInput/InfoBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAoB,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AASxD,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAkB,EAAE,EAAE,CAAC,CAC1E,MAAC,KAAK,IAAC,UAAU,EAAC,QAAQ,EAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAC,YAAY,aAC9D,KAAK,EACL,SAAS,IAAI,KAAC,UAAU,IAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE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,KAAK,EAAC,MAAM,EACZ,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAC5E,GACC,CACN,EACA,gBAAgB,IAAI,CACnB,uBACE,KAAC,SAAS,IACR,KAAK,EAAE,gBAAgB,CAAC,KAAK,EAC7B,OAAO,EAAE,CAAC,CAAC,eAAe,EAC1B,KAAK,EAAC,MAAM,EACZ,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GACpF,GACC,CACN,EACA,UAAU,IACR,GACU,IACb,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"StepModal.d.ts","sourceRoot":"","sources":["../../../src/views/Steps/StepModal.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAIjD,UAAU,KAAK;IACb,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAuGD,eAAO,MAAM,SAAS,iCAAkC,KAAK,4CA6F5D,CAAA"}
1
+ {"version":3,"file":"StepModal.d.ts","sourceRoot":"","sources":["../../../src/views/Steps/StepModal.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAIjD,UAAU,KAAK;IACb,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAuGD,eAAO,MAAM,SAAS,iCAAkC,KAAK,4CA2F5D,CAAA"}
@@ -118,7 +118,7 @@ export const StepModal = ({ message, stepId, onClose }) => {
118
118
  const stepIndex = useMemo(() => entry.steps?.findIndex(s => s.id === stepId) ?? -1, [entry, stepId]);
119
119
  const step = entry.steps?.[stepIndex];
120
120
  const tools = step?.type === 'step' ? step.attempts[attempt]?.tools?.map(tool => (_jsxs("div", { className: "tool", children: [_jsx(ToolBadge, { name: tool.name, duration: tool.duration, image: tool.image, description: tool.description }), tool.input && _jsxs(_Fragment, { children: [_jsxs(Text, { appearance: "microtext1", colorScheme: "light.700", children: [t.input, ":"] }), _jsx(Code, { language: "json", className: "tool-input", showLineNumbers: false, showActionBar: true, children: tool.input })] }), tool.output && _jsxs(_Fragment, { children: [_jsxs(Text, { appearance: "microtext1", colorScheme: "light.700", children: [t.response, ":"] }), _jsx(Code, { language: "json", className: "tool-input", showLineNumbers: false, showActionBar: true, children: tool.output })] })] }, tool.id))) : undefined;
121
- const title = (_jsxs(Flex, { flex: 1, justifyContent: "space-between", alignItems: "center", children: [_jsx(Text, { appearance: "h6", children: getTitle(t, step, stepIndex) }), _jsxs(ExecutionBox, { children: [_jsxs(Text, { className: "time", appearance: "microtext1", children: [step?.status === 'running' && t.running, step?.status === 'pending' && t.pending, step?.status === 'success' && `${t.executionTime}: ${step?.duration ? `${toPrecision(step?.duration)}s` : t.unknown}`] }), step?.type === 'step' && step.attempts.length > 1 && _jsxs("div", { className: "navigator", children: [attempt > 0 && (_jsx(IconButton, { size: "xs", appearance: "text", title: t.previousAttempt, "aria-label": t.previousAttempt, onClick: () => setAttempt(attempt - 1), children: _jsx(ChevronLeft, {}) })), _jsxs(Text, { appearance: "microtext1", children: [attempt + 1, "/", step.attempts.length] }), attempt < step.attempts.length - 1 && (_jsx(IconButton, { size: "xs", appearance: "text", title: t.nextAttempt, "aria-label": t.nextAttempt, onClick: () => setAttempt(attempt + 1), children: _jsx(ChevronRight, {}) }))] })] })] }));
121
+ const title = (_jsxs(Flex, { flex: 1, justifyContent: "space-between", alignItems: "center", children: [_jsx(Text, { appearance: "h6", children: getTitle(t, step, stepIndex) }), _jsxs(ExecutionBox, { children: [_jsxs(Text, { className: "time", appearance: "microtext1", children: [step?.status === 'running' && t.running, step?.status === 'pending' && t.pending, step?.status === 'success' && `${t.executionTime}: ${step?.duration ? `${toPrecision(step?.duration)}s` : t.unknown}`] }), step?.type === 'step' && step.attempts.length > 1 && _jsxs("div", { className: "navigator", children: [attempt > 0 && (_jsx(IconButton, { size: "xs", title: t.previousAttempt, "aria-label": t.previousAttempt, onClick: () => setAttempt(attempt - 1), children: _jsx(ChevronLeft, {}) })), _jsxs(Text, { appearance: "microtext1", children: [attempt + 1, "/", step.attempts.length] }), attempt < step.attempts.length - 1 && (_jsx(IconButton, { size: "xs", title: t.nextAttempt, "aria-label": t.nextAttempt, onClick: () => setAttempt(attempt + 1), children: _jsx(ChevronRight, {}) }))] })] })] }));
122
122
  return (_jsxs(Modal, { open: !!step, onClose: onClose, title: title, children: [step?.type === 'answer' && _jsx(StyledSection, { className: "restrict-image-size", children: entry.type === 'md' ? _jsx(Markdown, { children: entry.content }) : _jsx(Text, { children: entry.content }) }), step?.type === 'planning' && _jsxs(StyledSection, { style: { alignItems: 'stretch' }, children: [_jsx(Badge, { appearance: "square", palette: "blue", style: { alignSelf: 'start' }, children: "Prompt" }), _jsx(Text, { children: step.goal }), _jsx("ul", { className: "steps", children: entry.steps?.filter(s => s.type === 'step').map((s, index) => (_jsxs("li", { children: [_jsx(Flex, { mb: 2, children: _jsxs(Text, { children: [t.step, " ", index + 1, ": ", _jsx("span", { className: "step-description", children: s.input })] }) }), !!s.attempts[0].tools?.length && _jsx("ul", { className: "side-by-side-tools", children: s.attempts[0].tools.map((tool) => (_jsx("li", { children: _jsx(ToolBadge, { name: tool.name, image: tool.image, appearance: "round" }) }, tool.id))) })] }, index))) })] }), step?.type === 'step' && step?.input && _jsxs(StyledSection, { children: [_jsx(Badge, { appearance: "square", palette: "blue", children: "Prompt" }), _jsx(Text, { children: step.input })] }), !!tools?.length && _jsx(StyledSection, { children: tools })] }));
123
123
  };
124
124
  //# sourceMappingURL=StepModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepModal.js","sourceRoot":"","sources":["../../../src/views/Steps/StepModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAQ/C,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0BZ,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;iCAKb,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;sBAMjC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;0BAmBlB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;;;;eAKjC,KAA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,cAAE,IAAI,CAAC,KAAK,GAAQ,IACX,EACf,CAAC,CAAC,KAAK,EAAE,MAAM,IAAI,KAAC,aAAa,cAAE,KAAK,GAAiB,IACpD,CACT,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.20.1",
3
+ "version": "1.20.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  "@citric/core": "^6.4.0",
14
14
  "@stack-spot/portal-components": "^2.22.1",
15
15
  "@citric/icons": "^5.11.0",
16
- "@stack-spot/portal-network": "^0.119.1",
17
- "@citric/ui": "^6.7.0",
16
+ "@stack-spot/portal-network": "^0.124.0",
17
+ "@citric/ui": "^6.10.2",
18
18
  "@stack-spot/portal-theme": "^1.0.0",
19
19
  "@stack-spot/portal-translate": "^1.1.0",
20
20
  "lodash": "^4.17.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "1.20.1",
4
- "date": "Thu May 08 2025 19:04:28 GMT+0000 (Coordinated Universal Time)",
3
+ "version": "1.20.2",
4
+ "date": "Mon May 12 2025 19:59:56 GMT+0000 (Coordinated Universal Time)",
5
5
  "dependencies": [
6
6
  {
7
7
  "name": "@stack-spot/app-metadata",
@@ -97,7 +97,7 @@
97
97
  },
98
98
  {
99
99
  "name": "@citric/ui",
100
- "version": "6.7.0(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.11.0(react@18.2.0))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0))"
100
+ "version": "6.10.2(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.11.0(react@18.2.0))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0))"
101
101
  },
102
102
  {
103
103
  "name": "@dagrejs/dagre",
@@ -109,11 +109,11 @@
109
109
  },
110
110
  {
111
111
  "name": "@stack-spot/portal-components",
112
- "version": "2.22.1(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.11.0(react@18.2.0))(@citric/ui@6.7.0(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.11.0(react@18.2.0))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@stack-spot/portal-theme@1.1.0(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@stack-spot/portal-translate@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.3.11)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
112
+ "version": "2.22.1(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.11.0(react@18.2.0))(@citric/ui@6.10.2(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.11.0(react@18.2.0))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@stack-spot/portal-theme@1.1.0(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@stack-spot/portal-translate@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.3.11)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
113
113
  },
114
114
  {
115
115
  "name": "@stack-spot/portal-network",
116
- "version": "0.119.1(@stack-spot/auth@5.3.2)(@stack-spot/opa@2.5.0(@stack-spot/auth@5.3.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@stack-spot/portal-translate@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@tanstack/react-query@5.59.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
116
+ "version": "0.124.0(@stack-spot/auth@5.3.2)(@stack-spot/opa@2.5.0(@stack-spot/auth@5.3.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@stack-spot/portal-translate@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@tanstack/react-query@5.59.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
117
117
  },
118
118
  {
119
119
  "name": "@stack-spot/portal-theme",
@@ -12,7 +12,7 @@ import { Fading } from '../Fading'
12
12
  import { FallbackBoundary } from '../FallbackBoundary'
13
13
  import { SelectorBox } from './styled'
14
14
 
15
- type SectionVisibility = VisibilityLevelEnum | 'builtIn'
15
+ type SectionVisibility = VisibilityLevelEnum | 'built-in'
16
16
 
17
17
  type SelectorShortcut = '/' | '@'
18
18
 
@@ -136,9 +136,9 @@ const List = <T extends Item>({ selectorConfig, filter, visibility, onSelect, fa
136
136
 
137
137
  return (
138
138
  <ul className="selector-list">
139
- {filtered?.map((item) => (
139
+ {filtered?.map((item, i) => (
140
140
  <ListItem
141
- key={item.id}
141
+ key={`${item.id}${item.visibility_level}${i}`}
142
142
  item={item}
143
143
  selectorConfig={selectorConfig}
144
144
  onSelect={onSelect}
@@ -172,7 +172,7 @@ const SelectorContent = ({ filter, onClose, selectorConfig, favorite }: ContentP
172
172
  return (
173
173
  <li key={action ?? 'all'}>
174
174
  <button className={visibility === action ? 'active' : ''} onFocus={() => setVisibility(action)}>
175
- {t[action ?? 'all']}
175
+ {t[action?.toLowerCase() as keyof typeof t ?? 'all']}
176
176
  </button>
177
177
  </li>
178
178
  )
@@ -268,7 +268,7 @@ const dictionary = {
268
268
  personal: 'Personal',
269
269
  account: 'Account',
270
270
  shared: 'Shared',
271
- builtIn: 'Built-in',
271
+ 'built-in': 'Built-in',
272
272
  workspace: 'Spot',
273
273
  error: 'Could not load the $0s.',
274
274
  noData: 'You don\'t have any $0 yet.',
@@ -282,7 +282,7 @@ const dictionary = {
282
282
  account: 'Conta',
283
283
  shared: 'Compartilhado',
284
284
  workspace: 'Spot',
285
- builtIn: 'Embutido',
285
+ 'built-in': 'Embutido',
286
286
  error: 'Não foi possível carregar os $0s.',
287
287
  noData: 'Você ainda não possui $0s.',
288
288
  noResults: 'Não $0s para mostrar aqui.',
@@ -1,7 +1,6 @@
1
1
  import { Text } from '@citric/core'
2
2
  import { Badge, Skeleton } from '@citric/ui'
3
- import { agentClient } from '@stack-spot/portal-network'
4
- import { VisibilityLevel } from '@stack-spot/portal-network/api/agent'
3
+ import { agentClient, AgentVisibilityLevel } from '@stack-spot/portal-network'
5
4
  import { useMemo } from 'react'
6
5
  import { ToolBadge } from '../../components/ToolBadge'
7
6
  import { useAgentsDictionary } from './dictionary'
@@ -12,15 +11,16 @@ interface Props {
12
11
  llm?: string,
13
12
  description?: string,
14
13
  numberOfKnowledgeSources: number,
15
- visibility: VisibilityLevel | 'BUILT-IN',
14
+ visibility: AgentVisibilityLevel,
16
15
  }
17
16
 
18
17
  export const AgentDescription = ({ agentId, llm, description, numberOfKnowledgeSources, visibility }: Props) => {
19
18
  const t = useAgentsDictionary()
20
- const [agent, , , { isLoading }] = visibility === 'BUILT-IN'
21
- ? agentClient.publicAgent.useStatefulQuery({ agentId: agentId! }, { enabled: !!agentId })
22
- : agentClient.agent.useStatefulQuery({ agentId: agentId! }, { enabled: !!agentId })
23
-
19
+ const [agent, , , { isLoading }] = agentClient.agentById.useStatefulQuery(
20
+ { agentId: agentId!, builtIn: visibility === 'BUILT-IN' },
21
+ { enabled: !!agentId },
22
+ )
23
+
24
24
  const knowledgeSources = useMemo(
25
25
  () => agent?.knowledge_sources_config?.knowledge_sources_details?.map((ks, index) => (
26
26
  <li key={index}><Badge palette="teal" appearance="square">{ks.name}</Badge></li>
@@ -1,11 +1,12 @@
1
1
  import { useEffect, useMemo, useRef } from 'react'
2
2
  import { RightPanelTabs } from '../../components/RightPanelTabs'
3
3
  import { useCurrentChat } from '../../context/hooks'
4
- import { isAgentDefault } from '../../utils/agent'
5
4
  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,7 +17,7 @@ export const AgentsPanel = () => {
16
17
  const agent = useRef(chat.get('agent'))
17
18
 
18
19
  useEffect(() => {
19
- if (!isAgentDefault(chat.get('agent')?.slug)) {
20
+ if (agentDefaultSlug !== chat.get('agent')?.slug) {
20
21
  agent.current = chat.get('agent')
21
22
  }
22
23
  }, [chat])
@@ -2,8 +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 { agentClient, workspaceAiClient } from '@stack-spot/portal-network'
6
- import { AgentResponse, VisibilityLevel } from '@stack-spot/portal-network/api/agent'
5
+ import { agentClient, AgentResponseWithBuiltIn, workspaceAiClient } from '@stack-spot/portal-network'
6
+ import { VisibilityLevel } from '@stack-spot/portal-network/api/agent'
7
7
  import { WorkspaceResponse } from '@stack-spot/portal-network/api/workspace-ai'
8
8
  import { useCallback, useMemo, useState } from 'react'
9
9
  import { ButtonFavorite } from '../../components/ButtonFavorite'
@@ -14,7 +14,6 @@ import { WorkspaceTabNavigator } from '../../components/WorkspaceTabNavigator'
14
14
  import { useCurrentChat } from '../../context/hooks'
15
15
  import { useRightPanel } from '../../right-panel/hooks'
16
16
  import { ChatProperties } from '../../state/ChatState'
17
- import { isAgentDefault } from '../../utils/agent'
18
17
  import { AgentDescription } from './AgentDescription'
19
18
  import { useAgentsDictionary } from './dictionary'
20
19
  import { AgentLabel } from './styled'
@@ -34,14 +33,13 @@ export const AgentsTab = ({ visibility, workspaceId, agent, showSubmitButton = t
34
33
  const [filter, setFilter] = useState('')
35
34
  const { useFavorites, onAddFavorite, onRemoveFavorite } = useAgentFavorites()
36
35
  const listFavorites = useFavorites()
37
-
38
- const agentsBuiltIn = agentClient.publicAgents.useQuery({})
39
- const agentDefault = agentsBuiltIn.find((agent) => isAgentDefault(agent.slug))
36
+ const agentDefault = agentClient.agentDefault.useQuery({})
40
37
  const agents = workspaceId
41
38
  ? workspaceAiClient.getAgentFromWorkspaceAi.useQuery({ workspaceId })
42
- : visibility === 'BUILT-IN' ? agentsBuiltIn : agentClient.agents.useQuery({ visibility })
39
+ : agentClient.allAgents.useQuery({ visibilities: [visibility] })
40
+
43
41
 
44
- const [value, setValue] = useState<AgentResponse | undefined>(
42
+ const [value, setValue] = useState<AgentResponseWithBuiltIn | undefined>(
45
43
  agent.current
46
44
  ? agents.find(a => a.id === agent.current?.id)
47
45
  : chat.get('agent') ? agents.find(a => a.id === chat.get('agent')?.id) : agentDefault,
@@ -55,24 +53,14 @@ export const AgentsTab = ({ visibility, workspaceId, agent, showSubmitButton = t
55
53
 
56
54
  function submit() {
57
55
  if (value) {
58
- const isBuiltIn = visibility === 'BUILT-IN' || agentsBuiltIn.some((agent) => agent.id === value.id)
59
- chat.set('agent', {
60
- id: value.id,
61
- label: value.name,
62
- image: value.avatar,
63
- builtIn: isBuiltIn,
64
- slug: value.slug,
65
- visibility_level: value.visibility_level,
66
- })
56
+ chat.set('agent', { id: value.id, label: value.name, image: value.avatar, builtIn: !!value.builtIn, slug: value.slug })
67
57
  }
68
58
  close()
69
59
  }
70
60
 
71
- const onChange = useCallback((newValue: AgentResponse) => {
72
- const isBuiltIn = visibility === 'BUILT-IN' || agentsBuiltIn.some((agent) => agent.id === newValue.id)
73
-
61
+ const onChange = useCallback((newValue: AgentResponseWithBuiltIn) => {
74
62
  setValue(newValue)
75
- agent.current = { ...newValue, builtIn: isBuiltIn, label: newValue.name }
63
+ agent.current = { ...newValue, label: newValue.name, builtIn: !!newValue.builtIn }
76
64
  }, [])
77
65
 
78
66
  return (
@@ -82,8 +70,9 @@ export const AgentsTab = ({ visibility, workspaceId, agent, showSubmitButton = t
82
70
  {!!filtered.length && <DescribedRadioGroup
83
71
  options={filtered}
84
72
  renderAfterElement={({ id }) => (
85
- <ButtonFavorite favorite={{
86
- idOrSlug: id, listFavorites, onAddFavorite, onRemoveFavorite }} />
73
+ <ButtonFavorite favorite={{
74
+ idOrSlug: id, listFavorites, onAddFavorite, onRemoveFavorite,
75
+ }} />
87
76
  )}
88
77
  keygen={a => a.id}
89
78
  value={value}
@@ -2,14 +2,14 @@
2
2
  import { agentClient } from '@stack-spot/portal-network'
3
3
 
4
4
  export function useAgentFavorites() {
5
- const useFavorites = () => agentClient.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 agentClient.agents.invalidate()
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 agentClient.agents.invalidate()
22
+ await agentClient.allAgents.invalidate({ visibilities: ['FAVORITE'] })
23
23
  } catch (error) {
24
24
  // eslint-disable-next-line no-console
25
25
  console.error(error)
@@ -184,9 +184,7 @@ export const ChatMessage = ({ message, username, isLast, beforeMessage, afterMes
184
184
  const widget = useWidget()
185
185
  const chat = useCurrentChat()
186
186
  const agentId = entry.agent?.id ?? ''
187
- const [agentById] = agentClient.agent.useStatefulQuery({ agentId }, { enabled: !!agentId && !entry?.agent?.builtIn })
188
- const [agentBuiltInById] = agentClient.publicAgent.useStatefulQuery({ agentId }, { enabled: !!agentId && entry?.agent?.builtIn })
189
- const agent = agentById ?? agentBuiltInById
187
+ const [agent] = agentClient.agentById.useStatefulQuery({ agentId, builtIn: !!entry?.agent?.builtIn }, { enabled: !!agentId })
190
188
 
191
189
  useChatScrollToBottomEffect(ref, [entry])
192
190
 
@@ -1,4 +1,4 @@
1
- import { agentClient, aiClient, workspaceAiClient, workspaceClient } from '@stack-spot/portal-network'
1
+ import { agentClient, aiClient, workspaceClient } from '@stack-spot/portal-network'
2
2
  import { ChatProperties } from '../../state/ChatState'
3
3
  import { LabeledWithImage } from '../../state/types'
4
4
 
@@ -44,20 +44,8 @@ export async function findWorkspace(id: string | null): Promise<ChatProperties['
44
44
  */
45
45
  export async function getAllAgents(): Promise<LabeledWithImage[]> {
46
46
  try {
47
- const [agentsAccount, agentsPersonal, agentsShared, publicAgents, workspaceAgents] = await Promise.all([
48
- agentClient.agents.query({ visibility: 'ACCOUNT' }),
49
- agentClient.agents.query({ visibility: 'PERSONAL' }),
50
- agentClient.agents.query({ visibility: 'SHARED' }),
51
- agentClient.publicAgents.query({}),
52
-
53
- workspaceAiClient.workspacesContentsByType.query({ contentType: 'agent' }),
54
- ])
55
-
56
- const workspaceAgentsAsArray = workspaceAgents.flatMap(({ agents }) => agents)
57
- const builtInAgents = publicAgents.map((a) => ({ id: a.id, label: a.name, image: a.avatar, slug: a.slug, builtIn: true }))
58
- return [...agentsAccount, ...agentsPersonal, ...agentsShared, ...workspaceAgentsAsArray]
59
- .map(a => ({ id: a?.id, label: a?.name, image: a?.avatar, slug: a?.slug, builtIn: false }))
60
- .concat(builtInAgents)
47
+ const agents = await agentClient.allAgents.query({ visibilities: ['ALL'] })
48
+ return agents.map(a => ({ id: a.id, label: a.name, image: a.avatar, slug: a.slug, builtIn: a.builtIn }))
61
49
  } catch (error) {
62
50
  // eslint-disable-next-line no-console
63
51
  console.error(error)
@@ -1,15 +1,13 @@
1
1
  import { Flex, IconBox, Image } from '@citric/core'
2
2
  import { Agent } from '@citric/icons'
3
- import { agentClient, workspaceAiClient } from '@stack-spot/portal-network'
4
- import { AgentResponse } from '@stack-spot/portal-network/api/agent'
5
- import { uniqBy } from 'lodash'
3
+ import { agentClient, AgentResponseWithBuiltIn } from '@stack-spot/portal-network'
6
4
  import { useCallback } from 'react'
7
5
  import { Selector } from '../../components/Selector'
8
6
  import { useCurrentChat, useCurrentChatState } from '../../context/hooks'
9
7
  import { agentRegex } from '../../regex'
10
8
  import { useAgentFavorites } from '../Agents/useAgentFavorites'
11
9
 
12
- type AgentWithSpaceName = AgentResponse & { spaceName?: string }
10
+ type AgentWithSpaceName = AgentResponseWithBuiltIn
13
11
 
14
12
  const AgentItem = ({ avatar, name, spaceName }: AgentWithSpaceName) => {
15
13
  const avatarComponent = avatar ? <Image width="32" height="32" radius="full" src={avatar} /> : <IconBox size="md"><Agent /></IconBox>
@@ -23,25 +21,27 @@ const AgentItem = ({ avatar, name, spaceName }: AgentWithSpaceName) => {
23
21
  </Flex>
24
22
  }
25
23
 
26
- export const AgentSelector = ({ inputRef, isTrial }: { isTrial: boolean,
24
+ export const AgentSelector = ({ inputRef, isTrial }: {
25
+ isTrial: boolean,
27
26
  inputRef: React.RefObject<HTMLTextAreaElement | HTMLInputElement>,
28
27
  }) => {
29
28
  const chat = useCurrentChat()
30
29
  const isAgentEnabled = useCurrentChatState('features').agent
31
30
 
32
31
  const { useFavorites, onAddFavorite, onRemoveFavorite } = useAgentFavorites()
33
-
34
- const onSelectItem = useCallback(async (agent: AgentResponse) => {
35
- const publicAgents = await agentClient.publicAgents.query({})
36
- const builtInsAgents = [...publicAgents.map((agent) => ({ ...agent, visibility_level: 'builtIn' }))]
32
+
33
+ const onSelectItem = useCallback(async (agent: AgentResponseWithBuiltIn) => {
37
34
  const newValue = `@${agent.slug}`
38
35
  chat.set('nextMessage', undefined)
39
- const isBuiltIn = agent.visibility_level === 'builtIn' || builtInsAgents.some((builtInAgent) => builtInAgent.id === agent.id)
40
36
  chat.set(
41
37
  'agent',
42
38
  {
43
- id: agent.id, label: agent.name, image: agent.avatar, slug: agent.slug,
44
- builtIn: isBuiltIn, visibility_level: agent.visibility_level,
39
+ id: agent.id,
40
+ label: agent.name,
41
+ image: agent.avatar,
42
+ slug: agent.slug,
43
+ builtIn: agent.builtIn,
44
+ visibility_level: agent.visibility_level,
45
45
  },
46
46
  )
47
47
 
@@ -50,22 +50,12 @@ export const AgentSelector = ({ inputRef, isTrial }: { isTrial: boolean,
50
50
  inputRef.current.focus()
51
51
  }, [chat, inputRef])
52
52
 
53
- const getAgents = () => {
54
- const personalAgents = agentClient.agents.useQuery({ visibility: 'PERSONAL' })
55
- const publicAgents = agentClient.publicAgents.useQuery({})
56
- const builtInsAgents = [...publicAgents.map((agent) => ({ ...agent, visibility_level: 'builtIn' }))]
57
- const workspaceAgents = workspaceAiClient.workspacesContentsByType.useQuery({ contentType: 'agent' })
58
53
 
59
- const workspaceAgentsWithWorkspaceName = workspaceAgents.flatMap(({ agents, space_name }) =>
60
- agents?.map((agent) => ({ ...agent, spaceName: space_name }))) as AgentWithSpaceName[]
61
- let accountAgents: AgentResponse[] = []
62
- let sharedAgents: AgentResponse[] = []
63
- if (!isTrial) {
64
- accountAgents = agentClient.agents.useQuery({ visibility: 'ACCOUNT' }) || []
65
- sharedAgents = agentClient.agents.useQuery({ visibility: 'SHARED' }) || []
54
+ const getAgents = () => {
55
+ if (isTrial) {
56
+ return agentClient.allAgents.useQuery({ visibilities: ['PERSONAL', 'BUILT-IN'] })
66
57
  }
67
-
68
- return uniqBy([...personalAgents, ...workspaceAgentsWithWorkspaceName, ...accountAgents, ...sharedAgents, ...builtInsAgents], 'id')
58
+ return agentClient.allAgents.useQuery({ visibilities: ['ACCOUNT', 'SHARED', 'PERSONAL', 'BUILT-IN', 'WORKSPACE'] })
69
59
  }
70
60
 
71
61
  return <Selector
@@ -78,7 +68,7 @@ export const AgentSelector = ({ inputRef, isTrial }: { isTrial: boolean,
78
68
  regex: agentRegex,
79
69
  urlBuilder: (agent) => `/agents/${agent?.id}`,
80
70
  searchProp: 'name',
81
- sections: isTrial ? ['favorite', 'personal', 'builtIn'] : ['favorite', 'personal', 'workspace', 'account', 'shared', 'builtIn'],
71
+ sections: isTrial ? ['favorite', 'personal', 'built-in'] : ['favorite', 'personal', 'workspace', 'account', 'shared', 'built-in'],
82
72
  renderComponentItem: AgentItem,
83
73
  isEnabled: isAgentEnabled,
84
74
  onSelect: onSelectItem,
@@ -5,13 +5,11 @@ import { MiniLogo } from '@stack-spot/portal-components/svg'
5
5
  import { agentClient } from '@stack-spot/portal-network'
6
6
  import { useEffect } from 'react'
7
7
  import { useCurrentChat, useCurrentChatState, useWidget } from '../../context/hooks'
8
- import { isAgentDefault } from '../../utils/agent'
9
8
  import { useMessageInputDictionary } from './dictionary'
10
9
 
11
10
  export const ButtonAgent = () => {
12
11
  const t = useMessageInputDictionary()
13
- const [agentsBuiltIn] = agentClient.publicAgents.useStatefulQuery({})
14
- const agentDefault = agentsBuiltIn?.find((agent) => isAgentDefault(agent.slug))
12
+ const agentDefault = agentClient.agentDefault.useQuery({})
15
13
  const widget = useWidget()
16
14
  const chat = useCurrentChat()
17
15
  const agent = useCurrentChatState('agent')
@@ -37,6 +35,8 @@ export const ButtonAgent = () => {
37
35
  }
38
36
  }, [agentDefault, agent])
39
37
 
38
+ const isAgentDefault = () => agent?.id === agentDefault?.id
39
+
40
40
  return (
41
41
  <div className="button-group">
42
42
  {features.agent && (
@@ -44,7 +44,7 @@ export const ButtonAgent = () => {
44
44
  <IconButton aria-label={t.agent} title={t.agent} className="agent" onClick={() => widget.set('panel', 'agent')}>
45
45
  {agentDefault?.avatar ? <img src={agentDefault.avatar} className="image" /> : <MiniLogo />}
46
46
  </IconButton>
47
- {agent?.id && !isAgentDefault(agent?.slug) &&
47
+ {agent?.id && !isAgentDefault() &&
48
48
  <Tooltip text={t.remove} >
49
49
  <IconButton aria-label={t.remove} className="agent agent-selected" onClick={setAgentDefault}>
50
50
  {agent?.image ? <img src={agent.image} className="image" /> : <IconBox className="image" size="xs"><Agent /></IconBox>}
@@ -1,3 +1,4 @@
1
+ import { Text } from '@citric/core'
1
2
  import { Times, TimesMini } from '@citric/icons'
2
3
  import { Badge, IconButton } from '@citric/ui'
3
4
  import { loader } from '@monaco-editor/react'
@@ -15,9 +16,14 @@ interface InfoBadgeProps {
15
16
  }
16
17
 
17
18
  const InfoBadge = ({ label, color, dismiss, onDismiss }: InfoBadgeProps) => (
18
- <Badge appearance="square" palette={color} className="info-badge">
19
- {label}
20
- {onDismiss && <IconButton onClick={onDismiss} title={dismiss} arial-label={dismiss}><TimesMini /></IconButton>}
19
+ <Badge appearance="square" palette={color} className="info-badge"
20
+ afterElement={
21
+ onDismiss &&
22
+ <IconButton appearance="square" colorIcon={`${color}.800`} onClick={onDismiss} title={dismiss} arial-label={dismiss}>
23
+ <TimesMini />
24
+ </IconButton>
25
+ }>
26
+ <Text nowrapEllipsis>{label}</Text>
21
27
  </Badge>
22
28
  )
23
29