@convex-dev/agent 0.2.5-alpha.0 → 0.2.6-alpha.0

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 (55) hide show
  1. package/dist/client/definePlaygroundAPI.d.ts +248 -18
  2. package/dist/client/definePlaygroundAPI.d.ts.map +1 -1
  3. package/dist/client/index.d.ts +211 -33
  4. package/dist/client/index.d.ts.map +1 -1
  5. package/dist/client/index.js +56 -52
  6. package/dist/client/index.js.map +1 -1
  7. package/dist/client/messages.d.ts +50 -4
  8. package/dist/client/messages.d.ts.map +1 -1
  9. package/dist/client/mockModel.d.ts +30 -0
  10. package/dist/client/mockModel.d.ts.map +1 -0
  11. package/dist/client/mockModel.js +153 -0
  12. package/dist/client/mockModel.js.map +1 -0
  13. package/dist/client/search.d.ts +50 -4
  14. package/dist/client/search.d.ts.map +1 -1
  15. package/dist/client/streaming.d.ts +603 -46
  16. package/dist/client/streaming.d.ts.map +1 -1
  17. package/dist/client/streaming.js +30 -35
  18. package/dist/client/streaming.js.map +1 -1
  19. package/dist/client/textStreamParts.d.ts +5 -0
  20. package/dist/client/textStreamParts.d.ts.map +1 -0
  21. package/dist/{parts.js → client/textStreamParts.js} +18 -1
  22. package/dist/client/textStreamParts.js.map +1 -0
  23. package/dist/component/_generated/api.d.ts +240 -16
  24. package/dist/component/messages.d.ts +549 -43
  25. package/dist/component/messages.d.ts.map +1 -1
  26. package/dist/component/messages.js +1 -1
  27. package/dist/component/messages.js.map +1 -1
  28. package/dist/component/schema.d.ts +1546 -98
  29. package/dist/component/schema.d.ts.map +1 -1
  30. package/dist/mapping.d.ts.map +1 -1
  31. package/dist/mapping.js +30 -18
  32. package/dist/mapping.js.map +1 -1
  33. package/dist/react/useSmoothText.d.ts +1 -1
  34. package/dist/react/useSmoothText.d.ts.map +1 -1
  35. package/dist/react/useSmoothText.js +30 -22
  36. package/dist/react/useSmoothText.js.map +1 -1
  37. package/dist/validators.d.ts +3740 -201
  38. package/dist/validators.d.ts.map +1 -1
  39. package/dist/validators.js +10 -1
  40. package/dist/validators.js.map +1 -1
  41. package/package.json +1 -1
  42. package/src/client/index.ts +90 -82
  43. package/src/client/mockModel.ts +195 -0
  44. package/src/client/streaming.ts +46 -54
  45. package/src/{parts.ts → client/textStreamParts.ts} +33 -1
  46. package/src/component/_generated/api.d.ts +240 -16
  47. package/src/component/messages.ts +1 -1
  48. package/src/mapping.test.ts +50 -1
  49. package/src/mapping.ts +42 -17
  50. package/src/react/toUIMessages.test.ts +16 -4
  51. package/src/react/useSmoothText.ts +40 -31
  52. package/src/validators.ts +23 -1
  53. package/dist/parts.d.ts +0 -3
  54. package/dist/parts.d.ts.map +0 -1
  55. package/dist/parts.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { type ChunkDetector, type StreamTextTransform, type TextStreamPart, type ToolSet } from "ai";
1
+ import { type ChunkDetector } from "ai";
2
2
  import { type ProviderOptions, type StreamArgs, type StreamMessage } from "../validators.js";
3
3
  import type { AgentComponent, RunActionCtx, RunMutationCtx, RunQueryCtx, SyncStreamsReturnValue } from "./types.js";
4
4
  export declare const vStreamMessagesReturnValue: import("convex/values").VObject<{
@@ -96,6 +96,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
96
96
  providerMetadata?: Record<string, Record<string, any>> | undefined;
97
97
  args?: any;
98
98
  providerExecuted?: boolean | undefined;
99
+ output?: {
100
+ type: "text";
101
+ value: string;
102
+ } | {
103
+ type: "json";
104
+ value: any;
105
+ } | {
106
+ type: "error-text";
107
+ value: string;
108
+ } | {
109
+ type: "error-json";
110
+ value: any;
111
+ } | {
112
+ type: "content";
113
+ value: ({
114
+ type: "text";
115
+ text: string;
116
+ } | {
117
+ type: "media";
118
+ data: string;
119
+ mediaType: string;
120
+ })[];
121
+ } | undefined;
122
+ result?: any;
99
123
  isError?: boolean | undefined;
100
124
  experimental_content?: ({
101
125
  type: "text";
@@ -108,7 +132,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
108
132
  type: "tool-result";
109
133
  toolCallId: string;
110
134
  toolName: string;
111
- result: any;
112
135
  } | {
113
136
  providerOptions?: Record<string, Record<string, any>> | undefined;
114
137
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -124,8 +147,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
124
147
  id: string;
125
148
  title: string;
126
149
  type: "source";
127
- sourceType: "document";
128
150
  mediaType: string;
151
+ sourceType: "document";
129
152
  })[];
130
153
  } | {
131
154
  providerOptions?: Record<string, Record<string, any>> | undefined;
@@ -135,6 +158,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
135
158
  providerMetadata?: Record<string, Record<string, any>> | undefined;
136
159
  args?: any;
137
160
  providerExecuted?: boolean | undefined;
161
+ output?: {
162
+ type: "text";
163
+ value: string;
164
+ } | {
165
+ type: "json";
166
+ value: any;
167
+ } | {
168
+ type: "error-text";
169
+ value: string;
170
+ } | {
171
+ type: "error-json";
172
+ value: any;
173
+ } | {
174
+ type: "content";
175
+ value: ({
176
+ type: "text";
177
+ text: string;
178
+ } | {
179
+ type: "media";
180
+ data: string;
181
+ mediaType: string;
182
+ })[];
183
+ } | undefined;
184
+ result?: any;
138
185
  isError?: boolean | undefined;
139
186
  experimental_content?: ({
140
187
  type: "text";
@@ -147,7 +194,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
147
194
  type: "tool-result";
148
195
  toolCallId: string;
149
196
  toolName: string;
150
- result: any;
151
197
  }[];
152
198
  } | {
153
199
  providerOptions?: Record<string, Record<string, any>> | undefined;
@@ -179,8 +225,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
179
225
  id: string;
180
226
  title: string;
181
227
  type: "source";
182
- sourceType: "document";
183
228
  mediaType: string;
229
+ sourceType: "document";
184
230
  })[] | undefined;
185
231
  warnings?: ({
186
232
  details?: string | undefined;
@@ -384,6 +430,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
384
430
  providerMetadata?: Record<string, Record<string, any>> | undefined;
385
431
  args?: any;
386
432
  providerExecuted?: boolean | undefined;
433
+ output?: {
434
+ type: "text";
435
+ value: string;
436
+ } | {
437
+ type: "json";
438
+ value: any;
439
+ } | {
440
+ type: "error-text";
441
+ value: string;
442
+ } | {
443
+ type: "error-json";
444
+ value: any;
445
+ } | {
446
+ type: "content";
447
+ value: ({
448
+ type: "text";
449
+ text: string;
450
+ } | {
451
+ type: "media";
452
+ data: string;
453
+ mediaType: string;
454
+ })[];
455
+ } | undefined;
456
+ result?: any;
387
457
  isError?: boolean | undefined;
388
458
  experimental_content?: ({
389
459
  type: "text";
@@ -396,7 +466,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
396
466
  type: "tool-result";
397
467
  toolCallId: string;
398
468
  toolName: string;
399
- result: any;
400
469
  } | {
401
470
  providerOptions?: Record<string, Record<string, any>> | undefined;
402
471
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -412,8 +481,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
412
481
  id: string;
413
482
  title: string;
414
483
  type: "source";
415
- sourceType: "document";
416
484
  mediaType: string;
485
+ sourceType: "document";
417
486
  })[];
418
487
  } | {
419
488
  providerOptions?: Record<string, Record<string, any>> | undefined;
@@ -423,6 +492,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
423
492
  providerMetadata?: Record<string, Record<string, any>> | undefined;
424
493
  args?: any;
425
494
  providerExecuted?: boolean | undefined;
495
+ output?: {
496
+ type: "text";
497
+ value: string;
498
+ } | {
499
+ type: "json";
500
+ value: any;
501
+ } | {
502
+ type: "error-text";
503
+ value: string;
504
+ } | {
505
+ type: "error-json";
506
+ value: any;
507
+ } | {
508
+ type: "content";
509
+ value: ({
510
+ type: "text";
511
+ text: string;
512
+ } | {
513
+ type: "media";
514
+ data: string;
515
+ mediaType: string;
516
+ })[];
517
+ } | undefined;
518
+ result?: any;
426
519
  isError?: boolean | undefined;
427
520
  experimental_content?: ({
428
521
  type: "text";
@@ -435,7 +528,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
435
528
  type: "tool-result";
436
529
  toolCallId: string;
437
530
  toolName: string;
438
- result: any;
439
531
  }[];
440
532
  } | {
441
533
  providerOptions?: Record<string, Record<string, any>> | undefined;
@@ -467,8 +559,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
467
559
  id: string;
468
560
  title: string;
469
561
  type: "source";
470
- sourceType: "document";
471
562
  mediaType: string;
563
+ sourceType: "document";
472
564
  })[] | undefined;
473
565
  warnings?: ({
474
566
  details?: string | undefined;
@@ -574,6 +666,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
574
666
  providerMetadata?: Record<string, Record<string, any>> | undefined;
575
667
  args?: any;
576
668
  providerExecuted?: boolean | undefined;
669
+ output?: {
670
+ type: "text";
671
+ value: string;
672
+ } | {
673
+ type: "json";
674
+ value: any;
675
+ } | {
676
+ type: "error-text";
677
+ value: string;
678
+ } | {
679
+ type: "error-json";
680
+ value: any;
681
+ } | {
682
+ type: "content";
683
+ value: ({
684
+ type: "text";
685
+ text: string;
686
+ } | {
687
+ type: "media";
688
+ data: string;
689
+ mediaType: string;
690
+ })[];
691
+ } | undefined;
692
+ result?: any;
577
693
  isError?: boolean | undefined;
578
694
  experimental_content?: ({
579
695
  type: "text";
@@ -586,7 +702,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
586
702
  type: "tool-result";
587
703
  toolCallId: string;
588
704
  toolName: string;
589
- result: any;
590
705
  } | {
591
706
  providerOptions?: Record<string, Record<string, any>> | undefined;
592
707
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -602,8 +717,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
602
717
  id: string;
603
718
  title: string;
604
719
  type: "source";
605
- sourceType: "document";
606
720
  mediaType: string;
721
+ sourceType: "document";
607
722
  })[];
608
723
  } | {
609
724
  providerOptions?: Record<string, Record<string, any>> | undefined;
@@ -613,6 +728,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
613
728
  providerMetadata?: Record<string, Record<string, any>> | undefined;
614
729
  args?: any;
615
730
  providerExecuted?: boolean | undefined;
731
+ output?: {
732
+ type: "text";
733
+ value: string;
734
+ } | {
735
+ type: "json";
736
+ value: any;
737
+ } | {
738
+ type: "error-text";
739
+ value: string;
740
+ } | {
741
+ type: "error-json";
742
+ value: any;
743
+ } | {
744
+ type: "content";
745
+ value: ({
746
+ type: "text";
747
+ text: string;
748
+ } | {
749
+ type: "media";
750
+ data: string;
751
+ mediaType: string;
752
+ })[];
753
+ } | undefined;
754
+ result?: any;
616
755
  isError?: boolean | undefined;
617
756
  experimental_content?: ({
618
757
  type: "text";
@@ -625,7 +764,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
625
764
  type: "tool-result";
626
765
  toolCallId: string;
627
766
  toolName: string;
628
- result: any;
629
767
  }[];
630
768
  } | {
631
769
  providerOptions?: Record<string, Record<string, any>> | undefined;
@@ -657,8 +795,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
657
795
  id: string;
658
796
  title: string;
659
797
  type: "source";
660
- sourceType: "document";
661
798
  mediaType: string;
799
+ sourceType: "document";
662
800
  })[] | undefined;
663
801
  warnings?: ({
664
802
  details?: string | undefined;
@@ -767,6 +905,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
767
905
  providerMetadata?: Record<string, Record<string, any>> | undefined;
768
906
  args?: any;
769
907
  providerExecuted?: boolean | undefined;
908
+ output?: {
909
+ type: "text";
910
+ value: string;
911
+ } | {
912
+ type: "json";
913
+ value: any;
914
+ } | {
915
+ type: "error-text";
916
+ value: string;
917
+ } | {
918
+ type: "error-json";
919
+ value: any;
920
+ } | {
921
+ type: "content";
922
+ value: ({
923
+ type: "text";
924
+ text: string;
925
+ } | {
926
+ type: "media";
927
+ data: string;
928
+ mediaType: string;
929
+ })[];
930
+ } | undefined;
931
+ result?: any;
770
932
  isError?: boolean | undefined;
771
933
  experimental_content?: ({
772
934
  type: "text";
@@ -779,7 +941,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
779
941
  type: "tool-result";
780
942
  toolCallId: string;
781
943
  toolName: string;
782
- result: any;
783
944
  } | {
784
945
  providerOptions?: Record<string, Record<string, any>> | undefined;
785
946
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -795,8 +956,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
795
956
  id: string;
796
957
  title: string;
797
958
  type: "source";
798
- sourceType: "document";
799
959
  mediaType: string;
960
+ sourceType: "document";
800
961
  })[];
801
962
  } | {
802
963
  providerOptions?: Record<string, Record<string, any>> | undefined;
@@ -806,6 +967,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
806
967
  providerMetadata?: Record<string, Record<string, any>> | undefined;
807
968
  args?: any;
808
969
  providerExecuted?: boolean | undefined;
970
+ output?: {
971
+ type: "text";
972
+ value: string;
973
+ } | {
974
+ type: "json";
975
+ value: any;
976
+ } | {
977
+ type: "error-text";
978
+ value: string;
979
+ } | {
980
+ type: "error-json";
981
+ value: any;
982
+ } | {
983
+ type: "content";
984
+ value: ({
985
+ type: "text";
986
+ text: string;
987
+ } | {
988
+ type: "media";
989
+ data: string;
990
+ mediaType: string;
991
+ })[];
992
+ } | undefined;
993
+ result?: any;
809
994
  isError?: boolean | undefined;
810
995
  experimental_content?: ({
811
996
  type: "text";
@@ -818,7 +1003,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
818
1003
  type: "tool-result";
819
1004
  toolCallId: string;
820
1005
  toolName: string;
821
- result: any;
822
1006
  }[];
823
1007
  } | {
824
1008
  providerOptions?: Record<string, Record<string, any>> | undefined;
@@ -973,6 +1157,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
973
1157
  providerMetadata?: Record<string, Record<string, any>> | undefined;
974
1158
  args?: any;
975
1159
  providerExecuted?: boolean | undefined;
1160
+ output?: {
1161
+ type: "text";
1162
+ value: string;
1163
+ } | {
1164
+ type: "json";
1165
+ value: any;
1166
+ } | {
1167
+ type: "error-text";
1168
+ value: string;
1169
+ } | {
1170
+ type: "error-json";
1171
+ value: any;
1172
+ } | {
1173
+ type: "content";
1174
+ value: ({
1175
+ type: "text";
1176
+ text: string;
1177
+ } | {
1178
+ type: "media";
1179
+ data: string;
1180
+ mediaType: string;
1181
+ })[];
1182
+ } | undefined;
1183
+ result?: any;
976
1184
  isError?: boolean | undefined;
977
1185
  experimental_content?: ({
978
1186
  type: "text";
@@ -985,7 +1193,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
985
1193
  type: "tool-result";
986
1194
  toolCallId: string;
987
1195
  toolName: string;
988
- result: any;
989
1196
  } | {
990
1197
  providerOptions?: Record<string, Record<string, any>> | undefined;
991
1198
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -1001,8 +1208,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1001
1208
  id: string;
1002
1209
  title: string;
1003
1210
  type: "source";
1004
- sourceType: "document";
1005
1211
  mediaType: string;
1212
+ sourceType: "document";
1006
1213
  })[];
1007
1214
  }, {
1008
1215
  role: import("convex/values").VLiteral<"assistant", "required">;
@@ -1042,6 +1249,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1042
1249
  providerMetadata?: Record<string, Record<string, any>> | undefined;
1043
1250
  args?: any;
1044
1251
  providerExecuted?: boolean | undefined;
1252
+ output?: {
1253
+ type: "text";
1254
+ value: string;
1255
+ } | {
1256
+ type: "json";
1257
+ value: any;
1258
+ } | {
1259
+ type: "error-text";
1260
+ value: string;
1261
+ } | {
1262
+ type: "error-json";
1263
+ value: any;
1264
+ } | {
1265
+ type: "content";
1266
+ value: ({
1267
+ type: "text";
1268
+ text: string;
1269
+ } | {
1270
+ type: "media";
1271
+ data: string;
1272
+ mediaType: string;
1273
+ })[];
1274
+ } | undefined;
1275
+ result?: any;
1045
1276
  isError?: boolean | undefined;
1046
1277
  experimental_content?: ({
1047
1278
  type: "text";
@@ -1054,7 +1285,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1054
1285
  type: "tool-result";
1055
1286
  toolCallId: string;
1056
1287
  toolName: string;
1057
- result: any;
1058
1288
  } | {
1059
1289
  providerOptions?: Record<string, Record<string, any>> | undefined;
1060
1290
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -1070,8 +1300,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1070
1300
  id: string;
1071
1301
  title: string;
1072
1302
  type: "source";
1073
- sourceType: "document";
1074
1303
  mediaType: string;
1304
+ sourceType: "document";
1075
1305
  })[], [import("convex/values").VString<string, "required">, import("convex/values").VArray<({
1076
1306
  providerOptions?: Record<string, Record<string, any>> | undefined;
1077
1307
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -1108,6 +1338,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1108
1338
  providerMetadata?: Record<string, Record<string, any>> | undefined;
1109
1339
  args?: any;
1110
1340
  providerExecuted?: boolean | undefined;
1341
+ output?: {
1342
+ type: "text";
1343
+ value: string;
1344
+ } | {
1345
+ type: "json";
1346
+ value: any;
1347
+ } | {
1348
+ type: "error-text";
1349
+ value: string;
1350
+ } | {
1351
+ type: "error-json";
1352
+ value: any;
1353
+ } | {
1354
+ type: "content";
1355
+ value: ({
1356
+ type: "text";
1357
+ text: string;
1358
+ } | {
1359
+ type: "media";
1360
+ data: string;
1361
+ mediaType: string;
1362
+ })[];
1363
+ } | undefined;
1364
+ result?: any;
1111
1365
  isError?: boolean | undefined;
1112
1366
  experimental_content?: ({
1113
1367
  type: "text";
@@ -1120,7 +1374,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1120
1374
  type: "tool-result";
1121
1375
  toolCallId: string;
1122
1376
  toolName: string;
1123
- result: any;
1124
1377
  } | {
1125
1378
  providerOptions?: Record<string, Record<string, any>> | undefined;
1126
1379
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -1136,8 +1389,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1136
1389
  id: string;
1137
1390
  title: string;
1138
1391
  type: "source";
1139
- sourceType: "document";
1140
1392
  mediaType: string;
1393
+ sourceType: "document";
1141
1394
  })[], import("convex/values").VUnion<{
1142
1395
  providerOptions?: Record<string, Record<string, any>> | undefined;
1143
1396
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -1174,6 +1427,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1174
1427
  providerMetadata?: Record<string, Record<string, any>> | undefined;
1175
1428
  args?: any;
1176
1429
  providerExecuted?: boolean | undefined;
1430
+ output?: {
1431
+ type: "text";
1432
+ value: string;
1433
+ } | {
1434
+ type: "json";
1435
+ value: any;
1436
+ } | {
1437
+ type: "error-text";
1438
+ value: string;
1439
+ } | {
1440
+ type: "error-json";
1441
+ value: any;
1442
+ } | {
1443
+ type: "content";
1444
+ value: ({
1445
+ type: "text";
1446
+ text: string;
1447
+ } | {
1448
+ type: "media";
1449
+ data: string;
1450
+ mediaType: string;
1451
+ })[];
1452
+ } | undefined;
1453
+ result?: any;
1177
1454
  isError?: boolean | undefined;
1178
1455
  experimental_content?: ({
1179
1456
  type: "text";
@@ -1186,7 +1463,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1186
1463
  type: "tool-result";
1187
1464
  toolCallId: string;
1188
1465
  toolName: string;
1189
- result: any;
1190
1466
  } | {
1191
1467
  providerOptions?: Record<string, Record<string, any>> | undefined;
1192
1468
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -1202,8 +1478,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1202
1478
  id: string;
1203
1479
  title: string;
1204
1480
  type: "source";
1205
- sourceType: "document";
1206
1481
  mediaType: string;
1482
+ sourceType: "document";
1207
1483
  }, [import("convex/values").VObject<{
1208
1484
  providerOptions?: Record<string, Record<string, any>> | undefined;
1209
1485
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -1271,6 +1547,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1271
1547
  providerMetadata?: Record<string, Record<string, any>> | undefined;
1272
1548
  args?: any;
1273
1549
  providerExecuted?: boolean | undefined;
1550
+ output?: {
1551
+ type: "text";
1552
+ value: string;
1553
+ } | {
1554
+ type: "json";
1555
+ value: any;
1556
+ } | {
1557
+ type: "error-text";
1558
+ value: string;
1559
+ } | {
1560
+ type: "error-json";
1561
+ value: any;
1562
+ } | {
1563
+ type: "content";
1564
+ value: ({
1565
+ type: "text";
1566
+ text: string;
1567
+ } | {
1568
+ type: "media";
1569
+ data: string;
1570
+ mediaType: string;
1571
+ })[];
1572
+ } | undefined;
1573
+ result?: any;
1274
1574
  isError?: boolean | undefined;
1275
1575
  experimental_content?: ({
1276
1576
  type: "text";
@@ -1283,15 +1583,102 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1283
1583
  type: "tool-result";
1284
1584
  toolCallId: string;
1285
1585
  toolName: string;
1286
- result: any;
1287
1586
  }, {
1288
1587
  type: import("convex/values").VLiteral<"tool-result", "required">;
1289
1588
  toolCallId: import("convex/values").VString<string, "required">;
1290
1589
  toolName: import("convex/values").VString<string, "required">;
1291
- result: import("convex/values").VAny<any, "required", string>;
1590
+ output: import("convex/values").VUnion<{
1591
+ type: "text";
1592
+ value: string;
1593
+ } | {
1594
+ type: "json";
1595
+ value: any;
1596
+ } | {
1597
+ type: "error-text";
1598
+ value: string;
1599
+ } | {
1600
+ type: "error-json";
1601
+ value: any;
1602
+ } | {
1603
+ type: "content";
1604
+ value: ({
1605
+ type: "text";
1606
+ text: string;
1607
+ } | {
1608
+ type: "media";
1609
+ data: string;
1610
+ mediaType: string;
1611
+ })[];
1612
+ } | undefined, [import("convex/values").VObject<{
1613
+ type: "text";
1614
+ value: string;
1615
+ }, {
1616
+ type: import("convex/values").VLiteral<"text", "required">;
1617
+ value: import("convex/values").VString<string, "required">;
1618
+ }, "required", "type" | "value">, import("convex/values").VObject<{
1619
+ type: "json";
1620
+ value: any;
1621
+ }, {
1622
+ type: import("convex/values").VLiteral<"json", "required">;
1623
+ value: import("convex/values").VAny<any, "required", string>;
1624
+ }, "required", "type" | "value" | `value.${string}`>, import("convex/values").VObject<{
1625
+ type: "error-text";
1626
+ value: string;
1627
+ }, {
1628
+ type: import("convex/values").VLiteral<"error-text", "required">;
1629
+ value: import("convex/values").VString<string, "required">;
1630
+ }, "required", "type" | "value">, import("convex/values").VObject<{
1631
+ type: "error-json";
1632
+ value: any;
1633
+ }, {
1634
+ type: import("convex/values").VLiteral<"error-json", "required">;
1635
+ value: import("convex/values").VAny<any, "required", string>;
1636
+ }, "required", "type" | "value" | `value.${string}`>, import("convex/values").VObject<{
1637
+ type: "content";
1638
+ value: ({
1639
+ type: "text";
1640
+ text: string;
1641
+ } | {
1642
+ type: "media";
1643
+ data: string;
1644
+ mediaType: string;
1645
+ })[];
1646
+ }, {
1647
+ type: import("convex/values").VLiteral<"content", "required">;
1648
+ value: import("convex/values").VArray<({
1649
+ type: "text";
1650
+ text: string;
1651
+ } | {
1652
+ type: "media";
1653
+ data: string;
1654
+ mediaType: string;
1655
+ })[], import("convex/values").VUnion<{
1656
+ type: "text";
1657
+ text: string;
1658
+ } | {
1659
+ type: "media";
1660
+ data: string;
1661
+ mediaType: string;
1662
+ }, [import("convex/values").VObject<{
1663
+ type: "text";
1664
+ text: string;
1665
+ }, {
1666
+ type: import("convex/values").VLiteral<"text", "required">;
1667
+ text: import("convex/values").VString<string, "required">;
1668
+ }, "required", "type" | "text">, import("convex/values").VObject<{
1669
+ type: "media";
1670
+ data: string;
1671
+ mediaType: string;
1672
+ }, {
1673
+ type: import("convex/values").VLiteral<"media", "required">;
1674
+ data: import("convex/values").VString<string, "required">;
1675
+ mediaType: import("convex/values").VString<string, "required">;
1676
+ }, "required", "type" | "data" | "mediaType">], "required", "type" | "text" | "data" | "mediaType">, "required">;
1677
+ }, "required", "type" | "value">], "optional", "type" | "value" | `value.${string}`>;
1292
1678
  providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
1293
1679
  providerMetadata: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
1294
1680
  providerExecuted: import("convex/values").VBoolean<boolean | undefined, "optional">;
1681
+ result: import("convex/values").VAny<any, "optional", string>;
1295
1682
  isError: import("convex/values").VBoolean<boolean | undefined, "optional">;
1296
1683
  args: import("convex/values").VAny<any, "optional", string>;
1297
1684
  experimental_content: import("convex/values").VArray<({
@@ -1323,7 +1710,7 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1323
1710
  data: import("convex/values").VString<string, "required">;
1324
1711
  mimeType: import("convex/values").VString<string | undefined, "optional">;
1325
1712
  }, "required", "type" | "mimeType" | "data">], "required", "type" | "text" | "mimeType" | "data">, "optional">;
1326
- }, "required", "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "toolCallId" | "toolName" | "args" | "providerExecuted" | `args.${string}` | "result" | "isError" | "experimental_content" | `result.${string}`>, import("convex/values").VUnion<{
1713
+ }, "required", "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "toolCallId" | "toolName" | "args" | "providerExecuted" | `args.${string}` | "output" | "result" | "isError" | "experimental_content" | "output.type" | "output.value" | `output.value.${string}` | `result.${string}`>, import("convex/values").VUnion<{
1327
1714
  providerOptions?: Record<string, Record<string, any>> | undefined;
1328
1715
  providerMetadata?: Record<string, Record<string, any>> | undefined;
1329
1716
  id: string;
@@ -1338,8 +1725,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1338
1725
  id: string;
1339
1726
  title: string;
1340
1727
  type: "source";
1341
- sourceType: "document";
1342
1728
  mediaType: string;
1729
+ sourceType: "document";
1343
1730
  }, [import("convex/values").VObject<{
1344
1731
  providerOptions?: Record<string, Record<string, any>> | undefined;
1345
1732
  providerMetadata?: Record<string, Record<string, any>> | undefined;
@@ -1363,8 +1750,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1363
1750
  id: string;
1364
1751
  title: string;
1365
1752
  type: "source";
1366
- sourceType: "document";
1367
1753
  mediaType: string;
1754
+ sourceType: "document";
1368
1755
  }, {
1369
1756
  type: import("convex/values").VLiteral<"source", "required">;
1370
1757
  sourceType: import("convex/values").VLiteral<"document", "required">;
@@ -1374,7 +1761,7 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1374
1761
  filename: import("convex/values").VString<string | undefined, "optional">;
1375
1762
  providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
1376
1763
  providerMetadata: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
1377
- }, "required", "id" | "title" | "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "filename" | "sourceType" | "mediaType">], "required", "id" | "title" | "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "filename" | "sourceType" | "url" | "mediaType">], "required", "id" | "title" | "type" | "providerOptions" | "text" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "mimeType" | "data" | "filename" | "signature" | "toolCallId" | "toolName" | "args" | "providerExecuted" | `args.${string}` | "result" | "isError" | "experimental_content" | `result.${string}` | "sourceType" | "url" | "mediaType">, "required">], "required", never>;
1764
+ }, "required", "id" | "title" | "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "filename" | "mediaType" | "sourceType">], "required", "id" | "title" | "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "filename" | "mediaType" | "sourceType" | "url">], "required", "id" | "title" | "type" | "providerOptions" | "text" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "mimeType" | "data" | "filename" | "signature" | "toolCallId" | "toolName" | "args" | "providerExecuted" | `args.${string}` | "output" | "mediaType" | "result" | "isError" | "experimental_content" | "output.type" | "output.value" | `output.value.${string}` | `result.${string}` | "sourceType" | "url">, "required">], "required", never>;
1378
1765
  providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
1379
1766
  }, "required", "providerOptions" | "role" | `providerOptions.${string}` | "content">, import("convex/values").VObject<{
1380
1767
  providerOptions?: Record<string, Record<string, any>> | undefined;
@@ -1384,6 +1771,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1384
1771
  providerMetadata?: Record<string, Record<string, any>> | undefined;
1385
1772
  args?: any;
1386
1773
  providerExecuted?: boolean | undefined;
1774
+ output?: {
1775
+ type: "text";
1776
+ value: string;
1777
+ } | {
1778
+ type: "json";
1779
+ value: any;
1780
+ } | {
1781
+ type: "error-text";
1782
+ value: string;
1783
+ } | {
1784
+ type: "error-json";
1785
+ value: any;
1786
+ } | {
1787
+ type: "content";
1788
+ value: ({
1789
+ type: "text";
1790
+ text: string;
1791
+ } | {
1792
+ type: "media";
1793
+ data: string;
1794
+ mediaType: string;
1795
+ })[];
1796
+ } | undefined;
1797
+ result?: any;
1387
1798
  isError?: boolean | undefined;
1388
1799
  experimental_content?: ({
1389
1800
  type: "text";
@@ -1396,7 +1807,6 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1396
1807
  type: "tool-result";
1397
1808
  toolCallId: string;
1398
1809
  toolName: string;
1399
- result: any;
1400
1810
  }[];
1401
1811
  }, {
1402
1812
  role: import("convex/values").VLiteral<"tool", "required">;
@@ -1405,6 +1815,30 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1405
1815
  providerMetadata?: Record<string, Record<string, any>> | undefined;
1406
1816
  args?: any;
1407
1817
  providerExecuted?: boolean | undefined;
1818
+ output?: {
1819
+ type: "text";
1820
+ value: string;
1821
+ } | {
1822
+ type: "json";
1823
+ value: any;
1824
+ } | {
1825
+ type: "error-text";
1826
+ value: string;
1827
+ } | {
1828
+ type: "error-json";
1829
+ value: any;
1830
+ } | {
1831
+ type: "content";
1832
+ value: ({
1833
+ type: "text";
1834
+ text: string;
1835
+ } | {
1836
+ type: "media";
1837
+ data: string;
1838
+ mediaType: string;
1839
+ })[];
1840
+ } | undefined;
1841
+ result?: any;
1408
1842
  isError?: boolean | undefined;
1409
1843
  experimental_content?: ({
1410
1844
  type: "text";
@@ -1417,12 +1851,35 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1417
1851
  type: "tool-result";
1418
1852
  toolCallId: string;
1419
1853
  toolName: string;
1420
- result: any;
1421
1854
  }[], import("convex/values").VObject<{
1422
1855
  providerOptions?: Record<string, Record<string, any>> | undefined;
1423
1856
  providerMetadata?: Record<string, Record<string, any>> | undefined;
1424
1857
  args?: any;
1425
1858
  providerExecuted?: boolean | undefined;
1859
+ output?: {
1860
+ type: "text";
1861
+ value: string;
1862
+ } | {
1863
+ type: "json";
1864
+ value: any;
1865
+ } | {
1866
+ type: "error-text";
1867
+ value: string;
1868
+ } | {
1869
+ type: "error-json";
1870
+ value: any;
1871
+ } | {
1872
+ type: "content";
1873
+ value: ({
1874
+ type: "text";
1875
+ text: string;
1876
+ } | {
1877
+ type: "media";
1878
+ data: string;
1879
+ mediaType: string;
1880
+ })[];
1881
+ } | undefined;
1882
+ result?: any;
1426
1883
  isError?: boolean | undefined;
1427
1884
  experimental_content?: ({
1428
1885
  type: "text";
@@ -1435,15 +1892,102 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1435
1892
  type: "tool-result";
1436
1893
  toolCallId: string;
1437
1894
  toolName: string;
1438
- result: any;
1439
1895
  }, {
1440
1896
  type: import("convex/values").VLiteral<"tool-result", "required">;
1441
1897
  toolCallId: import("convex/values").VString<string, "required">;
1442
1898
  toolName: import("convex/values").VString<string, "required">;
1443
- result: import("convex/values").VAny<any, "required", string>;
1899
+ output: import("convex/values").VUnion<{
1900
+ type: "text";
1901
+ value: string;
1902
+ } | {
1903
+ type: "json";
1904
+ value: any;
1905
+ } | {
1906
+ type: "error-text";
1907
+ value: string;
1908
+ } | {
1909
+ type: "error-json";
1910
+ value: any;
1911
+ } | {
1912
+ type: "content";
1913
+ value: ({
1914
+ type: "text";
1915
+ text: string;
1916
+ } | {
1917
+ type: "media";
1918
+ data: string;
1919
+ mediaType: string;
1920
+ })[];
1921
+ } | undefined, [import("convex/values").VObject<{
1922
+ type: "text";
1923
+ value: string;
1924
+ }, {
1925
+ type: import("convex/values").VLiteral<"text", "required">;
1926
+ value: import("convex/values").VString<string, "required">;
1927
+ }, "required", "type" | "value">, import("convex/values").VObject<{
1928
+ type: "json";
1929
+ value: any;
1930
+ }, {
1931
+ type: import("convex/values").VLiteral<"json", "required">;
1932
+ value: import("convex/values").VAny<any, "required", string>;
1933
+ }, "required", "type" | "value" | `value.${string}`>, import("convex/values").VObject<{
1934
+ type: "error-text";
1935
+ value: string;
1936
+ }, {
1937
+ type: import("convex/values").VLiteral<"error-text", "required">;
1938
+ value: import("convex/values").VString<string, "required">;
1939
+ }, "required", "type" | "value">, import("convex/values").VObject<{
1940
+ type: "error-json";
1941
+ value: any;
1942
+ }, {
1943
+ type: import("convex/values").VLiteral<"error-json", "required">;
1944
+ value: import("convex/values").VAny<any, "required", string>;
1945
+ }, "required", "type" | "value" | `value.${string}`>, import("convex/values").VObject<{
1946
+ type: "content";
1947
+ value: ({
1948
+ type: "text";
1949
+ text: string;
1950
+ } | {
1951
+ type: "media";
1952
+ data: string;
1953
+ mediaType: string;
1954
+ })[];
1955
+ }, {
1956
+ type: import("convex/values").VLiteral<"content", "required">;
1957
+ value: import("convex/values").VArray<({
1958
+ type: "text";
1959
+ text: string;
1960
+ } | {
1961
+ type: "media";
1962
+ data: string;
1963
+ mediaType: string;
1964
+ })[], import("convex/values").VUnion<{
1965
+ type: "text";
1966
+ text: string;
1967
+ } | {
1968
+ type: "media";
1969
+ data: string;
1970
+ mediaType: string;
1971
+ }, [import("convex/values").VObject<{
1972
+ type: "text";
1973
+ text: string;
1974
+ }, {
1975
+ type: import("convex/values").VLiteral<"text", "required">;
1976
+ text: import("convex/values").VString<string, "required">;
1977
+ }, "required", "type" | "text">, import("convex/values").VObject<{
1978
+ type: "media";
1979
+ data: string;
1980
+ mediaType: string;
1981
+ }, {
1982
+ type: import("convex/values").VLiteral<"media", "required">;
1983
+ data: import("convex/values").VString<string, "required">;
1984
+ mediaType: import("convex/values").VString<string, "required">;
1985
+ }, "required", "type" | "data" | "mediaType">], "required", "type" | "text" | "data" | "mediaType">, "required">;
1986
+ }, "required", "type" | "value">], "optional", "type" | "value" | `value.${string}`>;
1444
1987
  providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
1445
1988
  providerMetadata: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
1446
1989
  providerExecuted: import("convex/values").VBoolean<boolean | undefined, "optional">;
1990
+ result: import("convex/values").VAny<any, "optional", string>;
1447
1991
  isError: import("convex/values").VBoolean<boolean | undefined, "optional">;
1448
1992
  args: import("convex/values").VAny<any, "optional", string>;
1449
1993
  experimental_content: import("convex/values").VArray<({
@@ -1475,7 +2019,7 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1475
2019
  data: import("convex/values").VString<string, "required">;
1476
2020
  mimeType: import("convex/values").VString<string | undefined, "optional">;
1477
2021
  }, "required", "type" | "mimeType" | "data">], "required", "type" | "text" | "mimeType" | "data">, "optional">;
1478
- }, "required", "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "toolCallId" | "toolName" | "args" | "providerExecuted" | `args.${string}` | "result" | "isError" | "experimental_content" | `result.${string}`>, "required">;
2022
+ }, "required", "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "toolCallId" | "toolName" | "args" | "providerExecuted" | `args.${string}` | "output" | "result" | "isError" | "experimental_content" | "output.type" | "output.value" | `output.value.${string}` | `result.${string}`>, "required">;
1479
2023
  providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
1480
2024
  }, "required", "providerOptions" | "role" | `providerOptions.${string}` | "content">, import("convex/values").VObject<{
1481
2025
  providerOptions?: Record<string, Record<string, any>> | undefined;
@@ -1517,8 +2061,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1517
2061
  id: string;
1518
2062
  title: string;
1519
2063
  type: "source";
1520
- sourceType: "document";
1521
2064
  mediaType: string;
2065
+ sourceType: "document";
1522
2066
  })[] | undefined, import("convex/values").VUnion<{
1523
2067
  title?: string | undefined;
1524
2068
  type?: "source" | undefined;
@@ -1534,8 +2078,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1534
2078
  id: string;
1535
2079
  title: string;
1536
2080
  type: "source";
1537
- sourceType: "document";
1538
2081
  mediaType: string;
2082
+ sourceType: "document";
1539
2083
  }, [import("convex/values").VObject<{
1540
2084
  title?: string | undefined;
1541
2085
  type?: "source" | undefined;
@@ -1559,8 +2103,8 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1559
2103
  id: string;
1560
2104
  title: string;
1561
2105
  type: "source";
1562
- sourceType: "document";
1563
2106
  mediaType: string;
2107
+ sourceType: "document";
1564
2108
  }, {
1565
2109
  type: import("convex/values").VLiteral<"source", "required">;
1566
2110
  sourceType: import("convex/values").VLiteral<"document", "required">;
@@ -1570,7 +2114,7 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
1570
2114
  filename: import("convex/values").VString<string | undefined, "optional">;
1571
2115
  providerOptions: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
1572
2116
  providerMetadata: import("convex/values").VRecord<Record<string, Record<string, any>> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VRecord<Record<string, any>, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "required", string>, "optional", string>;
1573
- }, "required", "id" | "title" | "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "filename" | "sourceType" | "mediaType">], "required", "id" | "title" | "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "filename" | "sourceType" | "url" | "mediaType">, "optional">;
2117
+ }, "required", "id" | "title" | "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "filename" | "mediaType" | "sourceType">], "required", "id" | "title" | "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "filename" | "mediaType" | "sourceType" | "url">, "optional">;
1574
2118
  warnings: import("convex/values").VArray<({
1575
2119
  details?: string | undefined;
1576
2120
  type: "unsupported-setting";
@@ -1744,8 +2288,14 @@ export declare const DEFAULT_STREAMING_OPTIONS: {
1744
2288
  throttleMs: number;
1745
2289
  returnImmediately: false;
1746
2290
  };
1747
- export declare function mergeTransforms<TOOLS extends ToolSet>(options: StreamingOptions | boolean | undefined, existing: StreamTextTransform<TOOLS> | Array<StreamTextTransform<TOOLS>> | undefined): StreamTextTransform<TOOLS> | StreamTextTransform<TOOLS>[] | undefined;
1748
- export declare class DeltaStreamer {
2291
+ /**
2292
+ * DeltaStreamer can be used to save a stream of "parts" by writing
2293
+ * batches of them in "deltas" to the database so clients can subscribe
2294
+ * (using the syncStreams utility and client hooks) and re-hydrate the stream.
2295
+ * You can optionally compress the parts, e.g. concatenating text deltas, to
2296
+ * optimize the data in transit.
2297
+ */
2298
+ export declare class DeltaStreamer<T> {
1749
2299
  #private;
1750
2300
  readonly component: AgentComponent;
1751
2301
  readonly ctx: RunActionCtx;
@@ -1758,12 +2308,20 @@ export declare class DeltaStreamer {
1758
2308
  model?: string;
1759
2309
  provider?: string;
1760
2310
  providerOptions?: ProviderOptions;
1761
- abortSignal?: AbortSignal;
1762
2311
  };
1763
2312
  streamId: string | undefined;
1764
- readonly options: Required<StreamingOptions>;
2313
+ readonly config: {
2314
+ stream: Required<StreamingOptions>;
2315
+ onAsyncAbort: (reason: string) => Promise<void>;
2316
+ compress: ((parts: T[]) => T[]) | null;
2317
+ };
1765
2318
  abortController: AbortController;
1766
- constructor(component: AgentComponent, ctx: RunActionCtx, options: true | StreamingOptions, metadata: {
2319
+ constructor(component: AgentComponent, ctx: RunActionCtx, config: {
2320
+ stream: true | StreamingOptions;
2321
+ onAsyncAbort: (reason: string) => Promise<void>;
2322
+ abortSignal: AbortSignal | undefined;
2323
+ compress: ((parts: T[]) => T[]) | null;
2324
+ }, metadata: {
1767
2325
  threadId: string;
1768
2326
  userId?: string;
1769
2327
  order: number;
@@ -1772,9 +2330,8 @@ export declare class DeltaStreamer {
1772
2330
  model?: string;
1773
2331
  provider?: string;
1774
2332
  providerOptions?: ProviderOptions;
1775
- abortSignal?: AbortSignal;
1776
2333
  });
1777
- addParts(parts: TextStreamPart<ToolSet>[]): Promise<void>;
2334
+ addParts(parts: T[]): Promise<void>;
1778
2335
  finish(): Promise<void>;
1779
2336
  fail(reason: string): Promise<void>;
1780
2337
  }