@stack-spot/ai-chat-widget 2.0.0-betacitric.9 → 3.0.0-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.
- package/CHANGELOG.md +94 -0
- package/dist/app-metadata.json +7 -7
- package/dist/chat-interceptors/send-message.d.ts.map +1 -1
- package/dist/chat-interceptors/send-message.js +78 -0
- package/dist/chat-interceptors/send-message.js.map +1 -1
- package/dist/state/ChatState.d.ts +4 -0
- package/dist/state/ChatState.d.ts.map +1 -1
- package/dist/state/ChatState.js.map +1 -1
- package/dist/utils/date.d.ts +1 -2
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +3 -3
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/error.js +2 -2
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/planning-tool.d.ts +14 -0
- package/dist/utils/planning-tool.d.ts.map +1 -0
- package/dist/utils/planning-tool.js +25 -0
- package/dist/utils/planning-tool.js.map +1 -0
- package/dist/utils/update-tool-step.d.ts +3 -0
- package/dist/utils/update-tool-step.d.ts.map +1 -0
- package/dist/utils/update-tool-step.js +23 -0
- package/dist/utils/update-tool-step.js.map +1 -0
- package/dist/views/Chat/ChatMessage.d.ts +1 -1
- package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessage.js +4 -3
- package/dist/views/Chat/ChatMessage.js.map +1 -1
- package/dist/views/Chat/StepsList.d.ts +6 -1
- package/dist/views/Chat/StepsList.d.ts.map +1 -1
- package/dist/views/Chat/StepsList.js +118 -13
- package/dist/views/Chat/StepsList.js.map +1 -1
- package/dist/views/Chat/styled.d.ts.map +1 -1
- package/dist/views/Chat/styled.js +13 -6
- package/dist/views/Chat/styled.js.map +1 -1
- package/dist/views/MessageInput/dictionary.d.ts +1 -1
- package/dist/views/Steps/FlowChart/NodeStep.js +1 -1
- package/dist/views/Steps/FlowChart/NodeStep.js.map +1 -1
- package/dist/views/Steps/FlowChart/layout.d.ts +1 -1
- package/dist/views/Steps/FlowChart/layout.d.ts.map +1 -1
- package/dist/views/Steps/FlowChart/layout.js +1 -0
- package/dist/views/Steps/FlowChart/layout.js.map +1 -1
- package/dist/views/Steps/FlowChart/types.d.ts +1 -1
- package/dist/views/Steps/FlowChart/types.d.ts.map +1 -1
- package/dist/views/Steps/StepModal.js +2 -2
- package/dist/views/Steps/StepModal.js.map +1 -1
- package/dist/views/Steps/dictionary.d.ts +1 -1
- package/dist/views/Steps/utils.d.ts +1 -1
- package/dist/views/Steps/utils.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/app-metadata.json +7 -7
- package/src/chat-interceptors/send-message.ts +91 -1
- package/src/state/ChatState.ts +4 -0
- package/src/utils/date.ts +3 -3
- package/src/utils/error.ts +2 -2
- package/src/utils/planning-tool.ts +32 -0
- package/src/utils/update-tool-step.tsx +27 -0
- package/src/views/Chat/ChatMessage.tsx +8 -4
- package/src/views/Chat/StepsList.tsx +284 -31
- package/src/views/Chat/styled.ts +13 -6
- package/src/views/Steps/FlowChart/NodeStep.tsx +1 -1
- package/src/views/Steps/FlowChart/layout.ts +1 -0
- package/src/views/Steps/FlowChart/types.ts +1 -1
- package/src/views/Steps/StepModal.tsx +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,99 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.0.0-beta.1](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget-beta@v2.0.0-beta.1...ai-chat-widget-beta@v3.0.0-beta.1) (2025-10-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* updates Citric + ADP features ([#304](https://github.com/stack-spot/portal-ai-chat-widget/issues/304))
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* 2721 context upload file ([#248](https://github.com/stack-spot/portal-ai-chat-widget/issues/248)) ([f7b8d0b](https://github.com/stack-spot/portal-ai-chat-widget/commit/f7b8d0b99cdf93fa1386d9d2d52d72515404979f))
|
|
13
|
+
* 3049 execution modes chat ([#312](https://github.com/stack-spot/portal-ai-chat-widget/issues/312)) ([e5df99a](https://github.com/stack-spot/portal-ai-chat-widget/commit/e5df99a7a688603cd2d4f8786ad662dcaab4c3e2))
|
|
14
|
+
* accept csv ([#238](https://github.com/stack-spot/portal-ai-chat-widget/issues/238)) ([868f4ee](https://github.com/stack-spot/portal-ai-chat-widget/commit/868f4eed18df6038e8e7a2694221d055edf2eded))
|
|
15
|
+
* add copy button user prompts ([#143](https://github.com/stack-spot/portal-ai-chat-widget/issues/143)) ([4439093](https://github.com/stack-spot/portal-ai-chat-widget/commit/4439093f972c718ea3b7bddfb0925b4268d01828))
|
|
16
|
+
* add filters to show contents in chat ([#240](https://github.com/stack-spot/portal-ai-chat-widget/issues/240)) ([95dd865](https://github.com/stack-spot/portal-ai-chat-widget/commit/95dd8659e623e0eeb6afb6d3380e83e9c4bb2b86))
|
|
17
|
+
* add new download feature in code snippets ([#151](https://github.com/stack-spot/portal-ai-chat-widget/issues/151)) ([3e2fac8](https://github.com/stack-spot/portal-ai-chat-widget/commit/3e2fac85f7a5d4150cae921eb57abc6b8ac92e5e))
|
|
18
|
+
* add visibility filter for recently used agents ([#247](https://github.com/stack-spot/portal-ai-chat-widget/issues/247)) ([bc85769](https://github.com/stack-spot/portal-ai-chat-widget/commit/bc85769b7863f4bca2202852804e4b603fca9f7b))
|
|
19
|
+
* Adds drag-and-drop and paste upload functionality ([#192](https://github.com/stack-spot/portal-ai-chat-widget/issues/192)) ([a052b9e](https://github.com/stack-spot/portal-ai-chat-widget/commit/a052b9e8108b6a0971d96596f25c6be873664980))
|
|
20
|
+
* adds some new feature configs + small css fixes for file uploads ([#176](https://github.com/stack-spot/portal-ai-chat-widget/issues/176)) ([d033d65](https://github.com/stack-spot/portal-ai-chat-widget/commit/d033d65ff37003b5f7fb2e76377ea5f712af44e1))
|
|
21
|
+
* agent as tools ([#290](https://github.com/stack-spot/portal-ai-chat-widget/issues/290)) ([0a853a4](https://github.com/stack-spot/portal-ai-chat-widget/commit/0a853a492426353b5aacb2d3ca33a4b9a054c3ea))
|
|
22
|
+
* Change knowledge_source_config to knowledge_sources_config([#274](https://github.com/stack-spot/portal-ai-chat-widget/issues/274)) ([2ce8748](https://github.com/stack-spot/portal-ai-chat-widget/commit/2ce8748d3e16d33aa11c7436dd3e463fb68abb5b))
|
|
23
|
+
* custom tools ([#222](https://github.com/stack-spot/portal-ai-chat-widget/issues/222)) ([03cab5b](https://github.com/stack-spot/portal-ai-chat-widget/commit/03cab5bcbe9b51e04dcaecfdb1a0a35a6646dc2b))
|
|
24
|
+
* Feat agent as tools dropdwon upd ([#291](https://github.com/stack-spot/portal-ai-chat-widget/issues/291)) ([50770a4](https://github.com/stack-spot/portal-ai-chat-widget/commit/50770a4c39ba3c289a926fabc1969944a8ed5475))
|
|
25
|
+
* file upload ([#174](https://github.com/stack-spot/portal-ai-chat-widget/issues/174)) ([48e665a](https://github.com/stack-spot/portal-ai-chat-widget/commit/48e665a5cb503d6f90e6cbee3ac64bc78357dca3))
|
|
26
|
+
* freemium improves ([#187](https://github.com/stack-spot/portal-ai-chat-widget/issues/187)) ([060a1c5](https://github.com/stack-spot/portal-ai-chat-widget/commit/060a1c52272c86323458aa4c79ba3e53f09fb7f0))
|
|
27
|
+
* Get QC from v2 ([#182](https://github.com/stack-spot/portal-ai-chat-widget/issues/182)) ([0c2ce48](https://github.com/stack-spot/portal-ai-chat-widget/commit/0c2ce48b7faa480dfe431acbfe083d3b1eda5a3d))
|
|
28
|
+
* layout css on content of chat ([#161](https://github.com/stack-spot/portal-ai-chat-widget/issues/161)) ([b9c90c8](https://github.com/stack-spot/portal-ai-chat-widget/commit/b9c90c87fa750d93893ca511df66f562909de2ac))
|
|
29
|
+
* support qc conditional ([#228](https://github.com/stack-spot/portal-ai-chat-widget/issues/228)) ([6c5aa8c](https://github.com/stack-spot/portal-ai-chat-widget/commit/6c5aa8cc25f22d44bb8cb40fb3e9383d60f86ccf))
|
|
30
|
+
* tools and new api agent ([f1384f2](https://github.com/stack-spot/portal-ai-chat-widget/commit/f1384f255ab091733f3a93815735641c9e8e7f18))
|
|
31
|
+
* upd layout input ([#152](https://github.com/stack-spot/portal-ai-chat-widget/issues/152)) ([c1e9574](https://github.com/stack-spot/portal-ai-chat-widget/commit/c1e95743c6d8f6f2f6b62da09c81de3c71c7ec55))
|
|
32
|
+
* updates Citric + ADP features ([#304](https://github.com/stack-spot/portal-ai-chat-widget/issues/304)) ([30f068d](https://github.com/stack-spot/portal-ai-chat-widget/commit/30f068d25f6e677241bc4ce4e92cc85910b12fe9))
|
|
33
|
+
* upgrades translation lib + auth ([#310](https://github.com/stack-spot/portal-ai-chat-widget/issues/310)) ([8bae024](https://github.com/stack-spot/portal-ai-chat-widget/commit/8bae0249e1232fb2b3cecd739a790d7e39cfaa5a))
|
|
34
|
+
* visibility filter to retrieve recently used agents ([29b8646](https://github.com/stack-spot/portal-ai-chat-widget/commit/29b86468ce6dfd1757104199faa3efe8965e7904))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* 1745 to show custom tools on panel ([#278](https://github.com/stack-spot/portal-ai-chat-widget/issues/278)) ([fed5db7](https://github.com/stack-spot/portal-ai-chat-widget/commit/fed5db7dfc86fbdd0d8a60f958b302e552dfbbd3))
|
|
40
|
+
* 850 qc conditional next step beta release ([#252](https://github.com/stack-spot/portal-ai-chat-widget/issues/252)) ([68531b1](https://github.com/stack-spot/portal-ai-chat-widget/commit/68531b19ec8c0d0b4cde2ddc0f5f7c3ac43c31cc))
|
|
41
|
+
* 918 Copy button and Message MD validator ([#166](https://github.com/stack-spot/portal-ai-chat-widget/issues/166)) ([2120f4c](https://github.com/stack-spot/portal-ai-chat-widget/commit/2120f4c94a853568a0b22830972473047867af0b))
|
|
42
|
+
* accessibility file insert ([f0a0ea6](https://github.com/stack-spot/portal-ai-chat-widget/commit/f0a0ea68d37886f80f4183d315f8eace014a27e1))
|
|
43
|
+
* accessibility file insert ([6d4b4dc](https://github.com/stack-spot/portal-ai-chat-widget/commit/6d4b4dc1356de3d1cefba828c9bd56e5d9900bdc))
|
|
44
|
+
* accessibility file insert ([#259](https://github.com/stack-spot/portal-ai-chat-widget/issues/259)) ([b4be0c2](https://github.com/stack-spot/portal-ai-chat-widget/commit/b4be0c206a8dae042e9fc765e6c4e99981928a72))
|
|
45
|
+
* accessibility image insert beta ([#257](https://github.com/stack-spot/portal-ai-chat-widget/issues/257)) ([1dc25ce](https://github.com/stack-spot/portal-ai-chat-widget/commit/1dc25ce29110b743f84c88729651081bd0c8eb9e))
|
|
46
|
+
* acessibility upload file ([#286](https://github.com/stack-spot/portal-ai-chat-widget/issues/286)) ([91a8447](https://github.com/stack-spot/portal-ai-chat-widget/commit/91a8447867be3d7556675f1bdd8b18184fd6c47b))
|
|
47
|
+
* adaptive-text-area-max-height' into beta-release ([c973d7e](https://github.com/stack-spot/portal-ai-chat-widget/commit/c973d7ee1dc3f223e70e0a241aae50f228c0aabe))
|
|
48
|
+
* add csv in array languages and fix language undefined ([5f3a0ab](https://github.com/stack-spot/portal-ai-chat-widget/commit/5f3a0ab6d9a37cf1ce775937c76d5949a3bf05a6))
|
|
49
|
+
* add docx TIFF/TIF and BMP to upload ([#302](https://github.com/stack-spot/portal-ai-chat-widget/issues/302)) ([aefe654](https://github.com/stack-spot/portal-ai-chat-widget/commit/aefe6543230283367c752f9d53382abb11d54e7f))
|
|
50
|
+
* add id on button of add for content ([#154](https://github.com/stack-spot/portal-ai-chat-widget/issues/154)) ([e4b09d5](https://github.com/stack-spot/portal-ai-chat-widget/commit/e4b09d562986bb4640e7f3de2252457daf267bd3))
|
|
51
|
+
* Adds attributes to AdaptiveTextArea and updates SelectorBox prop naming ([#194](https://github.com/stack-spot/portal-ai-chat-widget/issues/194)) ([ac34d4b](https://github.com/stack-spot/portal-ai-chat-widget/commit/ac34d4b4c11dcdca74ca1f6111a443282901fe01))
|
|
52
|
+
* Adds prompt length validation to message input ([#215](https://github.com/stack-spot/portal-ai-chat-widget/issues/215)) ([cd752f1](https://github.com/stack-spot/portal-ai-chat-widget/commit/cd752f1d569072e0396322ae947a0ae413e01807))
|
|
53
|
+
* adjusts file size error ([#231](https://github.com/stack-spot/portal-ai-chat-widget/issues/231)) ([f977294](https://github.com/stack-spot/portal-ai-chat-widget/commit/f97729409d0330c128da5763959377f63fa6c7f6))
|
|
54
|
+
* adjusts file size error (beta - release) ([#232](https://github.com/stack-spot/portal-ai-chat-widget/issues/232)) ([0cda5b8](https://github.com/stack-spot/portal-ai-chat-widget/commit/0cda5b8df804eed6a3bb160106953befb9a7d9cd))
|
|
55
|
+
* agent as tools dropdown upd | beta-release ([#293](https://github.com/stack-spot/portal-ai-chat-widget/issues/293)) ([32428da](https://github.com/stack-spot/portal-ai-chat-widget/commit/32428da7c7384463ff796a776ecc4852da1a422a))
|
|
56
|
+
* agent chat history ([#242](https://github.com/stack-spot/portal-ai-chat-widget/issues/242)) ([c1ed38b](https://github.com/stack-spot/portal-ai-chat-widget/commit/c1ed38b64e064a53c0b0394b96ba5e3f6d11f3f2))
|
|
57
|
+
* agent create chat view adjusts ([#263](https://github.com/stack-spot/portal-ai-chat-widget/issues/263)) ([433a45a](https://github.com/stack-spot/portal-ai-chat-widget/commit/433a45a2e83e40194f6baf5a5b309212fe2d51bc))
|
|
58
|
+
* calc max height ([#199](https://github.com/stack-spot/portal-ai-chat-widget/issues/199)) ([82d8e02](https://github.com/stack-spot/portal-ai-chat-widget/commit/82d8e0259278063204628c7aeac365777c6a94e0))
|
|
59
|
+
* calc max height ([#200](https://github.com/stack-spot/portal-ai-chat-widget/issues/200)) ([01d69c0](https://github.com/stack-spot/portal-ai-chat-widget/commit/01d69c04848db47e55b368b1e27a27b4ad24e8a3))
|
|
60
|
+
* conflicts branch with beta-relise ([e100471](https://github.com/stack-spot/portal-ai-chat-widget/commit/e100471ec084f3ed585316068844e385b9062844))
|
|
61
|
+
* copy to clipboard fallback ([#170](https://github.com/stack-spot/portal-ai-chat-widget/issues/170)) ([19b3b10](https://github.com/stack-spot/portal-ai-chat-widget/commit/19b3b1028a00358313eb260c68e65230c8866c3c))
|
|
62
|
+
* execute qc on chat ([#148](https://github.com/stack-spot/portal-ai-chat-widget/issues/148)) ([02c0e62](https://github.com/stack-spot/portal-ai-chat-widget/commit/02c0e62d942d30dd04b1f9a2755f9dfe01e2990f))
|
|
63
|
+
* fix count executions ([#271](https://github.com/stack-spot/portal-ai-chat-widget/issues/271)) ([47931dd](https://github.com/stack-spot/portal-ai-chat-widget/commit/47931dd911fa1f81775755abc0e6ed6ec9849eb8))
|
|
64
|
+
* fix QC recursively ([#269](https://github.com/stack-spot/portal-ai-chat-widget/issues/269)) ([d4f8820](https://github.com/stack-spot/portal-ai-chat-widget/commit/d4f8820ffd479f1987748f69a459d446ce99a1a8))
|
|
65
|
+
* Fix text ([#189](https://github.com/stack-spot/portal-ai-chat-widget/issues/189)) ([f201b57](https://github.com/stack-spot/portal-ai-chat-widget/commit/f201b57f0a38f854af3b6afd3373a53a94bf987b))
|
|
66
|
+
* Fix typo ([#275](https://github.com/stack-spot/portal-ai-chat-widget/issues/275)) ([027df85](https://github.com/stack-spot/portal-ai-chat-widget/commit/027df857d68606b3fe53a9a4835feefab58b1ba6))
|
|
67
|
+
* Inconsistent dates at midnight turnover ([#289](https://github.com/stack-spot/portal-ai-chat-widget/issues/289)) ([1cfd845](https://github.com/stack-spot/portal-ai-chat-widget/commit/1cfd845f0517c9f740fbe7eae7d9c1aa32c6853b))
|
|
68
|
+
* layout for messages without space ([#157](https://github.com/stack-spot/portal-ai-chat-widget/issues/157)) ([071bf1b](https://github.com/stack-spot/portal-ai-chat-widget/commit/071bf1baf4e1a43b27c520537c0d629d24bfbed8))
|
|
69
|
+
* lets pdf files be upload ([#183](https://github.com/stack-spot/portal-ai-chat-widget/issues/183)) ([d422d88](https://github.com/stack-spot/portal-ai-chat-widget/commit/d422d887d6745f2b9c1564c00b70dc6e83010209))
|
|
70
|
+
* maximum height of the text-area ([#217](https://github.com/stack-spot/portal-ai-chat-widget/issues/217)) ([0f8ba52](https://github.com/stack-spot/portal-ai-chat-widget/commit/0f8ba52716488bb1b19f0bc035ecd0aa1da61e50))
|
|
71
|
+
* merge branch accessibility chat ([cfe99b4](https://github.com/stack-spot/portal-ai-chat-widget/commit/cfe99b40f23754bed2a294ded2d2edeea4e45615))
|
|
72
|
+
* message buttons low res ([#211](https://github.com/stack-spot/portal-ai-chat-widget/issues/211)) ([345134f](https://github.com/stack-spot/portal-ai-chat-widget/commit/345134f37e64f8cdd780d7290b38c6754c99e9bc))
|
|
73
|
+
* prevent useless double click in message menu ([#178](https://github.com/stack-spot/portal-ai-chat-widget/issues/178)) ([9ba7099](https://github.com/stack-spot/portal-ai-chat-widget/commit/9ba7099c8463ed07bbcaed975b499226503263d4))
|
|
74
|
+
* removes some upload types ([#180](https://github.com/stack-spot/portal-ai-chat-widget/issues/180)) ([7d31860](https://github.com/stack-spot/portal-ai-chat-widget/commit/7d318601ca7e40d855e2bd406dd7071886506cd9))
|
|
75
|
+
* send button adjusts ([#195](https://github.com/stack-spot/portal-ai-chat-widget/issues/195)) ([a31fc1f](https://github.com/stack-spot/portal-ai-chat-widget/commit/a31fc1ff33c5ed511aa890fda856adc84e2e840b))
|
|
76
|
+
* set language to undefined if panel is closed ([#162](https://github.com/stack-spot/portal-ai-chat-widget/issues/162)) ([5ae54d5](https://github.com/stack-spot/portal-ai-chat-widget/commit/5ae54d54937b4562a03201c5943721e37ffaa21d))
|
|
77
|
+
* show ks ([#237](https://github.com/stack-spot/portal-ai-chat-widget/issues/237)) ([b6c68cd](https://github.com/stack-spot/portal-ai-chat-widget/commit/b6c68cd0c58857f0aa822ad44c987a6ed50a7795))
|
|
78
|
+
* small styling issues ([#168](https://github.com/stack-spot/portal-ai-chat-widget/issues/168)) ([2a2ee42](https://github.com/stack-spot/portal-ai-chat-widget/commit/2a2ee428bf5d6b4fb1964ae35852dfc4d2e18f69))
|
|
79
|
+
* spacing chat messages ([#164](https://github.com/stack-spot/portal-ai-chat-widget/issues/164)) ([18c82fd](https://github.com/stack-spot/portal-ai-chat-widget/commit/18c82fd724bf16a9caaaa2c8636f6c524e324caa))
|
|
80
|
+
* update ([26feb55](https://github.com/stack-spot/portal-ai-chat-widget/commit/26feb552d3a9acd0e82192cd253a62d33051f7b6))
|
|
81
|
+
* update ([#219](https://github.com/stack-spot/portal-ai-chat-widget/issues/219)) ([cb45644](https://github.com/stack-spot/portal-ai-chat-widget/commit/cb456444f6f1e604c4c6247e631d256d755e82b0))
|
|
82
|
+
* update network lib ([#245](https://github.com/stack-spot/portal-ai-chat-widget/issues/245)) ([8341240](https://github.com/stack-spot/portal-ai-chat-widget/commit/83412402296f22e8fb61c6079f13cf94066ae886))
|
|
83
|
+
* Update release ([#203](https://github.com/stack-spot/portal-ai-chat-widget/issues/203)) ([5cb758e](https://github.com/stack-spot/portal-ai-chat-widget/commit/5cb758e1832ff41485300d08f6e306917d80e142))
|
|
84
|
+
* update text ([#185](https://github.com/stack-spot/portal-ai-chat-widget/issues/185)) ([58c03d3](https://github.com/stack-spot/portal-ai-chat-widget/commit/58c03d36e4bec75cbdb721202e8fed694499a7be))
|
|
85
|
+
|
|
86
|
+
## [2.0.0](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.36.4...ai-chat-widget@v2.0.0) (2025-09-17)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### ⚠ BREAKING CHANGES
|
|
90
|
+
|
|
91
|
+
* updates Citric + ADP features ([#304](https://github.com/stack-spot/portal-ai-chat-widget/issues/304))
|
|
92
|
+
|
|
93
|
+
### Features
|
|
94
|
+
|
|
95
|
+
* updates Citric + ADP features ([#304](https://github.com/stack-spot/portal-ai-chat-widget/issues/304)) ([30f068d](https://github.com/stack-spot/portal-ai-chat-widget/commit/30f068d25f6e677241bc4ce4e92cc85910b12fe9))
|
|
96
|
+
|
|
3
97
|
## [1.36.4](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v1.36.3...ai-chat-widget@v1.36.4) (2025-09-04)
|
|
4
98
|
|
|
5
99
|
|
package/dist/app-metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "
|
|
4
|
-
"date": "
|
|
3
|
+
"version": "3.0.0-beta.1",
|
|
4
|
+
"date": "Wed Oct 01 2025 15:13:49 GMT+0000 (Coordinated Universal Time)",
|
|
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.
|
|
112
|
+
"version": "0.2.3"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"name": "@stack-spot/citric-react",
|
|
116
|
-
"version": "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.
|
|
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.
|
|
124
|
+
"version": "0.179.1-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": "
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-message.d.ts","sourceRoot":"","sources":["../../src/chat-interceptors/send-message.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAkC,MAAM,oBAAoB,CAAA;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"send-message.d.ts","sourceRoot":"","sources":["../../src/chat-interceptors/send-message.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAkC,MAAM,oBAAoB,CAAA;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAwC9C;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,iBA4JlG"}
|
|
@@ -3,6 +3,7 @@ import { ChatEntry } from '../state/ChatEntry.js';
|
|
|
3
3
|
import { buildConversationContext } from '../utils/chat.js';
|
|
4
4
|
import { treatHTMLInErrorMessage } from '../utils/error.js';
|
|
5
5
|
import { genericSourcesToKnowledgeSources } from '../utils/knowledge-source.js';
|
|
6
|
+
import { planningToolDictionaryHelper } from '../utils/planning-tool.js';
|
|
6
7
|
/**
|
|
7
8
|
* Transforms a chat response from the backend into a chat entry that can be added to the chat.
|
|
8
9
|
* @param response the original response.
|
|
@@ -52,6 +53,16 @@ export async function sendMessageInterceptor(entry, chat, signal) {
|
|
|
52
53
|
chat.set('label', content || entry.getValue().upload?.[0]?.name || 'Chat');
|
|
53
54
|
chat.untitled = false;
|
|
54
55
|
}
|
|
56
|
+
//Verify if the last planning in the messages has status awaiting_approval
|
|
57
|
+
const messages = chat.getMessages();
|
|
58
|
+
const lastPlanningAwaiting = messages.slice().reverse().find(item => {
|
|
59
|
+
const steps = item.getValue().steps;
|
|
60
|
+
if (steps) {
|
|
61
|
+
const hasPlanning = steps.find((step) => step.type === 'planning');
|
|
62
|
+
return hasPlanning ? hasPlanning.status === 'awaiting_approval' : false;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
});
|
|
55
66
|
const stream = aiClient.sendChatMessage({ context, user_prompt: buildPrompt(content, data) });
|
|
56
67
|
signal.addEventListener('abort', () => stream.cancel());
|
|
57
68
|
const botEntry = ChatEntry.createStreamedBotEntry();
|
|
@@ -60,10 +71,77 @@ export async function sendMessageInterceptor(entry, chat, signal) {
|
|
|
60
71
|
chat.pushMessage(botEntry);
|
|
61
72
|
}
|
|
62
73
|
let knowledgeSources;
|
|
74
|
+
const updatePlanningMessage = () => {
|
|
75
|
+
if (lastPlanningAwaiting) {
|
|
76
|
+
const originalItem = messages.find((message) => message.id === lastPlanningAwaiting.id);
|
|
77
|
+
const originalItemValue = originalItem?.getValue();
|
|
78
|
+
originalItemValue?.steps?.map((step) => {
|
|
79
|
+
if (step.type === 'planning' && step.status === 'awaiting_approval') {
|
|
80
|
+
step.status = 'success';
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
originalItem?.setValue({ ...originalItemValue });
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const updateToolStatus = (agentInfo) => {
|
|
87
|
+
const executionId = agentInfo.id;
|
|
88
|
+
if (executionId) {
|
|
89
|
+
//Update message with type step which contains the planning steps
|
|
90
|
+
const messageId = planningToolDictionaryHelper.getMessageIdPlanningStepFromToolExecutionId(executionId);
|
|
91
|
+
const originalItem = messages.find((message) => `${message.id}` === messageId);
|
|
92
|
+
const originalItemValue = originalItem?.getValue();
|
|
93
|
+
let update = false;
|
|
94
|
+
const status = agentInfo.action === 'start' ? 'pending' : 'success';
|
|
95
|
+
const step = originalItemValue?.steps?.find(step => step.type === 'step' && step.attempts?.[0].tools?.[0].executionId === executionId);
|
|
96
|
+
if (step && step.status !== status) {
|
|
97
|
+
step.status = status;
|
|
98
|
+
update = true;
|
|
99
|
+
}
|
|
100
|
+
if (update) {
|
|
101
|
+
originalItem?.setValue({ ...originalItemValue });
|
|
102
|
+
}
|
|
103
|
+
//Updates message with type tool which contains the actually tool steps
|
|
104
|
+
const toolMessageId = planningToolDictionaryHelper.getMessageIdToolStepFromToolExecutionId(executionId);
|
|
105
|
+
const toolOriginalItem = messages.find((message) => `${message.id}` === toolMessageId);
|
|
106
|
+
const toolOriginalItemValue = toolOriginalItem?.getValue();
|
|
107
|
+
const toolStep = toolOriginalItemValue?.steps?.find(step => step.type === 'tool' && step.attempts?.[0].tools?.[0].executionId === executionId);
|
|
108
|
+
update = false;
|
|
109
|
+
if (toolStep && toolStep.status !== status) {
|
|
110
|
+
toolStep.status = status;
|
|
111
|
+
update = true;
|
|
112
|
+
}
|
|
113
|
+
if (update) {
|
|
114
|
+
toolOriginalItem?.setValue({ ...toolOriginalItemValue });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
63
118
|
stream.onChange(value => {
|
|
119
|
+
if (value.agent_info?.type === 'planning') {
|
|
120
|
+
if (value.agent_info.action === 'start') {
|
|
121
|
+
chat.set('isPlaning', true);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
chat.set('isPlaning', false);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
64
127
|
if (value.sources?.length !== knowledgeSources?.length && chat.get('features').showSourcesInResponse) {
|
|
65
128
|
knowledgeSources = genericSourcesToKnowledgeSources(value.sources);
|
|
66
129
|
}
|
|
130
|
+
// When there is a planning with status awaiting_approval and we receive a new one
|
|
131
|
+
// we do not not want to add it again.
|
|
132
|
+
if (lastPlanningAwaiting && value.steps) {
|
|
133
|
+
const hasPlanningAwaiting = value.steps.find((item) => item.type === 'planning' && item.status === 'awaiting_approval');
|
|
134
|
+
value.steps = value.steps?.filter(step => {
|
|
135
|
+
if (step.type === 'planning') {
|
|
136
|
+
updatePlanningMessage();
|
|
137
|
+
}
|
|
138
|
+
return hasPlanningAwaiting ? true : (step.type !== 'planning' && step.type !== 'step' &&
|
|
139
|
+
(step.type !== 'answer' || (step.type === 'answer' && step.status === 'pending')));
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
if (value.agent_info?.type === 'tool') {
|
|
143
|
+
updateToolStatus(value.agent_info);
|
|
144
|
+
}
|
|
67
145
|
botEntry.setValue(createEntryValueFromChatResponse(value, knowledgeSources, chat.get('agent')));
|
|
68
146
|
});
|
|
69
147
|
let finalValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-message.js","sourceRoot":"","sources":["../../src/chat-interceptors/send-message.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"send-message.js","sourceRoot":"","sources":["../../src/chat-interceptors/send-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAyB,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAE/H,OAAO,EAAE,SAAS,EAAkC,MAAM,oBAAoB,CAAA;AAG9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAA;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAA;AAErE;;;;;;;;GAQG;AACH,SAAS,gCAAgC,CACvC,QAAwC,EACxC,gBAA+C,EAC/C,KAAmC,EACnC,WAAW,GAAG,KAAK;IAEnB,OAAO;QACL,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,QAAQ,CAAC,MAAM,IAAI,EAAE;QAC9B,SAAS,EAAE,QAAQ,CAAC,UAAU,IAAI,SAAS;QAC3C,gBAAgB;QAChB,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;QAC3D,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,KAAK,EAAE,QAAQ,CAAC,KAAK;KACtB,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAAC,OAAe,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AAG,CAAC,OAAO,CAAC,EAAE;qBAC7D,CAAC,CAAA;gBACJ,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,sCAAsC;oBACtC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAA;gBAClE,CAAC;YACH,CAAC;YACD,6CAA6C;YAC7C,QAAQ,CAAC,KAAK,CAAC,UAAU,EAAE,CAAA;QAC7B,CAAC;IACH,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;AAC9B,CAAC"}
|
|
@@ -28,6 +28,10 @@ export interface ChatPropertiesWithOptionalFeatures {
|
|
|
28
28
|
* Whether or not the chat is in a loading state.
|
|
29
29
|
*/
|
|
30
30
|
isLoading?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether or not the chat is planning.
|
|
33
|
+
*/
|
|
34
|
+
isPlaning?: boolean;
|
|
31
35
|
/**
|
|
32
36
|
* The value of the next message. This is the value of the text typed in the textarea below the chat.
|
|
33
37
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatState.d.ts","sourceRoot":"","sources":["../../src/state/ChatState.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAA2B,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE/C,MAAM,WAAW,kCAAkC;IACjD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OA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D;;OAEG;IACH,iBAAiB,mBAAyB;IAC1C;;OAEG;IACH,OAAO,CAAC,SAAS,CAAwB;IACzC;;OAEG;IACH,QAAQ,CAAC,aAAa,gBAAmG;IACzH,QAAQ,EAAE,OAAO,CAAA;gBAEL,EAAE,EAAE,EAAE,OAAO,EAAE,OAAY,EAAE,YAAiB,EAAE,QAAgB,EAAE,EAAE,OAAO;IAQvF,OAAO,CAAC,oBAAoB;YAId,eAAe;IAe7B;;;OAGG;IACH,WAAW,CAAC,GAAG,OAAO,EAAE,SAAS,EAAE;IAOnC;;;OAGG;IACH,UAAU,CAAC,QAAQ,SAAI;IAKvB;;OAEG;IACH,WAAW;IAIX;;;;OAIG;IACH,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB;IAO/C;;OAEG;IACH,KAAK;IAKL;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM;CAUhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatState.js","sourceRoot":"","sources":["../../src/state/ChatState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAgB,uBAAuB,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAE7D,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"ChatState.js","sourceRoot":"","sources":["../../src/state/ChatState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC9C,OAAO,E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C,QAA8B;QAC7C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACrC,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAA;QACxC,CAAC,CAAA;IACH,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC,CAAA;QACxD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;IACrB,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,KAAa;QAC7B,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC;YAC5B,EAAE,EAAE,IAAI,EAAE;YACV,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE;YACjC,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC,CAAA;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;QAClC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;QACnB,OAAO,OAAO,CAAA;IAChB,CAAC;CACF"}
|
package/dist/utils/date.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Language } from '@stack-spot/portal-translate';
|
|
2
1
|
/**
|
|
3
2
|
* Formats a date to show at the footer of a chat message.
|
|
4
3
|
*
|
|
@@ -10,7 +9,7 @@ import { Language } from '@stack-spot/portal-translate';
|
|
|
10
9
|
* @param language the language to use.
|
|
11
10
|
* @returns the formatted date.
|
|
12
11
|
*/
|
|
13
|
-
export declare function formatDateForChatMessage(date: Date, language?:
|
|
12
|
+
export declare function formatDateForChatMessage(date: Date, language?: "pt" | "en"): string;
|
|
14
13
|
/**
|
|
15
14
|
* Uses the current language to format dates.
|
|
16
15
|
* @returns an object containing functions for formatting dates.
|
package/dist/utils/date.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,cAAoB,UAUhF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB;IAG5B;;;OAGG;iCAC0B,IAAI;EAEpC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,QAE5D"}
|
package/dist/utils/date.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getLanguage, useLanguage } from '@stack-spot/portal-translate';
|
|
1
|
+
import { getLanguage, ptEn, useLanguage } from '@stack-spot/portal-translate';
|
|
2
2
|
const OneDay = 24 * 60 * 60 * 1000;
|
|
3
3
|
const timeFormatOptions = { hour: '2-digit', minute: '2-digit' };
|
|
4
4
|
const fullFormatOptions = {
|
|
@@ -17,7 +17,7 @@ const fullFormatOptions = {
|
|
|
17
17
|
* @param language the language to use.
|
|
18
18
|
* @returns the formatted date.
|
|
19
19
|
*/
|
|
20
|
-
export function formatDateForChatMessage(date, language = getLanguage()) {
|
|
20
|
+
export function formatDateForChatMessage(date, language = getLanguage(ptEn)) {
|
|
21
21
|
const formatted = [];
|
|
22
22
|
const now = new Date();
|
|
23
23
|
const isToday = date.toDateString() === now.toDateString();
|
|
@@ -35,7 +35,7 @@ export function formatDateForChatMessage(date, language = getLanguage()) {
|
|
|
35
35
|
* @returns an object containing functions for formatting dates.
|
|
36
36
|
*/
|
|
37
37
|
export function useDateFormatter() {
|
|
38
|
-
const language = useLanguage();
|
|
38
|
+
const language = useLanguage(ptEn);
|
|
39
39
|
return {
|
|
40
40
|
/**
|
|
41
41
|
* @param date the date to format using {@link formatDateForChatMessage}.
|
package/dist/utils/date.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAEzF,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAClC,MAAM,iBAAiB,GAA+B,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAC,SAAS,EAAE,CAAA;AAC3F,MAAM,iBAAiB,GAA+B;IACpD,GAAG,iBAAiB;IACpB,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,MAAM;CACd,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAU,EAAE,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC;IAC/E,MAAM,SAAS,GAAa,EAAE,CAAA;IAC9B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;IACtB,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,CAAC,YAAY,EAAE,CAAA;IAC1D,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,MAAM,CAAA;IAC3D,IAAI,OAAO;QAAE,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAA;SAClD,IAAI,WAAW;QAAE,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAA;IACpE,MAAM,OAAO,GAAG,OAAO,IAAI,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAA;IAC9E,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;IAChD,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;IAClC,OAAO;QACL;;;WAGG;QACH,oBAAoB,EAAE,CAAC,IAAU,EAAE,EAAE,CAAC,wBAAwB,CAAC,IAAI,EAAE,QAAQ,CAAC;KAC/E,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU,EAAE,YAAoB;IAC3D,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,YAAY,GAAG,EAAE,GAAG,KAAK,CAAC,CAAA;AAClE,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,OAAO;QACd,SAAS,EAAE,WAAW;KACvB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,OAAO;KACnB;CACmB,CAAA"}
|
package/dist/utils/error.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getLanguage } from '@stack-spot/portal-translate';
|
|
1
|
+
import { getLanguage, ptEn } from '@stack-spot/portal-translate';
|
|
2
2
|
const httpErrors = {
|
|
3
3
|
en: {
|
|
4
4
|
400: 'Bad Request',
|
|
@@ -46,7 +46,7 @@ const httpErrors = {
|
|
|
46
46
|
},
|
|
47
47
|
};
|
|
48
48
|
function getGenericErrorBasedOnStatus(status) {
|
|
49
|
-
return httpErrors[getLanguage()][status] ?? `Unknown error. Status code: ${status}.`;
|
|
49
|
+
return httpErrors[getLanguage(ptEn)][status] ?? `Unknown error. Status code: ${status}.`;
|
|
50
50
|
}
|
|
51
51
|
export function treatHTMLInErrorMessage(text, status) {
|
|
52
52
|
return (!text.includes('<html>')) ? text : getGenericErrorBasedOnStatus(status);
|
package/dist/utils/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;AAEhE,MAAM,UAAU,GAAgD;IAC9D,EAAE,EAAE;QACF,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,cAAc;QACnB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,oBAAoB;QACzB,GAAG,EAAE,gBAAgB;QACrB,GAAG,EAAE,iBAAiB;QACtB,GAAG,EAAE,UAAU;QACf,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,iBAAiB;QACtB,GAAG,EAAE,mBAAmB;QACxB,GAAG,EAAE,cAAc;QACnB,GAAG,EAAE,wBAAwB;QAC7B,GAAG,EAAE,mBAAmB;QACxB,GAAG,EAAE,uBAAuB;QAC5B,GAAG,EAAE,iBAAiB;QACtB,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,iBAAiB;QACtB,GAAG,EAAE,4BAA4B;KAClC;IACD,EAAE,EAAE;QACF,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,gBAAgB;QACrB,GAAG,EAAE,UAAU;QACf,GAAG,EAAE,gBAAgB;QACrB,GAAG,EAAE,sBAAsB;QAC3B,GAAG,EAAE,eAAe;QACpB,GAAG,EAAE,8BAA8B;QACnC,GAAG,EAAE,UAAU;QACf,GAAG,EAAE,cAAc;QACnB,GAAG,EAAE,wBAAwB;QAC7B,GAAG,EAAE,oBAAoB;QACzB,GAAG,EAAE,iBAAiB;QACtB,GAAG,EAAE,6BAA6B;QAClC,GAAG,EAAE,oBAAoB;QACzB,GAAG,EAAE,0BAA0B;QAC/B,GAAG,EAAE,kBAAkB;QACvB,GAAG,EAAE,kBAAkB;QACvB,GAAG,EAAE,sBAAsB;QAC3B,GAAG,EAAE,2BAA2B;QAChC,GAAG,EAAE,2BAA2B;KACjC;CACF,CAAA;AAED,SAAS,4BAA4B,CAAC,MAAc;IAClD,OAAO,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,+BAA+B,MAAM,GAAG,CAAA;AAC1F,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,IAAY,EAAE,MAAc;IAClE,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAA;AACjF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare class PlanningToolDictionaryHelper {
|
|
2
|
+
static instance: PlanningToolDictionaryHelper | undefined;
|
|
3
|
+
private toolExecutionIdPlanningStep;
|
|
4
|
+
private toolExecutionIdToolStep;
|
|
5
|
+
private constructor();
|
|
6
|
+
static create(): PlanningToolDictionaryHelper;
|
|
7
|
+
setMessageIdPlanningStepToolExecutionId(messageId: string, toolExecutionId: string): void;
|
|
8
|
+
setMessageIdToolStepToolExecutionId(messageId: string, toolExecutionId: string): void;
|
|
9
|
+
getMessageIdPlanningStepFromToolExecutionId(toolExecutionId: string): string;
|
|
10
|
+
getMessageIdToolStepFromToolExecutionId(toolExecutionId: string): string;
|
|
11
|
+
}
|
|
12
|
+
export declare const planningToolDictionaryHelper: PlanningToolDictionaryHelper;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=planning-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planning-tool.d.ts","sourceRoot":"","sources":["../../src/utils/planning-tool.ts"],"names":[],"mappings":"AAAA,cAAM,4BAA4B;IAChC,MAAM,CAAC,QAAQ,EAAE,4BAA4B,GAAG,SAAS,CAAA;IACzD,OAAO,CAAC,2BAA2B,CAA6B;IAChE,OAAO,CAAC,uBAAuB,CAA6B;IAE5D,OAAO;IAIP,MAAM,CAAC,MAAM;IAIb,uCAAuC,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;IAIlF,mCAAmC,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;IAI9E,2CAA2C,CAAC,eAAe,EAAE,MAAM;IAInE,uCAAuC,CAAC,eAAe,EAAE,MAAM;CAGhE;AAED,eAAO,MAAM,4BAA4B,8BAAwC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
class PlanningToolDictionaryHelper {
|
|
2
|
+
static instance;
|
|
3
|
+
toolExecutionIdPlanningStep = {};
|
|
4
|
+
toolExecutionIdToolStep = {};
|
|
5
|
+
constructor() {
|
|
6
|
+
PlanningToolDictionaryHelper.instance = this;
|
|
7
|
+
}
|
|
8
|
+
static create() {
|
|
9
|
+
return PlanningToolDictionaryHelper.instance ?? new PlanningToolDictionaryHelper();
|
|
10
|
+
}
|
|
11
|
+
setMessageIdPlanningStepToolExecutionId(messageId, toolExecutionId) {
|
|
12
|
+
this.toolExecutionIdPlanningStep[toolExecutionId] = messageId;
|
|
13
|
+
}
|
|
14
|
+
setMessageIdToolStepToolExecutionId(messageId, toolExecutionId) {
|
|
15
|
+
this.toolExecutionIdToolStep[toolExecutionId] = messageId;
|
|
16
|
+
}
|
|
17
|
+
getMessageIdPlanningStepFromToolExecutionId(toolExecutionId) {
|
|
18
|
+
return this.toolExecutionIdPlanningStep[toolExecutionId];
|
|
19
|
+
}
|
|
20
|
+
getMessageIdToolStepFromToolExecutionId(toolExecutionId) {
|
|
21
|
+
return this.toolExecutionIdToolStep[toolExecutionId];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const planningToolDictionaryHelper = PlanningToolDictionaryHelper.create();
|
|
25
|
+
//# sourceMappingURL=planning-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planning-tool.js","sourceRoot":"","sources":["../../src/utils/planning-tool.ts"],"names":[],"mappings":"AAAA,MAAM,4BAA4B;IAChC,MAAM,CAAC,QAAQ,CAA0C;IACjD,2BAA2B,GAA2B,EAAE,CAAA;IACxD,uBAAuB,GAA2B,EAAE,CAAA;IAE5D;QACE,4BAA4B,CAAC,QAAQ,GAAG,IAAI,CAAA;IAC9C,CAAC;IAED,MAAM,CAAC,MAAM;QACX,OAAO,4BAA4B,CAAC,QAAQ,IAAI,IAAI,4BAA4B,EAAE,CAAA;IACpF,CAAC;IAED,uCAAuC,CAAC,SAAiB,EAAE,eAAuB;QAChF,IAAI,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;IAC/D,CAAC;IAED,mCAAmC,CAAC,SAAiB,EAAE,eAAuB;QAC5E,IAAI,CAAC,uBAAuB,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;IAC3D,CAAC;IAED,2CAA2C,CAAC,eAAuB;QACjE,OAAO,IAAI,CAAC,2BAA2B,CAAC,eAAe,CAAC,CAAA;IAC1D,CAAC;IAED,uCAAuC,CAAC,eAAuB;QAC7D,OAAO,IAAI,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAA;IACtD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,4BAA4B,CAAC,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-tool-step.d.ts","sourceRoot":"","sources":["../../src/utils/update-tool-step.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,MAAM,oBAAoB,CAAA;AAG7D,eAAO,MAAM,cAAc,aAAc,SAAS,EAAE,eAAe,MAAM,aAC5D,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,mBAAmB,SAsB7E,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { planningToolDictionaryHelper } from './planning-tool.js';
|
|
2
|
+
export const updateToolStep = (messages, executionId, newStatus) => {
|
|
3
|
+
// if last message is a user message, no update in tool status is needed
|
|
4
|
+
if (messages[messages.length - 1].getValue().agentType === 'user')
|
|
5
|
+
return;
|
|
6
|
+
const messageId = planningToolDictionaryHelper.getMessageIdPlanningStepFromToolExecutionId(executionId);
|
|
7
|
+
const message = messages.find((message) => `${message.id}` === messageId);
|
|
8
|
+
let update = false;
|
|
9
|
+
const messageValue = message?.getValue();
|
|
10
|
+
messageValue?.steps?.map((step) => {
|
|
11
|
+
if (step.type === 'step') {
|
|
12
|
+
const tool = step.attempts?.[0].tools?.[0];
|
|
13
|
+
if (tool?.executionId === executionId && step.status !== newStatus) {
|
|
14
|
+
step.status = newStatus;
|
|
15
|
+
update = true;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
if (update) {
|
|
20
|
+
message?.setValue({ ...messageValue });
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=update-tool-step.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-tool-step.js","sourceRoot":"","sources":["../../src/utils/update-tool-step.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAA;AAE9D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAqB,EAAE,WAAmB,EACvE,SAA4E,EAAE,EAAE;IAEhF,wEAAwE;IACxE,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,KAAK,MAAM;QAAE,OAAM;IAEvE,MAAM,SAAS,GAAG,4BAA4B,CAAC,2CAA2C,CAAC,WAAW,CAAC,CAAA;IACvG,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,EAAE,EAAE,KAAK,SAAS,CAAC,CAAA;IACzE,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,MAAM,YAAY,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAA;IACxC,YAAY,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAChC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAA;YAC1C,IAAI,IAAI,EAAE,WAAW,KAAK,WAAW,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBACnE,IAAI,CAAC,MAAM,GAAG,SAAS,CAAA;gBACvB,MAAM,GAAG,IAAI,CAAA;YACf,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,EAAE,QAAQ,CAAC,EAAE,GAAG,YAA6B,EAAE,CAAC,CAAA;IACzD,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -54,6 +54,6 @@ interface Props extends CustomMessage {
|
|
|
54
54
|
/**
|
|
55
55
|
* Renders a message (ChatEntry) in the chat.
|
|
56
56
|
*/
|
|
57
|
-
export declare const ChatMessage: ({ message, isLast, beforeMessage, afterMessage, customRenderer }: Props) => "" | 0 | import("react/jsx-runtime").JSX.Element
|
|
57
|
+
export declare const ChatMessage: ({ message, isLast, beforeMessage, afterMessage, customRenderer }: Props) => false | "" | 0 | import("react/jsx-runtime").JSX.Element;
|
|
58
58
|
export {};
|
|
59
59
|
//# sourceMappingURL=ChatMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatMessage.d.ts","sourceRoot":"","sources":["../../../src/views/Chat/ChatMessage.tsx"],"names":[],"mappings":"AAQA,OAAO,qCAAqC,CAAA;AAK5C,OAAO,EAAE,SAAS,EAAsB,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAQpF,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B;;;;;;OAMG;IACH,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,OAAO,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACjD;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,OAAO,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAChD;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,kBAAkB,GAAG,SAAS,CAAC;CAC7E;AAED,UAAU,KAAM,SAAQ,aAAa;IACnC;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAiID;;GAEG;AACH,eAAO,MAAM,WAAW,qEAAsE,KAAK,
|
|
1
|
+
{"version":3,"file":"ChatMessage.d.ts","sourceRoot":"","sources":["../../../src/views/Chat/ChatMessage.tsx"],"names":[],"mappings":"AAQA,OAAO,qCAAqC,CAAA;AAK5C,OAAO,EAAE,SAAS,EAAsB,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAQpF,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B;;;;;;OAMG;IACH,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,OAAO,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACjD;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,OAAO,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAChD;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,kBAAkB,GAAG,SAAS,CAAC;CAC7E;AAED,UAAU,KAAM,SAAQ,aAAa;IACnC;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAiID;;GAEG;AACH,eAAO,MAAM,WAAW,qEAAsE,KAAK,6DAuSlG,CAAA"}
|
|
@@ -10,7 +10,7 @@ import { PhoneInput } from 'react-international-phone';
|
|
|
10
10
|
import 'react-international-phone/style.css';
|
|
11
11
|
import { FileDescription } from '../../components/FileDescription.js';
|
|
12
12
|
import { Markdown } from '../../components/Markdown.js';
|
|
13
|
-
import { useChatEntry, useCurrentChat, useWidget } from '../../context/hooks.js';
|
|
13
|
+
import { useChatEntry, useCurrentChat, useCurrentChatState, useWidget } from '../../context/hooks.js';
|
|
14
14
|
import { useMidnightUpdateView } from '../../hooks/midnight-update-view.js';
|
|
15
15
|
import { ChatEntry } from '../../state/ChatEntry.js';
|
|
16
16
|
import { useDateFormatter } from '../../utils/date.js';
|
|
@@ -18,7 +18,7 @@ import { toolById } from '../../utils/tools.js';
|
|
|
18
18
|
import { AgentInfo } from './AgentInfo.js';
|
|
19
19
|
import { useChatScrollToBottomEffect } from './chat-scroll.js';
|
|
20
20
|
import { onCopyAll, onCopyCode, onLikeOrDislike } from './events.js';
|
|
21
|
-
import { StepsList } from './StepsList.js';
|
|
21
|
+
import { StepsList, StepsPlaceholder } from './StepsList.js';
|
|
22
22
|
const RenderInputsEntry = ({ isLast, entry, value, setValue, labels, setLabels }) => {
|
|
23
23
|
const chat = useCurrentChat();
|
|
24
24
|
const [radioValue, setRadioValue] = useState();
|
|
@@ -93,6 +93,7 @@ export const ChatMessage = ({ message, isLast, beforeMessage, afterMessage, cust
|
|
|
93
93
|
const [agentsTools] = agentToolsClient.agentsByIds.useStatefulQuery({ searchAgentsRequest: { ids: entry.tools || [''] } }, { enabled: !!entry.tools });
|
|
94
94
|
const [copied, setCopied] = useState(false);
|
|
95
95
|
const [showUserButtonCopy, setShowUserButtonCopy] = useState(false);
|
|
96
|
+
const isPlanning = useCurrentChatState('isPlaning') ?? false;
|
|
96
97
|
useChatScrollToBottomEffect(ref, [entry]);
|
|
97
98
|
useMidnightUpdateView();
|
|
98
99
|
const detailKS = useCallback(({ name, slug, documentScore, documentId }) => {
|
|
@@ -168,7 +169,7 @@ export const ChatMessage = ({ message, isLast, beforeMessage, afterMessage, cust
|
|
|
168
169
|
widget.set('currentMessageInPanel', { chatId: chat.id, messageId: message.id });
|
|
169
170
|
widget.set('panel', 'resources');
|
|
170
171
|
}
|
|
171
|
-
return (entry.content || entry.error || !!entry.steps?.length || entry.upload?.length) && (_jsx("li", { className: entry.agentType, ref: ref, children: _jsxs("div", { className: "chat-message-container", onMouseEnter: entry.agentType === 'user' ? () => setShowUserButtonCopy(true) : undefined, onMouseLeave: entry.agentType === 'user' ? () => setShowUserButtonCopy(false) : undefined, children: [_jsxs("div", { className: "chat-message", ref: chatRef, onKeyDown: handleKeyDown, tabIndex: 0, children: [_jsx("div", { className: `user-info ${entry.agentType}`, children: _jsx(UserInfo, { entry: entry }) }), beforeMessage && createElement(beforeMessage, { message }), (entry.content || entry.steps || entry.upload?.length) && (_jsxs("div", { className: listToClass(['message-content', entry.card && 'card', entry.type]), children: [!!entry.badges?.length && _jsx("div", { className: "badges", children: entry.badges.map((b, index) => _jsx(Badge, { colorPalette: b.color ?? 'cyan', appearance: "square", children: b.label }, index)) }),
|
|
172
|
+
return (entry.content || entry.error || !!entry.steps?.length || entry.upload?.length || isPlanning) && (_jsx("li", { className: entry.agentType, ref: ref, children: _jsxs("div", { className: "chat-message-container", onMouseEnter: entry.agentType === 'user' ? () => setShowUserButtonCopy(true) : undefined, onMouseLeave: entry.agentType === 'user' ? () => setShowUserButtonCopy(false) : undefined, children: [_jsxs("div", { className: "chat-message", ref: chatRef, onKeyDown: handleKeyDown, tabIndex: 0, children: [_jsx("div", { className: `user-info ${entry.agentType}`, children: _jsx(UserInfo, { entry: entry }) }), beforeMessage && createElement(beforeMessage, { message }), (entry.content || entry.steps || entry.upload?.length) && (_jsxs("div", { className: listToClass(['message-content', entry.card && 'card', entry.type]), children: [!!entry.badges?.length && _jsx("div", { className: "badges", children: entry.badges.map((b, index) => _jsx(Badge, { colorPalette: b.color ?? 'cyan', appearance: "square", children: b.label }, index)) }), !!entry.steps?.length && _jsx(StepsList, { steps: entry.steps, chatId: chat.id, messageId: message.id }), renderContent()] })), isPlanning && entry.agentType === 'bot' && isLast && _jsx(StepsPlaceholder, {}), entry.error && _jsx(Alert, { type: "error", children: entry.error })] }), afterMessage && createElement(afterMessage, { message }), !!entry.knowledgeSources?.length && _jsxs("div", { className: "ks-box", children: [_jsx(Text, { appearance: "microtext1", color: "light.700", children: "Knowledge Sources:" }), _jsx("ul", { children: entry.knowledgeSources.map((ks, index) => (_jsx("li", { children: _jsx(Button, { size: "sm", colorScheme: "light", onClick: () => detailKS(ks), children: ks.name }) }, index))) })] }), (!!agentsTools?.length || !!entry.tools?.length) && _jsx("div", { className: "tools-box", children: _jsxs(Button, { appearance: "none", onClick: openResourcesPanel, "aria-label": t.openResourcesPanel, children: [agentsTools?.map((agent) => (_jsx(ImageBox, { className: "agent-info-avatar-resource", children: _jsx(ImageWithFallback, { src: agent.avatar ?? undefined, fallback: _jsx(Icon, { icon: "Agent" }), alt: agent.name, "aria-label": agent.name, title: agent.name }) }, agent.id))), entry.tools?.map((id) => {
|
|
172
173
|
const tool = toolById(id, toolKits);
|
|
173
174
|
return (_jsx(ImageBox, { className: "agent-info-avatar-resource", children: _jsx(ImageWithFallback, { src: tool?.image, fallback: _jsx(Icon, { icon: "Cog" }), alt: tool?.name, "aria-label": tool?.name, title: tool?.name }) }, id));
|
|
174
175
|
})] }) }), shouldShowFooter && _jsxs("div", { className: "message-footer", children: [entry.agentType === 'bot' && !entry.error && _jsxs("div", { className: "message-actions", children: [entry.type === 'md' && (_jsx(IconButton, { icon: "Copy", className: "copy-btn", appearance: "square", title: t.copy, "aria-label": t.copy, feedback: t.copied, onClick: handleCopy })), entry.messageId && (_jsxs(_Fragment, { children: [_jsx(IconButton, { group: liked === true ? 'fill' : 'outline', icon: "Like", appearance: "square", title: t.like, "aria-label": t.like, onClick: like }), _jsx(IconButton, { group: liked === false ? 'fill' : 'outline', icon: "Dislike", appearance: "square", color: "light", title: t.dislike, "aria-label": t.dislike, onClick: dislike })] }))] }), entry.agentType === 'user' && (_jsx("div", { className: "message-actions", children: copied ? (_jsx(Tooltip, { content: t.copied, position: 'left', children: _jsx(IconButton, { icon: "Check", appearance: "square", title: t.copied, "aria-label": t.copied, size: "sm" }) })) : (showUserButtonCopy && (_jsx("div", { className: "action-bar", children: _jsx(IconButton, { icon: "Copy", appearance: "square", title: t.copy, "aria-label": t.copy, onClick: handleCopy, size: "sm" }) }))) })), _jsx(Text, { appearance: "microtext1", className: "chat-date", children: dateFormatter.formatForChatMessage(date) })] })] }) }, entry.messageId));
|