@copilotkit/runtime-client-gql 0.0.0-main-20260126221712 → 0.0.0-main-20260402184302
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 +421 -3
- package/codegen.ts +4 -1
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/client/CopilotRuntimeClient.cjs +119 -0
- package/dist/client/CopilotRuntimeClient.cjs.map +1 -0
- package/dist/client/CopilotRuntimeClient.d.cts +44 -0
- package/dist/client/CopilotRuntimeClient.d.cts.map +1 -0
- package/dist/client/CopilotRuntimeClient.d.mts +44 -0
- package/dist/client/CopilotRuntimeClient.d.mts.map +1 -0
- package/dist/client/CopilotRuntimeClient.mjs +116 -10
- package/dist/client/CopilotRuntimeClient.mjs.map +1 -1
- package/dist/client/conversion.cjs +199 -0
- package/dist/client/conversion.cjs.map +1 -0
- package/dist/client/{conversion.d.ts → conversion.d.cts} +5 -4
- package/dist/client/conversion.d.cts.map +1 -0
- package/dist/client/conversion.d.mts +12 -0
- package/dist/client/conversion.d.mts.map +1 -0
- package/dist/client/conversion.mjs +192 -17
- package/dist/client/conversion.mjs.map +1 -1
- package/dist/client/index.d.cts +5 -0
- package/dist/client/index.d.mts +5 -0
- package/dist/client/types.cjs +86 -0
- package/dist/client/types.cjs.map +1 -0
- package/dist/client/types.d.cts +76 -0
- package/dist/client/types.d.cts.map +1 -0
- package/dist/client/types.d.mts +76 -0
- package/dist/client/types.d.mts.map +1 -0
- package/dist/client/types.mjs +76 -21
- package/dist/client/types.mjs.map +1 -1
- package/dist/{chunk-KTA7QTTU.mjs.map → graphql/@generated/gql.cjs} +15 -1
- package/dist/graphql/@generated/gql.cjs.map +1 -0
- package/dist/graphql/@generated/gql.mjs +13 -7
- package/dist/graphql/@generated/gql.mjs.map +1 -1
- package/dist/graphql/@generated/graphql.cjs +1154 -0
- package/dist/graphql/@generated/graphql.cjs.map +1 -0
- package/dist/graphql/@generated/graphql.d.cts +642 -0
- package/dist/graphql/@generated/graphql.d.cts.map +1 -0
- package/dist/graphql/@generated/graphql.d.mts +642 -0
- package/dist/graphql/@generated/graphql.d.mts.map +1 -0
- package/dist/graphql/@generated/graphql.mjs +1142 -24
- package/dist/graphql/@generated/graphql.mjs.map +1 -1
- package/dist/{chunk-KTA7QTTU.mjs → graphql/definitions/mutations.cjs} +12 -12
- package/dist/graphql/definitions/mutations.cjs.map +1 -0
- package/dist/graphql/definitions/mutations.mjs +140 -9
- package/dist/graphql/definitions/mutations.mjs.map +1 -1
- package/dist/graphql/definitions/queries.cjs +35 -0
- package/dist/graphql/definitions/queries.cjs.map +1 -0
- package/dist/graphql/definitions/queries.mjs +33 -11
- package/dist/graphql/definitions/queries.mjs.map +1 -1
- package/dist/index.cjs +43 -0
- package/dist/index.d.cts +9 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +8 -91
- package/dist/index.umd.js +2089 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/message-conversion/agui-to-gql.cjs +166 -0
- package/dist/message-conversion/agui-to-gql.cjs.map +1 -0
- package/dist/message-conversion/{agui-to-gql.d.ts → agui-to-gql.d.cts} +6 -5
- package/dist/message-conversion/agui-to-gql.d.cts.map +1 -0
- package/dist/message-conversion/agui-to-gql.d.mts +14 -0
- package/dist/message-conversion/agui-to-gql.d.mts.map +1 -0
- package/dist/message-conversion/agui-to-gql.mjs +160 -25
- package/dist/message-conversion/agui-to-gql.mjs.map +1 -1
- package/dist/message-conversion/gql-to-agui.cjs +169 -0
- package/dist/message-conversion/gql-to-agui.cjs.map +1 -0
- package/dist/message-conversion/{gql-to-agui.d.ts → gql-to-agui.d.cts} +6 -5
- package/dist/message-conversion/gql-to-agui.d.cts.map +1 -0
- package/dist/message-conversion/gql-to-agui.d.mts +13 -0
- package/dist/message-conversion/gql-to-agui.d.mts.map +1 -0
- package/dist/message-conversion/gql-to-agui.mjs +164 -23
- package/dist/message-conversion/gql-to-agui.mjs.map +1 -1
- package/dist/message-conversion/index.d.cts +2 -0
- package/dist/message-conversion/index.d.mts +2 -0
- package/dist/package.cjs +12 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.mjs +6 -0
- package/dist/package.mjs.map +1 -0
- package/package.json +38 -38
- package/project.json +4 -0
- package/src/client/CopilotRuntimeClient.ts +21 -5
- package/src/client/__tests__/conversion.test.ts +64 -0
- package/src/client/conversion.ts +16 -2
- package/src/client/types.ts +34 -12
- package/src/graphql/@generated/gql.ts +3 -3
- package/src/graphql/definitions/mutations.ts +4 -1
- package/src/message-conversion/agui-to-gql.test.ts +139 -18
- package/src/message-conversion/agui-to-gql.ts +64 -18
- package/src/message-conversion/gql-to-agui.test.ts +101 -26
- package/src/message-conversion/gql-to-agui.ts +31 -12
- package/src/message-conversion/roundtrip-conversion.test.ts +54 -19
- package/tsconfig.json +2 -2
- package/tsdown.config.ts +47 -0
- package/vitest.config.mjs +12 -0
- package/dist/chunk-3ETRQN2E.mjs +0 -38
- package/dist/chunk-3ETRQN2E.mjs.map +0 -1
- package/dist/chunk-7ECCT6PK.mjs +0 -1
- package/dist/chunk-7ECCT6PK.mjs.map +0 -1
- package/dist/chunk-AMFKR5ST.mjs +0 -237
- package/dist/chunk-AMFKR5ST.mjs.map +0 -1
- package/dist/chunk-CA4VMP2C.mjs +0 -1
- package/dist/chunk-CA4VMP2C.mjs.map +0 -1
- package/dist/chunk-DELDZXUX.mjs +0 -31
- package/dist/chunk-DELDZXUX.mjs.map +0 -1
- package/dist/chunk-EIPAWDCN.mjs +0 -213
- package/dist/chunk-EIPAWDCN.mjs.map +0 -1
- package/dist/chunk-FG6RU64Q.mjs +0 -165
- package/dist/chunk-FG6RU64Q.mjs.map +0 -1
- package/dist/chunk-L6PM6AT3.mjs +0 -17722
- package/dist/chunk-L6PM6AT3.mjs.map +0 -1
- package/dist/chunk-M5LBGBWO.mjs +0 -20
- package/dist/chunk-M5LBGBWO.mjs.map +0 -1
- package/dist/chunk-NHOKFX55.mjs +0 -89
- package/dist/chunk-NHOKFX55.mjs.map +0 -1
- package/dist/chunk-OBDQ5BWD.mjs +0 -63
- package/dist/chunk-OBDQ5BWD.mjs.map +0 -1
- package/dist/chunk-RNENVFJ3.mjs +0 -221
- package/dist/chunk-RNENVFJ3.mjs.map +0 -1
- package/dist/chunk-XZPL6QVK.mjs +0 -24
- package/dist/chunk-XZPL6QVK.mjs.map +0 -1
- package/dist/client/CopilotRuntimeClient.d.ts +0 -39
- package/dist/client/CopilotRuntimeClient.js +0 -352
- package/dist/client/CopilotRuntimeClient.js.map +0 -1
- package/dist/client/conversion.js +0 -339
- package/dist/client/conversion.js.map +0 -1
- package/dist/client/index.d.ts +0 -8
- package/dist/client/index.js +0 -693
- package/dist/client/index.js.map +0 -1
- package/dist/client/index.mjs +0 -43
- package/dist/client/index.mjs.map +0 -1
- package/dist/client/types.d.ts +0 -75
- package/dist/client/types.js +0 -128
- package/dist/client/types.js.map +0 -1
- package/dist/graphql/@generated/fragment-masking.d.ts +0 -22
- package/dist/graphql/@generated/fragment-masking.js +0 -50
- package/dist/graphql/@generated/fragment-masking.js.map +0 -1
- package/dist/graphql/@generated/fragment-masking.mjs +0 -12
- package/dist/graphql/@generated/fragment-masking.mjs.map +0 -1
- package/dist/graphql/@generated/gql.d.ts +0 -48
- package/dist/graphql/@generated/gql.js +0 -45
- package/dist/graphql/@generated/gql.js.map +0 -1
- package/dist/graphql/@generated/graphql.d.ts +0 -655
- package/dist/graphql/@generated/graphql.js +0 -96
- package/dist/graphql/@generated/graphql.js.map +0 -1
- package/dist/graphql/@generated/index.d.ts +0 -4
- package/dist/graphql/@generated/index.js +0 -69
- package/dist/graphql/@generated/index.js.map +0 -1
- package/dist/graphql/@generated/index.mjs +0 -17
- package/dist/graphql/@generated/index.mjs.map +0 -1
- package/dist/graphql/definitions/mutations.d.ts +0 -9
- package/dist/graphql/definitions/mutations.js +0 -178
- package/dist/graphql/definitions/mutations.js.map +0 -1
- package/dist/graphql/definitions/queries.d.ts +0 -11
- package/dist/graphql/definitions/queries.js +0 -76
- package/dist/graphql/definitions/queries.js.map +0 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -1176
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/magic-string.es-26DP735G.mjs +0 -1389
- package/dist/magic-string.es-26DP735G.mjs.map +0 -1
- package/dist/message-conversion/agui-to-gql.js +0 -324
- package/dist/message-conversion/agui-to-gql.js.map +0 -1
- package/dist/message-conversion/agui-to-gql.test.d.ts +0 -2
- package/dist/message-conversion/agui-to-gql.test.js +0 -20502
- package/dist/message-conversion/agui-to-gql.test.js.map +0 -1
- package/dist/message-conversion/agui-to-gql.test.mjs +0 -1106
- package/dist/message-conversion/agui-to-gql.test.mjs.map +0 -1
- package/dist/message-conversion/gql-to-agui.js +0 -254
- package/dist/message-conversion/gql-to-agui.js.map +0 -1
- package/dist/message-conversion/gql-to-agui.test.d.ts +0 -2
- package/dist/message-conversion/gql-to-agui.test.js +0 -20769
- package/dist/message-conversion/gql-to-agui.test.js.map +0 -1
- package/dist/message-conversion/gql-to-agui.test.mjs +0 -1374
- package/dist/message-conversion/gql-to-agui.test.mjs.map +0 -1
- package/dist/message-conversion/index.d.ts +0 -6
- package/dist/message-conversion/index.js +0 -535
- package/dist/message-conversion/index.js.map +0 -1
- package/dist/message-conversion/index.mjs +0 -39
- package/dist/message-conversion/index.mjs.map +0 -1
- package/dist/message-conversion/roundtrip-conversion.test.d.ts +0 -2
- package/dist/message-conversion/roundtrip-conversion.test.js +0 -20033
- package/dist/message-conversion/roundtrip-conversion.test.js.map +0 -1
- package/dist/message-conversion/roundtrip-conversion.test.mjs +0 -455
- package/dist/message-conversion/roundtrip-conversion.test.mjs.map +0 -1
- package/jest.config.js +0 -5
- package/tsup.config.ts +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,418 @@
|
|
|
1
1
|
# @copilotkit/runtime-client-gql
|
|
2
2
|
|
|
3
|
-
## 0.0.0-main-
|
|
3
|
+
## 0.0.0-main-20260402184302
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1ceb963: refactor: consolidate V1/V2 packages into flat @copilotkit/\* structure
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [1ceb963]
|
|
12
|
+
- @copilotkit/shared@0.0.0-main-20260402184302
|
|
13
|
+
|
|
14
|
+
## 1.55.0-next.8
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- @copilotkit/shared@1.55.0-next.8
|
|
19
|
+
|
|
20
|
+
## 1.55.0-next.7
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- 1ceb963: refactor: consolidate V1/V2 packages into flat @copilotkit/\* structure
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [1ceb963]
|
|
29
|
+
- @copilotkit/shared@1.55.0-next.7
|
|
30
|
+
|
|
31
|
+
## 1.54.1-next.6
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- @copilotkit/shared@1.54.1-next.6
|
|
36
|
+
|
|
37
|
+
## 1.54.1-next.5
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- @copilotkit/shared@1.54.1-next.5
|
|
42
|
+
|
|
43
|
+
## 1.54.1-next.4
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- @copilotkit/shared@1.54.1-next.4
|
|
48
|
+
|
|
49
|
+
## 1.54.1-next.3
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- @copilotkit/shared@1.54.1-next.3
|
|
54
|
+
|
|
55
|
+
## 1.54.1-next.2
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- @copilotkit/shared@1.54.1-next.2
|
|
60
|
+
|
|
61
|
+
## 1.54.1-next.1
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- @copilotkit/shared@1.54.1-next.1
|
|
66
|
+
|
|
67
|
+
## 1.54.1-next.0
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- @copilotkit/shared@1.54.1-next.0
|
|
72
|
+
|
|
73
|
+
## 1.54.0
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- @copilotkit/shared@1.54.0
|
|
78
|
+
|
|
79
|
+
## 1.54.0-next.9
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- @copilotkit/shared@1.54.0-next.9
|
|
84
|
+
|
|
85
|
+
## 1.54.0-next.8
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- @copilotkit/shared@1.54.0-next.8
|
|
90
|
+
|
|
91
|
+
## 1.54.0-next.7
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- @copilotkit/shared@1.54.0-next.7
|
|
96
|
+
|
|
97
|
+
## 1.54.0-next.6
|
|
4
98
|
|
|
5
99
|
### Patch Changes
|
|
6
100
|
|
|
101
|
+
- @copilotkit/shared@1.54.0-next.6
|
|
102
|
+
|
|
103
|
+
## 1.54.0-next.5
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- @copilotkit/shared@1.54.0-next.5
|
|
108
|
+
|
|
109
|
+
## 1.54.0-next.4
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- @copilotkit/shared@1.54.0-next.4
|
|
114
|
+
|
|
115
|
+
## 1.54.0-next.3
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- @copilotkit/shared@1.54.0-next.3
|
|
120
|
+
|
|
121
|
+
## 1.53.1-next.2
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- @copilotkit/shared@1.53.1-next.2
|
|
126
|
+
|
|
127
|
+
## 1.53.1-next.1
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- @copilotkit/shared@1.53.1-next.1
|
|
132
|
+
|
|
133
|
+
## 1.53.1-next.0
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- @copilotkit/shared@1.53.1-next.0
|
|
138
|
+
|
|
139
|
+
## 1.53.0
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Updated dependencies [1510f64]
|
|
144
|
+
- Updated dependencies [bf1fc6f]
|
|
145
|
+
- @copilotkit/shared@1.53.0
|
|
146
|
+
|
|
147
|
+
## 1.53.0-next.6
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- @copilotkit/shared@1.53.0-next.6
|
|
152
|
+
|
|
153
|
+
## 1.53.0-next.5
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- @copilotkit/shared@1.53.0-next.5
|
|
158
|
+
|
|
159
|
+
## 1.52.2-next.4
|
|
160
|
+
|
|
161
|
+
### Patch Changes
|
|
162
|
+
|
|
163
|
+
- @copilotkit/shared@1.52.2-next.4
|
|
164
|
+
|
|
165
|
+
## 1.52.2-next.3
|
|
166
|
+
|
|
167
|
+
### Patch Changes
|
|
168
|
+
|
|
169
|
+
- Updated dependencies [1510f64]
|
|
170
|
+
- @copilotkit/shared@1.52.2-next.3
|
|
171
|
+
|
|
172
|
+
## 1.52.2-next.2
|
|
173
|
+
|
|
174
|
+
### Patch Changes
|
|
175
|
+
|
|
176
|
+
- Updated dependencies [8e0f94f]
|
|
177
|
+
- @copilotkit/runtime@1.52.2-next.2
|
|
178
|
+
- @copilotkit/shared@1.52.2-next.2
|
|
179
|
+
|
|
180
|
+
## 1.52.2-next.1
|
|
181
|
+
|
|
182
|
+
### Patch Changes
|
|
183
|
+
|
|
184
|
+
- Updated dependencies [d1f7aba]
|
|
185
|
+
- Updated dependencies [bf1fc6f]
|
|
186
|
+
- @copilotkit/runtime@1.52.2-next.1
|
|
187
|
+
- @copilotkit/shared@1.52.2-next.1
|
|
188
|
+
|
|
189
|
+
## 1.52.2-next.0
|
|
190
|
+
|
|
191
|
+
### Patch Changes
|
|
192
|
+
|
|
193
|
+
- @copilotkit/runtime@1.52.2-next.0
|
|
194
|
+
- @copilotkit/shared@1.52.2-next.0
|
|
195
|
+
|
|
196
|
+
## 1.52.1
|
|
197
|
+
|
|
198
|
+
### Patch Changes
|
|
199
|
+
|
|
200
|
+
- @copilotkit/runtime@1.52.1
|
|
201
|
+
- @copilotkit/shared@1.52.1
|
|
202
|
+
|
|
203
|
+
## 1.52.1-next.1
|
|
204
|
+
|
|
205
|
+
### Patch Changes
|
|
206
|
+
|
|
207
|
+
- @copilotkit/runtime@1.52.1-next.1
|
|
208
|
+
- @copilotkit/shared@1.52.1-next.1
|
|
209
|
+
|
|
210
|
+
## 1.52.1-next.0
|
|
211
|
+
|
|
212
|
+
### Patch Changes
|
|
213
|
+
|
|
214
|
+
- @copilotkit/runtime@1.52.1-next.0
|
|
215
|
+
- @copilotkit/shared@1.52.1-next.0
|
|
216
|
+
|
|
217
|
+
## 1.52.0
|
|
218
|
+
|
|
219
|
+
### Patch Changes
|
|
220
|
+
|
|
221
|
+
- Updated dependencies [6dd6c84]
|
|
222
|
+
- Updated dependencies [ef0f539]
|
|
223
|
+
- @copilotkit/runtime@1.52.0
|
|
224
|
+
- @copilotkit/shared@1.52.0
|
|
225
|
+
|
|
226
|
+
## 1.52.0-next.8
|
|
227
|
+
|
|
228
|
+
### Patch Changes
|
|
229
|
+
|
|
230
|
+
- @copilotkit/runtime@1.52.0-next.8
|
|
231
|
+
- @copilotkit/shared@1.52.0-next.8
|
|
232
|
+
|
|
233
|
+
## 1.52.0-next.7
|
|
234
|
+
|
|
235
|
+
### Patch Changes
|
|
236
|
+
|
|
237
|
+
- @copilotkit/runtime@1.52.0-next.7
|
|
238
|
+
- @copilotkit/shared@1.52.0-next.7
|
|
239
|
+
|
|
240
|
+
## 1.52.0-next.6
|
|
241
|
+
|
|
242
|
+
### Patch Changes
|
|
243
|
+
|
|
244
|
+
- @copilotkit/runtime@1.52.0-next.6
|
|
245
|
+
- @copilotkit/shared@1.52.0-next.6
|
|
246
|
+
|
|
247
|
+
## 1.52.0-next.5
|
|
248
|
+
|
|
249
|
+
### Patch Changes
|
|
250
|
+
|
|
251
|
+
- Updated dependencies [6dd6c84]
|
|
252
|
+
- @copilotkit/runtime@1.52.0-next.5
|
|
253
|
+
- @copilotkit/shared@1.52.0-next.5
|
|
254
|
+
|
|
255
|
+
## 1.51.5-next.4
|
|
256
|
+
|
|
257
|
+
### Patch Changes
|
|
258
|
+
|
|
259
|
+
- @copilotkit/runtime@1.51.5-next.4
|
|
260
|
+
- @copilotkit/shared@1.51.5-next.4
|
|
261
|
+
|
|
262
|
+
## 1.51.5-next.3
|
|
263
|
+
|
|
264
|
+
### Patch Changes
|
|
265
|
+
|
|
266
|
+
- @copilotkit/runtime@1.51.5-next.3
|
|
267
|
+
- @copilotkit/shared@1.51.5-next.3
|
|
268
|
+
|
|
269
|
+
## 1.51.5-next.2
|
|
270
|
+
|
|
271
|
+
### Patch Changes
|
|
272
|
+
|
|
273
|
+
- @copilotkit/runtime@1.51.5-next.2
|
|
274
|
+
- @copilotkit/shared@1.51.5-next.2
|
|
275
|
+
|
|
276
|
+
## 1.51.5-next.1
|
|
277
|
+
|
|
278
|
+
### Patch Changes
|
|
279
|
+
|
|
280
|
+
- @copilotkit/runtime@1.51.5-next.1
|
|
281
|
+
- @copilotkit/shared@1.51.5-next.1
|
|
282
|
+
|
|
283
|
+
## 1.51.5-next.0
|
|
284
|
+
|
|
285
|
+
### Patch Changes
|
|
286
|
+
|
|
287
|
+
- Updated dependencies [ef0f539]
|
|
288
|
+
- @copilotkit/runtime@1.51.5-next.0
|
|
289
|
+
- @copilotkit/shared@1.51.5-next.0
|
|
290
|
+
|
|
291
|
+
## 1.51.4
|
|
292
|
+
|
|
293
|
+
### Patch Changes
|
|
294
|
+
|
|
295
|
+
- Updated dependencies [8d67519]
|
|
296
|
+
- Updated dependencies [4886f18]
|
|
297
|
+
- @copilotkit/runtime@1.51.4
|
|
298
|
+
- @copilotkit/shared@1.51.4
|
|
299
|
+
|
|
300
|
+
## 1.51.4-next.8
|
|
301
|
+
|
|
302
|
+
### Patch Changes
|
|
303
|
+
|
|
304
|
+
- @copilotkit/runtime@1.51.4-next.8
|
|
305
|
+
- @copilotkit/shared@1.51.4-next.8
|
|
306
|
+
|
|
307
|
+
## 1.51.4-next.7
|
|
308
|
+
|
|
309
|
+
### Patch Changes
|
|
310
|
+
|
|
311
|
+
- @copilotkit/runtime@1.51.4-next.7
|
|
312
|
+
- @copilotkit/shared@1.51.4-next.7
|
|
313
|
+
|
|
314
|
+
## 1.51.4-next.6
|
|
315
|
+
|
|
316
|
+
### Patch Changes
|
|
317
|
+
|
|
318
|
+
- @copilotkit/runtime@1.51.4-next.6
|
|
319
|
+
- @copilotkit/shared@1.51.4-next.6
|
|
320
|
+
|
|
321
|
+
## 1.51.4-next.5
|
|
322
|
+
|
|
323
|
+
### Patch Changes
|
|
324
|
+
|
|
325
|
+
- Updated dependencies [8d67519]
|
|
326
|
+
- @copilotkit/runtime@1.51.4-next.5
|
|
327
|
+
- @copilotkit/shared@1.51.4-next.5
|
|
328
|
+
|
|
329
|
+
## 1.51.4-next.4
|
|
330
|
+
|
|
331
|
+
### Patch Changes
|
|
332
|
+
|
|
333
|
+
- @copilotkit/runtime@1.51.4-next.4
|
|
334
|
+
- @copilotkit/shared@1.51.4-next.4
|
|
335
|
+
|
|
336
|
+
## 1.51.4-next.3
|
|
337
|
+
|
|
338
|
+
### Patch Changes
|
|
339
|
+
|
|
340
|
+
- @copilotkit/runtime@1.51.4-next.3
|
|
341
|
+
- @copilotkit/shared@1.51.4-next.3
|
|
342
|
+
|
|
343
|
+
## 1.51.4-next.2
|
|
344
|
+
|
|
345
|
+
### Patch Changes
|
|
346
|
+
|
|
347
|
+
- @copilotkit/runtime@1.51.4-next.2
|
|
348
|
+
- @copilotkit/shared@1.51.4-next.2
|
|
349
|
+
|
|
350
|
+
## 1.51.4-next.1
|
|
351
|
+
|
|
352
|
+
### Patch Changes
|
|
353
|
+
|
|
354
|
+
- @copilotkit/runtime@1.51.4-next.1
|
|
355
|
+
- @copilotkit/shared@1.51.4-next.1
|
|
356
|
+
|
|
357
|
+
## 1.51.4-next.0
|
|
358
|
+
|
|
359
|
+
### Patch Changes
|
|
360
|
+
|
|
361
|
+
- Updated dependencies [4886f18]
|
|
362
|
+
- @copilotkit/runtime@1.51.4-next.0
|
|
363
|
+
- @copilotkit/shared@1.51.4-next.0
|
|
364
|
+
|
|
365
|
+
## 1.51.3
|
|
366
|
+
|
|
367
|
+
### Patch Changes
|
|
368
|
+
|
|
369
|
+
- d36fc1e: Add UMD export
|
|
7
370
|
- Updated dependencies [d655e75]
|
|
8
371
|
- Updated dependencies [d268c49]
|
|
9
|
-
|
|
10
|
-
|
|
372
|
+
- Updated dependencies [d36fc1e]
|
|
373
|
+
- Updated dependencies [b49277b]
|
|
374
|
+
- Updated dependencies [3a0822d]
|
|
375
|
+
- @copilotkit/runtime@1.51.3
|
|
376
|
+
- @copilotkit/shared@1.51.3
|
|
377
|
+
|
|
378
|
+
## 1.51.3-next.8
|
|
379
|
+
|
|
380
|
+
### Patch Changes
|
|
381
|
+
|
|
382
|
+
- d36fc1e: Add UMD export
|
|
383
|
+
- Updated dependencies [d36fc1e]
|
|
384
|
+
- @copilotkit/runtime@1.51.3-next.8
|
|
385
|
+
- @copilotkit/shared@1.51.3-next.8
|
|
386
|
+
|
|
387
|
+
## 1.51.3-next.7
|
|
388
|
+
|
|
389
|
+
### Patch Changes
|
|
390
|
+
|
|
391
|
+
- @copilotkit/runtime@1.51.3-next.7
|
|
392
|
+
- @copilotkit/shared@1.51.3-next.7
|
|
393
|
+
|
|
394
|
+
## 1.51.3-next.6
|
|
395
|
+
|
|
396
|
+
### Patch Changes
|
|
397
|
+
|
|
398
|
+
- Updated dependencies [3a0822d]
|
|
399
|
+
- @copilotkit/runtime@1.51.3-next.6
|
|
400
|
+
- @copilotkit/shared@1.51.3-next.6
|
|
401
|
+
|
|
402
|
+
## 1.51.3-next.5
|
|
403
|
+
|
|
404
|
+
### Patch Changes
|
|
405
|
+
|
|
406
|
+
- @copilotkit/runtime@1.51.3-next.5
|
|
407
|
+
- @copilotkit/shared@1.51.3-next.5
|
|
408
|
+
|
|
409
|
+
## 1.51.3-next.4
|
|
410
|
+
|
|
411
|
+
### Patch Changes
|
|
412
|
+
|
|
413
|
+
- Updated dependencies [b49277b]
|
|
414
|
+
- @copilotkit/runtime@1.51.3-next.4
|
|
415
|
+
- @copilotkit/shared@1.51.3-next.4
|
|
11
416
|
|
|
12
417
|
## 1.51.3-next.3
|
|
13
418
|
|
|
@@ -558,6 +963,7 @@
|
|
|
558
963
|
- 7bf9dfa: - fix: address issue where catch-all tool renders don't work
|
|
559
964
|
|
|
560
965
|
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
|
|
966
|
+
|
|
561
967
|
- @copilotkit/shared@1.10.1
|
|
562
968
|
|
|
563
969
|
## 1.10.1-next.2
|
|
@@ -573,6 +979,7 @@
|
|
|
573
979
|
- 76e2603: - fix: make tool call results be structured in generativeUI
|
|
574
980
|
|
|
575
981
|
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
|
|
982
|
+
|
|
576
983
|
- @copilotkit/shared@1.10.1-next.1
|
|
577
984
|
|
|
578
985
|
## 1.10.1-next.0
|
|
@@ -582,6 +989,7 @@
|
|
|
582
989
|
- 7bf9dfa: - fix: address issue where catch-all tool renders don't work
|
|
583
990
|
|
|
584
991
|
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
|
|
992
|
+
|
|
585
993
|
- @copilotkit/shared@1.10.1-next.0
|
|
586
994
|
|
|
587
995
|
## 1.10.0
|
|
@@ -594,12 +1002,14 @@
|
|
|
594
1002
|
agentic runtimes we acquired tech-debt that, with this PR, is being alleviated.
|
|
595
1003
|
|
|
596
1004
|
As such, the following features have been updated to be completely functional with Headless UI.
|
|
1005
|
+
|
|
597
1006
|
- Generative UI
|
|
598
1007
|
- Suggestions
|
|
599
1008
|
- Agentic Generative UI
|
|
600
1009
|
- Interrupts
|
|
601
1010
|
|
|
602
1011
|
In addition, a variety of QOL changes have been made.
|
|
1012
|
+
|
|
603
1013
|
- New AG-UI based message types
|
|
604
1014
|
- Inline code rendering is fixed
|
|
605
1015
|
|
|
@@ -702,12 +1112,14 @@
|
|
|
702
1112
|
agentic runtimes we acquired tech-debt that, with this PR, is being alleviated.
|
|
703
1113
|
|
|
704
1114
|
As such, the following features have been updated to be completely functional with Headless UI.
|
|
1115
|
+
|
|
705
1116
|
- Generative UI
|
|
706
1117
|
- Suggestions
|
|
707
1118
|
- Agentic Generative UI
|
|
708
1119
|
- Interrupts
|
|
709
1120
|
|
|
710
1121
|
In addition, a variety of QOL changes have been made.
|
|
1122
|
+
|
|
711
1123
|
- New AG-UI based message types
|
|
712
1124
|
- Inline code rendering is fixed
|
|
713
1125
|
|
|
@@ -1684,6 +2096,7 @@
|
|
|
1684
2096
|
- 0dc0f43: - fix(runtime-client-gql): call controller.close() after suppressing abort errors
|
|
1685
2097
|
|
|
1686
2098
|
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
|
|
2099
|
+
|
|
1687
2100
|
- @copilotkit/shared@1.5.15-next.5
|
|
1688
2101
|
|
|
1689
2102
|
## 1.5.15-next.4
|
|
@@ -2115,6 +2528,7 @@
|
|
|
2115
2528
|
- e16d95e: New prerelease
|
|
2116
2529
|
- 1721cbd: Add convertActionsToDynamicStructuredTools to sdk-js
|
|
2117
2530
|
- CopilotKit Core:
|
|
2531
|
+
|
|
2118
2532
|
- Improved error messages and overall logs
|
|
2119
2533
|
- `useCopilotAction.renderAndAwait` renamed to `.renderAndAwaitForResponse` (backwards compatible, will be deprecated in the future)
|
|
2120
2534
|
- Improved scrolling behavior. It is now possible to scroll up during LLM response generation
|
|
@@ -2122,6 +2536,7 @@
|
|
|
2122
2536
|
- Updated interfaces for better developer ergonomics
|
|
2123
2537
|
|
|
2124
2538
|
CoAgents:
|
|
2539
|
+
|
|
2125
2540
|
- Renamed `remoteActions` to `remoteEndpoints` (backwards compatible, will be deprecated in the future)
|
|
2126
2541
|
- Support for LangGraph Platform in Remote Endpoints
|
|
2127
2542
|
- LangGraph JS Support for CoAgents (locally via `langgraph dev`, `langgraph up` or deployed to LangGraph Platform)
|
|
@@ -2129,6 +2544,7 @@
|
|
|
2129
2544
|
- Enhanced state management and message handling
|
|
2130
2545
|
|
|
2131
2546
|
CopilotKid Back-end SDK:
|
|
2547
|
+
|
|
2132
2548
|
- Released a whole-new `@copilotkit/sdk-js` for building agents with LangGraph JS Support
|
|
2133
2549
|
|
|
2134
2550
|
- 8d0144f: bump
|
|
@@ -2495,6 +2911,7 @@ CopilotKid Back-end SDK:
|
|
|
2495
2911
|
### Patch Changes
|
|
2496
2912
|
|
|
2497
2913
|
- inject minified css in bundle
|
|
2914
|
+
|
|
2498
2915
|
- removes the need to import `styles.css` manually
|
|
2499
2916
|
- empty `styles.css` included in the build for backwards compatibility
|
|
2500
2917
|
- uses tsup's `injectStyles` with `postcss` to bundle and minify the CSS, then inject it as a style tag
|
|
@@ -2645,6 +3062,7 @@ CopilotKid Back-end SDK:
|
|
|
2645
3062
|
### Major Changes
|
|
2646
3063
|
|
|
2647
3064
|
- b6a4b6eb: V1.0 Release Candidate
|
|
3065
|
+
|
|
2648
3066
|
- A robust new protocol between the frontend and the Copilot Runtime
|
|
2649
3067
|
- Support for Copilot Cloud
|
|
2650
3068
|
- Generative UI
|
package/codegen.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { CodegenConfig } from "@graphql-codegen/cli";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
|
-
const schema = path.resolve(
|
|
4
|
+
const schema = path.resolve(
|
|
5
|
+
__dirname,
|
|
6
|
+
"../runtime/__snapshots__/schema/schema.graphql",
|
|
7
|
+
);
|
|
5
8
|
|
|
6
9
|
const config: CodegenConfig = {
|
|
7
10
|
schema,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_package = require('../package.cjs');
|
|
3
|
+
const require_mutations = require('../graphql/definitions/mutations.cjs');
|
|
4
|
+
const require_queries = require('../graphql/definitions/queries.cjs');
|
|
5
|
+
let _urql_core = require("@urql/core");
|
|
6
|
+
let _copilotkit_shared = require("@copilotkit/shared");
|
|
7
|
+
|
|
8
|
+
//#region src/client/CopilotRuntimeClient.ts
|
|
9
|
+
const createFetchFn = (signal, handleGQLWarning) => async (...args) => {
|
|
10
|
+
const publicApiKey = args[1]?.headers?.["x-copilotcloud-public-api-key"];
|
|
11
|
+
try {
|
|
12
|
+
const result = await fetch(args[0], {
|
|
13
|
+
...args[1] ?? {},
|
|
14
|
+
signal
|
|
15
|
+
});
|
|
16
|
+
const mismatch = publicApiKey ? null : await (0, _copilotkit_shared.getPossibleVersionMismatch)({
|
|
17
|
+
runtimeVersion: result.headers.get("X-CopilotKit-Runtime-Version"),
|
|
18
|
+
runtimeClientGqlVersion: require_package.version
|
|
19
|
+
});
|
|
20
|
+
if (result.status !== 200) {
|
|
21
|
+
if (result.status >= 400 && result.status <= 500) {
|
|
22
|
+
if (mismatch) throw new _copilotkit_shared.CopilotKitVersionMismatchError(mismatch);
|
|
23
|
+
throw new _copilotkit_shared.ResolvedCopilotKitError({ status: result.status });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (mismatch && handleGQLWarning) handleGQLWarning(mismatch.message);
|
|
27
|
+
return result;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
if (error.message.includes("BodyStreamBuffer was aborted") || error.message.includes("signal is aborted without reason")) throw error;
|
|
30
|
+
if (error instanceof _copilotkit_shared.CopilotKitError) throw error;
|
|
31
|
+
throw new _copilotkit_shared.CopilotKitLowLevelError({
|
|
32
|
+
error,
|
|
33
|
+
url: args[0]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var CopilotRuntimeClient = class CopilotRuntimeClient {
|
|
38
|
+
constructor(options) {
|
|
39
|
+
const headers = {};
|
|
40
|
+
this.handleGQLErrors = options.handleGQLErrors;
|
|
41
|
+
this.handleGQLWarning = options.handleGQLWarning;
|
|
42
|
+
if (options.headers) Object.assign(headers, options.headers);
|
|
43
|
+
if (options.publicApiKey) headers["x-copilotcloud-public-api-key"] = options.publicApiKey;
|
|
44
|
+
this.client = new _urql_core.Client({
|
|
45
|
+
url: options.url,
|
|
46
|
+
exchanges: [_urql_core.cacheExchange, _urql_core.fetchExchange],
|
|
47
|
+
fetchOptions: {
|
|
48
|
+
headers: {
|
|
49
|
+
...headers,
|
|
50
|
+
"X-CopilotKit-Runtime-Client-GQL-Version": require_package.version
|
|
51
|
+
},
|
|
52
|
+
...options.credentials ? { credentials: options.credentials } : {}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
generateCopilotResponse({ data, properties, signal }) {
|
|
57
|
+
const fetchFn = createFetchFn(signal, this.handleGQLWarning);
|
|
58
|
+
return this.client.mutation(require_mutations.generateCopilotResponseMutation, {
|
|
59
|
+
data,
|
|
60
|
+
properties
|
|
61
|
+
}, { fetch: fetchFn });
|
|
62
|
+
}
|
|
63
|
+
asStream(source) {
|
|
64
|
+
const handleGQLErrors = this.handleGQLErrors;
|
|
65
|
+
return new ReadableStream({ start(controller) {
|
|
66
|
+
source.subscribe(({ data, hasNext, error }) => {
|
|
67
|
+
if (error) {
|
|
68
|
+
if (error.message.includes("BodyStreamBuffer was aborted") || error.message.includes("signal is aborted without reason")) {
|
|
69
|
+
if (!hasNext) controller.close();
|
|
70
|
+
console.warn("Abort error suppressed");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (error.extensions?.visibility) {
|
|
74
|
+
const syntheticError = {
|
|
75
|
+
...error,
|
|
76
|
+
graphQLErrors: [{
|
|
77
|
+
message: error.message,
|
|
78
|
+
extensions: error.extensions
|
|
79
|
+
}]
|
|
80
|
+
};
|
|
81
|
+
if (handleGQLErrors) handleGQLErrors(syntheticError);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
controller.error(error);
|
|
85
|
+
if (handleGQLErrors) handleGQLErrors(error);
|
|
86
|
+
} else {
|
|
87
|
+
controller.enqueue(data);
|
|
88
|
+
if (!hasNext) controller.close();
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
} });
|
|
92
|
+
}
|
|
93
|
+
availableAgents() {
|
|
94
|
+
const fetchFn = createFetchFn();
|
|
95
|
+
return this.client.query(require_queries.getAvailableAgentsQuery, {}, { fetch: fetchFn });
|
|
96
|
+
}
|
|
97
|
+
loadAgentState(data) {
|
|
98
|
+
const fetchFn = createFetchFn();
|
|
99
|
+
const result = this.client.query(require_queries.loadAgentStateQuery, { data }, { fetch: fetchFn });
|
|
100
|
+
result.toPromise().then(({ error }) => {
|
|
101
|
+
if (error && this.handleGQLErrors) this.handleGQLErrors(error);
|
|
102
|
+
}).catch(() => {});
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
static removeGraphQLTypename(data) {
|
|
106
|
+
if (Array.isArray(data)) data.forEach((item) => CopilotRuntimeClient.removeGraphQLTypename(item));
|
|
107
|
+
else if (typeof data === "object" && data !== null) {
|
|
108
|
+
delete data.__typename;
|
|
109
|
+
Object.keys(data).forEach((key) => {
|
|
110
|
+
if (typeof data[key] === "object" && data[key] !== null) CopilotRuntimeClient.removeGraphQLTypename(data[key]);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return data;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
exports.CopilotRuntimeClient = CopilotRuntimeClient;
|
|
119
|
+
//# sourceMappingURL=CopilotRuntimeClient.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopilotRuntimeClient.cjs","names":["CopilotKitVersionMismatchError","ResolvedCopilotKitError","CopilotKitError","CopilotKitLowLevelError","Client","cacheExchange","fetchExchange","generateCopilotResponseMutation","getAvailableAgentsQuery","loadAgentStateQuery"],"sources":["../../src/client/CopilotRuntimeClient.ts"],"sourcesContent":["import { Client, cacheExchange, fetchExchange } from \"@urql/core\";\nimport * as packageJson from \"../../package.json\";\nimport {\n AvailableAgentsQuery,\n GenerateCopilotResponseMutation,\n GenerateCopilotResponseMutationVariables,\n LoadAgentStateQuery,\n} from \"../graphql/@generated/graphql\";\nimport { generateCopilotResponseMutation } from \"../graphql/definitions/mutations\";\nimport {\n getAvailableAgentsQuery,\n loadAgentStateQuery,\n} from \"../graphql/definitions/queries\";\nimport { OperationResultSource, OperationResult } from \"urql\";\nimport {\n ResolvedCopilotKitError,\n CopilotKitLowLevelError,\n CopilotKitError,\n CopilotKitVersionMismatchError,\n getPossibleVersionMismatch,\n} from \"@copilotkit/shared\";\n\nconst createFetchFn =\n (signal?: AbortSignal, handleGQLWarning?: (warning: string) => void) =>\n async (...args: Parameters<typeof fetch>) => {\n // @ts-expect-error -- since this is our own header, TS will not recognize\n const publicApiKey = args[1]?.headers?.[\"x-copilotcloud-public-api-key\"];\n try {\n const result = await fetch(args[0], { ...(args[1] ?? {}), signal });\n\n // No mismatch checking if cloud is being used\n const mismatch = publicApiKey\n ? null\n : await getPossibleVersionMismatch({\n runtimeVersion: result.headers.get(\"X-CopilotKit-Runtime-Version\")!,\n runtimeClientGqlVersion: packageJson.version,\n });\n if (result.status !== 200) {\n if (result.status >= 400 && result.status <= 500) {\n if (mismatch) {\n throw new CopilotKitVersionMismatchError(mismatch);\n }\n\n throw new ResolvedCopilotKitError({ status: result.status });\n }\n }\n\n if (mismatch && handleGQLWarning) {\n handleGQLWarning(mismatch.message);\n }\n\n return result;\n } catch (error) {\n // Let abort error pass through. It will be suppressed later\n if (\n (error as Error).message.includes(\"BodyStreamBuffer was aborted\") ||\n (error as Error).message.includes(\"signal is aborted without reason\")\n ) {\n throw error;\n }\n if (error instanceof CopilotKitError) {\n throw error;\n }\n throw new CopilotKitLowLevelError({\n error: error as Error,\n url: args[0] as string,\n });\n }\n };\n\nexport interface CopilotRuntimeClientOptions {\n url: string;\n publicApiKey?: string;\n headers?: Record<string, string>;\n credentials?: RequestCredentials;\n handleGQLErrors?: (error: Error) => void;\n handleGQLWarning?: (warning: string) => void;\n}\n\nexport class CopilotRuntimeClient {\n client: Client;\n public handleGQLErrors?: (error: Error) => void;\n public handleGQLWarning?: (warning: string) => void;\n\n constructor(options: CopilotRuntimeClientOptions) {\n const headers: Record<string, string> = {};\n\n this.handleGQLErrors = options.handleGQLErrors;\n this.handleGQLWarning = options.handleGQLWarning;\n\n if (options.headers) {\n Object.assign(headers, options.headers);\n }\n\n if (options.publicApiKey) {\n headers[\"x-copilotcloud-public-api-key\"] = options.publicApiKey;\n }\n\n this.client = new Client({\n url: options.url,\n exchanges: [cacheExchange, fetchExchange],\n fetchOptions: {\n headers: {\n ...headers,\n \"X-CopilotKit-Runtime-Client-GQL-Version\": packageJson.version,\n },\n ...(options.credentials ? { credentials: options.credentials } : {}),\n },\n });\n }\n\n generateCopilotResponse({\n data,\n properties,\n signal,\n }: {\n data: GenerateCopilotResponseMutationVariables[\"data\"];\n properties?: GenerateCopilotResponseMutationVariables[\"properties\"];\n signal?: AbortSignal;\n }) {\n const fetchFn = createFetchFn(signal, this.handleGQLWarning);\n const result = this.client.mutation<\n GenerateCopilotResponseMutation,\n GenerateCopilotResponseMutationVariables\n >(\n generateCopilotResponseMutation,\n { data, properties },\n { fetch: fetchFn },\n );\n\n return result;\n }\n\n public asStream<S, T>(\n source: OperationResultSource<OperationResult<S, { data: T }>>,\n ) {\n const handleGQLErrors = this.handleGQLErrors;\n return new ReadableStream<S>({\n start(controller) {\n source.subscribe(({ data, hasNext, error }) => {\n if (error) {\n if (\n error.message.includes(\"BodyStreamBuffer was aborted\") ||\n error.message.includes(\"signal is aborted without reason\")\n ) {\n // close the stream if there is no next item\n if (!hasNext) controller.close();\n\n //suppress this specific error\n console.warn(\"Abort error suppressed\");\n return;\n }\n\n // Handle structured errors specially - check if it's a CopilotKitError with visibility\n if ((error as any).extensions?.visibility) {\n // Create a synthetic GraphQL error with the structured error info\n const syntheticError = {\n ...error,\n graphQLErrors: [\n {\n message: error.message,\n extensions: (error as any).extensions,\n },\n ],\n };\n\n if (handleGQLErrors) {\n handleGQLErrors(syntheticError);\n }\n return; // Don't close the stream for structured errors, let the error handler decide\n }\n\n controller.error(error);\n if (handleGQLErrors) {\n handleGQLErrors(error);\n }\n } else {\n controller.enqueue(data);\n if (!hasNext) {\n controller.close();\n }\n }\n });\n },\n });\n }\n\n availableAgents() {\n const fetchFn = createFetchFn();\n return this.client.query<AvailableAgentsQuery>(\n getAvailableAgentsQuery,\n {},\n { fetch: fetchFn },\n );\n }\n\n loadAgentState(data: { threadId: string; agentName: string }) {\n const fetchFn = createFetchFn();\n const result = this.client.query<LoadAgentStateQuery>(\n loadAgentStateQuery,\n { data },\n { fetch: fetchFn },\n );\n\n // Add error handling for GraphQL errors - similar to generateCopilotResponse\n result\n .toPromise()\n .then(({ error }) => {\n if (error && this.handleGQLErrors) {\n this.handleGQLErrors(error);\n }\n })\n .catch(() => {}); // Suppress promise rejection warnings\n\n return result;\n }\n\n static removeGraphQLTypename(data: any) {\n if (Array.isArray(data)) {\n data.forEach((item) => CopilotRuntimeClient.removeGraphQLTypename(item));\n } else if (typeof data === \"object\" && data !== null) {\n delete data.__typename;\n Object.keys(data).forEach((key) => {\n if (typeof data[key] === \"object\" && data[key] !== null) {\n CopilotRuntimeClient.removeGraphQLTypename(data[key]);\n }\n });\n }\n return data;\n }\n}\n"],"mappings":"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"}
|