@convex-dev/agent 0.2.4 → 0.2.5
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/dist/client/definePlaygroundAPI.d.ts +85 -0
- package/dist/client/definePlaygroundAPI.d.ts.map +1 -1
- package/dist/client/index.d.ts +85 -23
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +52 -51
- package/dist/client/index.js.map +1 -1
- package/dist/client/messages.d.ts +17 -0
- package/dist/client/messages.d.ts.map +1 -1
- package/dist/client/messages.js +5 -5
- package/dist/client/messages.js.map +1 -1
- package/dist/client/mockModel.d.ts +30 -0
- package/dist/client/mockModel.d.ts.map +1 -0
- package/dist/client/mockModel.js +153 -0
- package/dist/client/mockModel.js.map +1 -0
- package/dist/client/search.d.ts +17 -0
- package/dist/client/search.d.ts.map +1 -1
- package/dist/client/streaming.d.ts +190 -2
- package/dist/client/streaming.d.ts.map +1 -1
- package/dist/client/streaming.js +10 -8
- package/dist/client/streaming.js.map +1 -1
- package/dist/component/_generated/api.d.ts +176 -0
- package/dist/component/messages.d.ts +187 -0
- package/dist/component/messages.d.ts.map +1 -1
- package/dist/component/messages.js +1 -1
- package/dist/component/messages.js.map +1 -1
- package/dist/component/schema.d.ts +496 -3
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/mapping.d.ts.map +1 -1
- package/dist/mapping.js +5 -0
- package/dist/mapping.js.map +1 -1
- package/dist/react/toUIMessages.d.ts.map +1 -1
- package/dist/react/toUIMessages.js +29 -19
- package/dist/react/toUIMessages.js.map +1 -1
- package/dist/validators.d.ts +1183 -8
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +19 -1
- package/dist/validators.js.map +1 -1
- package/package.json +3 -3
- package/src/client/index.ts +91 -82
- package/src/client/messages.ts +6 -6
- package/src/client/mockModel.ts +195 -0
- package/src/client/streaming.ts +8 -7
- package/src/component/_generated/api.d.ts +176 -0
- package/src/component/messages.ts +1 -1
- package/src/mapping.ts +7 -0
- package/src/react/toUIMessages.ts +36 -19
- package/src/validators.ts +24 -0
|
@@ -109,6 +109,23 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
|
|
|
109
109
|
toolCallId: string;
|
|
110
110
|
toolName: string;
|
|
111
111
|
result: any;
|
|
112
|
+
} | {
|
|
113
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
114
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
115
|
+
id: string;
|
|
116
|
+
title: string;
|
|
117
|
+
type: "source";
|
|
118
|
+
sourceType: "url";
|
|
119
|
+
url: string;
|
|
120
|
+
} | {
|
|
121
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
122
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
123
|
+
filename?: string | undefined;
|
|
124
|
+
id: string;
|
|
125
|
+
title: string;
|
|
126
|
+
type: "source";
|
|
127
|
+
sourceType: "document";
|
|
128
|
+
mediaType: string;
|
|
112
129
|
})[];
|
|
113
130
|
} | {
|
|
114
131
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
@@ -380,6 +397,23 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
|
|
|
380
397
|
toolCallId: string;
|
|
381
398
|
toolName: string;
|
|
382
399
|
result: any;
|
|
400
|
+
} | {
|
|
401
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
402
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
403
|
+
id: string;
|
|
404
|
+
title: string;
|
|
405
|
+
type: "source";
|
|
406
|
+
sourceType: "url";
|
|
407
|
+
url: string;
|
|
408
|
+
} | {
|
|
409
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
410
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
411
|
+
filename?: string | undefined;
|
|
412
|
+
id: string;
|
|
413
|
+
title: string;
|
|
414
|
+
type: "source";
|
|
415
|
+
sourceType: "document";
|
|
416
|
+
mediaType: string;
|
|
383
417
|
})[];
|
|
384
418
|
} | {
|
|
385
419
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
@@ -553,6 +587,23 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
|
|
|
553
587
|
toolCallId: string;
|
|
554
588
|
toolName: string;
|
|
555
589
|
result: any;
|
|
590
|
+
} | {
|
|
591
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
592
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
593
|
+
id: string;
|
|
594
|
+
title: string;
|
|
595
|
+
type: "source";
|
|
596
|
+
sourceType: "url";
|
|
597
|
+
url: string;
|
|
598
|
+
} | {
|
|
599
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
600
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
601
|
+
filename?: string | undefined;
|
|
602
|
+
id: string;
|
|
603
|
+
title: string;
|
|
604
|
+
type: "source";
|
|
605
|
+
sourceType: "document";
|
|
606
|
+
mediaType: string;
|
|
556
607
|
})[];
|
|
557
608
|
} | {
|
|
558
609
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
@@ -729,6 +780,23 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
|
|
|
729
780
|
toolCallId: string;
|
|
730
781
|
toolName: string;
|
|
731
782
|
result: any;
|
|
783
|
+
} | {
|
|
784
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
785
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
786
|
+
id: string;
|
|
787
|
+
title: string;
|
|
788
|
+
type: "source";
|
|
789
|
+
sourceType: "url";
|
|
790
|
+
url: string;
|
|
791
|
+
} | {
|
|
792
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
793
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
794
|
+
filename?: string | undefined;
|
|
795
|
+
id: string;
|
|
796
|
+
title: string;
|
|
797
|
+
type: "source";
|
|
798
|
+
sourceType: "document";
|
|
799
|
+
mediaType: string;
|
|
732
800
|
})[];
|
|
733
801
|
} | {
|
|
734
802
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
@@ -918,6 +986,23 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
|
|
|
918
986
|
toolCallId: string;
|
|
919
987
|
toolName: string;
|
|
920
988
|
result: any;
|
|
989
|
+
} | {
|
|
990
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
991
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
992
|
+
id: string;
|
|
993
|
+
title: string;
|
|
994
|
+
type: "source";
|
|
995
|
+
sourceType: "url";
|
|
996
|
+
url: string;
|
|
997
|
+
} | {
|
|
998
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
999
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1000
|
+
filename?: string | undefined;
|
|
1001
|
+
id: string;
|
|
1002
|
+
title: string;
|
|
1003
|
+
type: "source";
|
|
1004
|
+
sourceType: "document";
|
|
1005
|
+
mediaType: string;
|
|
921
1006
|
})[];
|
|
922
1007
|
}, {
|
|
923
1008
|
role: import("convex/values").VLiteral<"assistant", "required">;
|
|
@@ -970,6 +1055,23 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
|
|
|
970
1055
|
toolCallId: string;
|
|
971
1056
|
toolName: string;
|
|
972
1057
|
result: any;
|
|
1058
|
+
} | {
|
|
1059
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1060
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1061
|
+
id: string;
|
|
1062
|
+
title: string;
|
|
1063
|
+
type: "source";
|
|
1064
|
+
sourceType: "url";
|
|
1065
|
+
url: string;
|
|
1066
|
+
} | {
|
|
1067
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1068
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1069
|
+
filename?: string | undefined;
|
|
1070
|
+
id: string;
|
|
1071
|
+
title: string;
|
|
1072
|
+
type: "source";
|
|
1073
|
+
sourceType: "document";
|
|
1074
|
+
mediaType: string;
|
|
973
1075
|
})[], [import("convex/values").VString<string, "required">, import("convex/values").VArray<({
|
|
974
1076
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
975
1077
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -1019,6 +1121,23 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
|
|
|
1019
1121
|
toolCallId: string;
|
|
1020
1122
|
toolName: string;
|
|
1021
1123
|
result: any;
|
|
1124
|
+
} | {
|
|
1125
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1126
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1127
|
+
id: string;
|
|
1128
|
+
title: string;
|
|
1129
|
+
type: "source";
|
|
1130
|
+
sourceType: "url";
|
|
1131
|
+
url: string;
|
|
1132
|
+
} | {
|
|
1133
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1134
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1135
|
+
filename?: string | undefined;
|
|
1136
|
+
id: string;
|
|
1137
|
+
title: string;
|
|
1138
|
+
type: "source";
|
|
1139
|
+
sourceType: "document";
|
|
1140
|
+
mediaType: string;
|
|
1022
1141
|
})[], import("convex/values").VUnion<{
|
|
1023
1142
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1024
1143
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -1068,6 +1187,23 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
|
|
|
1068
1187
|
toolCallId: string;
|
|
1069
1188
|
toolName: string;
|
|
1070
1189
|
result: any;
|
|
1190
|
+
} | {
|
|
1191
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1192
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1193
|
+
id: string;
|
|
1194
|
+
title: string;
|
|
1195
|
+
type: "source";
|
|
1196
|
+
sourceType: "url";
|
|
1197
|
+
url: string;
|
|
1198
|
+
} | {
|
|
1199
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1200
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1201
|
+
filename?: string | undefined;
|
|
1202
|
+
id: string;
|
|
1203
|
+
title: string;
|
|
1204
|
+
type: "source";
|
|
1205
|
+
sourceType: "document";
|
|
1206
|
+
mediaType: string;
|
|
1071
1207
|
}, [import("convex/values").VObject<{
|
|
1072
1208
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1073
1209
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
@@ -1187,7 +1323,58 @@ export declare const vStreamMessagesReturnValue: import("convex/values").VObject
|
|
|
1187
1323
|
data: import("convex/values").VString<string, "required">;
|
|
1188
1324
|
mimeType: import("convex/values").VString<string | undefined, "optional">;
|
|
1189
1325
|
}, "required", "type" | "mimeType" | "data">], "required", "type" | "text" | "mimeType" | "data">, "optional">;
|
|
1190
|
-
}, "required", "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "toolCallId" | "toolName" | "args" | "providerExecuted" | `args.${string}` | "result" | "isError" | "experimental_content" | `result.${string}
|
|
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<{
|
|
1327
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1328
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1329
|
+
id: string;
|
|
1330
|
+
title: string;
|
|
1331
|
+
type: "source";
|
|
1332
|
+
sourceType: "url";
|
|
1333
|
+
url: string;
|
|
1334
|
+
} | {
|
|
1335
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1336
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1337
|
+
filename?: string | undefined;
|
|
1338
|
+
id: string;
|
|
1339
|
+
title: string;
|
|
1340
|
+
type: "source";
|
|
1341
|
+
sourceType: "document";
|
|
1342
|
+
mediaType: string;
|
|
1343
|
+
}, [import("convex/values").VObject<{
|
|
1344
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1345
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1346
|
+
id: string;
|
|
1347
|
+
title: string;
|
|
1348
|
+
type: "source";
|
|
1349
|
+
sourceType: "url";
|
|
1350
|
+
url: string;
|
|
1351
|
+
}, {
|
|
1352
|
+
type: import("convex/values").VLiteral<"source", "required">;
|
|
1353
|
+
sourceType: import("convex/values").VLiteral<"url", "required">;
|
|
1354
|
+
id: import("convex/values").VString<string, "required">;
|
|
1355
|
+
url: import("convex/values").VString<string, "required">;
|
|
1356
|
+
title: import("convex/values").VString<string, "required">;
|
|
1357
|
+
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>;
|
|
1358
|
+
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>;
|
|
1359
|
+
}, "required", "id" | "title" | "type" | "providerOptions" | "providerMetadata" | `providerOptions.${string}` | `providerMetadata.${string}` | "sourceType" | "url">, import("convex/values").VObject<{
|
|
1360
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1361
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1362
|
+
filename?: string | undefined;
|
|
1363
|
+
id: string;
|
|
1364
|
+
title: string;
|
|
1365
|
+
type: "source";
|
|
1366
|
+
sourceType: "document";
|
|
1367
|
+
mediaType: string;
|
|
1368
|
+
}, {
|
|
1369
|
+
type: import("convex/values").VLiteral<"source", "required">;
|
|
1370
|
+
sourceType: import("convex/values").VLiteral<"document", "required">;
|
|
1371
|
+
id: import("convex/values").VString<string, "required">;
|
|
1372
|
+
mediaType: import("convex/values").VString<string, "required">;
|
|
1373
|
+
title: import("convex/values").VString<string, "required">;
|
|
1374
|
+
filename: import("convex/values").VString<string | undefined, "optional">;
|
|
1375
|
+
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
|
+
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>;
|
|
1191
1378
|
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>;
|
|
1192
1379
|
}, "required", "providerOptions" | "role" | `providerOptions.${string}` | "content">, import("convex/values").VObject<{
|
|
1193
1380
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
@@ -1562,6 +1749,7 @@ export declare class DeltaStreamer {
|
|
|
1562
1749
|
#private;
|
|
1563
1750
|
readonly component: AgentComponent;
|
|
1564
1751
|
readonly ctx: RunActionCtx;
|
|
1752
|
+
private onAsyncAbort;
|
|
1565
1753
|
readonly metadata: {
|
|
1566
1754
|
threadId: string;
|
|
1567
1755
|
userId?: string;
|
|
@@ -1576,7 +1764,7 @@ export declare class DeltaStreamer {
|
|
|
1576
1764
|
streamId: string | undefined;
|
|
1577
1765
|
readonly options: Required<StreamingOptions>;
|
|
1578
1766
|
abortController: AbortController;
|
|
1579
|
-
constructor(component: AgentComponent, ctx: RunActionCtx, options: true | StreamingOptions, metadata: {
|
|
1767
|
+
constructor(component: AgentComponent, ctx: RunActionCtx, options: true | StreamingOptions, onAsyncAbort: (reason: string) => Promise<void>, metadata: {
|
|
1580
1768
|
threadId: string;
|
|
1581
1769
|
userId?: string;
|
|
1582
1770
|
order: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../src/client/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,OAAO,EACb,MAAM,IAAI,CAAC;AACZ,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,UAAU,EAEf,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,WAAW,EACX,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAMpB,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../src/client/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,OAAO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
|
package/dist/client/streaming.js
CHANGED
|
@@ -95,6 +95,7 @@ export function mergeTransforms(options, existing) {
|
|
|
95
95
|
export class DeltaStreamer {
|
|
96
96
|
component;
|
|
97
97
|
ctx;
|
|
98
|
+
onAsyncAbort;
|
|
98
99
|
metadata;
|
|
99
100
|
streamId;
|
|
100
101
|
options;
|
|
@@ -103,26 +104,28 @@ export class DeltaStreamer {
|
|
|
103
104
|
#ongoingWrite;
|
|
104
105
|
#cursor = 0;
|
|
105
106
|
abortController;
|
|
106
|
-
constructor(component, ctx, options, metadata) {
|
|
107
|
+
constructor(component, ctx, options, onAsyncAbort, metadata) {
|
|
107
108
|
this.component = component;
|
|
108
109
|
this.ctx = ctx;
|
|
110
|
+
this.onAsyncAbort = onAsyncAbort;
|
|
109
111
|
this.metadata = metadata;
|
|
110
112
|
this.options =
|
|
111
|
-
|
|
113
|
+
options === true
|
|
112
114
|
? DEFAULT_STREAMING_OPTIONS
|
|
113
115
|
: { ...DEFAULT_STREAMING_OPTIONS, ...options };
|
|
114
116
|
this.#nextParts = [];
|
|
115
117
|
this.abortController = new AbortController();
|
|
116
118
|
if (metadata.abortSignal) {
|
|
117
119
|
metadata.abortSignal.addEventListener("abort", async () => {
|
|
120
|
+
if (this.abortController.signal.aborted) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
118
123
|
if (this.streamId) {
|
|
119
124
|
this.abortController.abort();
|
|
120
|
-
const finalDelta = this.#createDelta();
|
|
121
125
|
await this.#ongoingWrite;
|
|
122
126
|
await this.ctx.runMutation(this.component.streams.abort, {
|
|
123
127
|
streamId: this.streamId,
|
|
124
128
|
reason: "abortSignal",
|
|
125
|
-
finalDelta,
|
|
126
129
|
});
|
|
127
130
|
}
|
|
128
131
|
});
|
|
@@ -153,10 +156,13 @@ export class DeltaStreamer {
|
|
|
153
156
|
try {
|
|
154
157
|
const success = await this.ctx.runMutation(this.component.streams.addDelta, delta);
|
|
155
158
|
if (!success) {
|
|
159
|
+
await this.onAsyncAbort("async abort");
|
|
156
160
|
this.abortController.abort();
|
|
161
|
+
return;
|
|
157
162
|
}
|
|
158
163
|
}
|
|
159
164
|
catch (e) {
|
|
165
|
+
await this.onAsyncAbort(e instanceof Error ? e.message : "unknown error");
|
|
160
166
|
this.abortController.abort();
|
|
161
167
|
throw e;
|
|
162
168
|
}
|
|
@@ -188,11 +194,9 @@ export class DeltaStreamer {
|
|
|
188
194
|
if (!this.streamId) {
|
|
189
195
|
return;
|
|
190
196
|
}
|
|
191
|
-
const finalDelta = this.#createDelta();
|
|
192
197
|
await this.#ongoingWrite;
|
|
193
198
|
await this.ctx.runMutation(this.component.streams.finish, {
|
|
194
199
|
streamId: this.streamId,
|
|
195
|
-
finalDelta,
|
|
196
200
|
});
|
|
197
201
|
}
|
|
198
202
|
async fail(reason) {
|
|
@@ -203,12 +207,10 @@ export class DeltaStreamer {
|
|
|
203
207
|
if (!this.streamId) {
|
|
204
208
|
return;
|
|
205
209
|
}
|
|
206
|
-
const finalDelta = this.#createDelta();
|
|
207
210
|
await this.#ongoingWrite;
|
|
208
211
|
await this.ctx.runMutation(this.component.streams.abort, {
|
|
209
212
|
streamId: this.streamId,
|
|
210
213
|
reason,
|
|
211
|
-
finalDelta,
|
|
212
214
|
});
|
|
213
215
|
}
|
|
214
216
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.js","sourceRoot":"","sources":["../../src/client/streaming.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,GAIb,MAAM,IAAI,CAAC;AACZ,OAAO,EACL,YAAY,EACZ,cAAc,EACd,iBAAiB,GAKlB,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAA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I,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACxC,OAAO;QACT,CAAC;QACD,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAC7B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,aAAa,CAAC;QACzB,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE;YACvD,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM;SACP,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -260,6 +260,31 @@ export type Mounts = {
|
|
|
260
260
|
toolName: string;
|
|
261
261
|
type: "tool-result";
|
|
262
262
|
}
|
|
263
|
+
| {
|
|
264
|
+
id: string;
|
|
265
|
+
providerMetadata?: Record<
|
|
266
|
+
string,
|
|
267
|
+
Record<string, any>
|
|
268
|
+
>;
|
|
269
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
270
|
+
sourceType: "url";
|
|
271
|
+
title: string;
|
|
272
|
+
type: "source";
|
|
273
|
+
url: string;
|
|
274
|
+
}
|
|
275
|
+
| {
|
|
276
|
+
filename?: string;
|
|
277
|
+
id: string;
|
|
278
|
+
mediaType: string;
|
|
279
|
+
providerMetadata?: Record<
|
|
280
|
+
string,
|
|
281
|
+
Record<string, any>
|
|
282
|
+
>;
|
|
283
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
284
|
+
sourceType: "document";
|
|
285
|
+
title: string;
|
|
286
|
+
type: "source";
|
|
287
|
+
}
|
|
263
288
|
>;
|
|
264
289
|
providerOptions?: Record<string, Record<string, any>>;
|
|
265
290
|
role: "assistant";
|
|
@@ -469,6 +494,31 @@ export type Mounts = {
|
|
|
469
494
|
toolName: string;
|
|
470
495
|
type: "tool-result";
|
|
471
496
|
}
|
|
497
|
+
| {
|
|
498
|
+
id: string;
|
|
499
|
+
providerMetadata?: Record<
|
|
500
|
+
string,
|
|
501
|
+
Record<string, any>
|
|
502
|
+
>;
|
|
503
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
504
|
+
sourceType: "url";
|
|
505
|
+
title: string;
|
|
506
|
+
type: "source";
|
|
507
|
+
url: string;
|
|
508
|
+
}
|
|
509
|
+
| {
|
|
510
|
+
filename?: string;
|
|
511
|
+
id: string;
|
|
512
|
+
mediaType: string;
|
|
513
|
+
providerMetadata?: Record<
|
|
514
|
+
string,
|
|
515
|
+
Record<string, any>
|
|
516
|
+
>;
|
|
517
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
518
|
+
sourceType: "document";
|
|
519
|
+
title: string;
|
|
520
|
+
type: "source";
|
|
521
|
+
}
|
|
472
522
|
>;
|
|
473
523
|
providerOptions?: Record<string, Record<string, any>>;
|
|
474
524
|
role: "assistant";
|
|
@@ -687,6 +737,25 @@ export type Mounts = {
|
|
|
687
737
|
toolName: string;
|
|
688
738
|
type: "tool-result";
|
|
689
739
|
}
|
|
740
|
+
| {
|
|
741
|
+
id: string;
|
|
742
|
+
providerMetadata?: Record<string, Record<string, any>>;
|
|
743
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
744
|
+
sourceType: "url";
|
|
745
|
+
title: string;
|
|
746
|
+
type: "source";
|
|
747
|
+
url: string;
|
|
748
|
+
}
|
|
749
|
+
| {
|
|
750
|
+
filename?: string;
|
|
751
|
+
id: string;
|
|
752
|
+
mediaType: string;
|
|
753
|
+
providerMetadata?: Record<string, Record<string, any>>;
|
|
754
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
755
|
+
sourceType: "document";
|
|
756
|
+
title: string;
|
|
757
|
+
type: "source";
|
|
758
|
+
}
|
|
690
759
|
>;
|
|
691
760
|
providerOptions?: Record<string, Record<string, any>>;
|
|
692
761
|
role: "assistant";
|
|
@@ -918,6 +987,31 @@ export type Mounts = {
|
|
|
918
987
|
toolName: string;
|
|
919
988
|
type: "tool-result";
|
|
920
989
|
}
|
|
990
|
+
| {
|
|
991
|
+
id: string;
|
|
992
|
+
providerMetadata?: Record<
|
|
993
|
+
string,
|
|
994
|
+
Record<string, any>
|
|
995
|
+
>;
|
|
996
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
997
|
+
sourceType: "url";
|
|
998
|
+
title: string;
|
|
999
|
+
type: "source";
|
|
1000
|
+
url: string;
|
|
1001
|
+
}
|
|
1002
|
+
| {
|
|
1003
|
+
filename?: string;
|
|
1004
|
+
id: string;
|
|
1005
|
+
mediaType: string;
|
|
1006
|
+
providerMetadata?: Record<
|
|
1007
|
+
string,
|
|
1008
|
+
Record<string, any>
|
|
1009
|
+
>;
|
|
1010
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
1011
|
+
sourceType: "document";
|
|
1012
|
+
title: string;
|
|
1013
|
+
type: "source";
|
|
1014
|
+
}
|
|
921
1015
|
>;
|
|
922
1016
|
providerOptions?: Record<string, Record<string, any>>;
|
|
923
1017
|
role: "assistant";
|
|
@@ -1121,6 +1215,25 @@ export type Mounts = {
|
|
|
1121
1215
|
toolName: string;
|
|
1122
1216
|
type: "tool-result";
|
|
1123
1217
|
}
|
|
1218
|
+
| {
|
|
1219
|
+
id: string;
|
|
1220
|
+
providerMetadata?: Record<string, Record<string, any>>;
|
|
1221
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
1222
|
+
sourceType: "url";
|
|
1223
|
+
title: string;
|
|
1224
|
+
type: "source";
|
|
1225
|
+
url: string;
|
|
1226
|
+
}
|
|
1227
|
+
| {
|
|
1228
|
+
filename?: string;
|
|
1229
|
+
id: string;
|
|
1230
|
+
mediaType: string;
|
|
1231
|
+
providerMetadata?: Record<string, Record<string, any>>;
|
|
1232
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
1233
|
+
sourceType: "document";
|
|
1234
|
+
title: string;
|
|
1235
|
+
type: "source";
|
|
1236
|
+
}
|
|
1124
1237
|
>;
|
|
1125
1238
|
providerOptions?: Record<string, Record<string, any>>;
|
|
1126
1239
|
role: "assistant";
|
|
@@ -1317,6 +1430,25 @@ export type Mounts = {
|
|
|
1317
1430
|
toolName: string;
|
|
1318
1431
|
type: "tool-result";
|
|
1319
1432
|
}
|
|
1433
|
+
| {
|
|
1434
|
+
id: string;
|
|
1435
|
+
providerMetadata?: Record<string, Record<string, any>>;
|
|
1436
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
1437
|
+
sourceType: "url";
|
|
1438
|
+
title: string;
|
|
1439
|
+
type: "source";
|
|
1440
|
+
url: string;
|
|
1441
|
+
}
|
|
1442
|
+
| {
|
|
1443
|
+
filename?: string;
|
|
1444
|
+
id: string;
|
|
1445
|
+
mediaType: string;
|
|
1446
|
+
providerMetadata?: Record<string, Record<string, any>>;
|
|
1447
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
1448
|
+
sourceType: "document";
|
|
1449
|
+
title: string;
|
|
1450
|
+
type: "source";
|
|
1451
|
+
}
|
|
1320
1452
|
>;
|
|
1321
1453
|
providerOptions?: Record<string, Record<string, any>>;
|
|
1322
1454
|
role: "assistant";
|
|
@@ -1527,6 +1659,31 @@ export type Mounts = {
|
|
|
1527
1659
|
toolName: string;
|
|
1528
1660
|
type: "tool-result";
|
|
1529
1661
|
}
|
|
1662
|
+
| {
|
|
1663
|
+
id: string;
|
|
1664
|
+
providerMetadata?: Record<
|
|
1665
|
+
string,
|
|
1666
|
+
Record<string, any>
|
|
1667
|
+
>;
|
|
1668
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
1669
|
+
sourceType: "url";
|
|
1670
|
+
title: string;
|
|
1671
|
+
type: "source";
|
|
1672
|
+
url: string;
|
|
1673
|
+
}
|
|
1674
|
+
| {
|
|
1675
|
+
filename?: string;
|
|
1676
|
+
id: string;
|
|
1677
|
+
mediaType: string;
|
|
1678
|
+
providerMetadata?: Record<
|
|
1679
|
+
string,
|
|
1680
|
+
Record<string, any>
|
|
1681
|
+
>;
|
|
1682
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
1683
|
+
sourceType: "document";
|
|
1684
|
+
title: string;
|
|
1685
|
+
type: "source";
|
|
1686
|
+
}
|
|
1530
1687
|
>;
|
|
1531
1688
|
providerOptions?: Record<string, Record<string, any>>;
|
|
1532
1689
|
role: "assistant";
|
|
@@ -1661,6 +1818,25 @@ export type Mounts = {
|
|
|
1661
1818
|
toolName: string;
|
|
1662
1819
|
type: "tool-result";
|
|
1663
1820
|
}
|
|
1821
|
+
| {
|
|
1822
|
+
id: string;
|
|
1823
|
+
providerMetadata?: Record<string, Record<string, any>>;
|
|
1824
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
1825
|
+
sourceType: "url";
|
|
1826
|
+
title: string;
|
|
1827
|
+
type: "source";
|
|
1828
|
+
url: string;
|
|
1829
|
+
}
|
|
1830
|
+
| {
|
|
1831
|
+
filename?: string;
|
|
1832
|
+
id: string;
|
|
1833
|
+
mediaType: string;
|
|
1834
|
+
providerMetadata?: Record<string, Record<string, any>>;
|
|
1835
|
+
providerOptions?: Record<string, Record<string, any>>;
|
|
1836
|
+
sourceType: "document";
|
|
1837
|
+
title: string;
|
|
1838
|
+
type: "source";
|
|
1839
|
+
}
|
|
1664
1840
|
>;
|
|
1665
1841
|
providerOptions?: Record<string, Record<string, any>>;
|
|
1666
1842
|
role: "assistant";
|