@dremio/js-sdk 0.59.0 → 0.60.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.
- package/README.md +9 -0
- package/dist/cloud/ai/AIResource.d.ts +93 -13
- package/dist/enterprise/ai/AIResource.d.ts +93 -13
- package/dist/enterprise/ai/chat/chatEventSchema.d.ts +26 -3
- package/dist/enterprise/ai/chat/chatEventSchema.js +61 -11
- package/dist/enterprise/ai/chat/chatEventSchema.js.map +1 -1
- package/dist/enterprise/ai/conversations/AgentConversation.d.ts +30 -4
- package/dist/enterprise/ai/conversations/createConversationMachine.d.ts +97 -13
- package/dist/enterprise/ai/conversations/createConversationMachine.js +80 -11
- package/dist/enterprise/ai/conversations/createConversationMachine.js.map +1 -1
- package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.d.ts +15 -2
- package/dist/enterprise/ai/conversations/reduceChatEvents.d.ts +1 -1
- package/dist/enterprise/ai/conversations/reduceChatEvents.js +4 -1
- package/dist/enterprise/ai/conversations/reduceChatEvents.js.map +1 -1
- package/dist-iife/cloud.js +146 -28
- package/dist-iife/enterprise.js +146 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -464,6 +464,8 @@ type ConversationExchange = {
|
|
|
464
464
|
type ConversationExchangeMessage =
|
|
465
465
|
| ChatEventWithChunkType<"error">
|
|
466
466
|
| ChatEventWithChunkType<"model">
|
|
467
|
+
| ChatEventWithChunkType<"sandboxProgress">
|
|
468
|
+
| ChatEventWithChunkType<"sandboxStdout">
|
|
467
469
|
| ChatEventWithChunkType<"userMessage">;
|
|
468
470
|
|
|
469
471
|
type AgentToolCall = {
|
|
@@ -487,6 +489,13 @@ type ChatEvent = {
|
|
|
487
489
|
| { chunkType: "endOfStream" }
|
|
488
490
|
| { chunkType: "error"; message: string }
|
|
489
491
|
| { chunkType: "model"; name: string; result: Record<string, unknown> }
|
|
492
|
+
| { chunkType: "sandboxProgress"; stepName: string; text: string }
|
|
493
|
+
| {
|
|
494
|
+
chunkType: "sandboxStdout";
|
|
495
|
+
callId: string;
|
|
496
|
+
isFinal: boolean;
|
|
497
|
+
text: string;
|
|
498
|
+
}
|
|
490
499
|
| {
|
|
491
500
|
chunkType: "toolRequest";
|
|
492
501
|
callId: string;
|
|
@@ -137,12 +137,11 @@ export declare class AIResource {
|
|
|
137
137
|
};
|
|
138
138
|
role: "agent";
|
|
139
139
|
} | {
|
|
140
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
140
141
|
conversationId: string;
|
|
141
142
|
modelName: string;
|
|
142
143
|
modelProviderId: string;
|
|
143
144
|
runId: string;
|
|
144
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
145
|
-
id: string;
|
|
146
145
|
content: {
|
|
147
146
|
chunkType: "endOfStream";
|
|
148
147
|
};
|
|
@@ -199,6 +198,20 @@ export declare class AIResource {
|
|
|
199
198
|
text: string;
|
|
200
199
|
};
|
|
201
200
|
role: "agent";
|
|
201
|
+
} | {
|
|
202
|
+
conversationId: string;
|
|
203
|
+
modelName: string;
|
|
204
|
+
modelProviderId: string;
|
|
205
|
+
runId: string;
|
|
206
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
207
|
+
id: string;
|
|
208
|
+
content: {
|
|
209
|
+
callId: string;
|
|
210
|
+
chunkType: "sandboxStdout";
|
|
211
|
+
isFinal: boolean;
|
|
212
|
+
text: string;
|
|
213
|
+
};
|
|
214
|
+
role: "agent";
|
|
202
215
|
} | {
|
|
203
216
|
conversationId: string;
|
|
204
217
|
modelName: string;
|
|
@@ -286,12 +299,11 @@ export declare class AIResource {
|
|
|
286
299
|
};
|
|
287
300
|
role: "agent";
|
|
288
301
|
} | {
|
|
302
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
289
303
|
conversationId: string;
|
|
290
304
|
modelName: string;
|
|
291
305
|
modelProviderId: string;
|
|
292
306
|
runId: string;
|
|
293
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
294
|
-
id: string;
|
|
295
307
|
content: {
|
|
296
308
|
chunkType: "endOfStream";
|
|
297
309
|
};
|
|
@@ -348,6 +360,20 @@ export declare class AIResource {
|
|
|
348
360
|
text: string;
|
|
349
361
|
};
|
|
350
362
|
role: "agent";
|
|
363
|
+
} | {
|
|
364
|
+
conversationId: string;
|
|
365
|
+
modelName: string;
|
|
366
|
+
modelProviderId: string;
|
|
367
|
+
runId: string;
|
|
368
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
369
|
+
id: string;
|
|
370
|
+
content: {
|
|
371
|
+
callId: string;
|
|
372
|
+
chunkType: "sandboxStdout";
|
|
373
|
+
isFinal: boolean;
|
|
374
|
+
text: string;
|
|
375
|
+
};
|
|
376
|
+
role: "agent";
|
|
351
377
|
} | {
|
|
352
378
|
conversationId: string;
|
|
353
379
|
modelName: string;
|
|
@@ -442,12 +468,11 @@ export declare class AIResource {
|
|
|
442
468
|
};
|
|
443
469
|
role: "agent";
|
|
444
470
|
} | {
|
|
471
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
445
472
|
conversationId: string;
|
|
446
473
|
modelName: string;
|
|
447
474
|
modelProviderId: string;
|
|
448
475
|
runId: string;
|
|
449
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
450
|
-
id: string;
|
|
451
476
|
content: {
|
|
452
477
|
chunkType: "endOfStream";
|
|
453
478
|
};
|
|
@@ -504,6 +529,20 @@ export declare class AIResource {
|
|
|
504
529
|
text: string;
|
|
505
530
|
};
|
|
506
531
|
role: "agent";
|
|
532
|
+
} | {
|
|
533
|
+
conversationId: string;
|
|
534
|
+
modelName: string;
|
|
535
|
+
modelProviderId: string;
|
|
536
|
+
runId: string;
|
|
537
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
538
|
+
id: string;
|
|
539
|
+
content: {
|
|
540
|
+
callId: string;
|
|
541
|
+
chunkType: "sandboxStdout";
|
|
542
|
+
isFinal: boolean;
|
|
543
|
+
text: string;
|
|
544
|
+
};
|
|
545
|
+
role: "agent";
|
|
507
546
|
} | {
|
|
508
547
|
conversationId: string;
|
|
509
548
|
modelName: string;
|
|
@@ -615,12 +654,11 @@ export declare class AIResource {
|
|
|
615
654
|
};
|
|
616
655
|
role: "agent";
|
|
617
656
|
} | {
|
|
657
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
618
658
|
conversationId: string;
|
|
619
659
|
modelName: string;
|
|
620
660
|
modelProviderId: string;
|
|
621
661
|
runId: string;
|
|
622
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
623
|
-
id: string;
|
|
624
662
|
content: {
|
|
625
663
|
chunkType: "endOfStream";
|
|
626
664
|
};
|
|
@@ -677,6 +715,20 @@ export declare class AIResource {
|
|
|
677
715
|
text: string;
|
|
678
716
|
};
|
|
679
717
|
role: "agent";
|
|
718
|
+
} | {
|
|
719
|
+
conversationId: string;
|
|
720
|
+
modelName: string;
|
|
721
|
+
modelProviderId: string;
|
|
722
|
+
runId: string;
|
|
723
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
724
|
+
id: string;
|
|
725
|
+
content: {
|
|
726
|
+
callId: string;
|
|
727
|
+
chunkType: "sandboxStdout";
|
|
728
|
+
isFinal: boolean;
|
|
729
|
+
text: string;
|
|
730
|
+
};
|
|
731
|
+
role: "agent";
|
|
680
732
|
} | {
|
|
681
733
|
conversationId: string;
|
|
682
734
|
modelName: string;
|
|
@@ -768,12 +820,11 @@ export declare class AIResource {
|
|
|
768
820
|
};
|
|
769
821
|
role: "agent";
|
|
770
822
|
} | {
|
|
823
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
771
824
|
conversationId: string;
|
|
772
825
|
modelName: string;
|
|
773
826
|
modelProviderId: string;
|
|
774
827
|
runId: string;
|
|
775
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
776
|
-
id: string;
|
|
777
828
|
content: {
|
|
778
829
|
chunkType: "endOfStream";
|
|
779
830
|
};
|
|
@@ -830,6 +881,20 @@ export declare class AIResource {
|
|
|
830
881
|
text: string;
|
|
831
882
|
};
|
|
832
883
|
role: "agent";
|
|
884
|
+
} | {
|
|
885
|
+
conversationId: string;
|
|
886
|
+
modelName: string;
|
|
887
|
+
modelProviderId: string;
|
|
888
|
+
runId: string;
|
|
889
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
890
|
+
id: string;
|
|
891
|
+
content: {
|
|
892
|
+
callId: string;
|
|
893
|
+
chunkType: "sandboxStdout";
|
|
894
|
+
isFinal: boolean;
|
|
895
|
+
text: string;
|
|
896
|
+
};
|
|
897
|
+
role: "agent";
|
|
833
898
|
} | {
|
|
834
899
|
conversationId: string;
|
|
835
900
|
modelName: string;
|
|
@@ -936,12 +1001,11 @@ export declare class AIResource {
|
|
|
936
1001
|
};
|
|
937
1002
|
role: "agent";
|
|
938
1003
|
} | {
|
|
1004
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
939
1005
|
conversationId: string;
|
|
940
1006
|
modelName: string;
|
|
941
1007
|
modelProviderId: string;
|
|
942
1008
|
runId: string;
|
|
943
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
944
|
-
id: string;
|
|
945
1009
|
content: {
|
|
946
1010
|
chunkType: "endOfStream";
|
|
947
1011
|
};
|
|
@@ -998,6 +1062,20 @@ export declare class AIResource {
|
|
|
998
1062
|
text: string;
|
|
999
1063
|
};
|
|
1000
1064
|
role: "agent";
|
|
1065
|
+
} | {
|
|
1066
|
+
conversationId: string;
|
|
1067
|
+
modelName: string;
|
|
1068
|
+
modelProviderId: string;
|
|
1069
|
+
runId: string;
|
|
1070
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
1071
|
+
id: string;
|
|
1072
|
+
content: {
|
|
1073
|
+
callId: string;
|
|
1074
|
+
chunkType: "sandboxStdout";
|
|
1075
|
+
isFinal: boolean;
|
|
1076
|
+
text: string;
|
|
1077
|
+
};
|
|
1078
|
+
role: "agent";
|
|
1001
1079
|
} | {
|
|
1002
1080
|
conversationId: string;
|
|
1003
1081
|
modelName: string;
|
|
@@ -1048,7 +1126,7 @@ export declare class AIResource {
|
|
|
1048
1126
|
runId: string;
|
|
1049
1127
|
}, import("xstate").EventObject>;
|
|
1050
1128
|
id: string | undefined;
|
|
1051
|
-
}, never, never,
|
|
1129
|
+
}, never, never, "STREAM_RETRY_DELAY", "uninitialized" | "creating_conversation" | "retrieving_history" | "idle" | "submitting_message" | "retrieve_history_failed" | "stream_interrupted" | "stream_recovery_failed" | "submitting_message_failed" | {
|
|
1052
1130
|
streaming: "monitoring_replies" | "stopping";
|
|
1053
1131
|
}, string, import("../../enterprise/ai/conversations/createConversationMachine.ts").ConversationMachineInput, import("xstate").NonReducibleUnknown, {
|
|
1054
1132
|
type: "apiError";
|
|
@@ -1066,6 +1144,8 @@ export declare class AIResource {
|
|
|
1066
1144
|
readonly idle: {};
|
|
1067
1145
|
readonly retrieve_history_failed: {};
|
|
1068
1146
|
readonly retrieving_history: {};
|
|
1147
|
+
readonly stream_interrupted: {};
|
|
1148
|
+
readonly stream_recovery_failed: {};
|
|
1069
1149
|
readonly streaming: {
|
|
1070
1150
|
states: {
|
|
1071
1151
|
readonly monitoring_replies: {};
|
|
@@ -79,12 +79,11 @@ export declare class AIResource {
|
|
|
79
79
|
};
|
|
80
80
|
role: "agent";
|
|
81
81
|
} | {
|
|
82
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
82
83
|
conversationId: string;
|
|
83
84
|
modelName: string;
|
|
84
85
|
modelProviderId: string;
|
|
85
86
|
runId: string;
|
|
86
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
87
|
-
id: string;
|
|
88
87
|
content: {
|
|
89
88
|
chunkType: "endOfStream";
|
|
90
89
|
};
|
|
@@ -141,6 +140,20 @@ export declare class AIResource {
|
|
|
141
140
|
text: string;
|
|
142
141
|
};
|
|
143
142
|
role: "agent";
|
|
143
|
+
} | {
|
|
144
|
+
conversationId: string;
|
|
145
|
+
modelName: string;
|
|
146
|
+
modelProviderId: string;
|
|
147
|
+
runId: string;
|
|
148
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
149
|
+
id: string;
|
|
150
|
+
content: {
|
|
151
|
+
callId: string;
|
|
152
|
+
chunkType: "sandboxStdout";
|
|
153
|
+
isFinal: boolean;
|
|
154
|
+
text: string;
|
|
155
|
+
};
|
|
156
|
+
role: "agent";
|
|
144
157
|
} | {
|
|
145
158
|
conversationId: string;
|
|
146
159
|
modelName: string;
|
|
@@ -228,12 +241,11 @@ export declare class AIResource {
|
|
|
228
241
|
};
|
|
229
242
|
role: "agent";
|
|
230
243
|
} | {
|
|
244
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
231
245
|
conversationId: string;
|
|
232
246
|
modelName: string;
|
|
233
247
|
modelProviderId: string;
|
|
234
248
|
runId: string;
|
|
235
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
236
|
-
id: string;
|
|
237
249
|
content: {
|
|
238
250
|
chunkType: "endOfStream";
|
|
239
251
|
};
|
|
@@ -290,6 +302,20 @@ export declare class AIResource {
|
|
|
290
302
|
text: string;
|
|
291
303
|
};
|
|
292
304
|
role: "agent";
|
|
305
|
+
} | {
|
|
306
|
+
conversationId: string;
|
|
307
|
+
modelName: string;
|
|
308
|
+
modelProviderId: string;
|
|
309
|
+
runId: string;
|
|
310
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
311
|
+
id: string;
|
|
312
|
+
content: {
|
|
313
|
+
callId: string;
|
|
314
|
+
chunkType: "sandboxStdout";
|
|
315
|
+
isFinal: boolean;
|
|
316
|
+
text: string;
|
|
317
|
+
};
|
|
318
|
+
role: "agent";
|
|
293
319
|
} | {
|
|
294
320
|
conversationId: string;
|
|
295
321
|
modelName: string;
|
|
@@ -384,12 +410,11 @@ export declare class AIResource {
|
|
|
384
410
|
};
|
|
385
411
|
role: "agent";
|
|
386
412
|
} | {
|
|
413
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
387
414
|
conversationId: string;
|
|
388
415
|
modelName: string;
|
|
389
416
|
modelProviderId: string;
|
|
390
417
|
runId: string;
|
|
391
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
392
|
-
id: string;
|
|
393
418
|
content: {
|
|
394
419
|
chunkType: "endOfStream";
|
|
395
420
|
};
|
|
@@ -446,6 +471,20 @@ export declare class AIResource {
|
|
|
446
471
|
text: string;
|
|
447
472
|
};
|
|
448
473
|
role: "agent";
|
|
474
|
+
} | {
|
|
475
|
+
conversationId: string;
|
|
476
|
+
modelName: string;
|
|
477
|
+
modelProviderId: string;
|
|
478
|
+
runId: string;
|
|
479
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
480
|
+
id: string;
|
|
481
|
+
content: {
|
|
482
|
+
callId: string;
|
|
483
|
+
chunkType: "sandboxStdout";
|
|
484
|
+
isFinal: boolean;
|
|
485
|
+
text: string;
|
|
486
|
+
};
|
|
487
|
+
role: "agent";
|
|
449
488
|
} | {
|
|
450
489
|
conversationId: string;
|
|
451
490
|
modelName: string;
|
|
@@ -557,12 +596,11 @@ export declare class AIResource {
|
|
|
557
596
|
};
|
|
558
597
|
role: "agent";
|
|
559
598
|
} | {
|
|
599
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
560
600
|
conversationId: string;
|
|
561
601
|
modelName: string;
|
|
562
602
|
modelProviderId: string;
|
|
563
603
|
runId: string;
|
|
564
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
565
|
-
id: string;
|
|
566
604
|
content: {
|
|
567
605
|
chunkType: "endOfStream";
|
|
568
606
|
};
|
|
@@ -619,6 +657,20 @@ export declare class AIResource {
|
|
|
619
657
|
text: string;
|
|
620
658
|
};
|
|
621
659
|
role: "agent";
|
|
660
|
+
} | {
|
|
661
|
+
conversationId: string;
|
|
662
|
+
modelName: string;
|
|
663
|
+
modelProviderId: string;
|
|
664
|
+
runId: string;
|
|
665
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
666
|
+
id: string;
|
|
667
|
+
content: {
|
|
668
|
+
callId: string;
|
|
669
|
+
chunkType: "sandboxStdout";
|
|
670
|
+
isFinal: boolean;
|
|
671
|
+
text: string;
|
|
672
|
+
};
|
|
673
|
+
role: "agent";
|
|
622
674
|
} | {
|
|
623
675
|
conversationId: string;
|
|
624
676
|
modelName: string;
|
|
@@ -710,12 +762,11 @@ export declare class AIResource {
|
|
|
710
762
|
};
|
|
711
763
|
role: "agent";
|
|
712
764
|
} | {
|
|
765
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
713
766
|
conversationId: string;
|
|
714
767
|
modelName: string;
|
|
715
768
|
modelProviderId: string;
|
|
716
769
|
runId: string;
|
|
717
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
718
|
-
id: string;
|
|
719
770
|
content: {
|
|
720
771
|
chunkType: "endOfStream";
|
|
721
772
|
};
|
|
@@ -772,6 +823,20 @@ export declare class AIResource {
|
|
|
772
823
|
text: string;
|
|
773
824
|
};
|
|
774
825
|
role: "agent";
|
|
826
|
+
} | {
|
|
827
|
+
conversationId: string;
|
|
828
|
+
modelName: string;
|
|
829
|
+
modelProviderId: string;
|
|
830
|
+
runId: string;
|
|
831
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
832
|
+
id: string;
|
|
833
|
+
content: {
|
|
834
|
+
callId: string;
|
|
835
|
+
chunkType: "sandboxStdout";
|
|
836
|
+
isFinal: boolean;
|
|
837
|
+
text: string;
|
|
838
|
+
};
|
|
839
|
+
role: "agent";
|
|
775
840
|
} | {
|
|
776
841
|
conversationId: string;
|
|
777
842
|
modelName: string;
|
|
@@ -878,12 +943,11 @@ export declare class AIResource {
|
|
|
878
943
|
};
|
|
879
944
|
role: "agent";
|
|
880
945
|
} | {
|
|
946
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
881
947
|
conversationId: string;
|
|
882
948
|
modelName: string;
|
|
883
949
|
modelProviderId: string;
|
|
884
950
|
runId: string;
|
|
885
|
-
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
886
|
-
id: string;
|
|
887
951
|
content: {
|
|
888
952
|
chunkType: "endOfStream";
|
|
889
953
|
};
|
|
@@ -940,6 +1004,20 @@ export declare class AIResource {
|
|
|
940
1004
|
text: string;
|
|
941
1005
|
};
|
|
942
1006
|
role: "agent";
|
|
1007
|
+
} | {
|
|
1008
|
+
conversationId: string;
|
|
1009
|
+
modelName: string;
|
|
1010
|
+
modelProviderId: string;
|
|
1011
|
+
runId: string;
|
|
1012
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
1013
|
+
id: string;
|
|
1014
|
+
content: {
|
|
1015
|
+
callId: string;
|
|
1016
|
+
chunkType: "sandboxStdout";
|
|
1017
|
+
isFinal: boolean;
|
|
1018
|
+
text: string;
|
|
1019
|
+
};
|
|
1020
|
+
role: "agent";
|
|
943
1021
|
} | {
|
|
944
1022
|
conversationId: string;
|
|
945
1023
|
modelName: string;
|
|
@@ -990,7 +1068,7 @@ export declare class AIResource {
|
|
|
990
1068
|
runId: string;
|
|
991
1069
|
}, import("xstate").EventObject>;
|
|
992
1070
|
id: string | undefined;
|
|
993
|
-
}, never, never,
|
|
1071
|
+
}, never, never, "STREAM_RETRY_DELAY", "uninitialized" | "creating_conversation" | "retrieving_history" | "idle" | "submitting_message" | "retrieve_history_failed" | "stream_interrupted" | "stream_recovery_failed" | "submitting_message_failed" | {
|
|
994
1072
|
streaming: "monitoring_replies" | "stopping";
|
|
995
1073
|
}, string, import("./conversations/createConversationMachine.ts").ConversationMachineInput, import("xstate").NonReducibleUnknown, {
|
|
996
1074
|
type: "apiError";
|
|
@@ -1008,6 +1086,8 @@ export declare class AIResource {
|
|
|
1008
1086
|
readonly idle: {};
|
|
1009
1087
|
readonly retrieve_history_failed: {};
|
|
1010
1088
|
readonly retrieving_history: {};
|
|
1089
|
+
readonly stream_interrupted: {};
|
|
1090
|
+
readonly stream_recovery_failed: {};
|
|
1011
1091
|
readonly streaming: {
|
|
1012
1092
|
states: {
|
|
1013
1093
|
readonly monitoring_replies: {};
|
|
@@ -66,7 +66,6 @@ export declare const chatEventCodec: z.ZodMiniCodec<z.ZodMiniDiscriminatedUnion<
|
|
|
66
66
|
chunkType: z.ZodMiniLiteral<"endOfStream">;
|
|
67
67
|
conversationId: z.ZodMiniString<string>;
|
|
68
68
|
createdAt: z.ZodMiniString<string>;
|
|
69
|
-
messageId: z.ZodMiniString<string>;
|
|
70
69
|
modelName: z.ZodMiniString<string>;
|
|
71
70
|
modelProviderId: z.ZodMiniString<string>;
|
|
72
71
|
runId: z.ZodMiniString<string>;
|
|
@@ -120,6 +119,17 @@ export declare const chatEventCodec: z.ZodMiniCodec<z.ZodMiniDiscriminatedUnion<
|
|
|
120
119
|
modelName: z.ZodMiniString<string>;
|
|
121
120
|
modelProviderId: z.ZodMiniString<string>;
|
|
122
121
|
runId: z.ZodMiniString<string>;
|
|
122
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
123
|
+
callId: z.ZodMiniString<string>;
|
|
124
|
+
chunkType: z.ZodMiniLiteral<"sandboxStdout">;
|
|
125
|
+
isFinal: z.ZodMiniBoolean<boolean>;
|
|
126
|
+
text: z.ZodMiniString<string>;
|
|
127
|
+
conversationId: z.ZodMiniString<string>;
|
|
128
|
+
createdAt: z.ZodMiniString<string>;
|
|
129
|
+
messageId: z.ZodMiniString<string>;
|
|
130
|
+
modelName: z.ZodMiniString<string>;
|
|
131
|
+
modelProviderId: z.ZodMiniString<string>;
|
|
132
|
+
runId: z.ZodMiniString<string>;
|
|
123
133
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
124
134
|
arguments: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
|
|
125
135
|
callId: z.ZodMiniString<string>;
|
|
@@ -183,12 +193,11 @@ export declare const chatEventCodec: z.ZodMiniCodec<z.ZodMiniDiscriminatedUnion<
|
|
|
183
193
|
}, z.core.$strip>;
|
|
184
194
|
role: z.ZodMiniLiteral<"agent">;
|
|
185
195
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
196
|
+
createdAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
|
|
186
197
|
conversationId: z.ZodMiniString<string>;
|
|
187
198
|
modelName: z.ZodMiniString<string>;
|
|
188
199
|
modelProviderId: z.ZodMiniString<string>;
|
|
189
200
|
runId: z.ZodMiniString<string>;
|
|
190
|
-
createdAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
|
|
191
|
-
id: z.ZodMiniString<string>;
|
|
192
201
|
content: z.ZodMiniObject<{
|
|
193
202
|
chunkType: z.ZodMiniLiteral<"endOfStream">;
|
|
194
203
|
}, z.core.$strip>;
|
|
@@ -251,6 +260,20 @@ export declare const chatEventCodec: z.ZodMiniCodec<z.ZodMiniDiscriminatedUnion<
|
|
|
251
260
|
text: z.ZodMiniString<string>;
|
|
252
261
|
}, z.core.$strip>;
|
|
253
262
|
role: z.ZodMiniLiteral<"agent">;
|
|
263
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
264
|
+
conversationId: z.ZodMiniString<string>;
|
|
265
|
+
modelName: z.ZodMiniString<string>;
|
|
266
|
+
modelProviderId: z.ZodMiniString<string>;
|
|
267
|
+
runId: z.ZodMiniString<string>;
|
|
268
|
+
createdAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
|
|
269
|
+
id: z.ZodMiniString<string>;
|
|
270
|
+
content: z.ZodMiniObject<{
|
|
271
|
+
callId: z.ZodMiniString<string>;
|
|
272
|
+
chunkType: z.ZodMiniLiteral<"sandboxStdout">;
|
|
273
|
+
isFinal: z.ZodMiniBoolean<boolean>;
|
|
274
|
+
text: z.ZodMiniString<string>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
role: z.ZodMiniLiteral<"agent">;
|
|
254
277
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
255
278
|
conversationId: z.ZodMiniString<string>;
|
|
256
279
|
modelName: z.ZodMiniString<string>;
|
|
@@ -57,6 +57,15 @@ const conversationUpdateChunkSchema = z.object({
|
|
|
57
57
|
const endOfStreamChunkSchema = z.object({
|
|
58
58
|
chunkType: z.literal("endOfStream"),
|
|
59
59
|
});
|
|
60
|
+
// endOfStream omits messageId: the backend sends it absent or as "", neither maps to a meaningful id
|
|
61
|
+
const endOfStreamInputSchema = z.object({
|
|
62
|
+
chunkType: z.literal("endOfStream"),
|
|
63
|
+
conversationId: z.string(),
|
|
64
|
+
createdAt: z.string().check(z.iso.datetime()),
|
|
65
|
+
modelName: z.string(),
|
|
66
|
+
modelProviderId: z.string(),
|
|
67
|
+
runId: z.string(),
|
|
68
|
+
});
|
|
60
69
|
const interruptChunkSchema = z.object({
|
|
61
70
|
chunkType: z.literal("interrupt"),
|
|
62
71
|
});
|
|
@@ -76,6 +85,14 @@ const sandboxProgressChunkSchema = z.object({
|
|
|
76
85
|
stepName: z.string(),
|
|
77
86
|
text: z.string(),
|
|
78
87
|
});
|
|
88
|
+
const sandboxStdoutChunkSchema = z.object({
|
|
89
|
+
callId: z.string().check(z.trim(), z.minLength(1)),
|
|
90
|
+
chunkType: z.literal("sandboxStdout"),
|
|
91
|
+
isFinal: z.boolean(),
|
|
92
|
+
text: z.string(),
|
|
93
|
+
});
|
|
94
|
+
const sandboxStdoutContentSchema = sandboxStdoutChunkSchema;
|
|
95
|
+
const sandboxStdoutChatEventSchema = z.extend(sandboxStdoutChunkSchema, chatEventSharedSchema);
|
|
79
96
|
const toolPlanSchema = z.record(z.string(), z.unknown());
|
|
80
97
|
const toolRequestChunkSchema = z.object({
|
|
81
98
|
arguments: z.record(z.string(), z.unknown()),
|
|
@@ -122,12 +139,13 @@ export const chatEventV1Schema = z.discriminatedUnion("chunkType", [
|
|
|
122
139
|
]);
|
|
123
140
|
const chatEventInputSchema = z.discriminatedUnion("chunkType", [
|
|
124
141
|
z.extend(errorChunkV2Schema, chatEventSharedSchema),
|
|
125
|
-
|
|
142
|
+
endOfStreamInputSchema,
|
|
126
143
|
z.extend(interruptChunkSchema, chatEventSharedSchema),
|
|
127
144
|
z.extend(conversationUpdateChunkSchema, chatEventSharedSchema),
|
|
128
145
|
z.extend(jobUpdateChunkSchema, chatEventSharedSchema),
|
|
129
146
|
z.extend(modelChunkSchema, chatEventSharedSchema),
|
|
130
147
|
z.extend(sandboxProgressChunkSchema, chatEventSharedSchema),
|
|
148
|
+
sandboxStdoutChatEventSchema,
|
|
131
149
|
z.extend(toolRequestChunkSchema, chatEventSharedSchema),
|
|
132
150
|
z.extend(toolResponseChunkSchema, chatEventSharedSchema),
|
|
133
151
|
z.extend(userMessageChunkSchema, chatEventSharedSchema),
|
|
@@ -136,13 +154,15 @@ const chatEventOutputSharedSchema = z.extend(z.omit(z.strictObject(chatEventShar
|
|
|
136
154
|
createdAt: z.instanceof(Temporal.Instant),
|
|
137
155
|
id: z.string(),
|
|
138
156
|
});
|
|
157
|
+
// endOfStream has no meaningful messageId on input, so no id on output
|
|
158
|
+
const endOfStreamOutputSchema = z.omit(chatEventOutputSharedSchema, { id: true });
|
|
139
159
|
const chatEventOutputSchema = z.union([
|
|
140
160
|
z.extend(chatEventOutputSharedSchema, {
|
|
141
161
|
content: conversationUpdateChunkSchema,
|
|
142
162
|
role: z.literal("agent"),
|
|
143
163
|
}),
|
|
144
164
|
z.extend(chatEventOutputSharedSchema, { content: errorChunkV2Schema, role: z.literal("agent") }),
|
|
145
|
-
z.extend(
|
|
165
|
+
z.extend(endOfStreamOutputSchema, {
|
|
146
166
|
content: endOfStreamChunkSchema,
|
|
147
167
|
role: z.literal("agent"),
|
|
148
168
|
}),
|
|
@@ -159,6 +179,10 @@ const chatEventOutputSchema = z.union([
|
|
|
159
179
|
content: sandboxProgressChunkSchema,
|
|
160
180
|
role: z.literal("agent"),
|
|
161
181
|
}),
|
|
182
|
+
z.extend(chatEventOutputSharedSchema, {
|
|
183
|
+
content: sandboxStdoutContentSchema,
|
|
184
|
+
role: z.literal("agent"),
|
|
185
|
+
}),
|
|
162
186
|
z.extend(chatEventOutputSharedSchema, {
|
|
163
187
|
content: toolRequestChunkSchema,
|
|
164
188
|
role: z.literal("agent"),
|
|
@@ -174,6 +198,17 @@ const chatEventOutputSchema = z.union([
|
|
|
174
198
|
]);
|
|
175
199
|
export const chatEventCodec = z.codec(chatEventInputSchema, chatEventOutputSchema, {
|
|
176
200
|
decode(v) {
|
|
201
|
+
if (v.chunkType === "endOfStream") {
|
|
202
|
+
return {
|
|
203
|
+
content: { chunkType: "endOfStream" },
|
|
204
|
+
conversationId: v.conversationId,
|
|
205
|
+
createdAt: Temporal.Instant.from(v.createdAt),
|
|
206
|
+
modelName: v.modelName,
|
|
207
|
+
modelProviderId: v.modelProviderId,
|
|
208
|
+
role: "agent",
|
|
209
|
+
runId: v.runId,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
177
212
|
const sharedProperties = {
|
|
178
213
|
conversationId: v.conversationId,
|
|
179
214
|
createdAt: Temporal.Instant.from(v.createdAt),
|
|
@@ -203,14 +238,6 @@ export const chatEventCodec = z.codec(chatEventInputSchema, chatEventOutputSchem
|
|
|
203
238
|
},
|
|
204
239
|
role: "agent",
|
|
205
240
|
};
|
|
206
|
-
case "endOfStream":
|
|
207
|
-
return {
|
|
208
|
-
...sharedProperties,
|
|
209
|
-
content: {
|
|
210
|
-
chunkType: "endOfStream",
|
|
211
|
-
},
|
|
212
|
-
role: "agent",
|
|
213
|
-
};
|
|
214
241
|
case "interrupt":
|
|
215
242
|
return {
|
|
216
243
|
...sharedProperties,
|
|
@@ -251,6 +278,17 @@ export const chatEventCodec = z.codec(chatEventInputSchema, chatEventOutputSchem
|
|
|
251
278
|
},
|
|
252
279
|
role: "agent",
|
|
253
280
|
};
|
|
281
|
+
case "sandboxStdout":
|
|
282
|
+
return {
|
|
283
|
+
...sharedProperties,
|
|
284
|
+
content: {
|
|
285
|
+
callId: v.callId,
|
|
286
|
+
chunkType: "sandboxStdout",
|
|
287
|
+
isFinal: v.isFinal,
|
|
288
|
+
text: v.text,
|
|
289
|
+
},
|
|
290
|
+
role: "agent",
|
|
291
|
+
};
|
|
254
292
|
case "toolRequest":
|
|
255
293
|
return {
|
|
256
294
|
...sharedProperties,
|
|
@@ -287,10 +325,22 @@ export const chatEventCodec = z.codec(chatEventInputSchema, chatEventOutputSchem
|
|
|
287
325
|
}
|
|
288
326
|
},
|
|
289
327
|
encode(v) {
|
|
328
|
+
if (v.content.chunkType === "endOfStream") {
|
|
329
|
+
return {
|
|
330
|
+
chunkType: "endOfStream",
|
|
331
|
+
conversationId: v.conversationId,
|
|
332
|
+
createdAt: v.createdAt.toString(),
|
|
333
|
+
modelName: v.modelName,
|
|
334
|
+
modelProviderId: v.modelProviderId,
|
|
335
|
+
runId: v.runId,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
// Safe: endOfStream (the only variant without id) is handled by the early return above
|
|
339
|
+
const id = v.id;
|
|
290
340
|
return {
|
|
291
341
|
conversationId: v.conversationId,
|
|
292
342
|
createdAt: v.createdAt.toString(),
|
|
293
|
-
messageId:
|
|
343
|
+
messageId: id,
|
|
294
344
|
modelName: v.modelName,
|
|
295
345
|
modelProviderId: v.modelProviderId,
|
|
296
346
|
runId: v.runId,
|