@copilotkit/react-core 0.0.0-fix-interrupt-issues-20250409144731 → 0.0.0-fix-agent-lock-20250618155414
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +415 -4
- package/dist/{chunk-FIMW65V5.mjs → chunk-2FLZLANO.mjs} +8 -7
- package/dist/chunk-2FLZLANO.mjs.map +1 -0
- package/dist/{chunk-O3IIH54P.mjs → chunk-2J3SMMGW.mjs} +2 -2
- package/dist/{chunk-GOZVY5WH.mjs → chunk-4DVPRMVH.mjs} +38 -23
- package/dist/chunk-4DVPRMVH.mjs.map +1 -0
- package/dist/{chunk-M5U4XPDV.mjs → chunk-4VWM6JNK.mjs} +3 -3
- package/dist/{chunk-37LXOL6B.mjs → chunk-6PK72HMH.mjs} +4 -4
- package/dist/{chunk-7VNK2RT2.mjs → chunk-74AJEJTV.mjs} +47 -20
- package/dist/chunk-74AJEJTV.mjs.map +1 -0
- package/dist/{chunk-XFL2DWUF.mjs → chunk-7HDYPEWS.mjs} +5 -5
- package/dist/{chunk-XFL2DWUF.mjs.map → chunk-7HDYPEWS.mjs.map} +1 -1
- package/dist/{chunk-SGXCSXCK.mjs → chunk-B5UA5G3E.mjs} +2 -2
- package/dist/{chunk-YI7LPACV.mjs → chunk-EQ4XLLT4.mjs} +3 -3
- package/dist/{chunk-PTSWFERP.mjs → chunk-ERFA53MG.mjs} +2 -1
- package/dist/chunk-ERFA53MG.mjs.map +1 -0
- package/dist/{chunk-AT4ALBK4.mjs → chunk-FGBRHBRR.mjs} +2 -2
- package/dist/{chunk-NY3BUYYZ.mjs → chunk-G27C5EFO.mjs} +2 -2
- package/dist/{chunk-OKBPP25E.mjs → chunk-MDIIRGJD.mjs} +15 -10
- package/dist/chunk-MDIIRGJD.mjs.map +1 -0
- package/dist/{chunk-6U3UH3KO.mjs → chunk-RKTVJRK7.mjs} +5 -2
- package/dist/chunk-RKTVJRK7.mjs.map +1 -0
- package/dist/{chunk-JHPCDBBM.mjs → chunk-VQ3VTO26.mjs} +2 -2
- package/dist/{chunk-7XNZHQWJ.mjs → chunk-WZAEVHLK.mjs} +2 -2
- package/dist/components/copilot-provider/copilot-messages.js +1 -0
- package/dist/components/copilot-provider/copilot-messages.js.map +1 -1
- package/dist/components/copilot-provider/copilot-messages.mjs +2 -2
- package/dist/components/copilot-provider/copilotkit-props.d.ts +1 -1
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.d.ts +1 -1
- package/dist/components/copilot-provider/copilotkit.js +12 -3
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +6 -6
- package/dist/components/copilot-provider/index.d.ts +1 -1
- package/dist/components/copilot-provider/index.js +12 -3
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +6 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +12 -3
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +6 -6
- package/dist/context/copilot-context.d.ts +1 -1
- package/dist/context/copilot-context.js +1 -0
- package/dist/context/copilot-context.js.map +1 -1
- package/dist/context/copilot-context.mjs +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +1 -0
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +4 -4
- package/dist/{copilot-context-c402f48d.d.ts → copilot-context-309906bb.d.ts} +13 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +80 -36
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +28 -28
- package/dist/hooks/use-chat.d.ts +1 -1
- package/dist/hooks/use-chat.js +45 -18
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +1 -1
- package/dist/hooks/use-coagent-state-render.js +1 -0
- package/dist/hooks/use-coagent-state-render.js.map +1 -1
- package/dist/hooks/use-coagent-state-render.mjs +2 -2
- package/dist/hooks/use-coagent.d.ts +15 -21
- package/dist/hooks/use-coagent.js +80 -36
- package/dist/hooks/use-coagent.js.map +1 -1
- package/dist/hooks/use-coagent.mjs +10 -10
- package/dist/hooks/use-copilot-action.js +1 -0
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +2 -2
- package/dist/hooks/use-copilot-additional-instructions.js +1 -0
- package/dist/hooks/use-copilot-additional-instructions.js.map +1 -1
- package/dist/hooks/use-copilot-additional-instructions.mjs +2 -2
- package/dist/hooks/use-copilot-authenticated-action.js +1 -0
- package/dist/hooks/use-copilot-authenticated-action.js.map +1 -1
- package/dist/hooks/use-copilot-authenticated-action.mjs +3 -3
- package/dist/hooks/use-copilot-chat.d.ts +8 -2
- package/dist/hooks/use-copilot-chat.js +77 -34
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +9 -9
- package/dist/hooks/use-copilot-readable.js +1 -0
- package/dist/hooks/use-copilot-readable.js.map +1 -1
- package/dist/hooks/use-copilot-readable.mjs +2 -2
- package/dist/hooks/use-langgraph-interrupt-render.js +1 -0
- package/dist/hooks/use-langgraph-interrupt-render.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt-render.mjs +2 -2
- package/dist/hooks/use-langgraph-interrupt.d.ts +1 -1
- package/dist/hooks/use-langgraph-interrupt.js +77 -34
- package/dist/hooks/use-langgraph-interrupt.js.map +1 -1
- package/dist/hooks/use-langgraph-interrupt.mjs +10 -10
- package/dist/hooks/use-make-copilot-document-readable.js +1 -0
- package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
- package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
- package/dist/hooks/use-tree.d.ts +1 -0
- package/dist/hooks/use-tree.js +4 -1
- package/dist/hooks/use-tree.js.map +1 -1
- package/dist/hooks/use-tree.mjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +94 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -32
- package/dist/lib/copilot-task.d.ts +1 -1
- package/dist/lib/copilot-task.js +3 -5
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +7 -7
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +3 -5
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +7 -7
- package/dist/types/coagent-state.d.ts +4 -1
- package/dist/types/coagent-state.js.map +1 -1
- package/dist/types/interrupt-action.d.ts +1 -1
- package/dist/utils/extract.d.ts +1 -1
- package/dist/utils/extract.js.map +1 -1
- package/dist/utils/extract.mjs +6 -6
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +6 -6
- package/package.json +3 -3
- package/src/components/copilot-provider/copilotkit-props.tsx +0 -1
- package/src/components/copilot-provider/copilotkit.tsx +7 -1
- package/src/context/copilot-context.tsx +11 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-chat.ts +68 -10
- package/src/hooks/use-coagent.ts +24 -21
- package/src/hooks/use-copilot-chat.ts +52 -27
- package/src/hooks/use-tree.ts +6 -1
- package/src/lib/copilot-task.ts +1 -1
- package/src/types/coagent-state.ts +4 -1
- package/dist/chunk-6U3UH3KO.mjs.map +0 -1
- package/dist/chunk-7VNK2RT2.mjs.map +0 -1
- package/dist/chunk-FIMW65V5.mjs.map +0 -1
- package/dist/chunk-GOZVY5WH.mjs.map +0 -1
- package/dist/chunk-OKBPP25E.mjs.map +0 -1
- package/dist/chunk-PTSWFERP.mjs.map +0 -1
- /package/dist/{chunk-O3IIH54P.mjs.map → chunk-2J3SMMGW.mjs.map} +0 -0
- /package/dist/{chunk-M5U4XPDV.mjs.map → chunk-4VWM6JNK.mjs.map} +0 -0
- /package/dist/{chunk-37LXOL6B.mjs.map → chunk-6PK72HMH.mjs.map} +0 -0
- /package/dist/{chunk-SGXCSXCK.mjs.map → chunk-B5UA5G3E.mjs.map} +0 -0
- /package/dist/{chunk-YI7LPACV.mjs.map → chunk-EQ4XLLT4.mjs.map} +0 -0
- /package/dist/{chunk-AT4ALBK4.mjs.map → chunk-FGBRHBRR.mjs.map} +0 -0
- /package/dist/{chunk-NY3BUYYZ.mjs.map → chunk-G27C5EFO.mjs.map} +0 -0
- /package/dist/{chunk-JHPCDBBM.mjs.map → chunk-VQ3VTO26.mjs.map} +0 -0
- /package/dist/{chunk-7XNZHQWJ.mjs.map → chunk-WZAEVHLK.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,426 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
-
## 0.0.0-fix-
|
|
3
|
+
## 0.0.0-fix-agent-lock-20250618155414
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- @copilotkit/runtime-client-gql@0.0.0-fix-agent-lock-20250618155414
|
|
8
|
+
- @copilotkit/shared@0.0.0-fix-agent-lock-20250618155414
|
|
9
|
+
|
|
10
|
+
## 1.9.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [deaeca0]
|
|
15
|
+
- @copilotkit/shared@1.9.1
|
|
16
|
+
- @copilotkit/runtime-client-gql@1.9.1
|
|
17
|
+
|
|
18
|
+
## 1.9.1-next.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [deaeca0]
|
|
23
|
+
- @copilotkit/shared@1.9.1-next.0
|
|
24
|
+
- @copilotkit/runtime-client-gql@1.9.1-next.0
|
|
25
|
+
|
|
26
|
+
## 1.9.0
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- 54cae30: - fix(react-core): allow custom toolChoice in forwardedParameters to override default
|
|
31
|
+
- fix: move react-dom to peerDependencies in @copilotkit/react-textarea
|
|
32
|
+
- feat: add amazon bedrock adapter support
|
|
33
|
+
- @copilotkit/runtime-client-gql@1.9.0
|
|
34
|
+
- @copilotkit/shared@1.9.0
|
|
35
|
+
|
|
36
|
+
## 1.9.0-next.2
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- @copilotkit/runtime-client-gql@1.9.0-next.2
|
|
41
|
+
- @copilotkit/shared@1.9.0-next.2
|
|
42
|
+
|
|
43
|
+
## 1.8.15-next.1
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- 54cae30: - fix(react-core): allow custom toolChoice in forwardedParameters to override default
|
|
48
|
+
- fix: move react-dom to peerDependencies in @copilotkit/react-textarea
|
|
49
|
+
- feat: add amazon bedrock adapter support
|
|
50
|
+
- @copilotkit/runtime-client-gql@1.8.15-next.1
|
|
51
|
+
- @copilotkit/shared@1.8.15-next.1
|
|
52
|
+
|
|
53
|
+
## 1.8.15-next.0
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- @copilotkit/runtime-client-gql@1.8.15-next.0
|
|
58
|
+
- @copilotkit/shared@1.8.15-next.0
|
|
59
|
+
|
|
60
|
+
## 1.8.14
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- 9cf1fda: - fix append follow-up when actions disable followUp
|
|
65
|
+
- Create stupid-nails-travel.md
|
|
66
|
+
- fixup
|
|
67
|
+
- 9cf1fda: - fix append follow-up when actions disable followUp
|
|
68
|
+
- Updated dependencies [34a78d8]
|
|
69
|
+
- @copilotkit/shared@1.8.14
|
|
70
|
+
- @copilotkit/runtime-client-gql@1.8.14
|
|
71
|
+
|
|
72
|
+
## 1.8.14-next.5
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- @copilotkit/runtime-client-gql@1.8.14-next.5
|
|
77
|
+
- @copilotkit/shared@1.8.14-next.5
|
|
78
|
+
|
|
79
|
+
## 1.8.14-next.4
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- @copilotkit/runtime-client-gql@1.8.14-next.4
|
|
84
|
+
- @copilotkit/shared@1.8.14-next.4
|
|
85
|
+
|
|
86
|
+
## 1.8.14-next.3
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- @copilotkit/runtime-client-gql@1.8.14-next.3
|
|
91
|
+
- @copilotkit/shared@1.8.14-next.3
|
|
92
|
+
|
|
93
|
+
## 1.8.14-next.2
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- @copilotkit/runtime-client-gql@1.8.14-next.2
|
|
98
|
+
- @copilotkit/shared@1.8.14-next.2
|
|
99
|
+
|
|
100
|
+
## 1.8.14-next.1
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- Updated dependencies [34a78d8]
|
|
105
|
+
- @copilotkit/shared@1.8.14-next.1
|
|
106
|
+
- @copilotkit/runtime-client-gql@1.8.14-next.1
|
|
107
|
+
|
|
108
|
+
## 1.8.14-next.0
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- 9cf1fda: - fix append follow-up when actions disable followUp
|
|
113
|
+
- Create stupid-nails-travel.md
|
|
114
|
+
- fixup
|
|
115
|
+
- 9cf1fda: - fix append follow-up when actions disable followUp
|
|
116
|
+
- @copilotkit/runtime-client-gql@1.8.14-next.0
|
|
117
|
+
- @copilotkit/shared@1.8.14-next.0
|
|
118
|
+
|
|
119
|
+
## 1.8.13
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- 7fcf5c4: - fix followUp check
|
|
124
|
+
- @copilotkit/runtime-client-gql@1.8.13
|
|
125
|
+
- @copilotkit/shared@1.8.13
|
|
126
|
+
|
|
127
|
+
## 1.8.13-next.3
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- @copilotkit/runtime-client-gql@1.8.13-next.3
|
|
132
|
+
- @copilotkit/shared@1.8.13-next.3
|
|
133
|
+
|
|
134
|
+
## 1.8.13-next.2
|
|
135
|
+
|
|
136
|
+
### Patch Changes
|
|
137
|
+
|
|
138
|
+
- @copilotkit/runtime-client-gql@1.8.13-next.2
|
|
139
|
+
- @copilotkit/shared@1.8.13-next.2
|
|
140
|
+
|
|
141
|
+
## 1.8.13-next.1
|
|
142
|
+
|
|
143
|
+
### Patch Changes
|
|
144
|
+
|
|
145
|
+
- 7fcf5c4: - fix followUp check
|
|
146
|
+
- @copilotkit/runtime-client-gql@1.8.13-next.1
|
|
147
|
+
- @copilotkit/shared@1.8.13-next.1
|
|
148
|
+
|
|
149
|
+
## 1.8.13-next.0
|
|
150
|
+
|
|
151
|
+
### Patch Changes
|
|
152
|
+
|
|
153
|
+
- @copilotkit/runtime-client-gql@1.8.13-next.0
|
|
154
|
+
- @copilotkit/shared@1.8.13-next.0
|
|
155
|
+
|
|
156
|
+
## 1.8.12
|
|
157
|
+
|
|
158
|
+
### Patch Changes
|
|
159
|
+
|
|
160
|
+
- 3e09584: - fix: stop passing config if not exists
|
|
161
|
+
- 33ba021: - partial revert of potentially breaking check
|
|
162
|
+
- wip
|
|
163
|
+
- @copilotkit/runtime-client-gql@1.8.12
|
|
164
|
+
- @copilotkit/shared@1.8.12
|
|
165
|
+
|
|
166
|
+
## 1.8.12-next.6
|
|
167
|
+
|
|
168
|
+
### Patch Changes
|
|
169
|
+
|
|
170
|
+
- 3e09584: - fix: stop passing config if not exists
|
|
171
|
+
- @copilotkit/runtime-client-gql@1.8.12-next.6
|
|
172
|
+
- @copilotkit/shared@1.8.12-next.6
|
|
173
|
+
|
|
174
|
+
## 1.8.12-next.5
|
|
175
|
+
|
|
176
|
+
### Patch Changes
|
|
177
|
+
|
|
178
|
+
- @copilotkit/runtime-client-gql@1.8.12-next.5
|
|
179
|
+
- @copilotkit/shared@1.8.12-next.5
|
|
180
|
+
|
|
181
|
+
## 1.8.12-next.4
|
|
182
|
+
|
|
183
|
+
### Patch Changes
|
|
184
|
+
|
|
185
|
+
- @copilotkit/runtime-client-gql@1.8.12-next.4
|
|
186
|
+
- @copilotkit/shared@1.8.12-next.4
|
|
187
|
+
|
|
188
|
+
## 1.8.12-next.3
|
|
189
|
+
|
|
190
|
+
### Patch Changes
|
|
191
|
+
|
|
192
|
+
- @copilotkit/runtime-client-gql@1.8.12-next.3
|
|
193
|
+
- @copilotkit/shared@1.8.12-next.3
|
|
194
|
+
|
|
195
|
+
## 1.8.12-next.2
|
|
196
|
+
|
|
197
|
+
### Patch Changes
|
|
198
|
+
|
|
199
|
+
- 33ba021: - partial revert of potentially breaking check
|
|
200
|
+
- wip
|
|
201
|
+
- @copilotkit/runtime-client-gql@1.8.12-next.2
|
|
202
|
+
- @copilotkit/shared@1.8.12-next.2
|
|
203
|
+
|
|
204
|
+
## 1.8.12-next.1
|
|
205
|
+
|
|
206
|
+
### Patch Changes
|
|
207
|
+
|
|
208
|
+
- @copilotkit/runtime-client-gql@1.8.12-next.1
|
|
209
|
+
- @copilotkit/shared@1.8.12-next.1
|
|
210
|
+
|
|
211
|
+
## 1.8.12-next.0
|
|
212
|
+
|
|
213
|
+
### Patch Changes
|
|
214
|
+
|
|
215
|
+
- @copilotkit/runtime-client-gql@1.8.12-next.0
|
|
216
|
+
- @copilotkit/shared@1.8.12-next.0
|
|
217
|
+
|
|
218
|
+
## 1.8.11
|
|
219
|
+
|
|
220
|
+
### Patch Changes
|
|
221
|
+
|
|
222
|
+
- @copilotkit/runtime-client-gql@1.8.11
|
|
223
|
+
- @copilotkit/shared@1.8.11
|
|
224
|
+
|
|
225
|
+
## 1.8.11-next.1
|
|
226
|
+
|
|
227
|
+
### Patch Changes
|
|
228
|
+
|
|
229
|
+
- @copilotkit/runtime-client-gql@1.8.11-next.1
|
|
230
|
+
- @copilotkit/shared@1.8.11-next.1
|
|
231
|
+
|
|
232
|
+
## 1.8.11-next.0
|
|
233
|
+
|
|
234
|
+
### Patch Changes
|
|
235
|
+
|
|
236
|
+
- @copilotkit/runtime-client-gql@1.8.11-next.0
|
|
237
|
+
- @copilotkit/shared@1.8.11-next.0
|
|
238
|
+
|
|
239
|
+
## 1.8.10
|
|
240
|
+
|
|
241
|
+
### Patch Changes
|
|
242
|
+
|
|
243
|
+
- 742efbb: - feat: enable setting langgraph config from ui
|
|
244
|
+
- chore: document usage of new config
|
|
245
|
+
- @copilotkit/runtime-client-gql@1.8.10
|
|
246
|
+
- @copilotkit/shared@1.8.10
|
|
247
|
+
|
|
248
|
+
## 1.8.10-next.3
|
|
249
|
+
|
|
250
|
+
### Patch Changes
|
|
251
|
+
|
|
252
|
+
- @copilotkit/runtime-client-gql@1.8.10-next.3
|
|
253
|
+
- @copilotkit/shared@1.8.10-next.3
|
|
254
|
+
|
|
255
|
+
## 1.8.10-next.2
|
|
256
|
+
|
|
257
|
+
### Patch Changes
|
|
258
|
+
|
|
259
|
+
- @copilotkit/runtime-client-gql@1.8.10-next.2
|
|
260
|
+
- @copilotkit/shared@1.8.10-next.2
|
|
261
|
+
|
|
262
|
+
## 1.8.10-next.1
|
|
263
|
+
|
|
264
|
+
### Patch Changes
|
|
265
|
+
|
|
266
|
+
- @copilotkit/runtime-client-gql@1.8.10-next.1
|
|
267
|
+
- @copilotkit/shared@1.8.10-next.1
|
|
268
|
+
|
|
269
|
+
## 1.8.10-next.0
|
|
270
|
+
|
|
271
|
+
### Patch Changes
|
|
272
|
+
|
|
273
|
+
- 742efbb: - feat: enable setting langgraph config from ui
|
|
274
|
+
- chore: document usage of new config
|
|
275
|
+
- @copilotkit/runtime-client-gql@1.8.10-next.0
|
|
276
|
+
- @copilotkit/shared@1.8.10-next.0
|
|
277
|
+
|
|
278
|
+
## 1.8.9
|
|
279
|
+
|
|
280
|
+
### Patch Changes
|
|
281
|
+
|
|
282
|
+
- @copilotkit/runtime-client-gql@1.8.9
|
|
283
|
+
- @copilotkit/shared@1.8.9
|
|
284
|
+
|
|
285
|
+
## 1.8.9-next.0
|
|
286
|
+
|
|
287
|
+
### Patch Changes
|
|
288
|
+
|
|
289
|
+
- @copilotkit/runtime-client-gql@1.8.9-next.0
|
|
290
|
+
- @copilotkit/shared@1.8.9-next.0
|
|
291
|
+
|
|
292
|
+
## 1.8.8
|
|
293
|
+
|
|
294
|
+
### Patch Changes
|
|
295
|
+
|
|
296
|
+
- dfb67c3: - refactor: rename mcpEndpoints to mcpServers for naming consistency
|
|
297
|
+
- doc changes
|
|
298
|
+
- @copilotkit/runtime-client-gql@1.8.8
|
|
299
|
+
- @copilotkit/shared@1.8.8
|
|
300
|
+
|
|
301
|
+
## 1.8.8-next.1
|
|
302
|
+
|
|
303
|
+
### Patch Changes
|
|
304
|
+
|
|
305
|
+
- @copilotkit/runtime-client-gql@1.8.8-next.1
|
|
306
|
+
- @copilotkit/shared@1.8.8-next.1
|
|
307
|
+
|
|
308
|
+
## 1.8.8-next.0
|
|
309
|
+
|
|
310
|
+
### Patch Changes
|
|
311
|
+
|
|
312
|
+
- dfb67c3: - refactor: rename mcpEndpoints to mcpServers for naming consistency
|
|
313
|
+
- doc changes
|
|
314
|
+
- @copilotkit/runtime-client-gql@1.8.8-next.0
|
|
315
|
+
- @copilotkit/shared@1.8.8-next.0
|
|
316
|
+
|
|
317
|
+
## 1.8.7
|
|
318
|
+
|
|
319
|
+
### Patch Changes
|
|
320
|
+
|
|
321
|
+
- Updated dependencies [8b8474f]
|
|
322
|
+
- @copilotkit/runtime-client-gql@1.8.7
|
|
323
|
+
- @copilotkit/shared@1.8.7
|
|
324
|
+
|
|
325
|
+
## 1.8.7-next.0
|
|
326
|
+
|
|
327
|
+
### Patch Changes
|
|
328
|
+
|
|
329
|
+
- Updated dependencies [8b8474f]
|
|
330
|
+
- @copilotkit/runtime-client-gql@1.8.7-next.0
|
|
331
|
+
- @copilotkit/shared@1.8.7-next.0
|
|
332
|
+
|
|
333
|
+
## 1.8.6
|
|
334
|
+
|
|
335
|
+
### Patch Changes
|
|
336
|
+
|
|
337
|
+
- 7a04bd1: - fix: fix how results are communicated back on interrupt
|
|
338
|
+
- fix: do not allow followup for interrupt actions
|
|
339
|
+
- chore: improve TS docs for interrupt
|
|
340
|
+
- @copilotkit/runtime-client-gql@1.8.6
|
|
341
|
+
- @copilotkit/shared@1.8.6
|
|
342
|
+
|
|
343
|
+
## 1.8.6-next.0
|
|
344
|
+
|
|
345
|
+
### Patch Changes
|
|
346
|
+
|
|
347
|
+
- 7a04bd1: - fix: fix how results are communicated back on interrupt
|
|
8
348
|
- fix: do not allow followup for interrupt actions
|
|
9
349
|
- chore: improve TS docs for interrupt
|
|
350
|
+
- @copilotkit/runtime-client-gql@1.8.6-next.0
|
|
351
|
+
- @copilotkit/shared@1.8.6-next.0
|
|
352
|
+
|
|
353
|
+
## 1.8.5
|
|
354
|
+
|
|
355
|
+
### Patch Changes
|
|
356
|
+
|
|
357
|
+
- c0d3261: - full AWP support
|
|
358
|
+
|
|
359
|
+
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
|
|
360
|
+
|
|
361
|
+
- refactor: address linter issues with the new pages
|
|
362
|
+
|
|
363
|
+
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
|
|
364
|
+
|
|
365
|
+
- Merge branch 'mme/acp' into mme/mastra
|
|
366
|
+
- add sse example
|
|
367
|
+
- Create small-turkeys-agree.md
|
|
368
|
+
- upgrade AWP
|
|
369
|
+
- Merge branch 'mme/mastra' of github.com:CopilotKit/CopilotKit into mme/mastra
|
|
370
|
+
- make agents a dict
|
|
371
|
+
- update docs
|
|
372
|
+
- send tools
|
|
373
|
+
- update to latest packages
|
|
374
|
+
- fix problem where state sync are preventing tool calls
|
|
375
|
+
- set possibly undefined toolCalls to an empty array
|
|
376
|
+
- fix missing tool call ids
|
|
377
|
+
|
|
378
|
+
- 77a7457: - feat: Add Model Context Protocol (MCP) support
|
|
10
379
|
- d0e8a1e: - fix: fix duplicate messages on regenerate
|
|
11
|
-
- @copilotkit/runtime-client-gql@
|
|
12
|
-
- @copilotkit/shared@
|
|
380
|
+
- @copilotkit/runtime-client-gql@1.8.5
|
|
381
|
+
- @copilotkit/shared@1.8.5
|
|
382
|
+
|
|
383
|
+
## 1.8.5-next.5
|
|
384
|
+
|
|
385
|
+
### Patch Changes
|
|
386
|
+
|
|
387
|
+
- c0d3261: - full AWP support
|
|
388
|
+
|
|
389
|
+
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
|
|
390
|
+
|
|
391
|
+
- refactor: address linter issues with the new pages
|
|
392
|
+
|
|
393
|
+
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
|
|
394
|
+
|
|
395
|
+
- Merge branch 'mme/acp' into mme/mastra
|
|
396
|
+
- add sse example
|
|
397
|
+
- Create small-turkeys-agree.md
|
|
398
|
+
- upgrade AWP
|
|
399
|
+
- Merge branch 'mme/mastra' of github.com:CopilotKit/CopilotKit into mme/mastra
|
|
400
|
+
- make agents a dict
|
|
401
|
+
- update docs
|
|
402
|
+
- send tools
|
|
403
|
+
- update to latest packages
|
|
404
|
+
- fix problem where state sync are preventing tool calls
|
|
405
|
+
- set possibly undefined toolCalls to an empty array
|
|
406
|
+
- fix missing tool call ids
|
|
407
|
+
- @copilotkit/runtime-client-gql@1.8.5-next.5
|
|
408
|
+
- @copilotkit/shared@1.8.5-next.5
|
|
409
|
+
|
|
410
|
+
## 1.8.5-next.4
|
|
411
|
+
|
|
412
|
+
### Patch Changes
|
|
413
|
+
|
|
414
|
+
- @copilotkit/runtime-client-gql@1.8.5-next.4
|
|
415
|
+
- @copilotkit/shared@1.8.5-next.4
|
|
416
|
+
|
|
417
|
+
## 1.8.5-next.3
|
|
418
|
+
|
|
419
|
+
### Patch Changes
|
|
420
|
+
|
|
421
|
+
- 77a7457: - feat: Add Model Context Protocol (MCP) support
|
|
422
|
+
- @copilotkit/runtime-client-gql@1.8.5-next.3
|
|
423
|
+
- @copilotkit/shared@1.8.5-next.3
|
|
13
424
|
|
|
14
425
|
## 1.8.5-next.2
|
|
15
426
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotChat
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
useCopilotContext
|
|
6
|
-
} from "./chunk-PTSWFERP.mjs";
|
|
3
|
+
} from "./chunk-4DVPRMVH.mjs";
|
|
7
4
|
import {
|
|
8
5
|
useCopilotMessagesContext
|
|
9
6
|
} from "./chunk-DCTJZ742.mjs";
|
|
10
7
|
import {
|
|
11
8
|
useCopilotRuntimeClient
|
|
12
9
|
} from "./chunk-BKTARDXX.mjs";
|
|
10
|
+
import {
|
|
11
|
+
useCopilotContext
|
|
12
|
+
} from "./chunk-ERFA53MG.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAsyncCallback,
|
|
15
15
|
useToast
|
|
@@ -41,9 +41,11 @@ function useCoAgent(options) {
|
|
|
41
41
|
const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
|
|
42
42
|
const { coagentStates, coagentStatesRef, setCoagentStatesWithRef, threadId, copilotApiConfig } = context;
|
|
43
43
|
const { appendMessage, runChatCompletion } = useCopilotChat();
|
|
44
|
+
const headers = __spreadValues({}, copilotApiConfig.headers || {});
|
|
44
45
|
const runtimeClient = useCopilotRuntimeClient({
|
|
45
46
|
url: copilotApiConfig.chatApiEndpoint,
|
|
46
47
|
publicApiKey: copilotApiConfig.publicApiKey,
|
|
48
|
+
headers,
|
|
47
49
|
credentials: copilotApiConfig.credentials
|
|
48
50
|
});
|
|
49
51
|
const setState = useCallback(
|
|
@@ -176,14 +178,13 @@ var getCoagentState = ({
|
|
|
176
178
|
name,
|
|
177
179
|
options
|
|
178
180
|
}) => {
|
|
179
|
-
var _a;
|
|
180
181
|
if (coagentStates[name]) {
|
|
181
182
|
return coagentStates[name];
|
|
182
183
|
} else {
|
|
183
184
|
return {
|
|
184
185
|
name,
|
|
185
186
|
state: isInternalStateManagementWithInitial(options) ? options.initialState : {},
|
|
186
|
-
|
|
187
|
+
config: options.config ? options.config : options.configurable ? { configurable: options.configurable } : {},
|
|
187
188
|
running: false,
|
|
188
189
|
active: false,
|
|
189
190
|
threadId: void 0,
|
|
@@ -199,4 +200,4 @@ export {
|
|
|
199
200
|
stopAgent,
|
|
200
201
|
runAgent
|
|
201
202
|
};
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
203
|
+
//# sourceMappingURL=chunk-2FLZLANO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-coagent.ts"],"sourcesContent":["/**\n * <Callout type=\"info\">\n * Usage of this hook assumes some additional setup in your application, for more information\n * on that see the CoAgents <span className=\"text-blue-500\">[getting started guide](/coagents/quickstart/langgraph)</span>.\n * </Callout>\n * <Frame className=\"my-12\">\n * <img\n * src=\"/images/coagents/SharedStateCoAgents.gif\"\n * alt=\"CoAgents demonstration\"\n * className=\"w-auto\"\n * />\n * </Frame>\n *\n * This hook is used to integrate an agent into your application. With its use, you can\n * render and update the state of an agent, allowing for a dynamic and interactive experience.\n * We call these shared state experiences agentic copilots, or CoAgents for short.\n *\n * ## Usage\n *\n * ### Simple Usage\n *\n * ```tsx\n * import { useCoAgent } from \"@copilotkit/react-core\";\n *\n * type AgentState = {\n * count: number;\n * }\n *\n * const agent = useCoAgent<AgentState>({\n * name: \"my-agent\",\n * initialState: {\n * count: 0,\n * },\n * });\n *\n * ```\n *\n * `useCoAgent` returns an object with the following properties:\n *\n * ```tsx\n * const {\n * name, // The name of the agent currently being used.\n * nodeName, // The name of the current LangGraph node.\n * state, // The current state of the agent.\n * setState, // A function to update the state of the agent.\n * running, // A boolean indicating if the agent is currently running.\n * start, // A function to start the agent.\n * stop, // A function to stop the agent.\n * run, // A function to re-run the agent. Takes a HintFunction to inform the agent why it is being re-run.\n * } = agent;\n * ```\n *\n * Finally we can leverage these properties to create reactive experiences with the agent!\n *\n * ```tsx\n * const { state, setState } = useCoAgent<AgentState>({\n * name: \"my-agent\",\n * initialState: {\n * count: 0,\n * },\n * });\n *\n * return (\n * <div>\n * <p>Count: {state.count}</p>\n * <button onClick={() => setState({ count: state.count + 1 })}>Increment</button>\n * </div>\n * );\n * ```\n *\n * This reactivity is bidirectional, meaning that changes to the state from the agent will be reflected in the UI and vice versa.\n *\n * ## Parameters\n * <PropertyReference name=\"options\" type=\"UseCoagentOptions<T>\" required>\n * The options to use when creating the coagent.\n * <PropertyReference name=\"name\" type=\"string\" required>\n * The name of the agent to use.\n * </PropertyReference>\n * <PropertyReference name=\"initialState\" type=\"T | any\">\n * The initial state of the agent.\n * </PropertyReference>\n * <PropertyReference name=\"state\" type=\"T | any\">\n * State to manage externally if you are using this hook with external state management.\n * </PropertyReference>\n * <PropertyReference name=\"setState\" type=\"(newState: T | ((prevState: T | undefined) => T)) => void\">\n * A function to update the state of the agent if you are using this hook with external state management.\n * </PropertyReference>\n * </PropertyReference>\n */\n\nimport { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport {\n CopilotContextParams,\n CopilotMessagesContextParams,\n useCopilotContext,\n useCopilotMessagesContext,\n} from \"../context\";\nimport { CoagentState } from \"../types/coagent-state\";\nimport { useCopilotChat } from \"./use-copilot-chat\";\nimport { Message } from \"@copilotkit/runtime-client-gql\";\nimport { useAsyncCallback } from \"../components/error-boundary/error-utils\";\nimport { useToast } from \"../components/toast/toast-provider\";\nimport { useCopilotRuntimeClient } from \"./use-copilot-runtime-client\";\nimport { parseJson } from \"@copilotkit/shared\";\n\ninterface UseCoagentOptionsBase {\n /**\n * The name of the agent being used.\n */\n name: string;\n /**\n * @deprecated - use \"config.configurable\"\n * Config to pass to a LangGraph Agent\n */\n configurable?: Record<string, any>;\n /**\n * Config to pass to a LangGraph Agent\n */\n config?: {\n configurable?: Record<string, any>;\n [key: string]: any;\n };\n}\n\ninterface WithInternalStateManagementAndInitial<T> extends UseCoagentOptionsBase {\n /**\n * The initial state of the agent.\n */\n initialState: T;\n}\n\ninterface WithInternalStateManagement extends UseCoagentOptionsBase {\n /**\n * Optional initialState with default type any\n */\n initialState?: any;\n}\n\ninterface WithExternalStateManagement<T> extends UseCoagentOptionsBase {\n /**\n * The current state of the agent.\n */\n state: T;\n /**\n * A function to update the state of the agent.\n */\n setState: (newState: T | ((prevState: T | undefined) => T)) => void;\n}\n\ntype UseCoagentOptions<T> =\n | WithInternalStateManagementAndInitial<T>\n | WithInternalStateManagement\n | WithExternalStateManagement<T>;\n\nexport interface UseCoagentReturnType<T> {\n /**\n * The name of the agent being used.\n */\n name: string;\n /**\n * The name of the current LangGraph node.\n */\n nodeName?: string;\n /**\n * The ID of the thread the agent is running in.\n */\n threadId?: string;\n /**\n * A boolean indicating if the agent is currently running.\n */\n running: boolean;\n /**\n * The current state of the agent.\n */\n state: T;\n /**\n * A function to update the state of the agent.\n */\n setState: (newState: T | ((prevState: T | undefined) => T)) => void;\n /**\n * A function to start the agent.\n */\n start: () => void;\n /**\n * A function to stop the agent.\n */\n stop: () => void;\n /**\n * A function to re-run the agent. The hint function can be used to provide a hint to the agent\n * about why it is being re-run again.\n */\n run: (hint?: HintFunction) => Promise<void>;\n}\n\nexport interface HintFunctionParams {\n /**\n * The previous state of the agent.\n */\n previousState: any;\n /**\n * The current state of the agent.\n */\n currentState: any;\n}\n\nexport type HintFunction = (params: HintFunctionParams) => Message | undefined;\n\n/**\n * This hook is used to integrate an agent into your application. With its use, you can\n * render and update the state of the agent, allowing for a dynamic and interactive experience.\n * We call these shared state experiences \"agentic copilots\". To get started using agentic copilots, which\n * we refer to as CoAgents, checkout the documentation at https://docs.copilotkit.ai/coagents/quickstart/langgraph.\n */\nexport function useCoAgent<T = any>(options: UseCoagentOptions<T>): UseCoagentReturnType<T> {\n const generalContext = useCopilotContext();\n const { availableAgents } = generalContext;\n const { addToast } = useToast();\n const lastLoadedThreadId = useRef<string>();\n const lastLoadedState = useRef<any>();\n\n const { name } = options;\n useEffect(() => {\n if (availableAgents?.length && !availableAgents.some((a) => a.name === name)) {\n const message = `(useCoAgent): Agent \"${name}\" not found. Make sure the agent exists and is properly configured.`;\n console.warn(message);\n addToast({ type: \"warning\", message });\n }\n }, [availableAgents]);\n\n const messagesContext = useCopilotMessagesContext();\n const context = { ...generalContext, ...messagesContext };\n const { coagentStates, coagentStatesRef, setCoagentStatesWithRef, threadId, copilotApiConfig } =\n context;\n const { appendMessage, runChatCompletion } = useCopilotChat();\n const headers = {\n ...(copilotApiConfig.headers || {}),\n };\n\n const runtimeClient = useCopilotRuntimeClient({\n url: copilotApiConfig.chatApiEndpoint,\n publicApiKey: copilotApiConfig.publicApiKey,\n headers,\n credentials: copilotApiConfig.credentials,\n });\n\n // if we manage state internally, we need to provide a function to set the state\n const setState = useCallback(\n (newState: T | ((prevState: T | undefined) => T)) => {\n // coagentStatesRef.current || {}\n let coagentState: CoagentState = getCoagentState({ coagentStates, name, options });\n const updatedState =\n typeof newState === \"function\" ? (newState as Function)(coagentState.state) : newState;\n\n setCoagentStatesWithRef({\n ...coagentStatesRef.current,\n [name]: {\n ...coagentState,\n state: updatedState,\n },\n });\n },\n [coagentStates, name],\n );\n\n useEffect(() => {\n const fetchAgentState = async () => {\n if (!threadId || threadId === lastLoadedThreadId.current) return;\n\n const result = await runtimeClient.loadAgentState({\n threadId,\n agentName: name,\n });\n\n const newState = result.data?.loadAgentState?.state;\n if (newState === lastLoadedState.current) return;\n\n if (result.data?.loadAgentState?.threadExists && newState && newState != \"{}\") {\n lastLoadedState.current = newState;\n lastLoadedThreadId.current = threadId;\n const fetchedState = parseJson(newState, {});\n isExternalStateManagement(options)\n ? options.setState(fetchedState)\n : setState(fetchedState);\n }\n };\n void fetchAgentState();\n }, [threadId]);\n\n // Sync internal state with external state if state management is external\n useEffect(() => {\n if (isExternalStateManagement(options)) {\n setState(options.state);\n } else if (coagentStates[name] === undefined) {\n setState(options.initialState === undefined ? {} : options.initialState);\n }\n }, [\n isExternalStateManagement(options) ? JSON.stringify(options.state) : undefined,\n // reset initialstate on reset\n coagentStates[name] === undefined,\n ]);\n\n const runAgentCallback = useAsyncCallback(\n async (hint?: HintFunction) => {\n await runAgent(name, context, appendMessage, runChatCompletion, hint);\n },\n [name, context, appendMessage, runChatCompletion],\n );\n\n // Return the state and setState function\n return useMemo(() => {\n const coagentState = getCoagentState({ coagentStates, name, options });\n return {\n name,\n nodeName: coagentState.nodeName,\n threadId: coagentState.threadId,\n running: coagentState.running,\n state: coagentState.state,\n setState: isExternalStateManagement(options) ? options.setState : setState,\n start: () => startAgent(name, context),\n stop: () => stopAgent(name, context),\n run: runAgentCallback,\n };\n }, [name, coagentStates, options, setState, runAgentCallback]);\n}\n\nexport function startAgent(name: string, context: CopilotContextParams) {\n const { setAgentSession } = context;\n setAgentSession({\n agentName: name,\n });\n}\n\nexport function stopAgent(name: string, context: CopilotContextParams) {\n const { agentSession, setAgentSession } = context;\n if (agentSession && agentSession.agentName === name) {\n setAgentSession(null);\n context.setCoagentStates((prevAgentStates) => {\n return {\n ...prevAgentStates,\n [name]: {\n ...prevAgentStates[name],\n running: false,\n active: false,\n threadId: undefined,\n nodeName: undefined,\n runId: undefined,\n },\n };\n });\n } else {\n console.warn(`No agent session found for ${name}`);\n }\n}\n\nexport async function runAgent(\n name: string,\n context: CopilotContextParams & CopilotMessagesContextParams,\n appendMessage: (message: Message) => Promise<void>,\n runChatCompletion: () => Promise<Message[]>,\n hint?: HintFunction,\n) {\n const { agentSession, setAgentSession } = context;\n if (!agentSession || agentSession.agentName !== name) {\n setAgentSession({\n agentName: name,\n });\n }\n\n let previousState: any = null;\n for (let i = context.messages.length - 1; i >= 0; i--) {\n const message = context.messages[i];\n if (message.isAgentStateMessage() && message.agentName === name) {\n previousState = message.state;\n }\n }\n\n let state = context.coagentStatesRef.current?.[name]?.state || {};\n\n if (hint) {\n const hintMessage = hint({ previousState, currentState: state });\n if (hintMessage) {\n await appendMessage(hintMessage);\n } else {\n await runChatCompletion();\n }\n } else {\n await runChatCompletion();\n }\n}\n\nconst isExternalStateManagement = <T>(\n options: UseCoagentOptions<T>,\n): options is WithExternalStateManagement<T> => {\n return \"state\" in options && \"setState\" in options;\n};\n\nconst isInternalStateManagementWithInitial = <T>(\n options: UseCoagentOptions<T>,\n): options is WithInternalStateManagementAndInitial<T> => {\n return \"initialState\" in options;\n};\n\nconst getCoagentState = <T>({\n coagentStates,\n name,\n options,\n}: {\n coagentStates: Record<string, CoagentState>;\n name: string;\n options: UseCoagentOptions<T>;\n}) => {\n if (coagentStates[name]) {\n return coagentStates[name];\n } else {\n return {\n name,\n state: isInternalStateManagementWithInitial<T>(options) ? options.initialState : {},\n config: options.config\n ? options.config\n : options.configurable\n ? { configurable: options.configurable }\n : {},\n running: false,\n active: false,\n threadId: undefined,\n nodeName: undefined,\n runId: undefined,\n };\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0FA,SAAS,aAAa,WAAW,SAAS,cAAc;AAaxD,SAAS,iBAAiB;AA8GnB,SAAS,WAAoB,SAAwD;AAC1F,QAAM,iBAAiB,kBAAkB;AACzC,QAAM,EAAE,gBAAgB,IAAI;AAC5B,QAAM,EAAE,SAAS,IAAI,SAAS;AAC9B,QAAM,qBAAqB,OAAe;AAC1C,QAAM,kBAAkB,OAAY;AAEpC,QAAM,EAAE,KAAK,IAAI;AACjB,YAAU,MAAM;AACd,SAAI,mDAAiB,WAAU,CAAC,gBAAgB,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI,GAAG;AAC5E,YAAM,UAAU,wBAAwB;AACxC,cAAQ,KAAK,OAAO;AACpB,eAAS,EAAE,MAAM,WAAW,QAAQ,CAAC;AAAA,IACvC;AAAA,EACF,GAAG,CAAC,eAAe,CAAC;AAEpB,QAAM,kBAAkB,0BAA0B;AAClD,QAAM,UAAU,kCAAK,iBAAmB;AACxC,QAAM,EAAE,eAAe,kBAAkB,yBAAyB,UAAU,iBAAiB,IAC3F;AACF,QAAM,EAAE,eAAe,kBAAkB,IAAI,eAAe;AAC5D,QAAM,UAAU,mBACV,iBAAiB,WAAW,CAAC;AAGnC,QAAM,gBAAgB,wBAAwB;AAAA,IAC5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AAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,UAAU;AAAA,MACV,OAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ERFA53MG.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-additional-instructions.ts
|
|
6
6
|
import { useEffect } from "react";
|
|
@@ -21,4 +21,4 @@ function useCopilotAdditionalInstructions({ instructions, available = "enabled"
|
|
|
21
21
|
export {
|
|
22
22
|
useCopilotAdditionalInstructions
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-2J3SMMGW.mjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultCopilotContextCategories
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
useCopilotContext
|
|
6
|
-
} from "./chunk-PTSWFERP.mjs";
|
|
3
|
+
} from "./chunk-MDIIRGJD.mjs";
|
|
7
4
|
import {
|
|
8
5
|
useCopilotMessagesContext
|
|
9
6
|
} from "./chunk-DCTJZ742.mjs";
|
|
10
7
|
import {
|
|
11
8
|
useChat
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-74AJEJTV.mjs";
|
|
10
|
+
import {
|
|
11
|
+
useCopilotContext
|
|
12
|
+
} from "./chunk-ERFA53MG.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAsyncCallback
|
|
15
15
|
} from "./chunk-22ENANUU.mjs";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-SKC7AJIV.mjs";
|
|
22
22
|
|
|
23
23
|
// src/hooks/use-copilot-chat.ts
|
|
24
|
-
import { useRef, useEffect, useCallback } from "react";
|
|
24
|
+
import { useRef, useEffect, useCallback, useState } from "react";
|
|
25
25
|
import { Role, TextMessage } from "@copilotkit/runtime-client-gql";
|
|
26
26
|
function useCopilotChat(_a = {}) {
|
|
27
27
|
var _b = _a, {
|
|
@@ -55,21 +55,20 @@ function useCopilotChat(_a = {}) {
|
|
|
55
55
|
setLangGraphInterruptAction
|
|
56
56
|
} = useCopilotContext();
|
|
57
57
|
const { messages, setMessages } = useCopilotMessagesContext();
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, [getContextString, makeSystemMessage, chatInstructions]);
|
|
58
|
+
const [mcpServers, setLocalMcpServers] = useState([]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (mcpServers.length > 0) {
|
|
61
|
+
const serversCopy = [...mcpServers];
|
|
62
|
+
copilotApiConfig.mcpServers = serversCopy;
|
|
63
|
+
if (!copilotApiConfig.properties) {
|
|
64
|
+
copilotApiConfig.properties = {};
|
|
65
|
+
}
|
|
66
|
+
copilotApiConfig.properties.mcpServers = serversCopy;
|
|
67
|
+
}
|
|
68
|
+
}, [mcpServers, copilotApiConfig]);
|
|
69
|
+
const setMcpServers = useCallback((servers) => {
|
|
70
|
+
setLocalMcpServers(servers);
|
|
71
|
+
}, []);
|
|
73
72
|
const onCoAgentStateRender = useAsyncCallback(
|
|
74
73
|
(args) => __async(this, null, function* () {
|
|
75
74
|
var _a2;
|
|
@@ -88,6 +87,20 @@ function useCopilotChat(_a = {}) {
|
|
|
88
87
|
}),
|
|
89
88
|
[coAgentStateRenders]
|
|
90
89
|
);
|
|
90
|
+
const makeSystemMessageCallback = useCallback(() => {
|
|
91
|
+
const systemMessageMaker = makeSystemMessage || defaultSystemMessage;
|
|
92
|
+
const contextString = getContextString([], defaultCopilotContextCategories);
|
|
93
|
+
return new TextMessage({
|
|
94
|
+
content: systemMessageMaker(contextString, chatInstructions),
|
|
95
|
+
role: Role.System
|
|
96
|
+
});
|
|
97
|
+
}, [getContextString, makeSystemMessage, chatInstructions]);
|
|
98
|
+
const deleteMessage = useCallback(
|
|
99
|
+
(messageId) => {
|
|
100
|
+
setMessages((prev) => prev.filter((message) => message.id !== messageId));
|
|
101
|
+
},
|
|
102
|
+
[setMessages]
|
|
103
|
+
);
|
|
91
104
|
const { append, reload, stop, runChatCompletion } = useChat(__spreadProps(__spreadValues({}, options), {
|
|
92
105
|
actions: Object.values(actions),
|
|
93
106
|
copilotConfig: copilotApiConfig,
|
|
@@ -184,7 +197,9 @@ function useCopilotChat(_a = {}) {
|
|
|
184
197
|
reset: latestResetFunc,
|
|
185
198
|
deleteMessage: latestDeleteFunc,
|
|
186
199
|
runChatCompletion: latestRunChatCompletionFunc,
|
|
187
|
-
isLoading
|
|
200
|
+
isLoading,
|
|
201
|
+
mcpServers,
|
|
202
|
+
setMcpServers
|
|
188
203
|
};
|
|
189
204
|
}
|
|
190
205
|
function useUpdatedRef(value) {
|
|
@@ -225,4 +240,4 @@ export {
|
|
|
225
240
|
useCopilotChat,
|
|
226
241
|
defaultSystemMessage
|
|
227
242
|
};
|
|
228
|
-
//# sourceMappingURL=chunk-
|
|
243
|
+
//# sourceMappingURL=chunk-4DVPRMVH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-copilot-chat.ts"],"sourcesContent":["/**\n * `useCopilotChat` is a React hook that lets you directly interact with the\n * Copilot instance. Use to implement a fully custom UI (headless UI) or to\n * programmatically interact with the Copilot instance managed by the default\n * UI.\n *\n * ## Usage\n *\n * ### Simple Usage\n *\n * ```tsx\n * import { useCopilotChat } from \"@copilotkit/react-core\";\n * import { Role, TextMessage } from \"@copilotkit/runtime-client-gql\";\n *\n * export function YourComponent() {\n * const { appendMessage } = useCopilotChat();\n *\n * appendMessage(\n * new TextMessage({\n * content: \"Hello World\",\n * role: Role.User,\n * }),\n * );\n *\n * // optionally, you can append a message without running chat completion\n * appendMessage(yourMessage, { followUp: false });\n * }\n * ```\n *\n * `useCopilotChat` returns an object with the following properties:\n *\n * ```tsx\n * const {\n * visibleMessages, // An array of messages that are currently visible in the chat.\n * appendMessage, // A function to append a message to the chat.\n * setMessages, // A function to set the messages in the chat.\n * deleteMessage, // A function to delete a message from the chat.\n * reloadMessages, // A function to reload the messages from the API.\n * stopGeneration, // A function to stop the generation of the next message.\n * reset, // A function to reset the chat.\n * isLoading, // A boolean indicating if the chat is loading.\n * } = useCopilotChat();\n * ```\n */\nimport { useRef, useEffect, useCallback, useState } from \"react\";\nimport { AgentSession, useCopilotContext } from \"../context/copilot-context\";\nimport { Message, Role, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { SystemMessageFunction } from \"../types\";\nimport { useChat, AppendMessageOptions } from \"./use-chat\";\nimport { defaultCopilotContextCategories } from \"../components\";\nimport { CoAgentStateRenderHandlerArguments } from \"@copilotkit/shared\";\nimport { useCopilotMessagesContext } from \"../context\";\nimport { useAsyncCallback } from \"../components/error-boundary/error-utils\";\n\nexport interface UseCopilotChatOptions {\n /**\n * A unique identifier for the chat. If not provided, a random one will be\n * generated. When provided, the `useChat` hook with the same `id` will\n * have shared states across components.\n */\n id?: string;\n\n /**\n * HTTP headers to be sent with the API request.\n */\n headers?: Record<string, string> | Headers;\n /**\n * System messages of the chat. Defaults to an empty array.\n */\n initialMessages?: Message[];\n\n /**\n * A function to generate the system message. Defaults to `defaultSystemMessage`.\n */\n makeSystemMessage?: SystemMessageFunction;\n}\n\nexport interface MCPServerConfig {\n endpoint: string;\n apiKey?: string;\n}\n\nexport interface UseCopilotChatReturn {\n visibleMessages: Message[];\n appendMessage: (message: Message, options?: AppendMessageOptions) => Promise<void>;\n setMessages: (messages: Message[]) => void;\n deleteMessage: (messageId: string) => void;\n reloadMessages: (messageId: string) => Promise<void>;\n stopGeneration: () => void;\n reset: () => void;\n isLoading: boolean;\n runChatCompletion: () => Promise<Message[]>;\n mcpServers: MCPServerConfig[];\n setMcpServers: (mcpServers: MCPServerConfig[]) => void;\n}\n\nexport function useCopilotChat({\n makeSystemMessage,\n ...options\n}: UseCopilotChatOptions = {}): UseCopilotChatReturn {\n const {\n getContextString,\n getFunctionCallHandler,\n copilotApiConfig,\n isLoading,\n setIsLoading,\n chatInstructions,\n actions,\n coagentStatesRef,\n setCoagentStatesWithRef,\n coAgentStateRenders,\n agentSession,\n setAgentSession,\n forwardedParameters,\n agentLock,\n threadId,\n setThreadId,\n runId,\n setRunId,\n chatAbortControllerRef,\n extensions,\n setExtensions,\n langGraphInterruptAction,\n setLangGraphInterruptAction,\n } = useCopilotContext();\n const { messages, setMessages } = useCopilotMessagesContext();\n\n // Simple state for MCP servers (keep for interface compatibility)\n const [mcpServers, setLocalMcpServers] = useState<MCPServerConfig[]>([]);\n\n // This effect directly updates the context when mcpServers state changes\n useEffect(() => {\n if (mcpServers.length > 0) {\n // Copy to avoid issues\n const serversCopy = [...mcpServers];\n\n // Update in all locations\n copilotApiConfig.mcpServers = serversCopy;\n\n // Also ensure it's in properties\n if (!copilotApiConfig.properties) {\n copilotApiConfig.properties = {};\n }\n copilotApiConfig.properties.mcpServers = serversCopy;\n }\n }, [mcpServers, copilotApiConfig]);\n\n // Provide the same interface\n const setMcpServers = useCallback((servers: MCPServerConfig[]) => {\n setLocalMcpServers(servers);\n }, []);\n\n // Move these function declarations above the useChat call\n const onCoAgentStateRender = useAsyncCallback(\n async (args: CoAgentStateRenderHandlerArguments) => {\n const { name, nodeName, state } = args;\n let action = Object.values(coAgentStateRenders).find(\n (action) => action.name === name && action.nodeName === nodeName,\n );\n if (!action) {\n action = Object.values(coAgentStateRenders).find(\n (action) => action.name === name && !action.nodeName,\n );\n }\n if (action) {\n await action.handler?.({ state, nodeName });\n }\n },\n [coAgentStateRenders],\n );\n\n const makeSystemMessageCallback = useCallback(() => {\n const systemMessageMaker = makeSystemMessage || defaultSystemMessage;\n // this always gets the latest context string\n const contextString = getContextString([], defaultCopilotContextCategories); // TODO: make the context categories configurable\n\n return new TextMessage({\n content: systemMessageMaker(contextString, chatInstructions),\n role: Role.System,\n });\n }, [getContextString, makeSystemMessage, chatInstructions]);\n\n const deleteMessage = useCallback(\n (messageId: string) => {\n setMessages((prev) => prev.filter((message) => message.id !== messageId));\n },\n [setMessages],\n );\n\n // Get chat helpers with updated config\n const { append, reload, stop, runChatCompletion } = useChat({\n ...options,\n actions: Object.values(actions),\n copilotConfig: copilotApiConfig,\n initialMessages: options.initialMessages || [],\n onFunctionCall: getFunctionCallHandler(),\n onCoAgentStateRender,\n messages,\n setMessages,\n makeSystemMessageCallback,\n isLoading,\n setIsLoading,\n coagentStatesRef,\n setCoagentStatesWithRef,\n agentSession,\n setAgentSession,\n forwardedParameters,\n threadId,\n setThreadId,\n runId,\n setRunId,\n chatAbortControllerRef,\n agentLock,\n extensions,\n setExtensions,\n langGraphInterruptAction,\n setLangGraphInterruptAction,\n });\n\n const latestAppend = useUpdatedRef(append);\n const latestAppendFunc = useAsyncCallback(\n async (message: Message, options?: AppendMessageOptions) => {\n return await latestAppend.current(message, options);\n },\n [latestAppend],\n );\n\n const latestReload = useUpdatedRef(reload);\n const latestReloadFunc = useAsyncCallback(\n async (messageId: string) => {\n return await latestReload.current(messageId);\n },\n [latestReload],\n );\n\n const latestStop = useUpdatedRef(stop);\n const latestStopFunc = useCallback(() => {\n return latestStop.current();\n }, [latestStop]);\n\n const latestDelete = useUpdatedRef(deleteMessage);\n const latestDeleteFunc = useCallback(\n (messageId: string) => {\n return latestDelete.current(messageId);\n },\n [latestDelete],\n );\n\n const latestSetMessages = useUpdatedRef(setMessages);\n const latestSetMessagesFunc = useCallback(\n (messages: Message[]) => {\n return latestSetMessages.current(messages);\n },\n [latestSetMessages],\n );\n\n const latestRunChatCompletion = useUpdatedRef(runChatCompletion);\n const latestRunChatCompletionFunc = useAsyncCallback(async () => {\n return await latestRunChatCompletion.current!();\n }, [latestRunChatCompletion]);\n\n const reset = useCallback(() => {\n latestStopFunc();\n setMessages([]);\n setRunId(null);\n setCoagentStatesWithRef({});\n let initialAgentSession: AgentSession | null = null;\n if (agentLock) {\n initialAgentSession = {\n agentName: agentLock,\n };\n }\n setAgentSession(initialAgentSession);\n }, [\n latestStopFunc,\n setMessages,\n setThreadId,\n setCoagentStatesWithRef,\n setAgentSession,\n agentLock,\n ]);\n\n const latestReset = useUpdatedRef(reset);\n const latestResetFunc = useCallback(() => {\n return latestReset.current();\n }, [latestReset]);\n\n return {\n visibleMessages: messages,\n appendMessage: latestAppendFunc,\n setMessages: latestSetMessagesFunc,\n reloadMessages: latestReloadFunc,\n stopGeneration: latestStopFunc,\n reset: latestResetFunc,\n deleteMessage: latestDeleteFunc,\n runChatCompletion: latestRunChatCompletionFunc,\n isLoading,\n mcpServers,\n setMcpServers,\n };\n}\n\n// store `value` in a ref and update\n// it whenever it changes.\nfunction useUpdatedRef<T>(value: T) {\n const ref = useRef(value);\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref;\n}\n\nexport function defaultSystemMessage(\n contextString: string,\n additionalInstructions?: string,\n): string {\n return (\n `\nPlease act as an efficient, competent, conscientious, and industrious professional assistant.\n\nHelp the user achieve their goals, and you do so in a way that is as efficient as possible, without unnecessary fluff, but also without sacrificing professionalism.\nAlways be polite and respectful, and prefer brevity over verbosity.\n\nThe user has provided you with the following context:\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n\nThey have also provided you with functions you can call to initiate actions on their behalf, or functions you can call to receive more information.\n\nPlease assist them as best you can.\n\nYou can ask them for clarifying questions if needed, but don't be annoying about it. If you can reasonably 'fill in the blanks' yourself, do so.\n\nIf you would like to call a function, call it without saying anything else.\nIn case of a function error:\n- If this error stems from incorrect function parameters or syntax, you may retry with corrected arguments.\n- If the error's source is unclear or seems unrelated to your input, do not attempt further retries.\n` + (additionalInstructions ? `\\n\\n${additionalInstructions}` : \"\")\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4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