@stack-spot/ai-chat-widget 2.0.0-betacitric.9 → 2.0.1-beta.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 (67) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/dist/app-metadata.json +7 -7
  3. package/dist/chat-interceptors/send-message.d.ts.map +1 -1
  4. package/dist/chat-interceptors/send-message.js +99 -1
  5. package/dist/chat-interceptors/send-message.js.map +1 -1
  6. package/dist/state/ChatEntry.d.ts +1 -1
  7. package/dist/state/ChatEntry.d.ts.map +1 -1
  8. package/dist/state/ChatEntry.js +2 -1
  9. package/dist/state/ChatEntry.js.map +1 -1
  10. package/dist/state/ChatState.d.ts +4 -0
  11. package/dist/state/ChatState.d.ts.map +1 -1
  12. package/dist/state/ChatState.js.map +1 -1
  13. package/dist/utils/date.d.ts +1 -2
  14. package/dist/utils/date.d.ts.map +1 -1
  15. package/dist/utils/date.js +3 -3
  16. package/dist/utils/date.js.map +1 -1
  17. package/dist/utils/error.js +2 -2
  18. package/dist/utils/error.js.map +1 -1
  19. package/dist/utils/planning-tool.d.ts +14 -0
  20. package/dist/utils/planning-tool.d.ts.map +1 -0
  21. package/dist/utils/planning-tool.js +25 -0
  22. package/dist/utils/planning-tool.js.map +1 -0
  23. package/dist/utils/update-tool-step.d.ts +3 -0
  24. package/dist/utils/update-tool-step.d.ts.map +1 -0
  25. package/dist/utils/update-tool-step.js +23 -0
  26. package/dist/utils/update-tool-step.js.map +1 -0
  27. package/dist/views/Chat/ChatMessage.d.ts +1 -1
  28. package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
  29. package/dist/views/Chat/ChatMessage.js +4 -3
  30. package/dist/views/Chat/ChatMessage.js.map +1 -1
  31. package/dist/views/Chat/StepsList.d.ts +6 -1
  32. package/dist/views/Chat/StepsList.d.ts.map +1 -1
  33. package/dist/views/Chat/StepsList.js +117 -13
  34. package/dist/views/Chat/StepsList.js.map +1 -1
  35. package/dist/views/Chat/styled.d.ts.map +1 -1
  36. package/dist/views/Chat/styled.js +13 -6
  37. package/dist/views/Chat/styled.js.map +1 -1
  38. package/dist/views/MessageInput/dictionary.d.ts +1 -1
  39. package/dist/views/Steps/FlowChart/NodeStep.js +1 -1
  40. package/dist/views/Steps/FlowChart/NodeStep.js.map +1 -1
  41. package/dist/views/Steps/FlowChart/layout.d.ts +1 -1
  42. package/dist/views/Steps/FlowChart/layout.d.ts.map +1 -1
  43. package/dist/views/Steps/FlowChart/layout.js +1 -0
  44. package/dist/views/Steps/FlowChart/layout.js.map +1 -1
  45. package/dist/views/Steps/FlowChart/types.d.ts +1 -1
  46. package/dist/views/Steps/FlowChart/types.d.ts.map +1 -1
  47. package/dist/views/Steps/StepModal.js +2 -2
  48. package/dist/views/Steps/StepModal.js.map +1 -1
  49. package/dist/views/Steps/dictionary.d.ts +1 -1
  50. package/dist/views/Steps/utils.d.ts +1 -1
  51. package/dist/views/Steps/utils.d.ts.map +1 -1
  52. package/package.json +12 -12
  53. package/src/app-metadata.json +7 -7
  54. package/src/chat-interceptors/send-message.ts +113 -2
  55. package/src/state/ChatEntry.ts +2 -1
  56. package/src/state/ChatState.ts +4 -0
  57. package/src/utils/date.ts +3 -3
  58. package/src/utils/error.ts +2 -2
  59. package/src/utils/planning-tool.ts +32 -0
  60. package/src/utils/update-tool-step.tsx +27 -0
  61. package/src/views/Chat/ChatMessage.tsx +8 -4
  62. package/src/views/Chat/StepsList.tsx +279 -31
  63. package/src/views/Chat/styled.ts +13 -6
  64. package/src/views/Steps/FlowChart/NodeStep.tsx +1 -1
  65. package/src/views/Steps/FlowChart/layout.ts +1 -0
  66. package/src/views/Steps/FlowChart/types.ts +1 -1
  67. package/src/views/Steps/StepModal.tsx +2 -2
@@ -5,6 +5,7 @@ const nodesSizes = {
5
5
  step: stepNodeSize,
6
6
  planning: planningNodeSize,
7
7
  answer: answerNodeSize,
8
+ tool: stepNodeSize,
8
9
  };
9
10
  export function useLayoutedElements(nodes, edges) {
10
11
  const dagreGraph = useMemo(() => new dagre.graphlib.Graph().setDefaultEdgeLabel(() => ({})), []);
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../src/views/Steps/FlowChart/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAGzE,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,gBAAgB;IAC1B,MAAM,EAAE,cAAc;CACvB,CAAA;AAED,MAAM,UAAU,mBAAmB,CAAC,KAA0B,EAAE,KAAa;IAC3E,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,mBAAmB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAChG,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;QAEtC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC/C,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;QAChD,CAAC,CAAC,CAAA;QAEF,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrB,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9C,CAAC,CAAC,CAAA;QAEF,KAAK,C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AAG,CAAC;iBACnC;aACF,CAAA;YAED,OAAO,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;QAEF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;IACnC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;AACpB,CAAC"}
@@ -7,7 +7,7 @@ export interface NodeData {
7
7
  }
8
8
  export interface NodeWithoutLayout {
9
9
  id: string;
10
- type: 'step' | 'planning' | 'answer';
10
+ type: 'step' | 'planning' | 'answer' | 'tool';
11
11
  data?: NodeData;
12
12
  }
13
13
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/views/Steps/FlowChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;IACrC,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/views/Steps/FlowChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB"}
@@ -115,8 +115,8 @@ export const StepModal = ({ message, stepId, onClose }) => {
115
115
  const [attempt, setAttempt] = useState(0);
116
116
  const stepIndex = useMemo(() => entry.steps?.findIndex(s => s.id === stepId) ?? -1, [entry, stepId]);
117
117
  const step = entry.steps?.[stepIndex];
118
- 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", color: "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", color: "light.700", children: [t.response, ":"] }), _jsx(Code, { language: "json", className: "tool-input", showLineNumbers: false, showActionBar: true, children: tool.output })] })] }, tool.id))) : undefined;
118
+ 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", color: "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", color: "light.700", children: [t.response, ":"] }), _jsx(Code, { language: "json", className: "tool-input", showLineNumbers: false, showActionBar: true, children: tool.output })] })] }, tool.id))) : undefined;
119
119
  const title = (_jsxs(Row, { flex: 1, justifyContent: "space-between", 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, { icon: "ChevronLeft", size: "xs", title: t.previousAttempt, "aria-label": t.previousAttempt, onClick: () => setAttempt(attempt - 1) })), _jsxs(Text, { appearance: "microtext1", children: [attempt + 1, "/", step.attempts.length] }), attempt < step.attempts.length - 1 && (_jsx(IconButton, { icon: "ChevronRight", size: "xs", title: t.nextAttempt, "aria-label": t.nextAttempt, onClick: () => setAttempt(attempt + 1) }))] })] })] }));
120
- 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", colorPalette: "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(Row, { 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 }) }, tool.id))) })] }, index))) })] }), step?.type === 'step' && step?.input && _jsxs(StyledSection, { children: [_jsx(Badge, { appearance: "square", colorPalette: "blue", children: "Prompt" }), _jsx(Text, { children: step.input })] }), !!tools?.length && _jsx(StyledSection, { children: tools })] }));
120
+ 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", colorPalette: "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(Row, { 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 }) }, tool.id))) })] }, index))) })] }), step?.type === 'step' && step?.input && _jsxs(StyledSection, { children: [_jsx(Badge, { appearance: "square", colorPalette: "blue", children: "Prompt" }), _jsx(Text, { children: step.input })] }), !!tools?.length && _jsx(StyledSection, { children: tools })] }));
121
121
  };
122
122
  //# sourceMappingURL=StepModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepModal.js","sourceRoot":"","sources":["../../../src/views/Steps/StepModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACvE,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,wBAAw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ACE,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI,IADhD,IAAI,CAAC,EAAE,CAEX,CACN,CAAC,GACC,KAVE,KAAK,CAWT,CACN,CAAC,GACC,IACS,EAEf,IAAI,EAAE,IAAI,KAAK,MAAM,IAAI,IAAI,EAAE,KAAK,IAAI,MAAC,aAAa,eACrD,KAAC,KAAK,IAAC,UAAU,EAAC,QAAQ,EAAC,YAAY,EAAC,MAAM,uBAAe,EAC7D,KAAC,IAAI,cAAE,IAAI,CAAC,KAAK,GAAQ,IACX,EACf,CAAC,CAAC,KAAK,EAAE,MAAM,IAAI,KAAC,aAAa,cAAE,KAAK,GAAiB,IACpD,CACT,CAAA;AACH,CAAC,CAAA"}
@@ -34,6 +34,6 @@ export declare const dictionary: {
34
34
  input: string;
35
35
  };
36
36
  };
37
- export declare function useStepsDictionary(): Record<"pending" | "input" | "step" | "steps" | "tools" | "answer" | "running" | "unknown" | "planning" | "stepsPanelDescription" | "response" | "executionTime" | "nextAttempt" | "previousAttempt", string>;
37
+ export declare function useStepsDictionary(): Record<"pending" | "input" | "step" | "steps" | "tools" | "answer" | "planning" | "running" | "unknown" | "stepsPanelDescription" | "response" | "executionTime" | "nextAttempt" | "previousAttempt", string>;
38
38
  export type ToolsDictionary = typeof dictionary['en'];
39
39
  //# sourceMappingURL=dictionary.d.ts.map
@@ -2,6 +2,6 @@ import { WithIcon } from '@stack-spot/citric-icons';
2
2
  import { ChatStep } from '@stack-spot/portal-network';
3
3
  export declare function getStatusIcon(status: ChatStep['status']): import("react/jsx-runtime").JSX.Element | null;
4
4
  export declare function getTypeIcon(type: ChatStep['type']): WithIcon;
5
- export declare function getTitle(translation: Record<'planning' | 'step' | 'answer', string>, step: ChatStep | undefined, index: number): string;
5
+ export declare function getTitle(translation: Record<'planning' | 'step' | 'answer', string>, step: ChatStep | undefined, index: number): string | undefined;
6
6
  export declare function toPrecision(n: number, precisionDigits?: number): number;
7
7
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/views/Steps/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAGrD,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,kDAOvD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,QAAQ,CAK5D;AAED,wBAAgB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,GAAG,QAAQ,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,UAO9H;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,SAAI,UAGzD"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/views/Steps/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAGrD,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,kDAOvD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,QAAQ,CAK5D;AAED,wBAAgB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,GAAG,QAAQ,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,sBAO9H;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,SAAI,UAGzD"}
package/package.json CHANGED
@@ -1,19 +1,24 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "2.0.0-betacitric.9",
3
+ "version": "2.0.1-beta.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "scripts": {
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
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10
+ "generate:metadata": "pnpm app-metadata --lockfile ../../pnpm-lock.yaml --path packages/widget"
11
+ },
7
12
  "peerDependencies": {
8
- "@stack-spot/citric-react": "^0.35.0",
9
- "@stack-spot/citric-icons": "^0.2.2",
13
+ "@stack-spot/citric-react": "^0.36.0",
14
+ "@stack-spot/citric-icons": "^0.2.3",
10
15
  "@stack-spot/portal-theme": "^1.2.1",
11
16
  "@citric/core": "^6.4.0",
12
- "@stack-spot/portal-components": "^2.25.5",
17
+ "@stack-spot/portal-components": "^2.26.0",
13
18
  "@citric/icons": "^5.13.0",
14
- "@stack-spot/portal-network": "0.173.1",
19
+ "@stack-spot/portal-network": "0.184.0-beta.1",
15
20
  "@citric/ui": "^6.10.2",
16
- "@stack-spot/portal-translate": "^1.1.0",
21
+ "@stack-spot/portal-translate": "^2.1.0",
17
22
  "lodash": "^4.17.0",
18
23
  "react": "^18.2.0",
19
24
  "react-dom": "^18.2.0",
@@ -53,10 +58,5 @@
53
58
  "ulid": "^2.3.0",
54
59
  "@xyflow/react": "^12.3.2",
55
60
  "@dagrejs/dagre": "^1.1.4"
56
- },
57
- "scripts": {
58
- "build": "rimraf dist && pnpm generate:metadata && tsc && tsc-esm-fix --target='dist' && cpy src/layout.css dist --flat && cpy src/assets/**/*.png dist/assets",
59
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
60
- "generate:metadata": "pnpm app-metadata --lockfile ../../pnpm-lock.yaml --path packages/widget"
61
61
  }
62
- }
62
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stack-spot/ai-chat-widget",
3
- "version": "2.0.0-betacitric.9",
4
- "date": "Tue Sep 09 2025 10:13:25 GMT-0300 (Horário Padrão de Brasília)",
3
+ "version": "2.0.1-beta.1",
4
+ "date": "Mon Oct 06 2025 16:16:08 GMT-0300 (Horário Padrão de Brasília)",
5
5
  "dependencies": [
6
6
  {
7
7
  "name": "@stack-spot/app-metadata",
@@ -109,19 +109,19 @@
109
109
  },
110
110
  {
111
111
  "name": "@stack-spot/citric-icons",
112
- "version": "0.2.2"
112
+ "version": "0.2.3"
113
113
  },
114
114
  {
115
115
  "name": "@stack-spot/citric-react",
116
- "version": "0.35.0(@stack-spot/citric-icons@0.2.2)(@stack-spot/portal-theme@1.2.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)))(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))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
116
+ "version": "0.36.0(@stack-spot/citric-icons@0.2.3)(@stack-spot/portal-theme@1.2.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)))(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@2.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
117
117
  },
118
118
  {
119
119
  "name": "@stack-spot/portal-components",
120
- "version": "2.25.5(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.13.0(react@18.2.0))(@citric/ui@6.10.2(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.13.0(react@18.2.0))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@stack-spot/portal-theme@1.2.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)))(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)"
120
+ "version": "2.26.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.13.0(react@18.2.0))(@citric/ui@6.10.2(@citric/core@6.4.0(lodash@4.17.21)(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@citric/icons@5.13.0(react@18.2.0))(lodash@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(styled-components@6.1.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0)))(@stack-spot/portal-theme@1.2.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)))(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@2.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)"
121
121
  },
122
122
  {
123
123
  "name": "@stack-spot/portal-network",
124
- "version": "0.173.1(@stack-spot/auth@5.3.2)(@stack-spot/opa@2.5.0(@stack-spot/auth@5.3.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@stack-spot/portal-translate@1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@tanstack/react-query@5.59.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
124
+ "version": "0.184.0-beta.1(@stack-spot/auth@6.1.0)(@stack-spot/opa@2.5.0(@stack-spot/auth@6.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@stack-spot/portal-translate@2.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)"
125
125
  },
126
126
  {
127
127
  "name": "@stack-spot/portal-theme",
@@ -129,7 +129,7 @@
129
129
  },
130
130
  {
131
131
  "name": "@stack-spot/portal-translate",
132
- "version": "1.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
132
+ "version": "2.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
133
133
  },
134
134
  {
135
135
  "name": "@xyflow/react",
@@ -1,4 +1,4 @@
1
- import { aiClient, ChatResponseWithSteps, StackspotAPIError, StreamCanceledError } from '@stack-spot/portal-network'
1
+ import { AgentInfo, aiClient, ChatResponseWithSteps, StackspotAPIError, StreamCanceledError } from '@stack-spot/portal-network'
2
2
  import { ChatResponse3 } from '@stack-spot/portal-network/api/ai'
3
3
  import { ChatEntry, KnowledgeSource, TextChatEntry } from '../state/ChatEntry'
4
4
  import { ChatState } from '../state/ChatState'
@@ -6,6 +6,7 @@ import { LabeledWithImage } from '../state/types'
6
6
  import { buildConversationContext } from '../utils/chat'
7
7
  import { treatHTMLInErrorMessage } from '../utils/error'
8
8
  import { genericSourcesToKnowledgeSources } from '../utils/knowledge-source'
9
+ import { planningToolDictionaryHelper } from '../utils/planning-tool'
9
10
 
10
11
  /**
11
12
  * Transforms a chat response from the backend into a chat entry that can be added to the chat.
@@ -22,7 +23,7 @@ function createEntryValueFromChatResponse(
22
23
  agent: LabeledWithImage | undefined,
23
24
  includeDate = false,
24
25
  ): TextChatEntry {
25
- return {
26
+ const entry= {
26
27
  agentType: 'bot',
27
28
  type: 'md',
28
29
  content: response.answer ?? '',
@@ -33,6 +34,7 @@ function createEntryValueFromChatResponse(
33
34
  steps: response.steps,
34
35
  tools: response.tools,
35
36
  }
37
+ return entry as TextChatEntry
36
38
  }
37
39
 
38
40
  function buildPrompt(content: string, data?: any) {
@@ -61,6 +63,18 @@ export async function sendMessageInterceptor(entry: ChatEntry, chat: ChatState,
61
63
  chat.set('label', content || entry.getValue().upload?.[0]?.name || 'Chat')
62
64
  chat.untitled = false
63
65
  }
66
+
67
+ //Verify if the last planning in the messages has status awaiting_approval
68
+ const messages = chat.getMessages()
69
+ const lastPlanningAwaiting = messages.slice().reverse().find(item => {
70
+ const steps = item.getValue().steps
71
+ if (steps) {
72
+ const hasPlanning = steps.find((step) => step.type === 'planning')
73
+ return hasPlanning ? hasPlanning.status === 'awaiting_approval' : false
74
+ }
75
+ return false
76
+ })
77
+
64
78
  const stream = aiClient.sendChatMessage({ context, user_prompt: buildPrompt(content, data) })
65
79
  signal.addEventListener('abort', () => stream.cancel())
66
80
  const botEntry = ChatEntry.createStreamedBotEntry()
@@ -69,12 +83,109 @@ export async function sendMessageInterceptor(entry: ChatEntry, chat: ChatState,
69
83
  chat.pushMessage(botEntry)
70
84
  }
71
85
  let knowledgeSources: KnowledgeSource[] | undefined
86
+
87
+ const updatePlanningMessage = () => {
88
+ if (lastPlanningAwaiting) {
89
+ const originalItem = messages.find((message) => message.id === lastPlanningAwaiting.id)
90
+ const originalItemValue = originalItem?.getValue()
91
+ originalItemValue?.steps?.map((step) => {
92
+ if (step.type === 'planning' && step.status === 'awaiting_approval') {
93
+ step.status = 'success'
94
+ }
95
+ })
96
+ originalItem?.setValue({ ...originalItemValue as TextChatEntry })
97
+ }
98
+ }
99
+
100
+ const updateToolStatus = (agentInfo: AgentInfo) => {
101
+ const executionId = agentInfo.id
102
+ if (executionId) {
103
+ //Update message with type step which contains the planning steps
104
+ const messageId = planningToolDictionaryHelper.getMessageIdPlanningStepFromToolExecutionId(executionId)
105
+ const originalItem = messages.find((message) => `${message.id}` === messageId)
106
+ const originalItemValue = originalItem?.getValue()
107
+ let update = false
108
+ const status = agentInfo.action === 'start' ? 'running' : 'success'
109
+ const step = originalItemValue?.steps?.find(step => step.type === 'step' && step.attempts?.[0].tools?.[0].executionId === executionId)
110
+ if (step && step.status !== status) {
111
+ step.status = status
112
+ update = true
113
+ }
114
+ if (update) {
115
+ originalItem?.setValue({ ...originalItemValue as TextChatEntry })
116
+ }
117
+
118
+ //Updates message with type tool which contains the actually tool steps
119
+ //We only want to show tools banner when they are awaiting_approval, by removing the step
120
+ // we avoid the entire bot message to be visible
121
+ const toolMessageId = planningToolDictionaryHelper.getMessageIdToolStepFromToolExecutionId(executionId)
122
+ const toolOriginalItem = messages.find((message) => `${message.id}` === toolMessageId)
123
+ const toolOriginalItemValue = toolOriginalItem?.getValue()
124
+ const toolStep = toolOriginalItemValue?.steps?.find(step =>
125
+ step.type === 'tool' && step.attempts?.[0].tools?.[0].executionId === executionId)
126
+ update = false
127
+ if (toolOriginalItemValue && toolStep && toolStep.status !== status) {
128
+ toolOriginalItemValue.steps = undefined
129
+ update = true
130
+ }
131
+ if (update) {
132
+ toolOriginalItem?.setValue({ ...toolOriginalItemValue as TextChatEntry })
133
+ }
134
+ }
135
+ }
136
+
72
137
  stream.onChange(value => {
138
+ if (value.agent_info?.type === 'planning') {
139
+ if (value.agent_info.action === 'start') {
140
+ chat.set('isPlaning', true)
141
+ } else {
142
+ chat.set('isPlaning', false)
143
+ }
144
+ }
145
+
73
146
  if (value.sources?.length !== knowledgeSources?.length && chat.get('features').showSourcesInResponse) {
74
147
  knowledgeSources = genericSourcesToKnowledgeSources(value.sources)
75
148
  }
149
+
150
+ // When there is a planning with status awaiting_approval and we receive a new one
151
+ // we do not not want to add it again.
152
+ if (lastPlanningAwaiting && value.steps) {
153
+ const hasPlanningAwaiting = value.steps.find((item) => item.type === 'planning' && item.status === 'awaiting_approval')
154
+ value.steps = value.steps?.filter(step => {
155
+ if (step.type === 'planning') {
156
+ updatePlanningMessage()
157
+ }
158
+
159
+ return hasPlanningAwaiting ? true : (step.type !== 'planning' && step.type !== 'step' &&
160
+ (step.type !== 'answer' || (step.type === 'answer' && step.status === 'pending')))
161
+ })
162
+ }
163
+
164
+ if (value.agent_info?.type === 'tool' && value.agent_info?.action !== 'awaiting_approval') {
165
+ updateToolStatus(value.agent_info)
166
+ }
167
+
168
+ if (value.steps) {
169
+ const tool = value.steps.find((item) => item.type === 'tool')
170
+ if (tool && tool.status === 'running') {
171
+ const messageId = planningToolDictionaryHelper.getMessageIdPlanningStepFromToolExecutionId(tool.id)
172
+ const originalItem = messages.find((message) => `${message.id}` === messageId)
173
+ const originalItemValue = originalItem?.getValue()
174
+ let update = false
175
+ const step = originalItemValue?.steps?.find(step => step.type === 'step')
176
+ if (step && step.attempts?.[0].tools?.[0].executionId === tool.id) {
177
+ step.attempts = JSON.parse(JSON.stringify(tool.attempts))
178
+ update = true
179
+ }
180
+ if (update) {
181
+ originalItem?.setValue({ ...originalItemValue as TextChatEntry })
182
+ }
183
+ }
184
+ }
185
+
76
186
  botEntry.setValue(createEntryValueFromChatResponse(value, knowledgeSources, chat.get('agent')))
77
187
  })
188
+
78
189
  let finalValue: Partial<ChatResponse3> | undefined
79
190
  try {
80
191
  finalValue = await stream.getValue()
@@ -205,13 +205,14 @@ export class ChatEntry {
205
205
  * @param hiddenContent the message's content.
206
206
  * @returns a new ChatEntry.
207
207
  */
208
- static createUserEntry(content: string, isMd = false, fieldName?: string, hiddenContent?: string[]) {
208
+ static createUserEntry(content: string, isMd = false, fieldName?: string, hiddenContent?: string[], data?: any) {
209
209
  return new ChatEntry({
210
210
  agentType: 'user',
211
211
  type: isMd ? 'md' : 'text',
212
212
  content,
213
213
  name: fieldName,
214
214
  hiddenContent,
215
+ data,
215
216
  updated: new Date().toISOString(),
216
217
  })
217
218
  }
@@ -33,6 +33,10 @@ export interface ChatPropertiesWithOptionalFeatures {
33
33
  * Whether or not the chat is in a loading state.
34
34
  */
35
35
  isLoading?: boolean,
36
+ /**
37
+ * Whether or not the chat is planning.
38
+ */
39
+ isPlaning?: boolean,
36
40
  /**
37
41
  * The value of the next message. This is the value of the text typed in the textarea below the chat.
38
42
  */
package/src/utils/date.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Dictionary, Language, getLanguage, useLanguage } from '@stack-spot/portal-translate'
1
+ import { Dictionary, getLanguage, ptEn, useLanguage } from '@stack-spot/portal-translate'
2
2
 
3
3
  const OneDay = 24 * 60 * 60 * 1000
4
4
  const timeFormatOptions: Intl.DateTimeFormatOptions = { hour: '2-digit', minute:'2-digit' }
@@ -19,7 +19,7 @@ const fullFormatOptions: Intl.DateTimeFormatOptions = {
19
19
  * @param language the language to use.
20
20
  * @returns the formatted date.
21
21
  */
22
- export function formatDateForChatMessage(date: Date, language: Language = getLanguage()) {
22
+ export function formatDateForChatMessage(date: Date, language = getLanguage(ptEn)) {
23
23
  const formatted: string[] = []
24
24
  const now = new Date()
25
25
  const isToday = date.toDateString() === now.toDateString()
@@ -36,7 +36,7 @@ export function formatDateForChatMessage(date: Date, language: Language = getLan
36
36
  * @returns an object containing functions for formatting dates.
37
37
  */
38
38
  export function useDateFormatter() {
39
- const language = useLanguage()
39
+ const language = useLanguage(ptEn)
40
40
  return {
41
41
  /**
42
42
  * @param date the date to format using {@link formatDateForChatMessage}.
@@ -1,4 +1,4 @@
1
- import { getLanguage } from '@stack-spot/portal-translate'
1
+ import { getLanguage, ptEn } from '@stack-spot/portal-translate'
2
2
 
3
3
  const httpErrors: Record<'en' | 'pt', Record<number, string>> = {
4
4
  en: {
@@ -48,7 +48,7 @@ const httpErrors: Record<'en' | 'pt', Record<number, string>> = {
48
48
  }
49
49
 
50
50
  function getGenericErrorBasedOnStatus(status: number) {
51
- return httpErrors[getLanguage()][status] ?? `Unknown error. Status code: ${status}.`
51
+ return httpErrors[getLanguage(ptEn)][status] ?? `Unknown error. Status code: ${status}.`
52
52
  }
53
53
 
54
54
  export function treatHTMLInErrorMessage(text: string, status: number) {
@@ -0,0 +1,32 @@
1
+ class PlanningToolDictionaryHelper {
2
+ static instance: PlanningToolDictionaryHelper | undefined
3
+ private toolExecutionIdPlanningStep: Record<string, string> = {}
4
+ private toolExecutionIdToolStep: Record<string, string> = {}
5
+
6
+ private constructor() {
7
+ PlanningToolDictionaryHelper.instance = this
8
+ }
9
+
10
+ static create() {
11
+ return PlanningToolDictionaryHelper.instance ?? new PlanningToolDictionaryHelper()
12
+ }
13
+
14
+ setMessageIdPlanningStepToolExecutionId(messageId: string, toolExecutionId: string){
15
+ this.toolExecutionIdPlanningStep[toolExecutionId] = messageId
16
+ }
17
+
18
+ setMessageIdToolStepToolExecutionId(messageId: string, toolExecutionId: string){
19
+ this.toolExecutionIdToolStep[toolExecutionId] = messageId
20
+ }
21
+
22
+ getMessageIdPlanningStepFromToolExecutionId(toolExecutionId: string){
23
+ return this.toolExecutionIdPlanningStep[toolExecutionId]
24
+ }
25
+
26
+ getMessageIdToolStepFromToolExecutionId(toolExecutionId: string){
27
+ return this.toolExecutionIdToolStep[toolExecutionId]
28
+ }
29
+ }
30
+
31
+ export const planningToolDictionaryHelper = PlanningToolDictionaryHelper.create()
32
+
@@ -0,0 +1,27 @@
1
+ import { ChatEntry, TextChatEntry } from '../state/ChatEntry'
2
+ import { planningToolDictionaryHelper } from './planning-tool'
3
+
4
+ export const updateToolStep = (messages: ChatEntry[], executionId: string,
5
+ newStatus: 'pending' | 'running' | 'success' | 'error' | 'awaiting_approval') => {
6
+
7
+ // if last message is a user message, no update in tool status is needed
8
+ if (messages[messages.length-1].getValue().agentType === 'user') return
9
+
10
+ const messageId = planningToolDictionaryHelper.getMessageIdPlanningStepFromToolExecutionId(executionId)
11
+ const message = messages.find((message) => `${message.id}` === messageId)
12
+ let update = false
13
+ const messageValue = message?.getValue()
14
+ messageValue?.steps?.map((step) => {
15
+ if (step.type === 'step') {
16
+ const tool = step.attempts?.[0].tools?.[0]
17
+ if (tool?.executionId === executionId && step.status !== newStatus) {
18
+ step.status = newStatus
19
+ update = true
20
+ }
21
+ }
22
+ })
23
+
24
+ if (update) {
25
+ message?.setValue({ ...messageValue as TextChatEntry })
26
+ }
27
+ }
@@ -9,7 +9,7 @@ import { PhoneInput } from 'react-international-phone'
9
9
  import 'react-international-phone/style.css'
10
10
  import { FileDescription } from '../../components/FileDescription'
11
11
  import { Markdown } from '../../components/Markdown'
12
- import { useChatEntry, useCurrentChat, useWidget } from '../../context/hooks'
12
+ import { useChatEntry, useCurrentChat, useCurrentChatState, useWidget } from '../../context/hooks'
13
13
  import { useMidnightUpdateView } from '../../hooks/midnight-update-view'
14
14
  import { ChatEntry, SerializableAction, TextChatEntry } from '../../state/ChatEntry'
15
15
  import { useDateFormatter } from '../../utils/date'
@@ -17,7 +17,7 @@ import { toolById } from '../../utils/tools'
17
17
  import { AgentInfo } from './AgentInfo'
18
18
  import { useChatScrollToBottomEffect } from './chat-scroll'
19
19
  import { onCopyAll, onCopyCode, onLikeOrDislike } from './events'
20
- import { StepsList } from './StepsList'
20
+ import { StepsList, StepsPlaceholder } from './StepsList'
21
21
 
22
22
  export interface CustomRenderResult {
23
23
  /**
@@ -218,6 +218,7 @@ export const ChatMessage = ({ message, isLast, beforeMessage, afterMessage, cust
218
218
  { searchAgentsRequest: { ids: entry.tools || [''] } }, { enabled: !!entry.tools })
219
219
  const [copied, setCopied] = useState(false)
220
220
  const [showUserButtonCopy, setShowUserButtonCopy] = useState(false)
221
+ const isPlanning = useCurrentChatState('isPlaning') ?? false
221
222
 
222
223
  useChatScrollToBottomEffect(ref, [entry])
223
224
  useMidnightUpdateView()
@@ -343,7 +344,7 @@ export const ChatMessage = ({ message, isLast, beforeMessage, afterMessage, cust
343
344
  widget.set('panel', 'resources')
344
345
  }
345
346
 
346
- return (entry.content || entry.error || !!entry.steps?.length || entry.upload?.length) && (
347
+ return (entry.content || entry.error || !!entry.steps?.length || entry.upload?.length || isPlanning) && (
347
348
  <li key={entry.messageId} className={entry.agentType} ref={ref}>
348
349
  <div className="chat-message-container"
349
350
  onMouseEnter={entry.agentType === 'user' ? () => setShowUserButtonCopy(true) : undefined}
@@ -356,11 +357,14 @@ export const ChatMessage = ({ message, isLast, beforeMessage, afterMessage, cust
356
357
  {!!entry.badges?.length && <div className="badges">
357
358
  {entry.badges.map((b, index) => <Badge key={index} colorPalette={b.color ?? 'cyan'} appearance="square">{b.label}</Badge>)}
358
359
  </div>}
360
+
361
+ {!!entry.steps?.length && <StepsList steps={entry.steps} chatId={chat.id} messageId={message.id} />}
362
+
359
363
  {renderContent()}
360
364
 
361
- {!!entry.steps?.length && <StepsList steps={entry.steps} chatId={chat.id} messageId={message.id} />}
362
365
  </div>
363
366
  )}
367
+ {isPlanning && entry.agentType === 'bot' && isLast && <StepsPlaceholder /> }
364
368
 
365
369
  {entry.error && <Alert type="error">{entry.error}</Alert>}
366
370
  </div>