@copilotkit/react-core 0.0.0-fix-use-warning-for-version-mismatch-20250212175807 → 0.0.0-main-20250416144141

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 (182) hide show
  1. package/CHANGELOG.md +527 -5
  2. package/dist/{chunk-XERJQUHA.mjs → chunk-4CEQJ2X6.mjs} +2 -2
  3. package/dist/{chunk-XERJQUHA.mjs.map → chunk-4CEQJ2X6.mjs.map} +1 -1
  4. package/dist/{chunk-5K2FUI34.mjs → chunk-534J55RX.mjs} +19 -13
  5. package/dist/chunk-534J55RX.mjs.map +1 -0
  6. package/dist/{chunk-2VIL3F36.mjs → chunk-5TVV6FJD.mjs} +26 -3
  7. package/dist/chunk-5TVV6FJD.mjs.map +1 -0
  8. package/dist/{chunk-HJWT7WXD.mjs → chunk-6OMSQLHC.mjs} +159 -82
  9. package/dist/chunk-6OMSQLHC.mjs.map +1 -0
  10. package/dist/chunk-6YOKPWQ7.mjs +1 -0
  11. package/dist/chunk-7VCWAAWC.mjs +24 -0
  12. package/dist/chunk-7VCWAAWC.mjs.map +1 -0
  13. package/dist/{chunk-DB25UMNI.mjs → chunk-CMEX33KD.mjs} +28 -14
  14. package/dist/chunk-CMEX33KD.mjs.map +1 -0
  15. package/dist/chunk-CQPYJIBH.mjs +1 -0
  16. package/dist/{chunk-ZAU4EMBM.mjs → chunk-DMQB35FC.mjs} +5 -6
  17. package/dist/chunk-DMQB35FC.mjs.map +1 -0
  18. package/dist/{chunk-MIUILUVX.mjs → chunk-FRRPZKXW.mjs} +3 -3
  19. package/dist/{chunk-7HWSAEOY.mjs → chunk-GOK4PDQO.mjs} +13 -4
  20. package/dist/{chunk-7HWSAEOY.mjs.map → chunk-GOK4PDQO.mjs.map} +1 -1
  21. package/dist/{chunk-5M47BILE.mjs → chunk-HGZXDC4Y.mjs} +2 -2
  22. package/dist/{chunk-24PU4QRT.mjs → chunk-IRC2ZBQ4.mjs} +4 -5
  23. package/dist/chunk-IRC2ZBQ4.mjs.map +1 -0
  24. package/dist/{chunk-CUSSPNG5.mjs → chunk-JWE4IXSG.mjs} +17 -3
  25. package/dist/chunk-JWE4IXSG.mjs.map +1 -0
  26. package/dist/{chunk-XOHLZIZK.mjs → chunk-KF5SB2VB.mjs} +2 -2
  27. package/dist/{chunk-2RDVL7EU.mjs → chunk-TDQC6FJW.mjs} +10 -7
  28. package/dist/chunk-TDQC6FJW.mjs.map +1 -0
  29. package/dist/{chunk-WSOA4BGM.mjs → chunk-TWWQG3EF.mjs} +3 -3
  30. package/dist/{chunk-ZM56S3LJ.mjs → chunk-UDUFMGWQ.mjs} +3 -1
  31. package/dist/chunk-UDUFMGWQ.mjs.map +1 -0
  32. package/dist/{chunk-CUMF2APV.mjs → chunk-V46EGT4W.mjs} +59 -47
  33. package/dist/chunk-V46EGT4W.mjs.map +1 -0
  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 +18 -2
  40. package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
  41. package/dist/components/copilot-provider/copilotkit.d.ts +1 -2
  42. package/dist/components/copilot-provider/copilotkit.js +46 -24
  43. package/dist/components/copilot-provider/copilotkit.js.map +1 -1
  44. package/dist/components/copilot-provider/copilotkit.mjs +5 -5
  45. package/dist/components/copilot-provider/index.d.ts +1 -2
  46. package/dist/components/copilot-provider/index.js +46 -24
  47. package/dist/components/copilot-provider/index.js.map +1 -1
  48. package/dist/components/copilot-provider/index.mjs +5 -5
  49. package/dist/components/error-boundary/error-boundary.d.ts +1 -1
  50. package/dist/components/error-boundary/error-boundary.js +18 -12
  51. package/dist/components/error-boundary/error-boundary.js.map +1 -1
  52. package/dist/components/error-boundary/error-boundary.mjs +1 -1
  53. package/dist/components/index.d.ts +1 -2
  54. package/dist/components/index.js +46 -24
  55. package/dist/components/index.js.map +1 -1
  56. package/dist/components/index.mjs +5 -5
  57. package/dist/context/copilot-context.d.ts +10 -148
  58. package/dist/context/copilot-context.js +2 -0
  59. package/dist/context/copilot-context.js.map +1 -1
  60. package/dist/context/copilot-context.mjs +1 -1
  61. package/dist/context/index.d.ts +1 -2
  62. package/dist/context/index.js +2 -0
  63. package/dist/context/index.js.map +1 -1
  64. package/dist/context/index.mjs +1 -1
  65. package/dist/copilot-context-0e923eb1.d.ts +194 -0
  66. package/dist/hooks/index.d.ts +2 -2
  67. package/dist/hooks/index.js +297 -145
  68. package/dist/hooks/index.js.map +1 -1
  69. package/dist/hooks/index.mjs +21 -17
  70. package/dist/hooks/use-chat.d.ts +2 -3
  71. package/dist/hooks/use-chat.js +156 -82
  72. package/dist/hooks/use-chat.js.map +1 -1
  73. package/dist/hooks/use-chat.mjs +2 -2
  74. package/dist/hooks/use-coagent-state-render.d.ts +1 -1
  75. package/dist/hooks/use-coagent-state-render.js +26 -1
  76. package/dist/hooks/use-coagent-state-render.js.map +1 -1
  77. package/dist/hooks/use-coagent-state-render.mjs +2 -2
  78. package/dist/hooks/use-coagent.d.ts +13 -2
  79. package/dist/hooks/use-coagent.js +222 -131
  80. package/dist/hooks/use-coagent.js.map +1 -1
  81. package/dist/hooks/use-coagent.mjs +9 -9
  82. package/dist/hooks/use-copilot-action.js +15 -0
  83. package/dist/hooks/use-copilot-action.js.map +1 -1
  84. package/dist/hooks/use-copilot-action.mjs +2 -2
  85. package/dist/hooks/use-copilot-additional-instructions.d.ts +26 -0
  86. package/dist/hooks/use-copilot-additional-instructions.js +162 -0
  87. package/dist/hooks/use-copilot-additional-instructions.js.map +1 -0
  88. package/dist/hooks/use-copilot-additional-instructions.mjs +9 -0
  89. package/dist/hooks/use-copilot-additional-instructions.mjs.map +1 -0
  90. package/dist/hooks/use-copilot-authenticated-action.js +15 -0
  91. package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
  92. package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
  93. package/dist/hooks/use-copilot-chat.d.ts +2 -3
  94. package/dist/hooks/use-copilot-chat.js +167 -88
  95. package/dist/hooks/use-copilot-chat.js.map +1 -1
  96. package/dist/hooks/use-copilot-chat.mjs +8 -8
  97. package/dist/hooks/use-copilot-readable.d.ts +5 -1
  98. package/dist/hooks/use-copilot-readable.js +13 -2
  99. package/dist/hooks/use-copilot-readable.js.map +1 -1
  100. package/dist/hooks/use-copilot-readable.mjs +2 -2
  101. package/dist/hooks/use-langgraph-interrupt-render.js +5 -4
  102. package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
  103. package/dist/hooks/use-langgraph-interrupt-render.mjs +2 -2
  104. package/dist/hooks/use-langgraph-interrupt.d.ts +10 -3
  105. package/dist/hooks/use-langgraph-interrupt.js +168 -90
  106. package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
  107. package/dist/hooks/use-langgraph-interrupt.mjs +9 -9
  108. package/dist/hooks/use-make-copilot-document-readable.js +2 -0
  109. package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
  110. package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
  111. package/dist/index.d.ts +4 -3
  112. package/dist/index.js +357 -185
  113. package/dist/index.js.map +1 -1
  114. package/dist/index.mjs +24 -19
  115. package/dist/lib/copilot-task.d.ts +1 -2
  116. package/dist/lib/copilot-task.js +1 -1
  117. package/dist/lib/copilot-task.js.map +1 -1
  118. package/dist/lib/copilot-task.mjs +7 -7
  119. package/dist/lib/index.d.ts +1 -2
  120. package/dist/lib/index.js +1 -1
  121. package/dist/lib/index.js.map +1 -1
  122. package/dist/lib/index.mjs +7 -7
  123. package/dist/types/coagent-state.d.ts +1 -0
  124. package/dist/types/coagent-state.js.map +1 -1
  125. package/dist/types/crew.d.ts +79 -0
  126. package/dist/types/crew.js +19 -0
  127. package/dist/types/crew.js.map +1 -0
  128. package/dist/types/crew.mjs +2 -0
  129. package/dist/types/crew.mjs.map +1 -0
  130. package/dist/types/frontend-action.d.ts +2 -1
  131. package/dist/types/frontend-action.js +1 -1
  132. package/dist/types/frontend-action.js.map +1 -1
  133. package/dist/types/frontend-action.mjs +1 -1
  134. package/dist/types/index.d.ts +2 -1
  135. package/dist/types/index.js.map +1 -1
  136. package/dist/types/index.mjs +2 -1
  137. package/dist/types/interrupt-action.d.ts +10 -35
  138. package/dist/types/interrupt-action.js.map +1 -1
  139. package/dist/utils/extract.d.ts +1 -2
  140. package/dist/utils/extract.js.map +1 -1
  141. package/dist/utils/extract.mjs +5 -5
  142. package/dist/utils/index.d.ts +1 -2
  143. package/dist/utils/index.js.map +1 -1
  144. package/dist/utils/index.mjs +5 -5
  145. package/package.json +3 -3
  146. package/src/components/copilot-provider/copilotkit-props.tsx +15 -0
  147. package/src/components/copilot-provider/copilotkit.tsx +20 -4
  148. package/src/components/error-boundary/error-boundary.tsx +24 -13
  149. package/src/context/copilot-context.tsx +13 -0
  150. package/src/hooks/index.ts +1 -0
  151. package/src/hooks/use-chat.ts +186 -77
  152. package/src/hooks/use-coagent-state-render.ts +38 -2
  153. package/src/hooks/use-coagent.ts +82 -55
  154. package/src/hooks/use-copilot-action.ts +16 -0
  155. package/src/hooks/use-copilot-additional-instructions.ts +85 -0
  156. package/src/hooks/use-copilot-chat.ts +9 -5
  157. package/src/hooks/use-copilot-readable.ts +16 -2
  158. package/src/hooks/use-langgraph-interrupt-render.ts +7 -3
  159. package/src/hooks/use-langgraph-interrupt.ts +3 -4
  160. package/src/types/coagent-state.ts +1 -0
  161. package/src/types/crew.ts +89 -0
  162. package/src/types/frontend-action.ts +5 -2
  163. package/src/types/index.ts +8 -0
  164. package/src/types/interrupt-action.ts +17 -13
  165. package/dist/chunk-24PU4QRT.mjs.map +0 -1
  166. package/dist/chunk-2RDVL7EU.mjs.map +0 -1
  167. package/dist/chunk-2VIL3F36.mjs.map +0 -1
  168. package/dist/chunk-5K2FUI34.mjs.map +0 -1
  169. package/dist/chunk-CUMF2APV.mjs.map +0 -1
  170. package/dist/chunk-CUSSPNG5.mjs.map +0 -1
  171. package/dist/chunk-DB25UMNI.mjs.map +0 -1
  172. package/dist/chunk-EFZPSZWO.mjs +0 -1
  173. package/dist/chunk-HJWT7WXD.mjs.map +0 -1
  174. package/dist/chunk-IGLITGLC.mjs +0 -1
  175. package/dist/chunk-ZAU4EMBM.mjs.map +0 -1
  176. package/dist/chunk-ZM56S3LJ.mjs.map +0 -1
  177. /package/dist/{chunk-EFZPSZWO.mjs.map → chunk-6YOKPWQ7.mjs.map} +0 -0
  178. /package/dist/{chunk-IGLITGLC.mjs.map → chunk-CQPYJIBH.mjs.map} +0 -0
  179. /package/dist/{chunk-MIUILUVX.mjs.map → chunk-FRRPZKXW.mjs.map} +0 -0
  180. /package/dist/{chunk-5M47BILE.mjs.map → chunk-HGZXDC4Y.mjs.map} +0 -0
  181. /package/dist/{chunk-XOHLZIZK.mjs.map → chunk-KF5SB2VB.mjs.map} +0 -0
  182. /package/dist/{chunk-WSOA4BGM.mjs.map → chunk-TWWQG3EF.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,14 +1,536 @@
1
1
  # ui
2
2
 
3
- ## 0.0.0-fix-use-warning-for-version-mismatch-20250212175807
3
+ ## 0.0.0-main-20250416144141
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - d471548: - fix: use warning when version mismatch is not expected to error out
7
+ - 7a04bd1: - 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
+ - @copilotkit/runtime-client-gql@0.0.0-main-20250416144141
11
+ - @copilotkit/shared@0.0.0-main-20250416144141
12
+
13
+ ## 1.8.6-next.0
14
+
15
+ ### Patch Changes
16
+
17
+ - 7a04bd1: - fix: fix how results are communicated back on interrupt
18
+ - fix: do not allow followup for interrupt actions
19
+ - chore: improve TS docs for interrupt
20
+ - @copilotkit/runtime-client-gql@1.8.6-next.0
21
+ - @copilotkit/shared@1.8.6-next.0
22
+
23
+ ## 1.8.5
24
+
25
+ ### Patch Changes
26
+
27
+ - c0d3261: - full AWP support
28
+
29
+ Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
30
+
31
+ - refactor: address linter issues with the new pages
32
+
33
+ Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
34
+
35
+ - Merge branch 'mme/acp' into mme/mastra
36
+ - add sse example
37
+ - Create small-turkeys-agree.md
38
+ - upgrade AWP
39
+ - Merge branch 'mme/mastra' of github.com:CopilotKit/CopilotKit into mme/mastra
40
+ - make agents a dict
41
+ - update docs
42
+ - send tools
43
+ - update to latest packages
44
+ - fix problem where state sync are preventing tool calls
45
+ - set possibly undefined toolCalls to an empty array
46
+ - fix missing tool call ids
47
+
48
+ - 77a7457: - feat: Add Model Context Protocol (MCP) support
49
+ - d0e8a1e: - fix: fix duplicate messages on regenerate
50
+ - @copilotkit/runtime-client-gql@1.8.5
51
+ - @copilotkit/shared@1.8.5
52
+
53
+ ## 1.8.5-next.5
54
+
55
+ ### Patch Changes
56
+
57
+ - c0d3261: - full AWP support
58
+
59
+ Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
60
+
61
+ - refactor: address linter issues with the new pages
62
+
63
+ Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
64
+
65
+ - Merge branch 'mme/acp' into mme/mastra
66
+ - add sse example
67
+ - Create small-turkeys-agree.md
68
+ - upgrade AWP
69
+ - Merge branch 'mme/mastra' of github.com:CopilotKit/CopilotKit into mme/mastra
70
+ - make agents a dict
71
+ - update docs
72
+ - send tools
73
+ - update to latest packages
74
+ - fix problem where state sync are preventing tool calls
75
+ - set possibly undefined toolCalls to an empty array
76
+ - fix missing tool call ids
77
+ - @copilotkit/runtime-client-gql@1.8.5-next.5
78
+ - @copilotkit/shared@1.8.5-next.5
79
+
80
+ ## 1.8.5-next.4
81
+
82
+ ### Patch Changes
83
+
84
+ - @copilotkit/runtime-client-gql@1.8.5-next.4
85
+ - @copilotkit/shared@1.8.5-next.4
86
+
87
+ ## 1.8.5-next.3
88
+
89
+ ### Patch Changes
90
+
91
+ - 77a7457: - feat: Add Model Context Protocol (MCP) support
92
+ - @copilotkit/runtime-client-gql@1.8.5-next.3
93
+ - @copilotkit/shared@1.8.5-next.3
94
+
95
+ ## 1.8.5-next.2
96
+
97
+ ### Patch Changes
98
+
99
+ - @copilotkit/runtime-client-gql@1.8.5-next.2
100
+ - @copilotkit/shared@1.8.5-next.2
101
+
102
+ ## 1.8.5-next.1
103
+
104
+ ### Patch Changes
105
+
106
+ - d0e8a1e: - fix: fix duplicate messages on regenerate
107
+ - @copilotkit/runtime-client-gql@1.8.5-next.1
108
+ - @copilotkit/shared@1.8.5-next.1
109
+
110
+ ## 1.8.5-next.0
111
+
112
+ ### Patch Changes
113
+
114
+ - @copilotkit/runtime-client-gql@1.8.5-next.0
115
+ - @copilotkit/shared@1.8.5-next.0
116
+
117
+ ## 1.8.4
118
+
119
+ ### Patch Changes
120
+
121
+ - 4e28414: - use new interface properly
122
+ - Updated dependencies [f363760]
123
+ - @copilotkit/shared@1.8.4
124
+ - @copilotkit/runtime-client-gql@1.8.4
125
+
126
+ ## 1.8.4-next.4
127
+
128
+ ### Patch Changes
129
+
130
+ - 4e28414: - use new interface properly
131
+ - @copilotkit/runtime-client-gql@1.8.4-next.4
132
+ - @copilotkit/shared@1.8.4-next.4
133
+
134
+ ## 1.8.4-next.3
135
+
136
+ ### Patch Changes
137
+
138
+ - @copilotkit/runtime-client-gql@1.8.4-next.3
139
+ - @copilotkit/shared@1.8.4-next.3
140
+
141
+ ## 1.8.4-next.2
142
+
143
+ ### Patch Changes
144
+
145
+ - @copilotkit/runtime-client-gql@1.8.4-next.2
146
+ - @copilotkit/shared@1.8.4-next.2
147
+
148
+ ## 1.8.4-next.1
149
+
150
+ ### Patch Changes
151
+
152
+ - Updated dependencies [f363760]
153
+ - @copilotkit/shared@1.8.4-next.1
154
+ - @copilotkit/runtime-client-gql@1.8.4-next.1
155
+
156
+ ## 1.8.4-next.0
157
+
158
+ ### Patch Changes
159
+
160
+ - @copilotkit/runtime-client-gql@1.8.4-next.0
161
+ - @copilotkit/shared@1.8.4-next.0
162
+
163
+ ## 1.8.3
164
+
165
+ ### Patch Changes
166
+
167
+ - @copilotkit/runtime-client-gql@1.8.3
168
+ - @copilotkit/shared@1.8.3
169
+
170
+ ## 1.8.3-next.0
171
+
172
+ ### Patch Changes
173
+
174
+ - @copilotkit/runtime-client-gql@1.8.3-next.0
175
+ - @copilotkit/shared@1.8.3-next.0
176
+
177
+ ## 1.8.2-next.3
178
+
179
+ ### Patch Changes
180
+
181
+ - @copilotkit/runtime-client-gql@1.8.2-next.3
182
+ - @copilotkit/shared@1.8.2-next.3
183
+
184
+ ## 1.8.2-next.2
185
+
186
+ ### Patch Changes
187
+
188
+ - @copilotkit/runtime-client-gql@1.8.2-next.2
189
+ - @copilotkit/shared@1.8.2-next.2
190
+
191
+ ## 1.8.2-next.1
192
+
193
+ ### Patch Changes
194
+
195
+ - @copilotkit/runtime-client-gql@1.8.2-next.1
196
+ - @copilotkit/shared@1.8.2-next.1
197
+
198
+ ## 1.8.2-next.0
199
+
200
+ ### Patch Changes
201
+
202
+ - @copilotkit/runtime-client-gql@1.8.2-next.0
203
+ - @copilotkit/shared@1.8.2-next.0
204
+
205
+ ## 1.8.1
206
+
207
+ ### Patch Changes
208
+
209
+ - 7a42944: - fix(react-core): update agentSession when agent props change #1497
210
+ - @copilotkit/runtime-client-gql@1.8.1
211
+ - @copilotkit/shared@1.8.1
212
+
213
+ ## 1.8.1-next.1
214
+
215
+ ### Patch Changes
216
+
217
+ - @copilotkit/runtime-client-gql@1.8.1-next.1
218
+ - @copilotkit/shared@1.8.1-next.1
219
+
220
+ ## 1.8.1-next.0
221
+
222
+ ### Patch Changes
223
+
224
+ - 7a42944: - fix(react-core): update agentSession when agent props change #1497
225
+ - @copilotkit/runtime-client-gql@1.8.1-next.0
226
+ - @copilotkit/shared@1.8.1-next.0
227
+
228
+ ## 1.8.0
229
+
230
+ ### Patch Changes
231
+
232
+ - 73f5eaa: - fix(react-core): export missing action-related types for public API
233
+ - a50f4c1: - move default components out of ui
234
+ - @copilotkit/runtime-client-gql@1.8.0
235
+ - @copilotkit/shared@1.8.0
236
+
237
+ ## 1.8.0-next.8
238
+
239
+ ### Patch Changes
240
+
241
+ - @copilotkit/runtime-client-gql@1.8.0-next.8
242
+ - @copilotkit/shared@1.8.0-next.8
243
+
244
+ ## 1.8.0-next.7
245
+
246
+ ### Patch Changes
247
+
248
+ - @copilotkit/runtime-client-gql@1.8.0-next.7
249
+ - @copilotkit/shared@1.8.0-next.7
250
+
251
+ ## 1.8.0-next.6
252
+
253
+ ### Patch Changes
254
+
255
+ - @copilotkit/runtime-client-gql@1.8.0-next.6
256
+ - @copilotkit/shared@1.8.0-next.6
257
+
258
+ ## 1.8.0-next.5
259
+
260
+ ### Patch Changes
261
+
262
+ - a50f4c1: - move default components out of ui
263
+ - @copilotkit/runtime-client-gql@1.8.0-next.5
264
+ - @copilotkit/shared@1.8.0-next.5
265
+
266
+ ## 1.8.0-next.4
267
+
268
+ ### Patch Changes
269
+
270
+ - @copilotkit/runtime-client-gql@1.8.0-next.4
271
+ - @copilotkit/shared@1.8.0-next.4
272
+
273
+ ## 1.8.0-next.3
274
+
275
+ ### Patch Changes
276
+
277
+ - @copilotkit/runtime-client-gql@1.8.0-next.3
278
+ - @copilotkit/shared@1.8.0-next.3
279
+
280
+ ## 1.7.2-next.2
281
+
282
+ ### Patch Changes
283
+
284
+ - @copilotkit/runtime-client-gql@1.7.2-next.2
285
+ - @copilotkit/shared@1.7.2-next.2
286
+
287
+ ## 1.7.2-next.1
288
+
289
+ ### Patch Changes
290
+
291
+ - 73f5eaa: - fix(react-core): export missing action-related types for public API
292
+ - @copilotkit/runtime-client-gql@1.7.2-next.1
293
+ - @copilotkit/shared@1.7.2-next.1
294
+
295
+ ## 1.7.2-next.0
296
+
297
+ ### Patch Changes
298
+
299
+ - @copilotkit/runtime-client-gql@1.7.2-next.0
300
+ - @copilotkit/shared@1.7.2-next.0
301
+
302
+ ## 1.7.1
303
+
304
+ ### Patch Changes
305
+
306
+ - @copilotkit/runtime-client-gql@1.7.1
307
+ - @copilotkit/shared@1.7.1
308
+
309
+ ## 1.7.1-next.0
310
+
311
+ ### Patch Changes
312
+
313
+ - @copilotkit/runtime-client-gql@1.7.1-next.0
314
+ - @copilotkit/shared@1.7.1-next.0
315
+
316
+ ## 1.7.0
317
+
318
+ ### Patch Changes
319
+
320
+ - @copilotkit/runtime-client-gql@1.7.0
321
+ - @copilotkit/shared@1.7.0
322
+
323
+ ## 1.7.0-next.1
324
+
325
+ ### Patch Changes
326
+
327
+ - @copilotkit/runtime-client-gql@1.7.0-next.1
328
+ - @copilotkit/shared@1.7.0-next.1
329
+
330
+ ## 1.7.0-next.0
331
+
332
+ ### Patch Changes
333
+
334
+ - @copilotkit/runtime-client-gql@1.7.0-next.0
335
+ - @copilotkit/shared@1.7.0-next.0
336
+
337
+ ## 1.6.0
338
+
339
+ ### Minor Changes
340
+
341
+ - 7d061d9: - feat(configurable): execute langgraph with user config
342
+
343
+ ### Patch Changes
344
+
345
+ - d833f4c: - fix: provide the ability to type interrupt event value
346
+ - d800f03: - fix: use memoization in useCoAgent internal functions
347
+ - 85753b3: - feat(actions): enable restricting actions to frontend only
348
+ - b454827: - fix: simplify condition options for langgraph interrupts
349
+ - chore: add new enabled to e2e tests
350
+ - fix: refine argument types
351
+ - chore: document hook API reference
352
+ - c1cc77f: - feat: new useCopilotAdditionalInstructions hook and available property on useCopilotReadable
353
+ - Updated dependencies [d833f4c]
354
+ - Updated dependencies [090203d]
355
+ - @copilotkit/runtime-client-gql@1.6.0
356
+ - @copilotkit/shared@1.6.0
357
+
358
+ ## 1.6.0-next.12
359
+
360
+ ### Patch Changes
361
+
362
+ - @copilotkit/runtime-client-gql@1.6.0-next.12
363
+ - @copilotkit/shared@1.6.0-next.12
364
+
365
+ ## 1.6.0-next.11
366
+
367
+ ### Patch Changes
368
+
369
+ - 85753b3: - feat(actions): enable restricting actions to frontend only
370
+ - @copilotkit/runtime-client-gql@1.6.0-next.11
371
+ - @copilotkit/shared@1.6.0-next.11
372
+
373
+ ## 1.6.0-next.10
374
+
375
+ ### Patch Changes
376
+
377
+ - @copilotkit/runtime-client-gql@1.6.0-next.10
378
+ - @copilotkit/shared@1.6.0-next.10
379
+
380
+ ## 1.6.0-next.9
381
+
382
+ ### Patch Changes
383
+
384
+ - @copilotkit/runtime-client-gql@1.6.0-next.9
385
+ - @copilotkit/shared@1.6.0-next.9
386
+
387
+ ## 1.6.0-next.8
388
+
389
+ ### Patch Changes
390
+
391
+ - @copilotkit/runtime-client-gql@1.6.0-next.8
392
+ - @copilotkit/shared@1.6.0-next.8
393
+
394
+ ## 1.6.0-next.7
395
+
396
+ ### Patch Changes
397
+
398
+ - d800f03: - fix: use memoization in useCoAgent internal functions
399
+ - @copilotkit/runtime-client-gql@1.6.0-next.7
400
+ - @copilotkit/shared@1.6.0-next.7
401
+
402
+ ## 1.6.0-next.6
403
+
404
+ ### Patch Changes
405
+
406
+ - @copilotkit/runtime-client-gql@1.6.0-next.6
407
+ - @copilotkit/shared@1.6.0-next.6
408
+
409
+ ## 1.6.0-next.5
410
+
411
+ ### Patch Changes
412
+
413
+ - Updated dependencies [090203d]
414
+ - @copilotkit/shared@1.6.0-next.5
415
+ - @copilotkit/runtime-client-gql@1.6.0-next.5
416
+
417
+ ## 1.6.0-next.4
418
+
419
+ ### Patch Changes
420
+
421
+ - @copilotkit/runtime-client-gql@1.6.0-next.4
422
+ - @copilotkit/shared@1.6.0-next.4
423
+
424
+ ## 1.6.0-next.3
425
+
426
+ ### Patch Changes
427
+
428
+ - @copilotkit/runtime-client-gql@1.6.0-next.3
429
+ - @copilotkit/shared@1.6.0-next.3
430
+
431
+ ## 1.6.0-next.2
432
+
433
+ ### Patch Changes
434
+
435
+ - b454827: - fix: simplify condition options for langgraph interrupts
436
+ - chore: add new enabled to e2e tests
437
+ - fix: refine argument types
438
+ - chore: document hook API reference
439
+ - @copilotkit/runtime-client-gql@1.6.0-next.2
440
+ - @copilotkit/shared@1.6.0-next.2
441
+
442
+ ## 1.6.0-next.1
443
+
444
+ ### Patch Changes
445
+
446
+ - d833f4c: - fix: provide the ability to type interrupt event value
447
+ - Updated dependencies [d833f4c]
448
+ - @copilotkit/runtime-client-gql@1.6.0-next.1
449
+ - @copilotkit/shared@1.6.0-next.1
450
+
451
+ ## 1.6.0-next.0
452
+
453
+ ### Minor Changes
454
+
455
+ - 7d061d9: - feat(configurable): execute langgraph with user config
456
+
457
+ ### Patch Changes
458
+
459
+ - @copilotkit/runtime-client-gql@1.6.0-next.0
460
+ - @copilotkit/shared@1.6.0-next.0
461
+
462
+ ## 1.5.20
463
+
464
+ ### Patch Changes
465
+
466
+ - Updated dependencies [51f0d66]
467
+ - @copilotkit/shared@1.5.20
468
+ - @copilotkit/runtime-client-gql@1.5.20
469
+
470
+ ## 1.5.20-next.0
471
+
472
+ ### Patch Changes
473
+
474
+ - Updated dependencies [51f0d66]
475
+ - @copilotkit/shared@1.5.20-next.0
476
+ - @copilotkit/runtime-client-gql@1.5.20-next.0
477
+
478
+ ## 1.5.19
479
+
480
+ ### Patch Changes
481
+
482
+ - 0dd1ab9: - fix(errors): allow non copilotkit errors to pass to consumer app error boundary
483
+ - 5bc68f8: - fix(actions): warn on action duplication
484
+ - fix(actions): warn on coagent state render duplication
485
+ - Updated dependencies [0dd1ab9]
486
+ - @copilotkit/shared@1.5.19
487
+ - @copilotkit/runtime-client-gql@1.5.19
488
+
489
+ ## 1.5.19-next.1
490
+
491
+ ### Patch Changes
492
+
493
+ - 0dd1ab9: - fix(errors): allow non copilotkit errors to pass to consumer app error boundary
494
+ - Updated dependencies [0dd1ab9]
495
+ - @copilotkit/shared@1.5.19-next.1
496
+ - @copilotkit/runtime-client-gql@1.5.19-next.1
497
+
498
+ ## 1.5.19-next.0
499
+
500
+ ### Patch Changes
501
+
502
+ - 5bc68f8: - fix(actions): warn on action duplication
503
+ - fix(actions): warn on coagent state render duplication
504
+ - @copilotkit/runtime-client-gql@1.5.19-next.0
505
+ - @copilotkit/shared@1.5.19-next.0
506
+
507
+ ## 1.5.18
508
+
509
+ ### Patch Changes
510
+
511
+ - f77a7b9: - fix: use warning when version mismatch is not expected to error out
8
512
  - 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
513
+ - Updated dependencies [f77a7b9]
514
+ - Updated dependencies [38d3ac2]
515
+ - @copilotkit/runtime-client-gql@1.5.18
516
+ - @copilotkit/shared@1.5.18
517
+
518
+ ## 1.5.18-next.3
519
+
520
+ ### Patch Changes
521
+
522
+ - f77a7b9: - fix: use warning when version mismatch is not expected to error out
523
+ - Updated dependencies [f77a7b9]
524
+ - @copilotkit/runtime-client-gql@1.5.18-next.3
525
+ - @copilotkit/shared@1.5.18-next.3
526
+
527
+ ## 1.5.18-next.2
528
+
529
+ ### Patch Changes
530
+
531
+ - Updated dependencies [38d3ac2]
532
+ - @copilotkit/shared@1.5.18-next.2
533
+ - @copilotkit/runtime-client-gql@1.5.18-next.2
12
534
 
13
535
  ## 1.5.18-next.1
14
536
 
@@ -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":[]}