@dremio/js-sdk 0.58.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.
Files changed (26) hide show
  1. package/README.md +9 -0
  2. package/dist/cloud/ai/AIResource.d.ts +93 -13
  3. package/dist/enterprise/ai/AIResource.d.ts +93 -13
  4. package/dist/enterprise/ai/chat/UserChatMessage.d.ts +0 -2
  5. package/dist/enterprise/ai/chat/UserChatMessage.js +0 -1
  6. package/dist/enterprise/ai/chat/UserChatMessage.js.map +1 -1
  7. package/dist/enterprise/ai/chat/chatEventSchema.d.ts +26 -3
  8. package/dist/enterprise/ai/chat/chatEventSchema.js +61 -11
  9. package/dist/enterprise/ai/chat/chatEventSchema.js.map +1 -1
  10. package/dist/enterprise/ai/conversations/AgentConversation.d.ts +30 -4
  11. package/dist/enterprise/ai/conversations/createConversationMachine.d.ts +97 -13
  12. package/dist/enterprise/ai/conversations/createConversationMachine.js +80 -11
  13. package/dist/enterprise/ai/conversations/createConversationMachine.js.map +1 -1
  14. package/dist/enterprise/ai/conversations/methods/createConversation.d.ts +0 -1
  15. package/dist/enterprise/ai/conversations/methods/createConversation.js +0 -2
  16. package/dist/enterprise/ai/conversations/methods/createConversation.js.map +1 -1
  17. package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.d.ts +15 -2
  18. package/dist/enterprise/ai/conversations/reduceChatEvents.d.ts +1 -1
  19. package/dist/enterprise/ai/conversations/reduceChatEvents.js +4 -1
  20. package/dist/enterprise/ai/conversations/reduceChatEvents.js.map +1 -1
  21. package/dist/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.d.ts +7 -0
  22. package/dist/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.js +3 -0
  23. package/dist/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.js.map +1 -1
  24. package/dist-iife/cloud.js +150 -32
  25. package/dist-iife/enterprise.js +150 -32
  26. 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, never, "uninitialized" | "creating_conversation" | "retrieving_history" | "idle" | "submitting_message" | "retrieve_history_failed" | "submitting_message_failed" | {
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, never, "uninitialized" | "creating_conversation" | "retrieving_history" | "idle" | "submitting_message" | "retrieve_history_failed" | "submitting_message_failed" | {
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: {};
@@ -14,7 +14,6 @@ export declare class UserChatMessage {
14
14
  prompt: Omit<{
15
15
  text: string;
16
16
  acceptTaskNames?: string[] | undefined;
17
- approvalResponseOnly?: boolean | undefined;
18
17
  approvals?: {
19
18
  allToolsAllowed: boolean;
20
19
  approvalNonce: string;
@@ -35,7 +34,6 @@ export declare class UserChatMessage {
35
34
  }
36
35
  export declare const createConversationPromptSchema: z.ZodMiniObject<{
37
36
  acceptTaskNames: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
38
- approvalResponseOnly: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
39
37
  approvals: z.ZodMiniOptional<z.ZodMiniObject<{
40
38
  allToolsAllowed: z.ZodMiniBoolean<boolean>;
41
39
  approvalNonce: z.ZodMiniString<string>;
@@ -44,7 +44,6 @@ export class UserChatMessage {
44
44
  }
45
45
  export const createConversationPromptSchema = z.strictObject({
46
46
  acceptTaskNames: z.optional(z.array(z.string())),
47
- approvalResponseOnly: z.optional(z.boolean()),
48
47
  approvals: z.optional(z.object({
49
48
  allToolsAllowed: z.boolean(),
50
49
  approvalNonce: z.string(),
@@ -1 +1 @@
1
- {"version":3,"file":"UserChatMessage.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/UserChatMessage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,OAAO,eAAe;IACjB,SAAS,CAAyB;IAClC,OAAO,CAAS;IAChB,EAAE,CAAS;IACX,MAAM,CAAgE;IAE/E,YACE,EAAyB,EACzB,SAAuC,EACvC,OAAmC,EACnC,MAAkC;QAElC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IA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AAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;YAC5C,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YAC5C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;YACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;SACjB,CAAC,CACH;KACF,CAAC,CACH;IACD,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { nanoid } from \"nanoid/non-secure\";\nimport { Temporal } from \"temporal-polyfill\";\nimport * as z from \"zod/mini\";\n\nexport class UserChatMessage {\n readonly createdAt: Temporal.ZonedDateTime;\n readonly content: string;\n readonly id: string;\n readonly prompt?: Omit<z.infer<typeof createConversationPromptSchema>, \"text\">;\n\n constructor(\n id: UserChatMessage[\"id\"],\n createdAt: UserChatMessage[\"createdAt\"],\n content: UserChatMessage[\"content\"],\n prompt?: UserChatMessage[\"prompt\"],\n ) {\n this.id = id;\n this.createdAt = createdAt;\n this.content = content;\n this.prompt = prompt;\n }\n\n withPrompt(prompt: UserChatMessage[\"prompt\"]) {\n return new UserChatMessage(this.id, this.createdAt, this.content, prompt);\n }\n\n toJSON() {\n return {\n content: this.content,\n createdAt: this.createdAt.toString(),\n id: this.id,\n prompt: this.prompt,\n };\n }\n\n static new(content: UserChatMessage[\"content\"], prompt?: UserChatMessage[\"prompt\"]) {\n return new UserChatMessage(nanoid(), Temporal.Now.zonedDateTimeISO(), content, prompt);\n }\n}\n\nexport const createConversationPromptSchema = z.strictObject({\n acceptTaskNames: z.optional(z.array(z.string())),\n approvalResponseOnly: z.optional(z.boolean()),\n approvals: z.optional(\n z.object({\n allToolsAllowed: z.boolean(),\n approvalNonce: z.string(),\n toolDecisions: z.array(\n z.object({\n allowInConversation: z.optional(z.boolean()),\n approved: z.boolean(),\n arguments: z.record(z.string(), z.unknown()),\n catalogPath: z.optional(z.array(z.string())),\n executionId: z.string(),\n name: z.string(),\n }),\n ),\n }),\n ),\n context: z.optional(z.string()),\n skillIds: z.optional(z.array(z.string())),\n text: z.string(),\n});\n"]}
1
+ {"version":3,"file":"UserChatMessage.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/UserChatMessage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,OAAO,eAAe;IACjB,SAAS,CAAyB;IAClC,OAAO,CAAS;IAChB,EAAE,CAAS;IACX,MAAM,CAAgE;IAE/E,YACE,EAAyB,EACzB,SAAuC,EACvC,OAAmC,EACnC,MAAkC;QAElC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACv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,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YAC5C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;YACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;SACjB,CAAC,CACH;KACF,CAAC,CACH;IACD,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { nanoid } from \"nanoid/non-secure\";\nimport { Temporal } from \"temporal-polyfill\";\nimport * as z from \"zod/mini\";\n\nexport class UserChatMessage {\n readonly createdAt: Temporal.ZonedDateTime;\n readonly content: string;\n readonly id: string;\n readonly prompt?: Omit<z.infer<typeof createConversationPromptSchema>, \"text\">;\n\n constructor(\n id: UserChatMessage[\"id\"],\n createdAt: UserChatMessage[\"createdAt\"],\n content: UserChatMessage[\"content\"],\n prompt?: UserChatMessage[\"prompt\"],\n ) {\n this.id = id;\n this.createdAt = createdAt;\n this.content = content;\n this.prompt = prompt;\n }\n\n withPrompt(prompt: UserChatMessage[\"prompt\"]) {\n return new UserChatMessage(this.id, this.createdAt, this.content, prompt);\n }\n\n toJSON() {\n return {\n content: this.content,\n createdAt: this.createdAt.toString(),\n id: this.id,\n prompt: this.prompt,\n };\n }\n\n static new(content: UserChatMessage[\"content\"], prompt?: UserChatMessage[\"prompt\"]) {\n return new UserChatMessage(nanoid(), Temporal.Now.zonedDateTimeISO(), content, prompt);\n }\n}\n\nexport const createConversationPromptSchema = z.strictObject({\n acceptTaskNames: z.optional(z.array(z.string())),\n approvals: z.optional(\n z.object({\n allToolsAllowed: z.boolean(),\n approvalNonce: z.string(),\n toolDecisions: z.array(\n z.object({\n allowInConversation: z.optional(z.boolean()),\n approved: z.boolean(),\n arguments: z.record(z.string(), z.unknown()),\n catalogPath: z.optional(z.array(z.string())),\n executionId: z.string(),\n name: z.string(),\n }),\n ),\n }),\n ),\n context: z.optional(z.string()),\n skillIds: z.optional(z.array(z.string())),\n text: z.string(),\n});\n"]}
@@ -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>;