@copilotkit/react-core 0.0.0-fix-use-warning-for-version-mismatch-20250212175807 → 0.0.0-fix-interrupt-issues-20250409144731

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 (180) hide show
  1. package/CHANGELOG.md +446 -5
  2. package/dist/{chunk-5M47BILE.mjs → chunk-37LXOL6B.mjs} +2 -2
  3. package/dist/{chunk-XERJQUHA.mjs → chunk-4CEQJ2X6.mjs} +2 -2
  4. package/dist/{chunk-XERJQUHA.mjs.map → chunk-4CEQJ2X6.mjs.map} +1 -1
  5. package/dist/{chunk-5K2FUI34.mjs → chunk-534J55RX.mjs} +19 -13
  6. package/dist/chunk-534J55RX.mjs.map +1 -0
  7. package/dist/chunk-6YOKPWQ7.mjs +1 -0
  8. package/dist/{chunk-HJWT7WXD.mjs → chunk-7VNK2RT2.mjs} +153 -80
  9. package/dist/chunk-7VNK2RT2.mjs.map +1 -0
  10. package/dist/{chunk-ZAU4EMBM.mjs → chunk-7XNZHQWJ.mjs} +5 -6
  11. package/dist/chunk-7XNZHQWJ.mjs.map +1 -0
  12. package/dist/{chunk-7HWSAEOY.mjs → chunk-AT4ALBK4.mjs} +13 -4
  13. package/dist/{chunk-7HWSAEOY.mjs.map → chunk-AT4ALBK4.mjs.map} +1 -1
  14. package/dist/chunk-CQPYJIBH.mjs +1 -0
  15. package/dist/{chunk-CUMF2APV.mjs → chunk-FIMW65V5.mjs} +59 -47
  16. package/dist/chunk-FIMW65V5.mjs.map +1 -0
  17. package/dist/{chunk-2RDVL7EU.mjs → chunk-GOZVY5WH.mjs} +10 -7
  18. package/dist/chunk-GOZVY5WH.mjs.map +1 -0
  19. package/dist/{chunk-XOHLZIZK.mjs → chunk-JHPCDBBM.mjs} +2 -2
  20. package/dist/{chunk-24PU4QRT.mjs → chunk-M5U4XPDV.mjs} +4 -5
  21. package/dist/chunk-M5U4XPDV.mjs.map +1 -0
  22. package/dist/{chunk-CUSSPNG5.mjs → chunk-NY3BUYYZ.mjs} +17 -3
  23. package/dist/chunk-NY3BUYYZ.mjs.map +1 -0
  24. package/dist/chunk-O3IIH54P.mjs +24 -0
  25. package/dist/chunk-O3IIH54P.mjs.map +1 -0
  26. package/dist/{chunk-DB25UMNI.mjs → chunk-OKBPP25E.mjs} +23 -12
  27. package/dist/chunk-OKBPP25E.mjs.map +1 -0
  28. package/dist/{chunk-ZM56S3LJ.mjs → chunk-PTSWFERP.mjs} +3 -1
  29. package/dist/chunk-PTSWFERP.mjs.map +1 -0
  30. package/dist/{chunk-2VIL3F36.mjs → chunk-SGXCSXCK.mjs} +26 -3
  31. package/dist/chunk-SGXCSXCK.mjs.map +1 -0
  32. package/dist/{chunk-WSOA4BGM.mjs → chunk-XFL2DWUF.mjs} +3 -3
  33. package/dist/{chunk-MIUILUVX.mjs → chunk-YI7LPACV.mjs} +3 -3
  34. package/dist/chunk-YPBKY4KY.mjs +1 -0
  35. package/dist/chunk-YPBKY4KY.mjs.map +1 -0
  36. package/dist/components/copilot-provider/copilot-messages.js +2 -0
  37. package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
  38. package/dist/components/copilot-provider/copilot-messages.mjs +2 -2
  39. package/dist/components/copilot-provider/copilotkit-props.d.ts +1 -2
  40. package/dist/components/copilot-provider/copilotkit.d.ts +1 -2
  41. package/dist/components/copilot-provider/copilotkit.js +41 -22
  42. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  43. package/dist/components/copilot-provider/copilotkit.mjs +5 -5
  44. package/dist/components/copilot-provider/index.d.ts +1 -2
  45. package/dist/components/copilot-provider/index.js +41 -22
  46. package/dist/components/copilot-provider/index.js.map +1 -1
  47. package/dist/components/copilot-provider/index.mjs +5 -5
  48. package/dist/components/error-boundary/error-boundary.d.ts +1 -1
  49. package/dist/components/error-boundary/error-boundary.js +18 -12
  50. package/dist/components/error-boundary/error-boundary.js.map +1 -1
  51. package/dist/components/error-boundary/error-boundary.mjs +1 -1
  52. package/dist/components/index.d.ts +1 -2
  53. package/dist/components/index.js +41 -22
  54. package/dist/components/index.js.map +1 -1
  55. package/dist/components/index.mjs +5 -5
  56. package/dist/context/copilot-context.d.ts +10 -148
  57. package/dist/context/copilot-context.js +2 -0
  58. package/dist/context/copilot-context.js.map +1 -1
  59. package/dist/context/copilot-context.mjs +1 -1
  60. package/dist/context/index.d.ts +1 -2
  61. package/dist/context/index.js +2 -0
  62. package/dist/context/index.js.map +1 -1
  63. package/dist/context/index.mjs +1 -1
  64. package/dist/copilot-context-c402f48d.d.ts +185 -0
  65. package/dist/hooks/index.d.ts +2 -2
  66. package/dist/hooks/index.js +291 -143
  67. package/dist/hooks/index.js.map +1 -1
  68. package/dist/hooks/index.mjs +21 -17
  69. package/dist/hooks/use-chat.d.ts +2 -3
  70. package/dist/hooks/use-chat.js +150 -80
  71. package/dist/hooks/use-chat.js.map +1 -1
  72. package/dist/hooks/use-chat.mjs +2 -2
  73. package/dist/hooks/use-coagent-state-render.d.ts +1 -1
  74. package/dist/hooks/use-coagent-state-render.js +26 -1
  75. package/dist/hooks/use-coagent-state-render.js.map +1 -1
  76. package/dist/hooks/use-coagent-state-render.mjs +2 -2
  77. package/dist/hooks/use-coagent.d.ts +13 -2
  78. package/dist/hooks/use-coagent.js +216 -129
  79. package/dist/hooks/use-coagent.js.map +1 -1
  80. package/dist/hooks/use-coagent.mjs +9 -9
  81. package/dist/hooks/use-copilot-action.js +15 -0
  82. package/dist/hooks/use-copilot-action.js.map +1 -1
  83. package/dist/hooks/use-copilot-action.mjs +2 -2
  84. package/dist/hooks/use-copilot-additional-instructions.d.ts +26 -0
  85. package/dist/hooks/use-copilot-additional-instructions.js +162 -0
  86. package/dist/hooks/use-copilot-additional-instructions.js.map +1 -0
  87. package/dist/hooks/use-copilot-additional-instructions.mjs +9 -0
  88. package/dist/hooks/use-copilot-additional-instructions.mjs.map +1 -0
  89. package/dist/hooks/use-copilot-authenticated-action.js +15 -0
  90. package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
  91. package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
  92. package/dist/hooks/use-copilot-chat.d.ts +2 -3
  93. package/dist/hooks/use-copilot-chat.js +161 -86
  94. package/dist/hooks/use-copilot-chat.js.map +1 -1
  95. package/dist/hooks/use-copilot-chat.mjs +8 -8
  96. package/dist/hooks/use-copilot-readable.d.ts +5 -1
  97. package/dist/hooks/use-copilot-readable.js +13 -2
  98. package/dist/hooks/use-copilot-readable.js.map +1 -1
  99. package/dist/hooks/use-copilot-readable.mjs +2 -2
  100. package/dist/hooks/use-langgraph-interrupt-render.js +5 -4
  101. package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
  102. package/dist/hooks/use-langgraph-interrupt-render.mjs +2 -2
  103. package/dist/hooks/use-langgraph-interrupt.d.ts +10 -3
  104. package/dist/hooks/use-langgraph-interrupt.js +162 -88
  105. package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
  106. package/dist/hooks/use-langgraph-interrupt.mjs +9 -9
  107. package/dist/hooks/use-make-copilot-document-readable.js +2 -0
  108. package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
  109. package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
  110. package/dist/index.d.ts +4 -3
  111. package/dist/index.js +346 -181
  112. package/dist/index.js.map +1 -1
  113. package/dist/index.mjs +24 -19
  114. package/dist/lib/copilot-task.d.ts +1 -2
  115. package/dist/lib/copilot-task.js +1 -1
  116. package/dist/lib/copilot-task.js.map +1 -1
  117. package/dist/lib/copilot-task.mjs +7 -7
  118. package/dist/lib/index.d.ts +1 -2
  119. package/dist/lib/index.js +1 -1
  120. package/dist/lib/index.js.map +1 -1
  121. package/dist/lib/index.mjs +7 -7
  122. package/dist/types/coagent-state.d.ts +1 -0
  123. package/dist/types/coagent-state.js.map +1 -1
  124. package/dist/types/crew.d.ts +79 -0
  125. package/dist/types/crew.js +19 -0
  126. package/dist/types/crew.js.map +1 -0
  127. package/dist/types/crew.mjs +2 -0
  128. package/dist/types/crew.mjs.map +1 -0
  129. package/dist/types/frontend-action.d.ts +2 -1
  130. package/dist/types/frontend-action.js +1 -1
  131. package/dist/types/frontend-action.js.map +1 -1
  132. package/dist/types/frontend-action.mjs +1 -1
  133. package/dist/types/index.d.ts +2 -1
  134. package/dist/types/index.js.map +1 -1
  135. package/dist/types/index.mjs +2 -1
  136. package/dist/types/interrupt-action.d.ts +10 -35
  137. package/dist/types/interrupt-action.js.map +1 -1
  138. package/dist/utils/extract.d.ts +1 -2
  139. package/dist/utils/extract.js.map +1 -1
  140. package/dist/utils/extract.mjs +5 -5
  141. package/dist/utils/index.d.ts +1 -2
  142. package/dist/utils/index.js.map +1 -1
  143. package/dist/utils/index.mjs +5 -5
  144. package/package.json +3 -3
  145. package/src/components/copilot-provider/copilotkit.tsx +17 -4
  146. package/src/components/error-boundary/error-boundary.tsx +24 -13
  147. package/src/context/copilot-context.tsx +6 -0
  148. package/src/hooks/index.ts +1 -0
  149. package/src/hooks/use-chat.ts +175 -75
  150. package/src/hooks/use-coagent-state-render.ts +38 -2
  151. package/src/hooks/use-coagent.ts +82 -55
  152. package/src/hooks/use-copilot-action.ts +16 -0
  153. package/src/hooks/use-copilot-additional-instructions.ts +85 -0
  154. package/src/hooks/use-copilot-chat.ts +9 -5
  155. package/src/hooks/use-copilot-readable.ts +16 -2
  156. package/src/hooks/use-langgraph-interrupt-render.ts +7 -3
  157. package/src/hooks/use-langgraph-interrupt.ts +3 -4
  158. package/src/types/coagent-state.ts +1 -0
  159. package/src/types/crew.ts +89 -0
  160. package/src/types/frontend-action.ts +5 -2
  161. package/src/types/index.ts +8 -0
  162. package/src/types/interrupt-action.ts +17 -13
  163. package/dist/chunk-24PU4QRT.mjs.map +0 -1
  164. package/dist/chunk-2RDVL7EU.mjs.map +0 -1
  165. package/dist/chunk-2VIL3F36.mjs.map +0 -1
  166. package/dist/chunk-5K2FUI34.mjs.map +0 -1
  167. package/dist/chunk-CUMF2APV.mjs.map +0 -1
  168. package/dist/chunk-CUSSPNG5.mjs.map +0 -1
  169. package/dist/chunk-DB25UMNI.mjs.map +0 -1
  170. package/dist/chunk-EFZPSZWO.mjs +0 -1
  171. package/dist/chunk-HJWT7WXD.mjs.map +0 -1
  172. package/dist/chunk-IGLITGLC.mjs +0 -1
  173. package/dist/chunk-ZAU4EMBM.mjs.map +0 -1
  174. package/dist/chunk-ZM56S3LJ.mjs.map +0 -1
  175. /package/dist/{chunk-5M47BILE.mjs.map → chunk-37LXOL6B.mjs.map} +0 -0
  176. /package/dist/{chunk-EFZPSZWO.mjs.map → chunk-6YOKPWQ7.mjs.map} +0 -0
  177. /package/dist/{chunk-IGLITGLC.mjs.map → chunk-CQPYJIBH.mjs.map} +0 -0
  178. /package/dist/{chunk-XOHLZIZK.mjs.map → chunk-JHPCDBBM.mjs.map} +0 -0
  179. /package/dist/{chunk-WSOA4BGM.mjs.map → chunk-XFL2DWUF.mjs.map} +0 -0
  180. /package/dist/{chunk-MIUILUVX.mjs.map → chunk-YI7LPACV.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,14 +1,455 @@
1
1
  # ui
2
2
 
3
- ## 0.0.0-fix-use-warning-for-version-mismatch-20250212175807
3
+ ## 0.0.0-fix-interrupt-issues-20250409144731
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - d471548: - fix: use warning when version mismatch is not expected to error out
7
+ - b817a9f: - fix: fix how results are communicated back on interrupt
8
+ - fix: do not allow followup for interrupt actions
9
+ - chore: improve TS docs for interrupt
10
+ - d0e8a1e: - fix: fix duplicate messages on regenerate
11
+ - @copilotkit/runtime-client-gql@0.0.0-fix-interrupt-issues-20250409144731
12
+ - @copilotkit/shared@0.0.0-fix-interrupt-issues-20250409144731
13
+
14
+ ## 1.8.5-next.2
15
+
16
+ ### Patch Changes
17
+
18
+ - @copilotkit/runtime-client-gql@1.8.5-next.2
19
+ - @copilotkit/shared@1.8.5-next.2
20
+
21
+ ## 1.8.5-next.1
22
+
23
+ ### Patch Changes
24
+
25
+ - d0e8a1e: - fix: fix duplicate messages on regenerate
26
+ - @copilotkit/runtime-client-gql@1.8.5-next.1
27
+ - @copilotkit/shared@1.8.5-next.1
28
+
29
+ ## 1.8.5-next.0
30
+
31
+ ### Patch Changes
32
+
33
+ - @copilotkit/runtime-client-gql@1.8.5-next.0
34
+ - @copilotkit/shared@1.8.5-next.0
35
+
36
+ ## 1.8.4
37
+
38
+ ### Patch Changes
39
+
40
+ - 4e28414: - use new interface properly
41
+ - Updated dependencies [f363760]
42
+ - @copilotkit/shared@1.8.4
43
+ - @copilotkit/runtime-client-gql@1.8.4
44
+
45
+ ## 1.8.4-next.4
46
+
47
+ ### Patch Changes
48
+
49
+ - 4e28414: - use new interface properly
50
+ - @copilotkit/runtime-client-gql@1.8.4-next.4
51
+ - @copilotkit/shared@1.8.4-next.4
52
+
53
+ ## 1.8.4-next.3
54
+
55
+ ### Patch Changes
56
+
57
+ - @copilotkit/runtime-client-gql@1.8.4-next.3
58
+ - @copilotkit/shared@1.8.4-next.3
59
+
60
+ ## 1.8.4-next.2
61
+
62
+ ### Patch Changes
63
+
64
+ - @copilotkit/runtime-client-gql@1.8.4-next.2
65
+ - @copilotkit/shared@1.8.4-next.2
66
+
67
+ ## 1.8.4-next.1
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies [f363760]
72
+ - @copilotkit/shared@1.8.4-next.1
73
+ - @copilotkit/runtime-client-gql@1.8.4-next.1
74
+
75
+ ## 1.8.4-next.0
76
+
77
+ ### Patch Changes
78
+
79
+ - @copilotkit/runtime-client-gql@1.8.4-next.0
80
+ - @copilotkit/shared@1.8.4-next.0
81
+
82
+ ## 1.8.3
83
+
84
+ ### Patch Changes
85
+
86
+ - @copilotkit/runtime-client-gql@1.8.3
87
+ - @copilotkit/shared@1.8.3
88
+
89
+ ## 1.8.3-next.0
90
+
91
+ ### Patch Changes
92
+
93
+ - @copilotkit/runtime-client-gql@1.8.3-next.0
94
+ - @copilotkit/shared@1.8.3-next.0
95
+
96
+ ## 1.8.2-next.3
97
+
98
+ ### Patch Changes
99
+
100
+ - @copilotkit/runtime-client-gql@1.8.2-next.3
101
+ - @copilotkit/shared@1.8.2-next.3
102
+
103
+ ## 1.8.2-next.2
104
+
105
+ ### Patch Changes
106
+
107
+ - @copilotkit/runtime-client-gql@1.8.2-next.2
108
+ - @copilotkit/shared@1.8.2-next.2
109
+
110
+ ## 1.8.2-next.1
111
+
112
+ ### Patch Changes
113
+
114
+ - @copilotkit/runtime-client-gql@1.8.2-next.1
115
+ - @copilotkit/shared@1.8.2-next.1
116
+
117
+ ## 1.8.2-next.0
118
+
119
+ ### Patch Changes
120
+
121
+ - @copilotkit/runtime-client-gql@1.8.2-next.0
122
+ - @copilotkit/shared@1.8.2-next.0
123
+
124
+ ## 1.8.1
125
+
126
+ ### Patch Changes
127
+
128
+ - 7a42944: - fix(react-core): update agentSession when agent props change #1497
129
+ - @copilotkit/runtime-client-gql@1.8.1
130
+ - @copilotkit/shared@1.8.1
131
+
132
+ ## 1.8.1-next.1
133
+
134
+ ### Patch Changes
135
+
136
+ - @copilotkit/runtime-client-gql@1.8.1-next.1
137
+ - @copilotkit/shared@1.8.1-next.1
138
+
139
+ ## 1.8.1-next.0
140
+
141
+ ### Patch Changes
142
+
143
+ - 7a42944: - fix(react-core): update agentSession when agent props change #1497
144
+ - @copilotkit/runtime-client-gql@1.8.1-next.0
145
+ - @copilotkit/shared@1.8.1-next.0
146
+
147
+ ## 1.8.0
148
+
149
+ ### Patch Changes
150
+
151
+ - 73f5eaa: - fix(react-core): export missing action-related types for public API
152
+ - a50f4c1: - move default components out of ui
153
+ - @copilotkit/runtime-client-gql@1.8.0
154
+ - @copilotkit/shared@1.8.0
155
+
156
+ ## 1.8.0-next.8
157
+
158
+ ### Patch Changes
159
+
160
+ - @copilotkit/runtime-client-gql@1.8.0-next.8
161
+ - @copilotkit/shared@1.8.0-next.8
162
+
163
+ ## 1.8.0-next.7
164
+
165
+ ### Patch Changes
166
+
167
+ - @copilotkit/runtime-client-gql@1.8.0-next.7
168
+ - @copilotkit/shared@1.8.0-next.7
169
+
170
+ ## 1.8.0-next.6
171
+
172
+ ### Patch Changes
173
+
174
+ - @copilotkit/runtime-client-gql@1.8.0-next.6
175
+ - @copilotkit/shared@1.8.0-next.6
176
+
177
+ ## 1.8.0-next.5
178
+
179
+ ### Patch Changes
180
+
181
+ - a50f4c1: - move default components out of ui
182
+ - @copilotkit/runtime-client-gql@1.8.0-next.5
183
+ - @copilotkit/shared@1.8.0-next.5
184
+
185
+ ## 1.8.0-next.4
186
+
187
+ ### Patch Changes
188
+
189
+ - @copilotkit/runtime-client-gql@1.8.0-next.4
190
+ - @copilotkit/shared@1.8.0-next.4
191
+
192
+ ## 1.8.0-next.3
193
+
194
+ ### Patch Changes
195
+
196
+ - @copilotkit/runtime-client-gql@1.8.0-next.3
197
+ - @copilotkit/shared@1.8.0-next.3
198
+
199
+ ## 1.7.2-next.2
200
+
201
+ ### Patch Changes
202
+
203
+ - @copilotkit/runtime-client-gql@1.7.2-next.2
204
+ - @copilotkit/shared@1.7.2-next.2
205
+
206
+ ## 1.7.2-next.1
207
+
208
+ ### Patch Changes
209
+
210
+ - 73f5eaa: - fix(react-core): export missing action-related types for public API
211
+ - @copilotkit/runtime-client-gql@1.7.2-next.1
212
+ - @copilotkit/shared@1.7.2-next.1
213
+
214
+ ## 1.7.2-next.0
215
+
216
+ ### Patch Changes
217
+
218
+ - @copilotkit/runtime-client-gql@1.7.2-next.0
219
+ - @copilotkit/shared@1.7.2-next.0
220
+
221
+ ## 1.7.1
222
+
223
+ ### Patch Changes
224
+
225
+ - @copilotkit/runtime-client-gql@1.7.1
226
+ - @copilotkit/shared@1.7.1
227
+
228
+ ## 1.7.1-next.0
229
+
230
+ ### Patch Changes
231
+
232
+ - @copilotkit/runtime-client-gql@1.7.1-next.0
233
+ - @copilotkit/shared@1.7.1-next.0
234
+
235
+ ## 1.7.0
236
+
237
+ ### Patch Changes
238
+
239
+ - @copilotkit/runtime-client-gql@1.7.0
240
+ - @copilotkit/shared@1.7.0
241
+
242
+ ## 1.7.0-next.1
243
+
244
+ ### Patch Changes
245
+
246
+ - @copilotkit/runtime-client-gql@1.7.0-next.1
247
+ - @copilotkit/shared@1.7.0-next.1
248
+
249
+ ## 1.7.0-next.0
250
+
251
+ ### Patch Changes
252
+
253
+ - @copilotkit/runtime-client-gql@1.7.0-next.0
254
+ - @copilotkit/shared@1.7.0-next.0
255
+
256
+ ## 1.6.0
257
+
258
+ ### Minor Changes
259
+
260
+ - 7d061d9: - feat(configurable): execute langgraph with user config
261
+
262
+ ### Patch Changes
263
+
264
+ - d833f4c: - fix: provide the ability to type interrupt event value
265
+ - d800f03: - fix: use memoization in useCoAgent internal functions
266
+ - 85753b3: - feat(actions): enable restricting actions to frontend only
267
+ - b454827: - fix: simplify condition options for langgraph interrupts
268
+ - chore: add new enabled to e2e tests
269
+ - fix: refine argument types
270
+ - chore: document hook API reference
271
+ - c1cc77f: - feat: new useCopilotAdditionalInstructions hook and available property on useCopilotReadable
272
+ - Updated dependencies [d833f4c]
273
+ - Updated dependencies [090203d]
274
+ - @copilotkit/runtime-client-gql@1.6.0
275
+ - @copilotkit/shared@1.6.0
276
+
277
+ ## 1.6.0-next.12
278
+
279
+ ### Patch Changes
280
+
281
+ - @copilotkit/runtime-client-gql@1.6.0-next.12
282
+ - @copilotkit/shared@1.6.0-next.12
283
+
284
+ ## 1.6.0-next.11
285
+
286
+ ### Patch Changes
287
+
288
+ - 85753b3: - feat(actions): enable restricting actions to frontend only
289
+ - @copilotkit/runtime-client-gql@1.6.0-next.11
290
+ - @copilotkit/shared@1.6.0-next.11
291
+
292
+ ## 1.6.0-next.10
293
+
294
+ ### Patch Changes
295
+
296
+ - @copilotkit/runtime-client-gql@1.6.0-next.10
297
+ - @copilotkit/shared@1.6.0-next.10
298
+
299
+ ## 1.6.0-next.9
300
+
301
+ ### Patch Changes
302
+
303
+ - @copilotkit/runtime-client-gql@1.6.0-next.9
304
+ - @copilotkit/shared@1.6.0-next.9
305
+
306
+ ## 1.6.0-next.8
307
+
308
+ ### Patch Changes
309
+
310
+ - @copilotkit/runtime-client-gql@1.6.0-next.8
311
+ - @copilotkit/shared@1.6.0-next.8
312
+
313
+ ## 1.6.0-next.7
314
+
315
+ ### Patch Changes
316
+
317
+ - d800f03: - fix: use memoization in useCoAgent internal functions
318
+ - @copilotkit/runtime-client-gql@1.6.0-next.7
319
+ - @copilotkit/shared@1.6.0-next.7
320
+
321
+ ## 1.6.0-next.6
322
+
323
+ ### Patch Changes
324
+
325
+ - @copilotkit/runtime-client-gql@1.6.0-next.6
326
+ - @copilotkit/shared@1.6.0-next.6
327
+
328
+ ## 1.6.0-next.5
329
+
330
+ ### Patch Changes
331
+
332
+ - Updated dependencies [090203d]
333
+ - @copilotkit/shared@1.6.0-next.5
334
+ - @copilotkit/runtime-client-gql@1.6.0-next.5
335
+
336
+ ## 1.6.0-next.4
337
+
338
+ ### Patch Changes
339
+
340
+ - @copilotkit/runtime-client-gql@1.6.0-next.4
341
+ - @copilotkit/shared@1.6.0-next.4
342
+
343
+ ## 1.6.0-next.3
344
+
345
+ ### Patch Changes
346
+
347
+ - @copilotkit/runtime-client-gql@1.6.0-next.3
348
+ - @copilotkit/shared@1.6.0-next.3
349
+
350
+ ## 1.6.0-next.2
351
+
352
+ ### Patch Changes
353
+
354
+ - b454827: - fix: simplify condition options for langgraph interrupts
355
+ - chore: add new enabled to e2e tests
356
+ - fix: refine argument types
357
+ - chore: document hook API reference
358
+ - @copilotkit/runtime-client-gql@1.6.0-next.2
359
+ - @copilotkit/shared@1.6.0-next.2
360
+
361
+ ## 1.6.0-next.1
362
+
363
+ ### Patch Changes
364
+
365
+ - d833f4c: - fix: provide the ability to type interrupt event value
366
+ - Updated dependencies [d833f4c]
367
+ - @copilotkit/runtime-client-gql@1.6.0-next.1
368
+ - @copilotkit/shared@1.6.0-next.1
369
+
370
+ ## 1.6.0-next.0
371
+
372
+ ### Minor Changes
373
+
374
+ - 7d061d9: - feat(configurable): execute langgraph with user config
375
+
376
+ ### Patch Changes
377
+
378
+ - @copilotkit/runtime-client-gql@1.6.0-next.0
379
+ - @copilotkit/shared@1.6.0-next.0
380
+
381
+ ## 1.5.20
382
+
383
+ ### Patch Changes
384
+
385
+ - Updated dependencies [51f0d66]
386
+ - @copilotkit/shared@1.5.20
387
+ - @copilotkit/runtime-client-gql@1.5.20
388
+
389
+ ## 1.5.20-next.0
390
+
391
+ ### Patch Changes
392
+
393
+ - Updated dependencies [51f0d66]
394
+ - @copilotkit/shared@1.5.20-next.0
395
+ - @copilotkit/runtime-client-gql@1.5.20-next.0
396
+
397
+ ## 1.5.19
398
+
399
+ ### Patch Changes
400
+
401
+ - 0dd1ab9: - fix(errors): allow non copilotkit errors to pass to consumer app error boundary
402
+ - 5bc68f8: - fix(actions): warn on action duplication
403
+ - fix(actions): warn on coagent state render duplication
404
+ - Updated dependencies [0dd1ab9]
405
+ - @copilotkit/shared@1.5.19
406
+ - @copilotkit/runtime-client-gql@1.5.19
407
+
408
+ ## 1.5.19-next.1
409
+
410
+ ### Patch Changes
411
+
412
+ - 0dd1ab9: - fix(errors): allow non copilotkit errors to pass to consumer app error boundary
413
+ - Updated dependencies [0dd1ab9]
414
+ - @copilotkit/shared@1.5.19-next.1
415
+ - @copilotkit/runtime-client-gql@1.5.19-next.1
416
+
417
+ ## 1.5.19-next.0
418
+
419
+ ### Patch Changes
420
+
421
+ - 5bc68f8: - fix(actions): warn on action duplication
422
+ - fix(actions): warn on coagent state render duplication
423
+ - @copilotkit/runtime-client-gql@1.5.19-next.0
424
+ - @copilotkit/shared@1.5.19-next.0
425
+
426
+ ## 1.5.18
427
+
428
+ ### Patch Changes
429
+
430
+ - f77a7b9: - fix: use warning when version mismatch is not expected to error out
8
431
  - Updated dependencies [d47cd26]
9
- - Updated dependencies [d471548]
10
- - @copilotkit/runtime-client-gql@0.0.0-fix-use-warning-for-version-mismatch-20250212175807
11
- - @copilotkit/shared@0.0.0-fix-use-warning-for-version-mismatch-20250212175807
432
+ - Updated dependencies [f77a7b9]
433
+ - Updated dependencies [38d3ac2]
434
+ - @copilotkit/runtime-client-gql@1.5.18
435
+ - @copilotkit/shared@1.5.18
436
+
437
+ ## 1.5.18-next.3
438
+
439
+ ### Patch Changes
440
+
441
+ - f77a7b9: - fix: use warning when version mismatch is not expected to error out
442
+ - Updated dependencies [f77a7b9]
443
+ - @copilotkit/runtime-client-gql@1.5.18-next.3
444
+ - @copilotkit/shared@1.5.18-next.3
445
+
446
+ ## 1.5.18-next.2
447
+
448
+ ### Patch Changes
449
+
450
+ - Updated dependencies [38d3ac2]
451
+ - @copilotkit/shared@1.5.18-next.2
452
+ - @copilotkit/runtime-client-gql@1.5.18-next.2
12
453
 
13
454
  ## 1.5.18-next.1
14
455
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useCopilotContext
3
- } from "./chunk-ZM56S3LJ.mjs";
3
+ } from "./chunk-PTSWFERP.mjs";
4
4
  import {
5
5
  CopilotMessagesContext
6
6
  } from "./chunk-DCTJZ742.mjs";
@@ -60,4 +60,4 @@ function CopilotMessages({ children }) {
60
60
  export {
61
61
  CopilotMessages
62
62
  };
63
- //# sourceMappingURL=chunk-5M47BILE.mjs.map
63
+ //# sourceMappingURL=chunk-37LXOL6B.mjs.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "@copilotkit/shared";
6
6
  function processActionsForRuntimeRequest(actions) {
7
7
  const filteredActions = actions.filter(
8
- (action) => action.available !== ActionInputAvailability.Disabled && action.disabled !== true && action.name !== "*"
8
+ (action) => action.available !== ActionInputAvailability.Disabled && action.disabled !== true && action.name !== "*" && action.available != "frontend" && !action.pairedAction
9
9
  ).map((action) => {
10
10
  let available = ActionInputAvailability.Enabled;
11
11
  if (action.disabled) {
@@ -28,4 +28,4 @@ function processActionsForRuntimeRequest(actions) {
28
28
  export {
29
29
  processActionsForRuntimeRequest
30
30
  };
31
- //# sourceMappingURL=chunk-XERJQUHA.mjs.map
31
+ //# sourceMappingURL=chunk-4CEQJ2X6.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/frontend-action.ts"],"sourcesContent":["import { ActionInputAvailability } from \"@copilotkit/runtime-client-gql\";\nimport {\n Action,\n Parameter,\n MappedParameterTypes,\n actionParametersToJsonSchema,\n} from \"@copilotkit/shared\";\nimport React from \"react\";\n\ninterface InProgressState<T extends Parameter[] | [] = []> {\n status: \"inProgress\";\n args: Partial<MappedParameterTypes<T>>;\n result: undefined;\n}\n\ninterface ExecutingState<T extends Parameter[] | [] = []> {\n status: \"executing\";\n args: MappedParameterTypes<T>;\n result: undefined;\n}\n\ninterface CompleteState<T extends Parameter[] | [] = []> {\n status: \"complete\";\n args: MappedParameterTypes<T>;\n result: any;\n}\n\ninterface InProgressStateNoArgs<T extends Parameter[] | [] = []> {\n status: \"inProgress\";\n args: Partial<MappedParameterTypes<T>>;\n result: undefined;\n}\n\ninterface ExecutingStateNoArgs<T extends Parameter[] | [] = []> {\n status: \"executing\";\n args: MappedParameterTypes<T>;\n result: undefined;\n}\n\ninterface CompleteStateNoArgs<T extends Parameter[] | [] = []> {\n status: \"complete\";\n args: MappedParameterTypes<T>;\n result: any;\n}\n\ninterface InProgressStateWait<T extends Parameter[] | [] = []> {\n status: \"inProgress\";\n args: Partial<MappedParameterTypes<T>>;\n /** @deprecated use respond instead */\n handler: undefined;\n respond: undefined;\n result: undefined;\n}\n\ninterface ExecutingStateWait<T extends Parameter[] | [] = []> {\n status: \"executing\";\n args: MappedParameterTypes<T>;\n /** @deprecated use respond instead */\n handler: (result: any) => void;\n respond: (result: any) => void;\n result: undefined;\n}\n\ninterface CompleteStateWait<T extends Parameter[] | [] = []> {\n status: \"complete\";\n args: MappedParameterTypes<T>;\n /** @deprecated use respond instead */\n handler: undefined;\n respond: undefined;\n result: any;\n}\n\ninterface InProgressStateNoArgsWait<T extends Parameter[] | [] = []> {\n status: \"inProgress\";\n args: Partial<MappedParameterTypes<T>>;\n /** @deprecated use respond instead */\n handler: undefined;\n respond: undefined;\n result: undefined;\n}\n\ninterface ExecutingStateNoArgsWait<T extends Parameter[] | [] = []> {\n status: \"executing\";\n args: MappedParameterTypes<T>;\n /** @deprecated use respond instead */\n handler: (result: any) => void;\n respond: (result: any) => void;\n result: undefined;\n}\n\ninterface CompleteStateNoArgsWait<T extends Parameter[] | [] = []> {\n status: \"complete\";\n args: MappedParameterTypes<T>;\n /** @deprecated use respond instead */\n handler: undefined;\n respond: undefined;\n}\n\nexport type ActionRenderProps<T extends Parameter[] | [] = []> =\n | CompleteState<T>\n | ExecutingState<T>\n | InProgressState<T>;\n\nexport type ActionRenderPropsNoArgs<T extends Parameter[] | [] = []> =\n | CompleteStateNoArgs<T>\n | ExecutingStateNoArgs<T>\n | InProgressStateNoArgs<T>;\n\nexport type ActionRenderPropsWait<T extends Parameter[] | [] = []> =\n | CompleteStateWait<T>\n | ExecutingStateWait<T>\n | InProgressStateWait<T>;\n\nexport type ActionRenderPropsNoArgsWait<T extends Parameter[] | [] = []> =\n | CompleteStateNoArgsWait<T>\n | ExecutingStateNoArgsWait<T>\n | InProgressStateNoArgsWait<T>;\n\nexport type CatchAllActionRenderProps<T extends Parameter[] | [] = []> =\n | (CompleteState<T> & {\n name: string;\n })\n | (ExecutingState<T> & {\n name: string;\n })\n | (InProgressState<T> & {\n name: string;\n });\n\nexport type FrontendActionAvailability = \"disabled\" | \"enabled\" | \"remote\";\n\nexport type FrontendAction<\n T extends Parameter[] | [] = [],\n N extends string = string,\n> = Action<T> & {\n name: Exclude<N, \"*\">;\n /**\n * @deprecated Use `available` instead.\n */\n disabled?: boolean;\n available?: FrontendActionAvailability;\n followUp?: boolean;\n} & (\n | {\n render?:\n | string\n | (T extends []\n ? (props: ActionRenderPropsNoArgs<T>) => string | React.ReactElement\n : (props: ActionRenderProps<T>) => string | React.ReactElement);\n /** @deprecated use renderAndWaitForResponse instead */\n renderAndWait?: never;\n renderAndWaitForResponse?: never;\n }\n | {\n render?: never;\n /** @deprecated use renderAndWaitForResponse instead */\n renderAndWait?: T extends []\n ? (props: ActionRenderPropsNoArgsWait<T>) => React.ReactElement\n : (props: ActionRenderPropsWait<T>) => React.ReactElement;\n renderAndWaitForResponse?: T extends []\n ? (props: ActionRenderPropsNoArgsWait<T>) => React.ReactElement\n : (props: ActionRenderPropsWait<T>) => React.ReactElement;\n handler?: never;\n }\n );\n\nexport type CatchAllFrontendAction = {\n name: \"*\";\n render: (props: CatchAllActionRenderProps<any>) => React.ReactElement;\n};\n\nexport type RenderFunctionStatus = ActionRenderProps<any>[\"status\"];\n\nexport function processActionsForRuntimeRequest(actions: FrontendAction<any>[]) {\n const filteredActions = actions\n .filter(\n (action) =>\n action.available !== ActionInputAvailability.Disabled &&\n action.disabled !== true &&\n action.name !== \"*\",\n )\n .map((action) => {\n let available: ActionInputAvailability | undefined = ActionInputAvailability.Enabled;\n if (action.disabled) {\n available = ActionInputAvailability.Disabled;\n } else if (action.available === \"disabled\") {\n available = ActionInputAvailability.Disabled;\n } else if (action.available === \"remote\") {\n available = ActionInputAvailability.Remote;\n }\n return {\n name: action.name,\n description: action.description || \"\",\n jsonSchema: JSON.stringify(actionParametersToJsonSchema(action.parameters || [])),\n available,\n };\n });\n return filteredActions;\n}\n"],"mappings":";AAAA,SAAS,+BAA+B;AACxC;AAAA,EAIE;AAAA,OACK;AAuKA,SAAS,gCAAgC,SAAgC;AAC9E,QAAM,kBAAkB,QACrB;AAAA,IACC,CAAC,WACC,OAAO,cAAc,wBAAwB,YAC7C,OAAO,aAAa,QACpB,OAAO,SAAS;AAAA,EACpB,EACC,IAAI,CAAC,WAAW;AACf,QAAI,YAAiD,wBAAwB;AAC7E,QAAI,OAAO,UAAU;AACnB,kBAAY,wBAAwB;AAAA,IACtC,WAAW,OAAO,cAAc,YAAY;AAC1C,kBAAY,wBAAwB;AAAA,IACtC,WAAW,OAAO,cAAc,UAAU;AACxC,kBAAY,wBAAwB;AAAA,IACtC;AACA,WAAO;AAAA,MACL,MAAM,OAAO;AAAA,MACb,aAAa,OAAO,eAAe;AAAA,MACnC,YAAY,KAAK,UAAU,6BAA6B,OAAO,cAAc,CAAC,CAAC,CAAC;AAAA,MAChF;AAAA,IACF;AAAA,EACF,CAAC;AACH,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/types/frontend-action.ts"],"sourcesContent":["import { ActionInputAvailability } from \"@copilotkit/runtime-client-gql\";\nimport {\n Action,\n Parameter,\n MappedParameterTypes,\n actionParametersToJsonSchema,\n} from \"@copilotkit/shared\";\nimport React from \"react\";\n\ninterface InProgressState<T extends Parameter[] | [] = []> {\n status: \"inProgress\";\n args: Partial<MappedParameterTypes<T>>;\n result: undefined;\n}\n\ninterface ExecutingState<T extends Parameter[] | [] = []> {\n status: \"executing\";\n args: MappedParameterTypes<T>;\n result: undefined;\n}\n\ninterface CompleteState<T extends Parameter[] | [] = []> {\n status: \"complete\";\n args: MappedParameterTypes<T>;\n result: any;\n}\n\ninterface InProgressStateNoArgs<T extends Parameter[] | [] = []> {\n status: \"inProgress\";\n args: Partial<MappedParameterTypes<T>>;\n result: undefined;\n}\n\ninterface ExecutingStateNoArgs<T extends Parameter[] | [] = []> {\n status: \"executing\";\n args: MappedParameterTypes<T>;\n result: undefined;\n}\n\ninterface CompleteStateNoArgs<T extends Parameter[] | [] = []> {\n status: \"complete\";\n args: MappedParameterTypes<T>;\n result: any;\n}\n\ninterface InProgressStateWait<T extends Parameter[] | [] = []> {\n status: \"inProgress\";\n args: Partial<MappedParameterTypes<T>>;\n /** @deprecated use respond instead */\n handler: undefined;\n respond: undefined;\n result: undefined;\n}\n\ninterface ExecutingStateWait<T extends Parameter[] | [] = []> {\n status: \"executing\";\n args: MappedParameterTypes<T>;\n /** @deprecated use respond instead */\n handler: (result: any) => void;\n respond: (result: any) => void;\n result: undefined;\n}\n\ninterface CompleteStateWait<T extends Parameter[] | [] = []> {\n status: \"complete\";\n args: MappedParameterTypes<T>;\n /** @deprecated use respond instead */\n handler: undefined;\n respond: undefined;\n result: any;\n}\n\ninterface InProgressStateNoArgsWait<T extends Parameter[] | [] = []> {\n status: \"inProgress\";\n args: Partial<MappedParameterTypes<T>>;\n /** @deprecated use respond instead */\n handler: undefined;\n respond: undefined;\n result: undefined;\n}\n\ninterface ExecutingStateNoArgsWait<T extends Parameter[] | [] = []> {\n status: \"executing\";\n args: MappedParameterTypes<T>;\n /** @deprecated use respond instead */\n handler: (result: any) => void;\n respond: (result: any) => void;\n result: undefined;\n}\n\ninterface CompleteStateNoArgsWait<T extends Parameter[] | [] = []> {\n status: \"complete\";\n args: MappedParameterTypes<T>;\n /** @deprecated use respond instead */\n handler: undefined;\n respond: undefined;\n}\n\nexport type ActionRenderProps<T extends Parameter[] | [] = []> =\n | CompleteState<T>\n | ExecutingState<T>\n | InProgressState<T>;\n\nexport type ActionRenderPropsNoArgs<T extends Parameter[] | [] = []> =\n | CompleteStateNoArgs<T>\n | ExecutingStateNoArgs<T>\n | InProgressStateNoArgs<T>;\n\nexport type ActionRenderPropsWait<T extends Parameter[] | [] = []> =\n | CompleteStateWait<T>\n | ExecutingStateWait<T>\n | InProgressStateWait<T>;\n\nexport type ActionRenderPropsNoArgsWait<T extends Parameter[] | [] = []> =\n | CompleteStateNoArgsWait<T>\n | ExecutingStateNoArgsWait<T>\n | InProgressStateNoArgsWait<T>;\n\nexport type CatchAllActionRenderProps<T extends Parameter[] | [] = []> =\n | (CompleteState<T> & {\n name: string;\n })\n | (ExecutingState<T> & {\n name: string;\n })\n | (InProgressState<T> & {\n name: string;\n });\n\nexport type FrontendActionAvailability = \"disabled\" | \"enabled\" | \"remote\" | \"frontend\";\n\nexport type FrontendAction<\n T extends Parameter[] | [] = [],\n N extends string = string,\n> = Action<T> & {\n name: Exclude<N, \"*\">;\n /**\n * @deprecated Use `available` instead.\n */\n disabled?: boolean;\n available?: FrontendActionAvailability;\n pairedAction?: string;\n followUp?: boolean;\n} & (\n | {\n render?:\n | string\n | (T extends []\n ? (props: ActionRenderPropsNoArgs<T>) => string | React.ReactElement\n : (props: ActionRenderProps<T>) => string | React.ReactElement);\n /** @deprecated use renderAndWaitForResponse instead */\n renderAndWait?: never;\n renderAndWaitForResponse?: never;\n }\n | {\n render?: never;\n /** @deprecated use renderAndWaitForResponse instead */\n renderAndWait?: T extends []\n ? (props: ActionRenderPropsNoArgsWait<T>) => React.ReactElement\n : (props: ActionRenderPropsWait<T>) => React.ReactElement;\n renderAndWaitForResponse?: T extends []\n ? (props: ActionRenderPropsNoArgsWait<T>) => React.ReactElement\n : (props: ActionRenderPropsWait<T>) => React.ReactElement;\n handler?: never;\n }\n );\n\nexport type CatchAllFrontendAction = {\n name: \"*\";\n render: (props: CatchAllActionRenderProps<any>) => React.ReactElement;\n};\n\nexport type RenderFunctionStatus = ActionRenderProps<any>[\"status\"];\n\nexport function processActionsForRuntimeRequest(actions: FrontendAction<any>[]) {\n const filteredActions = actions\n .filter(\n (action) =>\n action.available !== ActionInputAvailability.Disabled &&\n action.disabled !== true &&\n action.name !== \"*\" &&\n action.available != \"frontend\" &&\n !action.pairedAction,\n )\n .map((action) => {\n let available: ActionInputAvailability | undefined = ActionInputAvailability.Enabled;\n if (action.disabled) {\n available = ActionInputAvailability.Disabled;\n } else if (action.available === \"disabled\") {\n available = ActionInputAvailability.Disabled;\n } else if (action.available === \"remote\") {\n available = ActionInputAvailability.Remote;\n }\n return {\n name: action.name,\n description: action.description || \"\",\n jsonSchema: JSON.stringify(actionParametersToJsonSchema(action.parameters || [])),\n available,\n };\n });\n return filteredActions;\n}\n"],"mappings":";AAAA,SAAS,+BAA+B;AACxC;AAAA,EAIE;AAAA,OACK;AAwKA,SAAS,gCAAgC,SAAgC;AAC9E,QAAM,kBAAkB,QACrB;AAAA,IACC,CAAC,WACC,OAAO,cAAc,wBAAwB,YAC7C,OAAO,aAAa,QACpB,OAAO,SAAS,OAChB,OAAO,aAAa,cACpB,CAAC,OAAO;AAAA,EACZ,EACC,IAAI,CAAC,WAAW;AACf,QAAI,YAAiD,wBAAwB;AAC7E,QAAI,OAAO,UAAU;AACnB,kBAAY,wBAAwB;AAAA,IACtC,WAAW,OAAO,cAAc,YAAY;AAC1C,kBAAY,wBAAwB;AAAA,IACtC,WAAW,OAAO,cAAc,UAAU;AACxC,kBAAY,wBAAwB;AAAA,IACtC;AACA,WAAO;AAAA,MACL,MAAM,OAAO;AAAA,MACb,aAAa,OAAO,eAAe;AAAA,MACnC,YAAY,KAAK,UAAU,6BAA6B,OAAO,cAAc,CAAC,CAAC,CAAC;AAAA,MAChF;AAAA,IACF;AAAA,EACF,CAAC;AACH,SAAO;AACT;","names":[]}
@@ -12,6 +12,7 @@ import {
12
12
  // src/components/error-boundary/error-boundary.tsx
13
13
  import React, { useEffect } from "react";
14
14
  import { CopilotKitError } from "@copilotkit/shared";
15
+ import { COPILOT_CLOUD_ERROR_NAMES } from "@copilotkit/shared";
15
16
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
16
17
  var statusChecker = new StatusChecker();
17
18
  var CopilotErrorBoundary = class extends React.Component {
@@ -47,20 +48,23 @@ var CopilotErrorBoundary = class extends React.Component {
47
48
  var _a, _b;
48
49
  if (this.state.hasError) {
49
50
  if (this.state.error instanceof CopilotKitError) {
50
- return renderCopilotKitUsage(this.state.error);
51
+ if (COPILOT_CLOUD_ERROR_NAMES.includes(this.state.error.name)) {
52
+ return /* @__PURE__ */ jsx(ErrorToast, { error: this.state.error, children: renderCopilotKitUsage(this.state.error) });
53
+ }
54
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
55
+ this.props.children,
56
+ this.props.showUsageBanner && /* @__PURE__ */ jsx(
57
+ UsageBanner,
58
+ {
59
+ severity: (_a = this.state.status) == null ? void 0 : _a.severity,
60
+ message: (_b = this.state.status) == null ? void 0 : _b.message
61
+ }
62
+ )
63
+ ] });
51
64
  }
52
- return /* @__PURE__ */ jsx(ErrorToast, { error: this.state.error, children: this.props.children });
65
+ throw this.state.error;
53
66
  }
54
- return /* @__PURE__ */ jsxs(Fragment, { children: [
55
- this.props.children,
56
- this.props.showUsageBanner ? /* @__PURE__ */ jsx(
57
- UsageBanner,
58
- {
59
- severity: (_a = this.state.status) == null ? void 0 : _a.severity,
60
- message: (_b = this.state.status) == null ? void 0 : _b.message
61
- }
62
- ) : null
63
- ] });
67
+ return this.props.children;
64
68
  }
65
69
  };
66
70
  function ErrorToast({ error, children }) {
@@ -70,6 +74,8 @@ function ErrorToast({ error, children }) {
70
74
  addErrorToast([error]);
71
75
  }
72
76
  }, [error, addErrorToast]);
77
+ if (!error)
78
+ throw error;
73
79
  return children;
74
80
  }
75
81
 
@@ -77,4 +83,4 @@ export {
77
83
  CopilotErrorBoundary,
78
84
  ErrorToast
79
85
  };
80
- //# sourceMappingURL=chunk-5K2FUI34.mjs.map
86
+ //# sourceMappingURL=chunk-534J55RX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/error-boundary/error-boundary.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { Severity, CopilotKitError } from \"@copilotkit/shared\";\nimport { StatusChecker } from \"../../lib/status-checker\";\nimport { renderCopilotKitUsage, UsageBanner } from \"../usage-banner\";\nimport { useErrorToast } from \"./error-utils\";\nimport { COPILOT_CLOUD_ERROR_NAMES } from \"@copilotkit/shared\";\n\nconst statusChecker = new StatusChecker();\n\ninterface Props {\n children: React.ReactNode;\n publicApiKey?: string;\n showUsageBanner?: boolean;\n}\n\ninterface State {\n hasError: boolean;\n error?: CopilotKitError;\n status?: {\n severity: Severity;\n message: string;\n };\n}\n\nexport class CopilotErrorBoundary extends React.Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = {\n hasError: false,\n };\n }\n\n static getDerivedStateFromError(error: CopilotKitError): State {\n return { hasError: true, error };\n }\n\n componentDidMount() {\n if (this.props.publicApiKey) {\n statusChecker.start(this.props.publicApiKey, (newStatus) => {\n this.setState((prevState) => {\n if (newStatus?.severity !== prevState.status?.severity) {\n return { status: newStatus ?? undefined };\n }\n return null;\n });\n });\n }\n }\n\n componentWillUnmount() {\n statusChecker.stop();\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n console.error(\"CopilotKit Error:\", error, errorInfo);\n }\n\n render() {\n if (this.state.hasError) {\n if (this.state.error instanceof CopilotKitError) {\n // @ts-expect-error -- It's a copilotkit error at this state. Name is valid\n if (COPILOT_CLOUD_ERROR_NAMES.includes(this.state.error.name)) {\n return (\n <ErrorToast error={this.state.error}>\n {renderCopilotKitUsage(this.state.error)}\n </ErrorToast>\n );\n }\n\n return (\n <>\n {this.props.children}\n {this.props.showUsageBanner && (\n <UsageBanner\n severity={this.state.status?.severity}\n message={this.state.status?.message}\n />\n )}\n </>\n );\n }\n throw this.state.error;\n }\n\n return this.props.children;\n }\n}\n\nexport function ErrorToast({ error, children }: { error?: Error; children: React.ReactNode }) {\n const addErrorToast = useErrorToast();\n\n useEffect(() => {\n if (error) {\n addErrorToast([error]);\n }\n }, [error, addErrorToast]);\n\n if (!error) throw error;\n return children;\n}\n"],"mappings":";;;;;;;;;;;;AAAA,OAAO,SAAS,iBAAiB;AACjC,SAAmB,uBAAuB;AAI1C,SAAS,iCAAiC;AA0D9B,SAOF,UAPE,KAOF,YAPE;AAxDZ,IAAM,gBAAgB,IAAI,cAAc;AAiBjC,IAAM,uBAAN,cAAmC,MAAM,UAAwB;AAAA,EACtE,YAAY,OAAc;AACxB,UAAM,KAAK;AACX,SAAK,QAAQ;AAAA,MACX,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EAEA,OAAO,yBAAyB,OAA+B;AAC7D,WAAO,EAAE,UAAU,MAAM,MAAM;AAAA,EACjC;AAAA,EAEA,oBAAoB;AAClB,QAAI,KAAK,MAAM,cAAc;AAC3B,oBAAc,MAAM,KAAK,MAAM,cAAc,CAAC,cAAc;AAC1D,aAAK,SAAS,CAAC,cAAc;AAvCrC;AAwCU,eAAI,uCAAW,gBAAa,eAAU,WAAV,mBAAkB,WAAU;AACtD,mBAAO,EAAE,QAAQ,gCAAa,OAAU;AAAA,UAC1C;AACA,iBAAO;AAAA,QACT,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,kBAAc,KAAK;AAAA,EACrB;AAAA,EAEA,kBAAkB,OAAc,WAA4B;AAC1D,YAAQ,MAAM,qBAAqB,OAAO,SAAS;AAAA,EACrD;AAAA,EAEA,SAAS;AAzDX;AA0DI,QAAI,KAAK,MAAM,UAAU;AACvB,UAAI,KAAK,MAAM,iBAAiB,iBAAiB;AAE/C,YAAI,0BAA0B,SAAS,KAAK,MAAM,MAAM,IAAI,GAAG;AAC7D,iBACE,oBAAC,cAAW,OAAO,KAAK,MAAM,OAC3B,gCAAsB,KAAK,MAAM,KAAK,GACzC;AAAA,QAEJ;AAEA,eACE,iCACG;AAAA,eAAK,MAAM;AAAA,UACX,KAAK,MAAM,mBACV;AAAA,YAAC;AAAA;AAAA,cACC,WAAU,UAAK,MAAM,WAAX,mBAAmB;AAAA,cAC7B,UAAS,UAAK,MAAM,WAAX,mBAAmB;AAAA;AAAA,UAC9B;AAAA,WAEJ;AAAA,MAEJ;AACA,YAAM,KAAK,MAAM;AAAA,IACnB;AAEA,WAAO,KAAK,MAAM;AAAA,EACpB;AACF;AAEO,SAAS,WAAW,EAAE,OAAO,SAAS,GAAiD;AAC5F,QAAM,gBAAgB,cAAc;AAEpC,YAAU,MAAM;AACd,QAAI,OAAO;AACT,oBAAc,CAAC,KAAK,CAAC;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,OAAO,aAAa,CAAC;AAEzB,MAAI,CAAC;AAAO,UAAM;AAClB,SAAO;AACT;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-6YOKPWQ7.mjs.map