@copilotkit/shared 2.0.0-rc.14 → 2.0.0-rc.16

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 (65) hide show
  1. package/dist/a2ui-envelope.cjs +2 -2
  2. package/dist/a2ui-envelope.cjs.map +1 -1
  3. package/dist/a2ui-envelope.d.cts +1 -1
  4. package/dist/a2ui-envelope.d.cts.map +1 -1
  5. package/dist/a2ui-envelope.d.mts +1 -1
  6. package/dist/a2ui-envelope.d.mts.map +1 -1
  7. package/dist/a2ui-envelope.mjs +2 -2
  8. package/dist/a2ui-envelope.mjs.map +1 -1
  9. package/dist/generative-ui/child-refs.cjs +3 -3
  10. package/dist/generative-ui/child-refs.cjs.map +1 -1
  11. package/dist/generative-ui/child-refs.d.cts.map +1 -1
  12. package/dist/generative-ui/child-refs.d.mts.map +1 -1
  13. package/dist/generative-ui/child-refs.mjs +3 -3
  14. package/dist/generative-ui/child-refs.mjs.map +1 -1
  15. package/dist/generative-ui/prompt-spec.cjs +11 -11
  16. package/dist/generative-ui/prompt-spec.cjs.map +1 -1
  17. package/dist/generative-ui/prompt-spec.mjs +11 -11
  18. package/dist/generative-ui/prompt-spec.mjs.map +1 -1
  19. package/dist/generative-ui/prompt.cjs +1 -1
  20. package/dist/generative-ui/prompt.cjs.map +1 -1
  21. package/dist/generative-ui/prompt.mjs +1 -1
  22. package/dist/generative-ui/prompt.mjs.map +1 -1
  23. package/dist/generative-ui/schema-render.cjs +1 -1
  24. package/dist/generative-ui/schema-render.cjs.map +1 -1
  25. package/dist/generative-ui/schema-render.d.cts.map +1 -1
  26. package/dist/generative-ui/schema-render.d.mts.map +1 -1
  27. package/dist/generative-ui/schema-render.mjs +1 -1
  28. package/dist/generative-ui/schema-render.mjs.map +1 -1
  29. package/dist/generative-ui/types.cjs +2 -2
  30. package/dist/generative-ui/types.cjs.map +1 -1
  31. package/dist/generative-ui/types.d.cts +7 -7
  32. package/dist/generative-ui/types.d.cts.map +1 -1
  33. package/dist/generative-ui/types.d.mts +7 -7
  34. package/dist/generative-ui/types.d.mts.map +1 -1
  35. package/dist/generative-ui/types.mjs +2 -2
  36. package/dist/generative-ui/types.mjs.map +1 -1
  37. package/dist/generative-ui/validate-operation.cjs +2 -2
  38. package/dist/generative-ui/validate-operation.cjs.map +1 -1
  39. package/dist/generative-ui/validate-operation.mjs +2 -2
  40. package/dist/generative-ui/validate-operation.mjs.map +1 -1
  41. package/dist/index.umd.js +24 -24
  42. package/dist/index.umd.js.map +1 -1
  43. package/dist/package.cjs +1 -1
  44. package/dist/package.mjs +1 -1
  45. package/dist/telemetry/lambda-client.cjs +1 -1
  46. package/dist/telemetry/lambda-client.cjs.map +1 -1
  47. package/dist/telemetry/lambda-client.d.cts.map +1 -1
  48. package/dist/telemetry/lambda-client.d.mts.map +1 -1
  49. package/dist/telemetry/lambda-client.mjs +1 -1
  50. package/dist/telemetry/lambda-client.mjs.map +1 -1
  51. package/package.json +2 -2
  52. package/src/__tests__/a2ui-envelope.test.ts +18 -13
  53. package/src/__tests__/a2ui-prompts.test.ts +5 -5
  54. package/src/__tests__/fixtures/prompt-goldens.json +64 -64
  55. package/src/a2ui-envelope.ts +7 -6
  56. package/src/generative-ui/__tests__/render-ui-args.test.ts +7 -7
  57. package/src/generative-ui/__tests__/validate-operation.test.ts +19 -13
  58. package/src/generative-ui/child-refs.ts +5 -4
  59. package/src/generative-ui/prompt-spec.ts +11 -11
  60. package/src/generative-ui/prompt.ts +1 -1
  61. package/src/generative-ui/schema-render.ts +4 -1
  62. package/src/generative-ui/types.ts +10 -7
  63. package/src/generative-ui/validate-operation.ts +2 -2
  64. package/src/telemetry/lambda-client.ts +5 -1
  65. package/tsconfig.json +3 -1
@@ -7,8 +7,8 @@
7
7
  "checks": false,
8
8
  "surfaces": false
9
9
  },
10
- "markdown": "3ddac3170e72057f65c715b29f7d086b07f0d4f788b9149807bf165cd2eb75fb",
11
- "tool": "da59c2fefe578ecbfed9f48d62205f0745b48b930c880710349ade449b7c1ecf"
10
+ "markdown": "265596cd69dac2877242fb6f9412509a63c325d1729424c6ed108f127ad38380",
11
+ "tool": "2831f893c748050be0c9286ac52c5edd2758d3375d8b0e22fb27631d5d7c6153"
12
12
  },
13
13
  {
14
14
  "flags": {
@@ -18,8 +18,8 @@
18
18
  "checks": false,
19
19
  "surfaces": false
20
20
  },
21
- "markdown": "3ddac3170e72057f65c715b29f7d086b07f0d4f788b9149807bf165cd2eb75fb",
22
- "tool": "5ad65f32a4189827a21b2924875b269ec2235bba05332ac72a8d2b0be482480c"
21
+ "markdown": "265596cd69dac2877242fb6f9412509a63c325d1729424c6ed108f127ad38380",
22
+ "tool": "428bc6098febce22a187932f45bcb8e04da425904166285f8c3f038b6359ec27"
23
23
  },
24
24
  {
25
25
  "flags": {
@@ -29,8 +29,8 @@
29
29
  "checks": false,
30
30
  "surfaces": false
31
31
  },
32
- "markdown": "c468612f1dbe2a44647d2d8e9c74cee0f7f8d7c704d07863d0f250a40119dca7",
33
- "tool": "1dcee6f315aeabe453ca55111075ab48719b72b76e903b55c67442d6e2b790ae"
32
+ "markdown": "8089a3aac3acb22f5d6cb7320465a9ca2c79d256dd98a4011cda968a72123407",
33
+ "tool": "55f1755e703874aade63bef55f0a66bf4652a151b722f354d98cccc814a79b26"
34
34
  },
35
35
  {
36
36
  "flags": {
@@ -40,8 +40,8 @@
40
40
  "checks": false,
41
41
  "surfaces": false
42
42
  },
43
- "markdown": "6ca9037303e526d731ac8ee5101855b38c69180f7282b657187d6cd42f5872d5",
44
- "tool": "a82a50e91cf13f3a6771d63f0ad54697a02e2dea64a1ef79757162f5ab8d3aa1"
43
+ "markdown": "ce392c2acc9ba13c92397ed3735b60b1296d7f2a09df1e979d50fe26c638ef23",
44
+ "tool": "daa208dec7887a3dd39a532c1ebbb031f7073d3fb52eb6fd65ea30bfb47205a2"
45
45
  },
46
46
  {
47
47
  "flags": {
@@ -51,8 +51,8 @@
51
51
  "checks": false,
52
52
  "surfaces": false
53
53
  },
54
- "markdown": "ef5569859e653f0529d04338257b1644fc56f5bce55e857446f843c5ce73ca5e",
55
- "tool": "6b2e9bc18599301976dabdf684dea81cf91365ee11603689218de769cd0ef95c"
54
+ "markdown": "f4e49df0b7e100ac9c26994f57b4c4affe63415f1c9c609e91f9dd74f8f7a6d4",
55
+ "tool": "b8c611514da84eb3ffc264fe8eea91d2525499fd2f0e75e239d605bba365ea71"
56
56
  },
57
57
  {
58
58
  "flags": {
@@ -62,8 +62,8 @@
62
62
  "checks": false,
63
63
  "surfaces": false
64
64
  },
65
- "markdown": "ef5569859e653f0529d04338257b1644fc56f5bce55e857446f843c5ce73ca5e",
66
- "tool": "9b57ec020025bbcc88cdc1a7a1a99946b12f4a0d203e6ecdf51fab24e3ed918f"
65
+ "markdown": "f4e49df0b7e100ac9c26994f57b4c4affe63415f1c9c609e91f9dd74f8f7a6d4",
66
+ "tool": "76370c17a5cdba4f880a032d55a162138ba9daf549e8896ab22b267e08dfd499"
67
67
  },
68
68
  {
69
69
  "flags": {
@@ -73,8 +73,8 @@
73
73
  "checks": false,
74
74
  "surfaces": false
75
75
  },
76
- "markdown": "a13b90987b8b89908730dc628158f7304e0ad78809c0a1a41979e3fc9f0035fa",
77
- "tool": "676ce6cb609feb9f1bac4cefa043d913074d46f870e36e7edb04730f6950387a"
76
+ "markdown": "5e7a0c80e08617730119cbaeb60340bf773faa2085f74d37608395b454e7b105",
77
+ "tool": "47ff29d2eaa301f3e0c80ae7c267a16184bf391666dae361d68cda5bdf29e7a4"
78
78
  },
79
79
  {
80
80
  "flags": {
@@ -84,8 +84,8 @@
84
84
  "checks": false,
85
85
  "surfaces": false
86
86
  },
87
- "markdown": "00e83a9d9805195af160cb999cdd34bd0284bc8b495f6451dbc270fda1ab4ab1",
88
- "tool": "e355251fe3b92e2205b2fa5245b7acd2ff738ebdaa481b5e5802fd1fc2a69aea"
87
+ "markdown": "dda6b56c079a787437c241dc698280ab6fd53f9ec8a7c14a0c91e9cdc642466b",
88
+ "tool": "cd6ceb69c8ae9be058338c8f9a634e50eecf6fecff195336862cf44907b42109"
89
89
  },
90
90
  {
91
91
  "flags": {
@@ -95,8 +95,8 @@
95
95
  "checks": true,
96
96
  "surfaces": false
97
97
  },
98
- "markdown": "7da604536a647020e18d93e42a3749ad604ff657ef12c5d08724521d3c3d16c7",
99
- "tool": "7fd263de43c0dcbd3f6e19e00f40ff2a3f7ee3a9fda0a89226cbce5c8bf7e0a2"
98
+ "markdown": "c9540725953d422a450f55d998a73115fdc5709881680f17c98654770236e450",
99
+ "tool": "cf1c7f8603b8bd3227154ee523540aef8f70129d6d99480411e0992c90c92c82"
100
100
  },
101
101
  {
102
102
  "flags": {
@@ -106,8 +106,8 @@
106
106
  "checks": true,
107
107
  "surfaces": false
108
108
  },
109
- "markdown": "7da604536a647020e18d93e42a3749ad604ff657ef12c5d08724521d3c3d16c7",
110
- "tool": "1c42a53bc74e85f0ea2d20190bc21c6e4e19e435ef593d266bb4ff11df51a44a"
109
+ "markdown": "c9540725953d422a450f55d998a73115fdc5709881680f17c98654770236e450",
110
+ "tool": "ca0ad9a17c5e6e7b7b0b4b3dbe6abd752de568ed626ca638a8921a97d168a577"
111
111
  },
112
112
  {
113
113
  "flags": {
@@ -117,8 +117,8 @@
117
117
  "checks": true,
118
118
  "surfaces": false
119
119
  },
120
- "markdown": "8b670e268be871c51b8d8f70f6d859927b4b37fb7b367a9d4ae85d4712386449",
121
- "tool": "18f3f5184c58c3ee790a7e0acb8e0142ea85aa183a4f997463ce3cf1f76087b4"
120
+ "markdown": "94c31a6d083321f352018d861a31e3e6a1db85ac3ee32d53776f9e2e334663e6",
121
+ "tool": "d47ae391ca59acf7ec38f135a9c3c050cadb50f06c9fa4d86161d3e1be1af6f8"
122
122
  },
123
123
  {
124
124
  "flags": {
@@ -128,8 +128,8 @@
128
128
  "checks": true,
129
129
  "surfaces": false
130
130
  },
131
- "markdown": "16e4b5f9c6a16fbdabf8d3b71aac7015097bf8b8d9bb0ba1ff04368550d7db9a",
132
- "tool": "1e276b241cbb5591dfe13a4bde90e1c287382edf1c0c9219fcd1bc42f04f1297"
131
+ "markdown": "de8e220f6dadcb090ac7deeeab0595dbb6aaff019ffea0c9487c03e5104b1dee",
132
+ "tool": "9bb7c1e3f8a307b3eae12ff643f69087f250d50b8e2dd9958d4d238fb0122a17"
133
133
  },
134
134
  {
135
135
  "flags": {
@@ -139,8 +139,8 @@
139
139
  "checks": true,
140
140
  "surfaces": false
141
141
  },
142
- "markdown": "ba7a65a361c8de5f90218699b9a11f13e755490bfe2a6fc6b2f9cbaf691a0760",
143
- "tool": "0d15832a09b57bebe9dfbc66d3b007512cf5e98ecd7ca96e7cbf05010d2f745e"
142
+ "markdown": "ac475fb084ed732561bb88416af3966599692e278c4a511cd8726278db6344f0",
143
+ "tool": "56a6232073f31385f9f1f8b4713598ef9444fc4d1f4bb8a0ed781404d96ce03b"
144
144
  },
145
145
  {
146
146
  "flags": {
@@ -150,8 +150,8 @@
150
150
  "checks": true,
151
151
  "surfaces": false
152
152
  },
153
- "markdown": "ba7a65a361c8de5f90218699b9a11f13e755490bfe2a6fc6b2f9cbaf691a0760",
154
- "tool": "b4d5715cc09b4aeec0be1da43ce21eb3488adbe5a371de84f7bc2a761f36a7df"
153
+ "markdown": "ac475fb084ed732561bb88416af3966599692e278c4a511cd8726278db6344f0",
154
+ "tool": "fddd878904428818a5e81266048bb03e49bdb12623c3238325b018a71a45a9f4"
155
155
  },
156
156
  {
157
157
  "flags": {
@@ -161,8 +161,8 @@
161
161
  "checks": true,
162
162
  "surfaces": false
163
163
  },
164
- "markdown": "2fdb692ad4cf85aa2e00062c062d916008f2d8cb911cf54b4084c1b1a8541e57",
165
- "tool": "7fbd8401e3b58b1ae2507c28bc5e2616c4595d56e56f69efbf1ecb1fc9b077be"
164
+ "markdown": "a3dada266648564dacf6286bd7dddc6efbf321b3ead4be50061faeaf3b6cfe13",
165
+ "tool": "993d46f71cacf10b13b615048bbf8e4c856303d82db87b17c70a8dd6439e9b80"
166
166
  },
167
167
  {
168
168
  "flags": {
@@ -172,8 +172,8 @@
172
172
  "checks": true,
173
173
  "surfaces": false
174
174
  },
175
- "markdown": "53a616bab2bbe091c9682b1d9e9d197814740cfba40848d68e6b6cbe225a0808",
176
- "tool": "7bac41fc3a32575978290c46b8f8df245d1302f8dbdccaece25b8ddd1b223273"
175
+ "markdown": "8aedaae7606007869f5530e5a0378f8143c371c103cb557c459a174bf5b1ff0d",
176
+ "tool": "c4b5e660ff7f9ad59b38d3410c234fb424b4fbc36a7e8999c42f31614193fc77"
177
177
  },
178
178
  {
179
179
  "flags": {
@@ -183,8 +183,8 @@
183
183
  "checks": false,
184
184
  "surfaces": true
185
185
  },
186
- "markdown": "3ddac3170e72057f65c715b29f7d086b07f0d4f788b9149807bf165cd2eb75fb",
187
- "tool": "2988eb7934ca2e90b78617d7c0021a90baad2c6f98461897483565d744bbba76"
186
+ "markdown": "265596cd69dac2877242fb6f9412509a63c325d1729424c6ed108f127ad38380",
187
+ "tool": "99a6ab165b6eadf8b18a925de922d119e550a3f7b8f75b98536f6424f660a326"
188
188
  },
189
189
  {
190
190
  "flags": {
@@ -194,8 +194,8 @@
194
194
  "checks": false,
195
195
  "surfaces": true
196
196
  },
197
- "markdown": "3ddac3170e72057f65c715b29f7d086b07f0d4f788b9149807bf165cd2eb75fb",
198
- "tool": "0cd1e12dfb92ef3abb8cee8af4daaaca38e15d9af2f52f3acf81b674ff5968a0"
197
+ "markdown": "265596cd69dac2877242fb6f9412509a63c325d1729424c6ed108f127ad38380",
198
+ "tool": "7f6acd8deadd6ecda655d41d02699a8c80b59513fac5c1dad8d2bb2f0343c26c"
199
199
  },
200
200
  {
201
201
  "flags": {
@@ -205,8 +205,8 @@
205
205
  "checks": false,
206
206
  "surfaces": true
207
207
  },
208
- "markdown": "c468612f1dbe2a44647d2d8e9c74cee0f7f8d7c704d07863d0f250a40119dca7",
209
- "tool": "013b089b6b9929cd4ef611d82c625def6daf2576576ef4ce173de7cd924e1da8"
208
+ "markdown": "8089a3aac3acb22f5d6cb7320465a9ca2c79d256dd98a4011cda968a72123407",
209
+ "tool": "0c241ec3391e2fd2c5b3df4477e7ffe9b4f7313854bb00e196c4a35d956be3f3"
210
210
  },
211
211
  {
212
212
  "flags": {
@@ -216,8 +216,8 @@
216
216
  "checks": false,
217
217
  "surfaces": true
218
218
  },
219
- "markdown": "6ca9037303e526d731ac8ee5101855b38c69180f7282b657187d6cd42f5872d5",
220
- "tool": "4b4a4cca1653566e8253175e3b40577e66829a308de3fe705d3bb8f3b205c4a5"
219
+ "markdown": "ce392c2acc9ba13c92397ed3735b60b1296d7f2a09df1e979d50fe26c638ef23",
220
+ "tool": "8e1a94fbf67daf280f6ac722ccc62075598911e39e55fd5a113646e4c6ec7fc6"
221
221
  },
222
222
  {
223
223
  "flags": {
@@ -227,8 +227,8 @@
227
227
  "checks": false,
228
228
  "surfaces": true
229
229
  },
230
- "markdown": "ef5569859e653f0529d04338257b1644fc56f5bce55e857446f843c5ce73ca5e",
231
- "tool": "6327c455e8320eaec9a0ee594404484dc75ab73f7963b9d26ac3b5de0db5f742"
230
+ "markdown": "f4e49df0b7e100ac9c26994f57b4c4affe63415f1c9c609e91f9dd74f8f7a6d4",
231
+ "tool": "45e9a5a47567f2c0fff0640c3646e498f0ec8068095394a55463f845bb996193"
232
232
  },
233
233
  {
234
234
  "flags": {
@@ -238,8 +238,8 @@
238
238
  "checks": false,
239
239
  "surfaces": true
240
240
  },
241
- "markdown": "ef5569859e653f0529d04338257b1644fc56f5bce55e857446f843c5ce73ca5e",
242
- "tool": "25b77d69e0997f64f5e3794bbe7fbbaa36dbfc5d777ac59f285e1ba653ba72be"
241
+ "markdown": "f4e49df0b7e100ac9c26994f57b4c4affe63415f1c9c609e91f9dd74f8f7a6d4",
242
+ "tool": "f40514ab61be567c4a6f2f5b61e934d1779e3323477ce0aa868f3f3a66f1585c"
243
243
  },
244
244
  {
245
245
  "flags": {
@@ -249,8 +249,8 @@
249
249
  "checks": false,
250
250
  "surfaces": true
251
251
  },
252
- "markdown": "a13b90987b8b89908730dc628158f7304e0ad78809c0a1a41979e3fc9f0035fa",
253
- "tool": "b5bccb0029ffc6aaa81565f7d29448841c94f3b85d866a6d08a4ebece8e6f4db"
252
+ "markdown": "5e7a0c80e08617730119cbaeb60340bf773faa2085f74d37608395b454e7b105",
253
+ "tool": "effee9743233f14583977f93b00133ff1fce48835e25d61f91af5113a480fd11"
254
254
  },
255
255
  {
256
256
  "flags": {
@@ -260,8 +260,8 @@
260
260
  "checks": false,
261
261
  "surfaces": true
262
262
  },
263
- "markdown": "00e83a9d9805195af160cb999cdd34bd0284bc8b495f6451dbc270fda1ab4ab1",
264
- "tool": "8e5e58a6c75eafac078273692eb4bc2ac28fe2513c9b3710138716af0b22973f"
263
+ "markdown": "dda6b56c079a787437c241dc698280ab6fd53f9ec8a7c14a0c91e9cdc642466b",
264
+ "tool": "9a36d1f42b83cfa3cb5beadb130f1b3c3555098304570c0aaa133e8130ad52ea"
265
265
  },
266
266
  {
267
267
  "flags": {
@@ -271,8 +271,8 @@
271
271
  "checks": true,
272
272
  "surfaces": true
273
273
  },
274
- "markdown": "7da604536a647020e18d93e42a3749ad604ff657ef12c5d08724521d3c3d16c7",
275
- "tool": "fae845e7d1c7ef964a5db8385ea55261ce8c1bf14021cbda9dc7daf0fba76a54"
274
+ "markdown": "c9540725953d422a450f55d998a73115fdc5709881680f17c98654770236e450",
275
+ "tool": "eb5246d342a50810de921927f3e5be58a5ecac008b8e0750c5a6cfe2037a3b28"
276
276
  },
277
277
  {
278
278
  "flags": {
@@ -282,8 +282,8 @@
282
282
  "checks": true,
283
283
  "surfaces": true
284
284
  },
285
- "markdown": "7da604536a647020e18d93e42a3749ad604ff657ef12c5d08724521d3c3d16c7",
286
- "tool": "cdc4b3c27eb5346400deb85188aa23869b43deea004661e2692974d973619c98"
285
+ "markdown": "c9540725953d422a450f55d998a73115fdc5709881680f17c98654770236e450",
286
+ "tool": "a79bd017703e7623301e33a8c33f26346e86752e7dec59344226de004ae385c5"
287
287
  },
288
288
  {
289
289
  "flags": {
@@ -293,8 +293,8 @@
293
293
  "checks": true,
294
294
  "surfaces": true
295
295
  },
296
- "markdown": "8b670e268be871c51b8d8f70f6d859927b4b37fb7b367a9d4ae85d4712386449",
297
- "tool": "56f85b65156343e568df4e3f0e6ab97d631df78d4ae4d5c6eb5d129b2af28888"
296
+ "markdown": "94c31a6d083321f352018d861a31e3e6a1db85ac3ee32d53776f9e2e334663e6",
297
+ "tool": "a4fe3c2f2326987ba63c8f4341b0bc100057cce07392f7930f47428b493cdd87"
298
298
  },
299
299
  {
300
300
  "flags": {
@@ -304,8 +304,8 @@
304
304
  "checks": true,
305
305
  "surfaces": true
306
306
  },
307
- "markdown": "16e4b5f9c6a16fbdabf8d3b71aac7015097bf8b8d9bb0ba1ff04368550d7db9a",
308
- "tool": "4e3c93cb6cd34986bbd18aceaf1220aa98ee70a9ae248e4abb05ba086a96830d"
307
+ "markdown": "de8e220f6dadcb090ac7deeeab0595dbb6aaff019ffea0c9487c03e5104b1dee",
308
+ "tool": "39ee92edc486d09a15ec1860f18b2349c170b4d010233afc6607b214373b32b5"
309
309
  },
310
310
  {
311
311
  "flags": {
@@ -315,8 +315,8 @@
315
315
  "checks": true,
316
316
  "surfaces": true
317
317
  },
318
- "markdown": "ba7a65a361c8de5f90218699b9a11f13e755490bfe2a6fc6b2f9cbaf691a0760",
319
- "tool": "3ef9ecfb1722218fa9a15c3d7a9489233a02c80bc024cf2f0843f79a5c48467c"
318
+ "markdown": "ac475fb084ed732561bb88416af3966599692e278c4a511cd8726278db6344f0",
319
+ "tool": "f215277ed2b79d86d1ad3aa9bb040c41812741ba00a5c357fd226031a083b7aa"
320
320
  },
321
321
  {
322
322
  "flags": {
@@ -326,8 +326,8 @@
326
326
  "checks": true,
327
327
  "surfaces": true
328
328
  },
329
- "markdown": "ba7a65a361c8de5f90218699b9a11f13e755490bfe2a6fc6b2f9cbaf691a0760",
330
- "tool": "47195e94aae1733f074bb08990f5617d3e55b71185b9208fc2437f60a3386530"
329
+ "markdown": "ac475fb084ed732561bb88416af3966599692e278c4a511cd8726278db6344f0",
330
+ "tool": "55f7a37ae48f2c5b7ead10a407f015b398ad866912f0d3b8a1c9da74a27730ae"
331
331
  },
332
332
  {
333
333
  "flags": {
@@ -337,8 +337,8 @@
337
337
  "checks": true,
338
338
  "surfaces": true
339
339
  },
340
- "markdown": "2fdb692ad4cf85aa2e00062c062d916008f2d8cb911cf54b4084c1b1a8541e57",
341
- "tool": "965e1199d17b0b3b12a32e0ce23453980ea5d2b2d185c6184112d499077f2ff3"
340
+ "markdown": "a3dada266648564dacf6286bd7dddc6efbf321b3ead4be50061faeaf3b6cfe13",
341
+ "tool": "541ad9d56614d3f611f6dc0873ec87e61abb499405e50bac0bd03af3263ba035"
342
342
  },
343
343
  {
344
344
  "flags": {
@@ -348,7 +348,7 @@
348
348
  "checks": true,
349
349
  "surfaces": true
350
350
  },
351
- "markdown": "53a616bab2bbe091c9682b1d9e9d197814740cfba40848d68e6b6cbe225a0808",
352
- "tool": "eed0597925b49e069b618365259aa7d1c95f778097afcbbea8d53a5d84b94c89"
351
+ "markdown": "8aedaae7606007869f5530e5a0378f8143c371c103cb557c459a174bf5b1ff0d",
352
+ "tool": "8ac027462d8448d3286401e9d520dad6b8d18c8c95912fd1baf7767fbca2ae1d"
353
353
  }
354
354
  ]
@@ -29,7 +29,7 @@ export const COPILOTKIT_UI_ENVELOPE_FORMAT = 3;
29
29
  /** What the client renders and calls, and how the model must write UI. */
30
30
  export interface CopilotKitUIEnvelope {
31
31
  /** The A2UI v1.0 renderer capabilities. */
32
- "v1.0": {
32
+ "1.0": {
33
33
  /**
34
34
  * The catalog that the client renders comes first, then the catalogs of
35
35
  * its `extends`. An operation can name any of them.
@@ -66,7 +66,7 @@ export interface CopilotKitUIEnvelope {
66
66
  }
67
67
 
68
68
  type InlineCatalog = NonNullable<
69
- CopilotKitUIEnvelope["v1.0"]["inlineCatalogs"]
69
+ CopilotKitUIEnvelope["1.0"]["inlineCatalogs"]
70
70
  >[number];
71
71
  type Extensions = CopilotKitUIEnvelope["metadata"]["extensions"];
72
72
 
@@ -149,7 +149,7 @@ function isInlineCatalog(value: unknown): value is InlineCatalog {
149
149
  );
150
150
  }
151
151
 
152
- function isCapabilities(value: unknown): value is CopilotKitUIEnvelope["v1.0"] {
152
+ function isCapabilities(value: unknown): value is CopilotKitUIEnvelope["1.0"] {
153
153
  return (
154
154
  isRecord(value) &&
155
155
  Array.isArray(value.supportedCatalogIds) &&
@@ -222,7 +222,7 @@ function isExtensions(value: unknown): value is Extensions {
222
222
  function isEnvelope(value: unknown): value is CopilotKitUIEnvelope {
223
223
  return (
224
224
  isRecord(value) &&
225
- isCapabilities(value["v1.0"]) &&
225
+ isCapabilities(value["1.0"]) &&
226
226
  isRecord(value.metadata) &&
227
227
  isExtensions(value.metadata.extensions)
228
228
  );
@@ -282,8 +282,9 @@ export function readCopilotKitUIEnvelope(forwardedProps: unknown) {
282
282
  * ```
283
283
  */
284
284
  export function envelopeToManifest(envelope: CopilotKitUIEnvelope) {
285
- const { supportedCatalogIds, inlineCatalogs } = envelope["v1.0"];
286
- const catalogId = supportedCatalogIds[0];
285
+ const { supportedCatalogIds, inlineCatalogs } = envelope["1.0"];
286
+ // `readCopilotKitUIEnvelope` only accepts a non-empty `supportedCatalogIds`.
287
+ const catalogId = supportedCatalogIds[0]!;
287
288
  const catalog = inlineCatalogs?.find(
288
289
  (entry) => entry.catalogId === catalogId,
289
290
  );
@@ -2,11 +2,11 @@ import { describe, expect, it } from "vitest";
2
2
  import { RenderUIArgsStream, extractRenderUIArgs } from "../render-ui-args";
3
3
 
4
4
  const opA = {
5
- version: "v1.0",
5
+ version: "1.0",
6
6
  createSurface: { surfaceId: "s" },
7
7
  };
8
8
  const opB = {
9
- version: "v1.0",
9
+ version: "1.0",
10
10
  updateComponents: {
11
11
  surfaceId: "s",
12
12
  components: [
@@ -20,12 +20,12 @@ const opB = {
20
20
  },
21
21
  };
22
22
  const opC = {
23
- version: "v1.0",
23
+ version: "1.0",
24
24
  updateDataModel: { surfaceId: "s", path: "/a", value: [1, { b: "]" }] },
25
25
  };
26
26
  /** One createSurface with the data model and the root inline. */
27
27
  const inlineCreate = {
28
- version: "v1.0",
28
+ version: "1.0",
29
29
  createSurface: {
30
30
  surfaceId: "plan",
31
31
  dataModel: { seats: 10, plans: [{ name: "Team" }] },
@@ -40,7 +40,7 @@ const inlineCreate = {
40
40
  },
41
41
  };
42
42
  const functionCall = {
43
- version: "v1.0",
43
+ version: "1.0",
44
44
  callRendererFunction: {
45
45
  functionCallId: "f1",
46
46
  callFunction: { "@call": "addToCart", args: { productId: "p{1}" } },
@@ -75,7 +75,7 @@ describe("extractRenderUIArgs", () => {
75
75
 
76
76
  it("returns null for a balanced element that is not valid JSON", () => {
77
77
  const text =
78
- '{"target":"chat","operations":[{"version":"v1.0", bad},' +
78
+ '{"target":"chat","operations":[{"version":"1.0", bad},' +
79
79
  JSON.stringify(opA) +
80
80
  "]}";
81
81
  expect(extractRenderUIArgs(text).operations).toEqual([null, opA]);
@@ -140,7 +140,7 @@ describe("RenderUIArgsStream", () => {
140
140
 
141
141
  it("keeps the parser state across deltas that split strings, escapes and braces", () => {
142
142
  const tricky = {
143
- version: "v1.0",
143
+ version: "1.0",
144
144
  updateDataModel: { surfaceId: "s", path: "/q", value: 'a "}{" \\ ]' },
145
145
  };
146
146
  const text = JSON.stringify({
@@ -62,19 +62,19 @@ const functions = {
62
62
  const knownSurfaces = new Set(["s1"]);
63
63
 
64
64
  const update = (...components: unknown[]) => ({
65
- version: "v1.0",
65
+ version: "1.0",
66
66
  updateComponents: { surfaceId: "s1", components },
67
67
  });
68
68
  const setData = (fields: { path?: string; value?: unknown }) => ({
69
- version: "v1.0",
69
+ version: "1.0",
70
70
  updateDataModel: { surfaceId: "s1", ...fields },
71
71
  });
72
72
  const create = (fields: Record<string, unknown>) => ({
73
- version: "v1.0",
73
+ version: "1.0",
74
74
  createSurface: { surfaceId: "s2", ...fields },
75
75
  });
76
76
  const callFunction = (fields: Record<string, unknown>) => ({
77
- version: "v1.0",
77
+ version: "1.0",
78
78
  callRendererFunction: { functionCallId: "f1", ...fields },
79
79
  });
80
80
  /** A valid ProductCard with `props` added or replaced. */
@@ -90,23 +90,29 @@ const reasonOf = (
90
90
  };
91
91
 
92
92
  describe("validateOperation: version and kind", () => {
93
- it("rejects a v0.9 operation with a reason that names v1.0", () => {
93
+ it("rejects the pre-release v1.0 spelling", () => {
94
+ expect(
95
+ reasonOf({ version: "v1.0", deleteSurface: { surfaceId: "s1" } }),
96
+ ).toBe('unsupported version "v1.0"; use "1.0"');
97
+ });
98
+
99
+ it("rejects a v0.9 operation with a reason that names 1.0", () => {
94
100
  expect(
95
101
  reasonOf({ version: "v0.9", deleteSurface: { surfaceId: "s1" } }),
96
- ).toBe('unsupported version "v0.9"; use "v1.0"');
102
+ ).toBe('unsupported version "v0.9"; use "1.0"');
97
103
  });
98
104
 
99
105
  it("rejects an operation without a version", () => {
100
106
  expect(reasonOf({ deleteSurface: { surfaceId: "s1" } })).toBe(
101
- 'operation needs "version":"v1.0"',
107
+ 'operation needs "version":"1.0"',
102
108
  );
103
109
  });
104
110
 
105
111
  it("rejects ops with zero or several kinds", () => {
106
- expect(reasonOf({ version: "v1.0" })).toMatch(/exactly one/);
112
+ expect(reasonOf({ version: "1.0" })).toMatch(/exactly one/);
107
113
  expect(
108
114
  reasonOf({
109
- version: "v1.0",
115
+ version: "1.0",
110
116
  deleteSurface: { surfaceId: "s1" },
111
117
  updateDataModel: { surfaceId: "s1", value: 1 },
112
118
  }),
@@ -133,7 +139,7 @@ describe("validateOperation: createSurface", () => {
133
139
  };
134
140
  const check = (catalogId: string) =>
135
141
  validateOperation(
136
- { version: "v1.0", createSurface: { surfaceId: "s2", catalogId } },
142
+ { version: "1.0", createSurface: { surfaceId: "s2", catalogId } },
137
143
  options,
138
144
  );
139
145
  expect(check("copilotkit/standard@1")).toEqual({ ok: true });
@@ -146,13 +152,13 @@ describe("validateOperation: createSurface", () => {
146
152
 
147
153
  it("rejects a createSurface without a surfaceId", () => {
148
154
  expect(
149
- reasonOf({ version: "v1.0", createSurface: { catalogId: "shop" } }),
155
+ reasonOf({ version: "1.0", createSurface: { catalogId: "shop" } }),
150
156
  ).toBe("createSurface.surfaceId is required");
151
157
  });
152
158
 
153
159
  it("rejects an existing surface", () => {
154
160
  expect(
155
- reasonOf({ version: "v1.0", createSurface: { surfaceId: "s1" } }),
161
+ reasonOf({ version: "1.0", createSurface: { surfaceId: "s1" } }),
156
162
  ).toBe('surface "s1" already exists');
157
163
  });
158
164
 
@@ -201,7 +207,7 @@ describe("validateOperation: surface updates", () => {
201
207
  it("rejects updates to surfaces that do not exist", () => {
202
208
  expect(
203
209
  reasonOf({
204
- version: "v1.0",
210
+ version: "1.0",
205
211
  updateComponents: {
206
212
  surfaceId: "missing",
207
213
  components: [{ id: "root", component: "ProductGrid" }],
@@ -107,7 +107,8 @@ export function collectChildRefs(schema: GenerativeUIJSONSchema): ChildRef[] {
107
107
  );
108
108
  const key = (ref: ChildRef) =>
109
109
  `${ref.kind}\u0000${ref.path.join("\u0000")}`;
110
- const shared = perVariant[0].filter((ref) =>
110
+ // `list` is not empty (checked above), so `perVariant` is not empty.
111
+ const shared = perVariant[0]!.filter((ref) =>
111
112
  perVariant.every((refs) => refs.some((r) => key(r) === key(ref))),
112
113
  );
113
114
  shared.forEach((ref) => add([...path, ...ref.path], ref.kind));
@@ -146,8 +147,8 @@ export function childIdsAtRefs(
146
147
  }
147
148
  };
148
149
  const visit = (value: unknown, path: readonly string[]) => {
149
- if (path.length === 0) return collect(value);
150
150
  const [head, ...rest] = path;
151
+ if (head === undefined) return collect(value);
151
152
  if (head === "*") {
152
153
  if (Array.isArray(value)) value.forEach((item) => visit(item, rest));
153
154
  return;
@@ -173,8 +174,8 @@ export function hasBoundChildRef(
173
174
  isRecord(value) && ("@path" in value || "@call" in value);
174
175
  const visit = (value: unknown, path: readonly string[]): boolean => {
175
176
  if (isDynamic(value)) return true;
176
- if (path.length === 0) return false;
177
177
  const [head, ...rest] = path;
178
+ if (head === undefined) return false;
178
179
  if (head === "*") {
179
180
  return Array.isArray(value) && value.some((item) => visit(item, rest));
180
181
  }
@@ -197,8 +198,8 @@ export function mapAtChildRef(
197
198
  path: readonly string[],
198
199
  replace: (found: unknown) => unknown,
199
200
  ): unknown {
200
- if (path.length === 0) return replace(value);
201
201
  const [head, ...rest] = path;
202
+ if (head === undefined) return replace(value);
202
203
  if (head === "*") {
203
204
  if (!Array.isArray(value)) return value;
204
205
  return value.map((item) => mapAtChildRef(item, rest, replace));
@@ -134,8 +134,8 @@ export function defaultGenerativeUIPromptSpec(): GenerativeUIPromptSpec {
134
134
  "Open a fence with ```a2ui target=<id> to show the surface in a named target. Use only target ids from the schema. When a target limits its components, its surfaces can use only those components.",
135
135
  "Inside a fence, write one JSON object per line and nothing else. No comments, no trailing commas, no pretty-printing.",
136
136
  "Keep each operation whole on its line.",
137
- 'Give every operation "version":"v1.0".',
138
- 'Start a surface with one createSurface. Put all the initial data in "dataModel" and the "root" component in "components". Then write the children in updateComponents lines, so that they show while you write:\n ```a2ui\n {"version":"v1.0","createSurface":{"surfaceId":"plan-picker","dataModel":{ ...initial data... },"components":[{"id":"root","component":"<Name>","children":["seats","pick"]}]}}\n {"version":"v1.0","updateComponents":{"surfaceId":"plan-picker","components":[ ...the children... ]}}\n ```',
137
+ 'Give every operation "version":"1.0".',
138
+ 'Start a surface with one createSurface. Put all the initial data in "dataModel" and the "root" component in "components". Then write the children in updateComponents lines, so that they show while you write:\n ```a2ui\n {"version":"1.0","createSurface":{"surfaceId":"plan-picker","dataModel":{ ...initial data... },"components":[{"id":"root","component":"<Name>","children":["seats","pick"]}]}}\n {"version":"1.0","updateComponents":{"surfaceId":"plan-picker","components":[ ...the children... ]}}\n ```',
139
139
  'Keep "dataModel" flat: top-level keys such as "seats" or "form", never one wrapper object around everything. Check that every { and [ you open in a line is closed.',
140
140
  'Every surface renders from the component with id "root". Make every other component reachable from "root" through slots.',
141
141
  "Send every component you reference in the same reply. If a surface gets long, make it smaller rather than leave components out.",
@@ -156,7 +156,7 @@ export function defaultGenerativeUIPromptSpec(): GenerativeUIPromptSpec {
156
156
  'For a computed list (chart data, template items) use series. Its description under Functions in the schema gives the rules and an example. Bind the "data" of a Chart or the "items" of a List to it; a template path stays a literal path.',
157
157
  'Bind a writable prop to let the user edit it: "value":{"@path":"/form/email"}. The user\'s input goes to that path.',
158
158
  'The value of a ChoicePicker is a list of strings, also for one choice. SegmentedControl, RadioGroup and Select take one string. Option values are always strings: for a yes/no choice use "yes" and "no", not true and false.',
159
- 'To change data, write updateDataModel with a "path" and a "value": {"version":"v1.0","updateDataModel":{"surfaceId":"plan-picker","path":"/seats","value":12}}. Always give "value".',
159
+ 'To change data, write updateDataModel with a "path" and a "value": {"version":"1.0","updateDataModel":{"surfaceId":"plan-picker","path":"/seats","value":12}}. Always give "value".',
160
160
  'Set "value":null to delete the key at "path".',
161
161
  {
162
162
  when: ["events"],
@@ -206,9 +206,9 @@ export function defaultGenerativeUIPromptSpec(): GenerativeUIPromptSpec {
206
206
  {
207
207
  when: ["agentCalls"],
208
208
  items: [
209
- 'To run an app function now, with no click, write a callRendererFunction line in a fence: {"version":"v1.0","callRendererFunction":{"functionCallId":"<unique id>","callFunction":{"@call":"<function>","args":{...}}}}. It needs no surface.',
209
+ 'To run an app function now, with no click, write a callRendererFunction line in a fence: {"version":"1.0","callRendererFunction":{"functionCallId":"<unique id>","callFunction":{"@call":"<function>","args":{...}}}}. It needs no surface.',
210
210
  "Give every callRendererFunction a new functionCallId. Call only a function that the schema marks UI or agent, or agent only; a function with no mark is for the UI only. A function marked agent only is only for callRendererFunction: do not bind an event to it.",
211
- 'The result of a callRendererFunction comes back to you as a developer message: {"version":"v1.0","rendererFunctionResponse":{"functionCallId":"<id>","value":...}}. If the call failed, it has "error" in place of "value". Then you get a new turn.',
211
+ 'The result of a callRendererFunction comes back to you as a developer message: {"version":"1.0","rendererFunctionResponse":{"functionCallId":"<id>","value":...}}. If the call failed, it has "error" in place of "value". Then you get a new turn.',
212
212
  "Do not guess the result of a callRendererFunction. Wait for the developer message.",
213
213
  ],
214
214
  },
@@ -223,14 +223,14 @@ export function defaultGenerativeUIPromptSpec(): GenerativeUIPromptSpec {
223
223
  intro: `Call \`${GENERATIVE_UI_RENDER_TOOL}\` to show UI. Arguments: \`target\` first, then \`operations\` (A2UI v1.0 operations, applied in order).`,
224
224
  whenToShow: GENERATIVE_UI_WHEN_TO_SHOW,
225
225
  operations: [
226
- '{"version":"v1.0","createSurface":{"surfaceId":"<new id>","dataModel":{...},"components":[{"id":"root","component":"<Name>","children":["<child id>"]}]}}: the first operation of a new surface. "dataModel" and "components" are optional.',
227
- '{"version":"v1.0","updateComponents":{"surfaceId":"<id>","components":[<component>, ...]}}: add or replace components by id.',
228
- '{"version":"v1.0","updateDataModel":{"surfaceId":"<id>","path":"/some/path","value":<json>}}: set the value at "path". Always give "value". "value":null deletes the key at "path".',
229
- '{"version":"v1.0","deleteSurface":{"surfaceId":"<id>"}}: remove the surface.',
226
+ '{"version":"1.0","createSurface":{"surfaceId":"<new id>","dataModel":{...},"components":[{"id":"root","component":"<Name>","children":["<child id>"]}]}}: the first operation of a new surface. "dataModel" and "components" are optional.',
227
+ '{"version":"1.0","updateComponents":{"surfaceId":"<id>","components":[<component>, ...]}}: add or replace components by id.',
228
+ '{"version":"1.0","updateDataModel":{"surfaceId":"<id>","path":"/some/path","value":<json>}}: set the value at "path". Always give "value". "value":null deletes the key at "path".',
229
+ '{"version":"1.0","deleteSurface":{"surfaceId":"<id>"}}: remove the surface.',
230
230
  {
231
231
  when: ["agentCalls"],
232
232
  items: [
233
- '{"version":"v1.0","callRendererFunction":{"functionCallId":"<unique id>","callFunction":{"@call":"<function>","args":{...}}}}: run an app function now, with no click. It needs no surface.',
233
+ '{"version":"1.0","callRendererFunction":{"functionCallId":"<unique id>","callFunction":{"@call":"<function>","args":{...}}}}: run an app function now, with no click. It needs no surface.',
234
234
  ],
235
235
  },
236
236
  ],
@@ -273,7 +273,7 @@ export function defaultGenerativeUIPromptSpec(): GenerativeUIPromptSpec {
273
273
  when: ["agentCalls"],
274
274
  items: [
275
275
  "Give every callRendererFunction a new functionCallId. Call only a function marked (UI or agent) or (agent only); a function with no mark is for the UI only. A function marked (agent only) is only for callRendererFunction: do not bind an event to it.",
276
- 'The result of a callRendererFunction comes back to you in a new turn, as a developer message: {"version":"v1.0","rendererFunctionResponse":{"functionCallId":"<id>","value":...}}. If the call failed, it has "error" in place of "value". Do not wait for the result in this reply, and do not guess it.',
276
+ 'The result of a callRendererFunction comes back to you in a new turn, as a developer message: {"version":"1.0","rendererFunctionResponse":{"functionCallId":"<id>","value":...}}. If the call failed, it has "error" in place of "value". Do not wait for the result in this reply, and do not guess it.',
277
277
  ],
278
278
  },
279
279
  ],
@@ -111,7 +111,7 @@ export function buildGenerativeUIPrompt(
111
111
  `## Generative UI
112
112
  ${intro}
113
113
 
114
- ${when}Every operation has "version":"v1.0" and exactly one of:
114
+ ${when}Every operation has "version":"1.0" and exactly one of:
115
115
  ${operations.map((op) => `- ${op}`).join("\n")}
116
116
 
117
117
  Rules: