@copilotkit/react-ui 1.9.2-next.8 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/dist/{chunk-KQEMBE47.mjs → chunk-4RAYX7ZX.mjs} +2 -2
  3. package/dist/{chunk-UKCPOBQM.mjs → chunk-53CVDVS5.mjs} +5 -2
  4. package/dist/chunk-53CVDVS5.mjs.map +1 -0
  5. package/dist/{chunk-AHVYHPVQ.mjs → chunk-BP3RN6OE.mjs} +2 -2
  6. package/dist/{chunk-OMIVNOML.mjs → chunk-EQUUN7ZM.mjs} +2 -2
  7. package/dist/{chunk-2TJK4TTF.mjs → chunk-TSDSBNOS.mjs} +2 -2
  8. package/dist/components/chat/Chat.js +4 -1
  9. package/dist/components/chat/Chat.js.map +1 -1
  10. package/dist/components/chat/Chat.mjs +2 -2
  11. package/dist/components/chat/Modal.js +4 -1
  12. package/dist/components/chat/Modal.js.map +1 -1
  13. package/dist/components/chat/Modal.mjs +3 -3
  14. package/dist/components/chat/Popup.js +4 -1
  15. package/dist/components/chat/Popup.js.map +1 -1
  16. package/dist/components/chat/Popup.mjs +4 -4
  17. package/dist/components/chat/Sidebar.js +4 -1
  18. package/dist/components/chat/Sidebar.js.map +1 -1
  19. package/dist/components/chat/Sidebar.mjs +4 -4
  20. package/dist/components/chat/index.js +4 -1
  21. package/dist/components/chat/index.js.map +1 -1
  22. package/dist/components/chat/index.mjs +5 -5
  23. package/dist/components/chat/messages/RenderActionExecutionMessage.js +4 -1
  24. package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -1
  25. package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +1 -1
  26. package/dist/components/index.js +4 -1
  27. package/dist/components/index.js.map +1 -1
  28. package/dist/components/index.mjs +5 -5
  29. package/dist/index.js +4 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +5 -5
  32. package/package.json +4 -4
  33. package/src/components/chat/messages/RenderActionExecutionMessage.tsx +4 -2
  34. package/dist/chunk-UKCPOBQM.mjs.map +0 -1
  35. /package/dist/{chunk-KQEMBE47.mjs.map → chunk-4RAYX7ZX.mjs.map} +0 -0
  36. /package/dist/{chunk-AHVYHPVQ.mjs.map → chunk-BP3RN6OE.mjs.map} +0 -0
  37. /package/dist/{chunk-OMIVNOML.mjs.map → chunk-EQUUN7ZM.mjs.map} +0 -0
  38. /package/dist/{chunk-2TJK4TTF.mjs.map → chunk-TSDSBNOS.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,204 @@
1
1
  # ui
2
2
 
3
+ ## 1.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - e1de032: - fix: synchronously execute renderAndWaitForResponse
8
+
9
+ Previously, it was impossible to execute multiple human-in-the-loop (renderAndWaitForResponse)
10
+ calls in a row. Ultimately this was due to an issue with how CopilotKit was rendering the updates
11
+ when multiple renderAndWaitForResponse actions appeared on screen due to a reference based approach.
12
+
13
+ With this change, actions will be executed in a synchronous way appearing almost queue like. This
14
+ works with any combination of action given much more freedom when asking for user input.
15
+
16
+ Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
17
+
18
+ - 10345a5: - feat: structured error visibility system for streaming errors
19
+ - abe23c3: - feat: enable hiding stop button
20
+ - 35537f1: - fix: memoize nested components to not rerender when content changes
21
+ - Updated dependencies [cbeccb5]
22
+ - Updated dependencies [3f8c575]
23
+ - Updated dependencies [fac89c2]
24
+ - Updated dependencies [e1de032]
25
+ - Updated dependencies [92e8d1c]
26
+ - Updated dependencies [9169ad7]
27
+ - Updated dependencies [c75a04f]
28
+ - Updated dependencies [c75a04f]
29
+ - Updated dependencies [fe9009c]
30
+ - Updated dependencies [1d1c51d]
31
+ - Updated dependencies [10345a5]
32
+ - Updated dependencies [9169ad7]
33
+ - Updated dependencies [35537f1]
34
+ - @copilotkit/react-core@1.9.2
35
+ - @copilotkit/shared@1.9.2
36
+ - @copilotkit/runtime-client-gql@1.9.2
37
+
38
+ ## 1.9.2-next.26
39
+
40
+ ### Patch Changes
41
+
42
+ - @copilotkit/runtime-client-gql@1.9.2-next.26
43
+ - @copilotkit/react-core@1.9.2-next.26
44
+ - @copilotkit/shared@1.9.2-next.26
45
+
46
+ ## 1.9.2-next.25
47
+
48
+ ### Patch Changes
49
+
50
+ - @copilotkit/runtime-client-gql@1.9.2-next.25
51
+ - @copilotkit/react-core@1.9.2-next.25
52
+ - @copilotkit/shared@1.9.2-next.25
53
+
54
+ ## 1.9.2-next.24
55
+
56
+ ### Patch Changes
57
+
58
+ - @copilotkit/runtime-client-gql@1.9.2-next.24
59
+ - @copilotkit/react-core@1.9.2-next.24
60
+ - @copilotkit/shared@1.9.2-next.24
61
+
62
+ ## 1.9.2-next.23
63
+
64
+ ### Patch Changes
65
+
66
+ - @copilotkit/runtime-client-gql@1.9.2-next.23
67
+ - @copilotkit/react-core@1.9.2-next.23
68
+ - @copilotkit/shared@1.9.2-next.23
69
+
70
+ ## 1.9.2-next.22
71
+
72
+ ### Patch Changes
73
+
74
+ - Updated dependencies [c75a04f]
75
+ - Updated dependencies [c75a04f]
76
+ - @copilotkit/react-core@1.9.2-next.22
77
+ - @copilotkit/runtime-client-gql@1.9.2-next.22
78
+ - @copilotkit/shared@1.9.2-next.22
79
+
80
+ ## 1.9.2-next.21
81
+
82
+ ### Patch Changes
83
+
84
+ - Updated dependencies [92e8d1c]
85
+ - @copilotkit/react-core@1.9.2-next.21
86
+ - @copilotkit/runtime-client-gql@1.9.2-next.21
87
+ - @copilotkit/shared@1.9.2-next.21
88
+
89
+ ## 1.9.2-next.20
90
+
91
+ ### Patch Changes
92
+
93
+ - e1de032: - fix: synchronously execute renderAndWaitForResponse
94
+
95
+ Previously, it was impossible to execute multiple human-in-the-loop (renderAndWaitForResponse)
96
+ calls in a row. Ultimately this was due to an issue with how CopilotKit was rendering the updates
97
+ when multiple renderAndWaitForResponse actions appeared on screen due to a reference based approach.
98
+
99
+ With this change, actions will be executed in a synchronous way appearing almost queue like. This
100
+ works with any combination of action given much more freedom when asking for user input.
101
+
102
+ Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
103
+
104
+ - Updated dependencies [e1de032]
105
+ - @copilotkit/react-core@1.9.2-next.20
106
+ - @copilotkit/runtime-client-gql@1.9.2-next.20
107
+ - @copilotkit/shared@1.9.2-next.20
108
+
109
+ ## 1.9.2-next.19
110
+
111
+ ### Patch Changes
112
+
113
+ - @copilotkit/runtime-client-gql@1.9.2-next.19
114
+ - @copilotkit/react-core@1.9.2-next.19
115
+ - @copilotkit/shared@1.9.2-next.19
116
+
117
+ ## 1.9.2-next.18
118
+
119
+ ### Patch Changes
120
+
121
+ - Updated dependencies [fac89c2]
122
+ - @copilotkit/react-core@1.9.2-next.18
123
+ - @copilotkit/shared@1.9.2-next.18
124
+ - @copilotkit/runtime-client-gql@1.9.2-next.18
125
+
126
+ ## 1.9.2-next.17
127
+
128
+ ### Patch Changes
129
+
130
+ - @copilotkit/runtime-client-gql@1.9.2-next.17
131
+ - @copilotkit/react-core@1.9.2-next.17
132
+ - @copilotkit/shared@1.9.2-next.17
133
+
134
+ ## 1.9.2-next.16
135
+
136
+ ### Patch Changes
137
+
138
+ - Updated dependencies [fe9009c]
139
+ - @copilotkit/react-core@1.9.2-next.16
140
+ - @copilotkit/runtime-client-gql@1.9.2-next.16
141
+ - @copilotkit/shared@1.9.2-next.16
142
+
143
+ ## 1.9.2-next.15
144
+
145
+ ### Patch Changes
146
+
147
+ - Updated dependencies [cbeccb5]
148
+ - @copilotkit/react-core@1.9.2-next.15
149
+ - @copilotkit/runtime-client-gql@1.9.2-next.15
150
+ - @copilotkit/shared@1.9.2-next.15
151
+
152
+ ## 1.9.2-next.14
153
+
154
+ ### Patch Changes
155
+
156
+ - @copilotkit/runtime-client-gql@1.9.2-next.14
157
+ - @copilotkit/react-core@1.9.2-next.14
158
+ - @copilotkit/shared@1.9.2-next.14
159
+
160
+ ## 1.9.2-next.13
161
+
162
+ ### Patch Changes
163
+
164
+ - @copilotkit/runtime-client-gql@1.9.2-next.13
165
+ - @copilotkit/react-core@1.9.2-next.13
166
+ - @copilotkit/shared@1.9.2-next.13
167
+
168
+ ## 1.9.2-next.12
169
+
170
+ ### Patch Changes
171
+
172
+ - Updated dependencies [3f8c575]
173
+ - @copilotkit/react-core@1.9.2-next.12
174
+ - @copilotkit/runtime-client-gql@1.9.2-next.12
175
+ - @copilotkit/shared@1.9.2-next.12
176
+
177
+ ## 1.9.2-next.11
178
+
179
+ ### Patch Changes
180
+
181
+ - @copilotkit/runtime-client-gql@1.9.2-next.11
182
+ - @copilotkit/react-core@1.9.2-next.11
183
+ - @copilotkit/shared@1.9.2-next.11
184
+
185
+ ## 1.9.2-next.10
186
+
187
+ ### Patch Changes
188
+
189
+ - @copilotkit/runtime-client-gql@1.9.2-next.10
190
+ - @copilotkit/react-core@1.9.2-next.10
191
+ - @copilotkit/shared@1.9.2-next.10
192
+
193
+ ## 1.9.2-next.9
194
+
195
+ ### Patch Changes
196
+
197
+ - Updated dependencies [1d1c51d]
198
+ - @copilotkit/react-core@1.9.2-next.9
199
+ - @copilotkit/runtime-client-gql@1.9.2-next.9
200
+ - @copilotkit/shared@1.9.2-next.9
201
+
3
202
  ## 1.9.2-next.8
4
203
 
5
204
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RenderActionExecutionMessage
3
- } from "./chunk-UKCPOBQM.mjs";
3
+ } from "./chunk-53CVDVS5.mjs";
4
4
  import {
5
5
  RenderAgentStateMessage
6
6
  } from "./chunk-2II3Q27P.mjs";
@@ -471,4 +471,4 @@ export {
471
471
  WrappedCopilotChat,
472
472
  useCopilotChatLogic
473
473
  };
474
- //# sourceMappingURL=chunk-KQEMBE47.mjs.map
474
+ //# sourceMappingURL=chunk-4RAYX7ZX.mjs.map
@@ -47,9 +47,12 @@ function RenderActionExecutionMessage(_a) {
47
47
  try {
48
48
  const toRender = render({
49
49
  status,
50
+ // Cast to any as RenderFunctionStatus is a union that can be complex to narrow here
50
51
  args,
51
52
  result: actionResult,
52
- name: message.name
53
+ name: message.name,
54
+ messageId: message.id
55
+ // Pass messageId for HITL action correlation
53
56
  });
54
57
  if (!toRender && status === "complete") {
55
58
  return null;
@@ -121,4 +124,4 @@ function RenderActionExecutionMessage(_a) {
121
124
  export {
122
125
  RenderActionExecutionMessage
123
126
  };
124
- //# sourceMappingURL=chunk-UKCPOBQM.mjs.map
127
+ //# sourceMappingURL=chunk-53CVDVS5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/chat/messages/RenderActionExecutionMessage.tsx"],"sourcesContent":["import { MessageStatusCode } from \"@copilotkit/runtime-client-gql\";\nimport { RenderMessageProps } from \"../props\";\nimport { RenderFunctionStatus, useCopilotContext } from \"@copilotkit/react-core\";\nimport { AssistantMessage as DefaultAssistantMessage } from \"./AssistantMessage\";\n\nexport function RenderActionExecutionMessage({\n AssistantMessage = DefaultAssistantMessage,\n ...props\n}: RenderMessageProps) {\n const { chatComponentsCache } = useCopilotContext();\n const { message, inProgress, index, isCurrentMessage, actionResult } = props;\n\n if (message.isActionExecutionMessage()) {\n if (\n chatComponentsCache.current !== null &&\n (chatComponentsCache.current.actions[message.name] ||\n chatComponentsCache.current.actions[\"*\"])\n ) {\n const render =\n chatComponentsCache.current.actions[message.name] ||\n chatComponentsCache.current.actions[\"*\"];\n // render a static string\n if (typeof render === \"string\") {\n // when render is static, we show it only when in progress\n if (isCurrentMessage && inProgress) {\n return (\n <AssistantMessage\n rawData={message}\n key={index}\n data-message-role=\"assistant\"\n isLoading={false}\n isGenerating={true}\n message={render}\n />\n );\n }\n // Done - silent by default to avoid a series of \"done\" messages\n else {\n return null;\n }\n }\n // render is a function\n else {\n const args = message.arguments;\n\n let status: RenderFunctionStatus = \"inProgress\";\n\n if (actionResult !== undefined) {\n status = \"complete\";\n } else if (message.status.code !== MessageStatusCode.Pending) {\n status = \"executing\";\n }\n\n try {\n const toRender = render({\n status: status as any, // Cast to any as RenderFunctionStatus is a union that can be complex to narrow here\n args,\n result: actionResult,\n name: message.name,\n messageId: message.id, // Pass messageId for HITL action correlation\n } as any);\n // No result and complete: stay silent\n if (!toRender && status === \"complete\") {\n return null;\n }\n if (typeof toRender === \"string\") {\n return (\n <AssistantMessage\n rawData={message}\n data-message-role=\"assistant\"\n key={index}\n isLoading={false}\n isGenerating={false}\n message={toRender}\n />\n );\n } else {\n return (\n <AssistantMessage\n rawData={message}\n data-message-role=\"action-render\"\n key={index}\n isLoading={false}\n isGenerating={false}\n subComponent={toRender}\n />\n );\n }\n } catch (e) {\n // It's useful to log this error for developers to debug their custom render functions\n console.error(`Error executing render function for action ${message.name}: ${e}`);\n return (\n <AssistantMessage\n rawData={message}\n data-message-role=\"assistant\"\n key={index}\n isLoading={false}\n isGenerating={false}\n subComponent={\n <div className=\"copilotKitMessage copilotKitAssistantMessage\">\n <b>❌ Error executing render function for action {message.name}:</b>\n <pre>{e instanceof Error ? e.message : String(e)}</pre>\n </div>\n }\n />\n );\n }\n }\n }\n // No render function found- show the default message\n else if (!inProgress || !isCurrentMessage) {\n // Done - silent by default to avoid a series of \"done\" messages\n return null;\n } else {\n // In progress\n return (\n <AssistantMessage\n rawData={message}\n key={index}\n data-message-role=\"assistant\"\n isLoading={true}\n isGenerating={true}\n />\n );\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,yBAAyB;AAElC,SAA+B,yBAAyB;AAwB5C,cA0EM,YA1EN;AArBL,SAAS,6BAA6B,IAGtB;AAHsB,eAC3C;AAAA,sBAAAA,oBAAmB;AAAA,EANrB,IAK6C,IAExC,kBAFwC,IAExC;AAAA,IADH;AAAA;AAGA,QAAM,EAAE,oBAAoB,IAAI,kBAAkB;AAClD,QAAM,EAAE,SAAS,YAAY,OAAO,kBAAkB,aAAa,IAAI;AAEvE,MAAI,QAAQ,yBAAyB,GAAG;AACtC,QACE,oBAAoB,YAAY,SAC/B,oBAAoB,QAAQ,QAAQ,QA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AAS,GAAG;AAChF,iBACE;AAAA,YAACA;AAAA,YAAA;AAAA,cACC,SAAS;AAAA,cACT,qBAAkB;AAAA,cAElB,WAAW;AAAA,cACX,cAAc;AAAA,cACd,cACE,qBAAC,SAAI,WAAU,gDACb;AAAA,qCAAC,OAAE;AAAA;AAAA,kBAA8C,QAAQ;AAAA,kBAAK;AAAA,mBAAC;AAAA,gBAC/D,oBAAC,SAAK,uBAAa,QAAQ,EAAE,UAAU,OAAO,CAAC,GAAE;AAAA,iBACnD;AAAA;AAAA,YAPG;AAAA,UASP;AAAA,QAEJ;AAAA,MACF;AAAA,IACF,WAES,CAAC,cAAc,CAAC,kBAAkB;AAEzC,aAAO;AAAA,IACT,OAAO;AAEL,aACE;AAAA,QAACA;AAAA,QAAA;AAAA,UACC,SAAS;AAAA,UAET,qBAAkB;AAAA,UAClB,WAAW;AAAA,UACX,cAAc;AAAA;AAAA,QAHT;AAAA,MAIP;AAAA,IAEJ;AAAA,EACF;AACF;","names":["AssistantMessage"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CopilotModal
3
- } from "./chunk-OMIVNOML.mjs";
3
+ } from "./chunk-EQUUN7ZM.mjs";
4
4
  import {
5
5
  __spreadProps,
6
6
  __spreadValues
@@ -18,4 +18,4 @@ function CopilotPopup(props) {
18
18
  export {
19
19
  CopilotPopup
20
20
  };
21
- //# sourceMappingURL=chunk-AHVYHPVQ.mjs.map
21
+ //# sourceMappingURL=chunk-BP3RN6OE.mjs.map
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-UFN2VWSR.mjs";
10
10
  import {
11
11
  CopilotChat
12
- } from "./chunk-KQEMBE47.mjs";
12
+ } from "./chunk-4RAYX7ZX.mjs";
13
13
  import {
14
14
  AssistantMessage
15
15
  } from "./chunk-L3GZ7TXC.mjs";
@@ -141,4 +141,4 @@ var CopilotModal = (_a) => {
141
141
  export {
142
142
  CopilotModal
143
143
  };
144
- //# sourceMappingURL=chunk-OMIVNOML.mjs.map
144
+ //# sourceMappingURL=chunk-EQUUN7ZM.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CopilotModal
3
- } from "./chunk-OMIVNOML.mjs";
3
+ } from "./chunk-EQUUN7ZM.mjs";
4
4
  import {
5
5
  __spreadProps,
6
6
  __spreadValues
@@ -27,4 +27,4 @@ function CopilotSidebar(props) {
27
27
  export {
28
28
  CopilotSidebar
29
29
  };
30
- //# sourceMappingURL=chunk-2TJK4TTF.mjs.map
30
+ //# sourceMappingURL=chunk-TSDSBNOS.mjs.map
@@ -1593,9 +1593,12 @@ function RenderActionExecutionMessage(_a) {
1593
1593
  try {
1594
1594
  const toRender = render({
1595
1595
  status,
1596
+ // Cast to any as RenderFunctionStatus is a union that can be complex to narrow here
1596
1597
  args,
1597
1598
  result: actionResult,
1598
- name: message.name
1599
+ name: message.name,
1600
+ messageId: message.id
1601
+ // Pass messageId for HITL action correlation
1599
1602
  });
1600
1603
  if (!toRender && status === "complete") {
1601
1604
  return null;