@dremio/js-sdk 0.56.0 → 0.57.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/dist/cloud/ai/AIResource.d.ts +78 -0
- package/dist/enterprise/ai/AIResource.d.ts +78 -0
- package/dist/enterprise/ai/chat/chatEventSchema.d.ts +23 -0
- package/dist/enterprise/ai/chat/chatEventSchema.js +20 -0
- package/dist/enterprise/ai/chat/chatEventSchema.js.map +1 -1
- package/dist/enterprise/ai/conversations/AgentConversation.d.ts +26 -0
- package/dist/enterprise/ai/conversations/createConversationMachine.d.ts +78 -0
- package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.d.ts +13 -0
- package/dist/enterprise/ai/conversations/reduceChatEvents.d.ts +1 -1
- package/dist/enterprise/ai/conversations/reduceChatEvents.js +1 -0
- package/dist/enterprise/ai/conversations/reduceChatEvents.js.map +1 -1
- package/dist-iife/cloud.js +21 -0
- package/dist-iife/enterprise.js +21 -0
- package/package.json +1 -1
|
@@ -186,6 +186,19 @@ export declare class AIResource {
|
|
|
186
186
|
result: Record<string, unknown>;
|
|
187
187
|
};
|
|
188
188
|
role: "agent";
|
|
189
|
+
} | {
|
|
190
|
+
conversationId: string;
|
|
191
|
+
modelName: string;
|
|
192
|
+
modelProviderId: string;
|
|
193
|
+
runId: string;
|
|
194
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
195
|
+
id: string;
|
|
196
|
+
content: {
|
|
197
|
+
chunkType: "sandboxProgress";
|
|
198
|
+
stepName: string;
|
|
199
|
+
text: string;
|
|
200
|
+
};
|
|
201
|
+
role: "agent";
|
|
189
202
|
} | {
|
|
190
203
|
conversationId: string;
|
|
191
204
|
modelName: string;
|
|
@@ -320,6 +333,19 @@ export declare class AIResource {
|
|
|
320
333
|
result: Record<string, unknown>;
|
|
321
334
|
};
|
|
322
335
|
role: "agent";
|
|
336
|
+
} | {
|
|
337
|
+
conversationId: string;
|
|
338
|
+
modelName: string;
|
|
339
|
+
modelProviderId: string;
|
|
340
|
+
runId: string;
|
|
341
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
342
|
+
id: string;
|
|
343
|
+
content: {
|
|
344
|
+
chunkType: "sandboxProgress";
|
|
345
|
+
stepName: string;
|
|
346
|
+
text: string;
|
|
347
|
+
};
|
|
348
|
+
role: "agent";
|
|
323
349
|
} | {
|
|
324
350
|
conversationId: string;
|
|
325
351
|
modelName: string;
|
|
@@ -461,6 +487,19 @@ export declare class AIResource {
|
|
|
461
487
|
result: Record<string, unknown>;
|
|
462
488
|
};
|
|
463
489
|
role: "agent";
|
|
490
|
+
} | {
|
|
491
|
+
conversationId: string;
|
|
492
|
+
modelName: string;
|
|
493
|
+
modelProviderId: string;
|
|
494
|
+
runId: string;
|
|
495
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
496
|
+
id: string;
|
|
497
|
+
content: {
|
|
498
|
+
chunkType: "sandboxProgress";
|
|
499
|
+
stepName: string;
|
|
500
|
+
text: string;
|
|
501
|
+
};
|
|
502
|
+
role: "agent";
|
|
464
503
|
} | {
|
|
465
504
|
conversationId: string;
|
|
466
505
|
modelName: string;
|
|
@@ -619,6 +658,19 @@ export declare class AIResource {
|
|
|
619
658
|
result: Record<string, unknown>;
|
|
620
659
|
};
|
|
621
660
|
role: "agent";
|
|
661
|
+
} | {
|
|
662
|
+
conversationId: string;
|
|
663
|
+
modelName: string;
|
|
664
|
+
modelProviderId: string;
|
|
665
|
+
runId: string;
|
|
666
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
667
|
+
id: string;
|
|
668
|
+
content: {
|
|
669
|
+
chunkType: "sandboxProgress";
|
|
670
|
+
stepName: string;
|
|
671
|
+
text: string;
|
|
672
|
+
};
|
|
673
|
+
role: "agent";
|
|
622
674
|
} | {
|
|
623
675
|
conversationId: string;
|
|
624
676
|
modelName: string;
|
|
@@ -757,6 +809,19 @@ export declare class AIResource {
|
|
|
757
809
|
result: Record<string, unknown>;
|
|
758
810
|
};
|
|
759
811
|
role: "agent";
|
|
812
|
+
} | {
|
|
813
|
+
conversationId: string;
|
|
814
|
+
modelName: string;
|
|
815
|
+
modelProviderId: string;
|
|
816
|
+
runId: string;
|
|
817
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
818
|
+
id: string;
|
|
819
|
+
content: {
|
|
820
|
+
chunkType: "sandboxProgress";
|
|
821
|
+
stepName: string;
|
|
822
|
+
text: string;
|
|
823
|
+
};
|
|
824
|
+
role: "agent";
|
|
760
825
|
} | {
|
|
761
826
|
conversationId: string;
|
|
762
827
|
modelName: string;
|
|
@@ -910,6 +975,19 @@ export declare class AIResource {
|
|
|
910
975
|
result: Record<string, unknown>;
|
|
911
976
|
};
|
|
912
977
|
role: "agent";
|
|
978
|
+
} | {
|
|
979
|
+
conversationId: string;
|
|
980
|
+
modelName: string;
|
|
981
|
+
modelProviderId: string;
|
|
982
|
+
runId: string;
|
|
983
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
984
|
+
id: string;
|
|
985
|
+
content: {
|
|
986
|
+
chunkType: "sandboxProgress";
|
|
987
|
+
stepName: string;
|
|
988
|
+
text: string;
|
|
989
|
+
};
|
|
990
|
+
role: "agent";
|
|
913
991
|
} | {
|
|
914
992
|
conversationId: string;
|
|
915
993
|
modelName: string;
|
|
@@ -128,6 +128,19 @@ export declare class AIResource {
|
|
|
128
128
|
result: Record<string, unknown>;
|
|
129
129
|
};
|
|
130
130
|
role: "agent";
|
|
131
|
+
} | {
|
|
132
|
+
conversationId: string;
|
|
133
|
+
modelName: string;
|
|
134
|
+
modelProviderId: string;
|
|
135
|
+
runId: string;
|
|
136
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
137
|
+
id: string;
|
|
138
|
+
content: {
|
|
139
|
+
chunkType: "sandboxProgress";
|
|
140
|
+
stepName: string;
|
|
141
|
+
text: string;
|
|
142
|
+
};
|
|
143
|
+
role: "agent";
|
|
131
144
|
} | {
|
|
132
145
|
conversationId: string;
|
|
133
146
|
modelName: string;
|
|
@@ -262,6 +275,19 @@ export declare class AIResource {
|
|
|
262
275
|
result: Record<string, unknown>;
|
|
263
276
|
};
|
|
264
277
|
role: "agent";
|
|
278
|
+
} | {
|
|
279
|
+
conversationId: string;
|
|
280
|
+
modelName: string;
|
|
281
|
+
modelProviderId: string;
|
|
282
|
+
runId: string;
|
|
283
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
284
|
+
id: string;
|
|
285
|
+
content: {
|
|
286
|
+
chunkType: "sandboxProgress";
|
|
287
|
+
stepName: string;
|
|
288
|
+
text: string;
|
|
289
|
+
};
|
|
290
|
+
role: "agent";
|
|
265
291
|
} | {
|
|
266
292
|
conversationId: string;
|
|
267
293
|
modelName: string;
|
|
@@ -403,6 +429,19 @@ export declare class AIResource {
|
|
|
403
429
|
result: Record<string, unknown>;
|
|
404
430
|
};
|
|
405
431
|
role: "agent";
|
|
432
|
+
} | {
|
|
433
|
+
conversationId: string;
|
|
434
|
+
modelName: string;
|
|
435
|
+
modelProviderId: string;
|
|
436
|
+
runId: string;
|
|
437
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
438
|
+
id: string;
|
|
439
|
+
content: {
|
|
440
|
+
chunkType: "sandboxProgress";
|
|
441
|
+
stepName: string;
|
|
442
|
+
text: string;
|
|
443
|
+
};
|
|
444
|
+
role: "agent";
|
|
406
445
|
} | {
|
|
407
446
|
conversationId: string;
|
|
408
447
|
modelName: string;
|
|
@@ -561,6 +600,19 @@ export declare class AIResource {
|
|
|
561
600
|
result: Record<string, unknown>;
|
|
562
601
|
};
|
|
563
602
|
role: "agent";
|
|
603
|
+
} | {
|
|
604
|
+
conversationId: string;
|
|
605
|
+
modelName: string;
|
|
606
|
+
modelProviderId: string;
|
|
607
|
+
runId: string;
|
|
608
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
609
|
+
id: string;
|
|
610
|
+
content: {
|
|
611
|
+
chunkType: "sandboxProgress";
|
|
612
|
+
stepName: string;
|
|
613
|
+
text: string;
|
|
614
|
+
};
|
|
615
|
+
role: "agent";
|
|
564
616
|
} | {
|
|
565
617
|
conversationId: string;
|
|
566
618
|
modelName: string;
|
|
@@ -699,6 +751,19 @@ export declare class AIResource {
|
|
|
699
751
|
result: Record<string, unknown>;
|
|
700
752
|
};
|
|
701
753
|
role: "agent";
|
|
754
|
+
} | {
|
|
755
|
+
conversationId: string;
|
|
756
|
+
modelName: string;
|
|
757
|
+
modelProviderId: string;
|
|
758
|
+
runId: string;
|
|
759
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
760
|
+
id: string;
|
|
761
|
+
content: {
|
|
762
|
+
chunkType: "sandboxProgress";
|
|
763
|
+
stepName: string;
|
|
764
|
+
text: string;
|
|
765
|
+
};
|
|
766
|
+
role: "agent";
|
|
702
767
|
} | {
|
|
703
768
|
conversationId: string;
|
|
704
769
|
modelName: string;
|
|
@@ -852,6 +917,19 @@ export declare class AIResource {
|
|
|
852
917
|
result: Record<string, unknown>;
|
|
853
918
|
};
|
|
854
919
|
role: "agent";
|
|
920
|
+
} | {
|
|
921
|
+
conversationId: string;
|
|
922
|
+
modelName: string;
|
|
923
|
+
modelProviderId: string;
|
|
924
|
+
runId: string;
|
|
925
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
926
|
+
id: string;
|
|
927
|
+
content: {
|
|
928
|
+
chunkType: "sandboxProgress";
|
|
929
|
+
stepName: string;
|
|
930
|
+
text: string;
|
|
931
|
+
};
|
|
932
|
+
role: "agent";
|
|
855
933
|
} | {
|
|
856
934
|
conversationId: string;
|
|
857
935
|
modelName: string;
|
|
@@ -108,6 +108,16 @@ export declare const chatEventCodec: z.ZodMiniCodec<z.ZodMiniDiscriminatedUnion<
|
|
|
108
108
|
modelName: z.ZodMiniString<string>;
|
|
109
109
|
modelProviderId: z.ZodMiniString<string>;
|
|
110
110
|
runId: z.ZodMiniString<string>;
|
|
111
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
112
|
+
chunkType: z.ZodMiniLiteral<"sandboxProgress">;
|
|
113
|
+
stepName: z.ZodMiniString<string>;
|
|
114
|
+
text: z.ZodMiniString<string>;
|
|
115
|
+
conversationId: z.ZodMiniString<string>;
|
|
116
|
+
createdAt: z.ZodMiniString<string>;
|
|
117
|
+
messageId: z.ZodMiniString<string>;
|
|
118
|
+
modelName: z.ZodMiniString<string>;
|
|
119
|
+
modelProviderId: z.ZodMiniString<string>;
|
|
120
|
+
runId: z.ZodMiniString<string>;
|
|
111
121
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
112
122
|
arguments: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
|
|
113
123
|
callId: z.ZodMiniString<string>;
|
|
@@ -224,6 +234,19 @@ export declare const chatEventCodec: z.ZodMiniCodec<z.ZodMiniDiscriminatedUnion<
|
|
|
224
234
|
result: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
|
|
225
235
|
}, z.core.$strip>;
|
|
226
236
|
role: z.ZodMiniLiteral<"agent">;
|
|
237
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
238
|
+
conversationId: z.ZodMiniString<string>;
|
|
239
|
+
modelName: z.ZodMiniString<string>;
|
|
240
|
+
modelProviderId: z.ZodMiniString<string>;
|
|
241
|
+
runId: z.ZodMiniString<string>;
|
|
242
|
+
createdAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
|
|
243
|
+
id: z.ZodMiniString<string>;
|
|
244
|
+
content: z.ZodMiniObject<{
|
|
245
|
+
chunkType: z.ZodMiniLiteral<"sandboxProgress">;
|
|
246
|
+
stepName: z.ZodMiniString<string>;
|
|
247
|
+
text: z.ZodMiniString<string>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
role: z.ZodMiniLiteral<"agent">;
|
|
227
250
|
}, z.core.$strict>, z.ZodMiniObject<{
|
|
228
251
|
conversationId: z.ZodMiniString<string>;
|
|
229
252
|
modelName: z.ZodMiniString<string>;
|
|
@@ -71,6 +71,11 @@ const modelChunkSchema = z.object({
|
|
|
71
71
|
*/
|
|
72
72
|
result: z.record(z.string(), z.unknown()),
|
|
73
73
|
});
|
|
74
|
+
const sandboxProgressChunkSchema = z.object({
|
|
75
|
+
chunkType: z.literal("sandboxProgress"),
|
|
76
|
+
stepName: z.string(),
|
|
77
|
+
text: z.string(),
|
|
78
|
+
});
|
|
74
79
|
const toolRequestChunkSchema = z.object({
|
|
75
80
|
arguments: z.record(z.string(), z.unknown()),
|
|
76
81
|
callId: z.string().check(z.trim(), z.minLength(1)),
|
|
@@ -119,6 +124,7 @@ const chatEventInputSchema = z.discriminatedUnion("chunkType", [
|
|
|
119
124
|
z.extend(conversationUpdateChunkSchema, chatEventSharedSchema),
|
|
120
125
|
z.extend(jobUpdateChunkSchema, chatEventSharedSchema),
|
|
121
126
|
z.extend(modelChunkSchema, chatEventSharedSchema),
|
|
127
|
+
z.extend(sandboxProgressChunkSchema, chatEventSharedSchema),
|
|
122
128
|
z.extend(toolRequestChunkSchema, chatEventSharedSchema),
|
|
123
129
|
z.extend(toolResponseChunkSchema, chatEventSharedSchema),
|
|
124
130
|
z.extend(userMessageChunkSchema, chatEventSharedSchema),
|
|
@@ -146,6 +152,10 @@ const chatEventOutputSchema = z.union([
|
|
|
146
152
|
role: z.literal("agent"),
|
|
147
153
|
}),
|
|
148
154
|
z.extend(chatEventOutputSharedSchema, { content: modelChunkSchema, role: z.literal("agent") }),
|
|
155
|
+
z.extend(chatEventOutputSharedSchema, {
|
|
156
|
+
content: sandboxProgressChunkSchema,
|
|
157
|
+
role: z.literal("agent"),
|
|
158
|
+
}),
|
|
149
159
|
z.extend(chatEventOutputSharedSchema, {
|
|
150
160
|
content: toolRequestChunkSchema,
|
|
151
161
|
role: z.literal("agent"),
|
|
@@ -228,6 +238,16 @@ export const chatEventCodec = z.codec(chatEventInputSchema, chatEventOutputSchem
|
|
|
228
238
|
},
|
|
229
239
|
role: "agent",
|
|
230
240
|
};
|
|
241
|
+
case "sandboxProgress":
|
|
242
|
+
return {
|
|
243
|
+
...sharedProperties,
|
|
244
|
+
content: {
|
|
245
|
+
chunkType: "sandboxProgress",
|
|
246
|
+
stepName: v.stepName,
|
|
247
|
+
text: v.text,
|
|
248
|
+
},
|
|
249
|
+
role: "agent",
|
|
250
|
+
};
|
|
231
251
|
case "toolRequest":
|
|
232
252
|
return {
|
|
233
253
|
...sharedProperties,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatEventSchema.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/chatEventSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B;;;GAGG;AACH,MAAM,uBAAuB,GAAG;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACrD,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC3D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;CACtD,CAAC;AAEF;;GAEG;AACH,MAAM,qBAAqB,GAAG;IAC5B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,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E,CAAC,CAAC,SAAS;wBACtB,MAAM,EAAE,CAAC,CAAC,MAAM;wBAChB,SAAS,EAAE,aAAa;wBACxB,UAAU,EAAE,CAAC,CAAC,UAAU;wBACxB,IAAI,EAAE,CAAC,CAAC,IAAI;wBACZ,eAAe,EAAE,CAAC,CAAC,eAAe;qBACnC;oBACD,IAAI,EAAE,OAAO;iBAC4C,CAAC;YAC9D,KAAK,cAAc;gBACjB,OAAO;oBACL,GAAG,gBAAgB;oBACnB,OAAO,EAAE;wBACP,MAAM,EAAE,CAAC,CAAC,MAAM;wBAChB,SAAS,EAAE,cAAc;wBACzB,UAAU,EAAE,CAAC,CAAC,UAAU;wBACxB,IAAI,EAAE,CAAC,CAAC,IAAI;wBACZ,MAAM,EAAE,CAAC,CAAC,MAAM;qBACjB;oBACD,IAAI,EAAE,OAAO;iBAC4C,CAAC;YAC9D,KAAK,aAAa;gBAChB,OAAO;oBACL,GAAG,gBAAgB;oBACnB,OAAO,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;oBACnD,IAAI,EAAE,MAAM;iBAC6C,CAAC;QAChE,CAAC;IACH,CAAC;IACD,MAAM,CAAC,CAAC;QACN,OAAO;YACL,cAAc,EAAE,CAAC,CAAC,cAAc;YAChC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE;YACjC,SAAS,EAAE,CAAC,CAAC,EAAE;YACf,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,eAAe,EAAE,CAAC,CAAC,eAAe;YAClC,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,GAAG,CAAC,CAAC,OAAO;SAC2C,CAAC;IAC5D,CAAC;CACF,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 { Temporal } from \"temporal-polyfill\";\nimport * as z from \"zod/mini\";\n\n/**\n * Shared chat event fields for all responses (except error response)\n * @deprecated\n */\nconst chatEventV1SharedSchema = {\n createdAt: z.string().check(z.iso.datetime()),\n modelName: z.string().check(z.trim(), z.minLength(1)),\n modelProviderId: z.string().check(z.trim(), z.minLength(1)),\n sessionId: z.string().check(z.trim(), z.minLength(1)),\n};\n\n/**\n * Shared chat event fields for all responses (except error response)\n */\nconst chatEventSharedSchema = {\n conversationId: z.string(),\n createdAt: z.string().check(z.iso.datetime()),\n messageId: z.string(),\n modelName: z.string(),\n modelProviderId: z.string(),\n runId: z.string(),\n};\n\nconst errorChunkSchema = z.object({\n chunkType: z.literal(\"error\"),\n /**\n * If the message is not present or very short, it won't be useful to show\n * anyways, so the parser should throw to the generic response error handler.\n */\n message: z.string().check(z.trim(), z.minLength(2)),\n});\n\nconst errorChunkV2Schema = z.object({\n chunkType: z.literal(\"error\"),\n message: z.string().check(z.trim(), z.minLength(2)),\n type: z.string(),\n});\n\nconst conversationUpdateChunkSchema = z.object({\n chunkType: z.literal(\"conversationUpdate\"),\n summary: z.optional(z.string()),\n title: z.optional(z.string()),\n});\n\nconst endOfStreamChunkSchema = z.object({\n chunkType: z.literal(\"endOfStream\"),\n});\n\nconst interruptChunkSchema = z.object({\n chunkType: z.literal(\"interrupt\"),\n});\n\nconst modelChunkSchema = z.object({\n chunkType: z.literal(\"model\"),\n name: z.string().check(z.trim(), z.minLength(1)),\n /**\n * It's useful to indicate (to the type system) that the result contents\n * at this stage can only be data (de)serializable from JSON. Because\n * model responses can vary depending on runtime flags and edition, we can\n * leave this field generic and refine it more precisely in later stages.\n */\n result: z.record(z.string(), z.unknown()),\n});\n\nconst toolRequestChunkSchema = z.object({\n arguments: z.record(z.string(), z.unknown()),\n callId: z.string().check(z.trim(), z.minLength(1)),\n chunkType: z.literal(\"toolRequest\"),\n commentary: z.optional(z.string()),\n name: z.string(),\n summarizedTitle: z.optional(z.string()),\n});\n\nconst toolResponseChunkSchema = z.object({\n callId: z.string(),\n chunkType: z.literal(\"toolResponse\"),\n commentary: z.optional(z.string()),\n name: z.string(),\n result: z.record(z.string(), z.unknown()),\n});\n\nconst jobUpdateChunkSchema = z.object({\n chunkType: z.literal(\"jobUpdate\"),\n jobId: z.string(),\n jobState: z.string(),\n toolExecutionId: z.string(),\n toolName: z.string(),\n});\n\nconst userMessageChunkSchema = z.object({\n chunkType: z.literal(\"userMessage\"),\n text: z.string(),\n});\n\n/**\n * Captures all of the possible chunks of data that the Agent can reply\n * with. We're lenient to extra/unexpected fields being present (`z.object`\n * instead of `z.strictObject`), but for the fields that are expected,\n * we validate that they match the most general type category they belong in.\n * For example, it's good enough to validate that the `callId` is a string\n * for type safety -- we don't need to verify that it's also a `z.uuid()`.\n * @deprecated\n */\nexport const chatEventV1Schema = z.discriminatedUnion(\"chunkType\", [\n errorChunkSchema,\n z.extend(modelChunkSchema, chatEventV1SharedSchema),\n z.extend(toolRequestChunkSchema, chatEventV1SharedSchema),\n z.extend(toolResponseChunkSchema, chatEventV1SharedSchema),\n]);\n\n/**\n * @deprecated\n */\nexport type ChatEventV1 = z.infer<typeof chatEventV1Schema>;\n\nconst chatEventInputSchema = z.discriminatedUnion(\"chunkType\", [\n z.extend(errorChunkV2Schema, chatEventSharedSchema),\n z.extend(endOfStreamChunkSchema, chatEventSharedSchema),\n z.extend(interruptChunkSchema, chatEventSharedSchema),\n z.extend(conversationUpdateChunkSchema, chatEventSharedSchema),\n z.extend(jobUpdateChunkSchema, chatEventSharedSchema),\n z.extend(modelChunkSchema, chatEventSharedSchema),\n z.extend(toolRequestChunkSchema, chatEventSharedSchema),\n z.extend(toolResponseChunkSchema, chatEventSharedSchema),\n z.extend(userMessageChunkSchema, chatEventSharedSchema),\n]);\n\nconst chatEventOutputSharedSchema = z.extend(\n z.omit(z.strictObject(chatEventSharedSchema), { createdAt: true, messageId: true }),\n {\n createdAt: z.instanceof(Temporal.Instant),\n id: z.string(),\n },\n);\n\nconst chatEventOutputSchema = z.union([\n z.extend(chatEventOutputSharedSchema, {\n content: conversationUpdateChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, { content: errorChunkV2Schema, role: z.literal(\"agent\") }),\n z.extend(chatEventOutputSharedSchema, {\n content: endOfStreamChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, {\n content: interruptChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, {\n content: jobUpdateChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, { content: modelChunkSchema, role: z.literal(\"agent\") }),\n z.extend(chatEventOutputSharedSchema, {\n content: toolRequestChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, {\n content: toolResponseChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, {\n content: userMessageChunkSchema,\n role: z.literal(\"user\"),\n }),\n]);\n\nexport const chatEventCodec = z.codec(chatEventInputSchema, chatEventOutputSchema, {\n decode(v) {\n const sharedProperties = {\n conversationId: v.conversationId,\n createdAt: Temporal.Instant.from(v.createdAt),\n id: v.messageId,\n modelName: v.modelName,\n modelProviderId: v.modelProviderId,\n runId: v.runId,\n } as const satisfies Omit<z.output<typeof chatEventOutputSchema>, \"content\" | \"role\">;\n\n switch (v.chunkType) {\n case \"conversationUpdate\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"conversationUpdate\",\n summary: v.summary,\n title: v.title,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"error\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"error\",\n message: v.message,\n type: v.type,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"endOfStream\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"endOfStream\",\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"interrupt\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"interrupt\",\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"jobUpdate\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"jobUpdate\",\n jobId: v.jobId,\n jobState: v.jobState,\n toolExecutionId: v.toolExecutionId,\n toolName: v.toolName,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"model\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"model\",\n name: v.name,\n result: v.result,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"toolRequest\":\n return {\n ...sharedProperties,\n content: {\n arguments: v.arguments,\n callId: v.callId,\n chunkType: \"toolRequest\",\n commentary: v.commentary,\n name: v.name,\n summarizedTitle: v.summarizedTitle,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"toolResponse\":\n return {\n ...sharedProperties,\n content: {\n callId: v.callId,\n chunkType: \"toolResponse\",\n commentary: v.commentary,\n name: v.name,\n result: v.result,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"userMessage\":\n return {\n ...sharedProperties,\n content: { chunkType: \"userMessage\", text: v.text },\n role: \"user\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n }\n },\n encode(v) {\n return {\n conversationId: v.conversationId,\n createdAt: v.createdAt.toString(),\n messageId: v.id,\n modelName: v.modelName,\n modelProviderId: v.modelProviderId,\n runId: v.runId,\n ...v.content,\n } as const satisfies z.infer<typeof chatEventInputSchema>;\n },\n});\n\nexport type ChatEvent = z.output<typeof chatEventCodec>;\nexport type ChatEventWithChunkType<T extends z.input<typeof chatEventCodec>[\"chunkType\"]> = Extract<\n ChatEvent,\n { content: { chunkType: T } }\n>;\n"]}
|
|
1
|
+
{"version":3,"file":"chatEventSchema.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/chat/chatEventSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B;;;GAGG;AACH,MAAM,uBAAuB,GAAG;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACrD,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC3D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;CACtD,CAAC;AAEF;;GAEG;AACH,MAAM,qBAAqB,GAAG;IAC5B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC7C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC;AAEF,MAAM,gB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Q,EAAE;YACjC,SAAS,EAAE,CAAC,CAAC,EAAE;YACf,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,eAAe,EAAE,CAAC,CAAC,eAAe;YAClC,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,GAAG,CAAC,CAAC,OAAO;SAC2C,CAAC;IAC5D,CAAC;CACF,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 { Temporal } from \"temporal-polyfill\";\nimport * as z from \"zod/mini\";\n\n/**\n * Shared chat event fields for all responses (except error response)\n * @deprecated\n */\nconst chatEventV1SharedSchema = {\n createdAt: z.string().check(z.iso.datetime()),\n modelName: z.string().check(z.trim(), z.minLength(1)),\n modelProviderId: z.string().check(z.trim(), z.minLength(1)),\n sessionId: z.string().check(z.trim(), z.minLength(1)),\n};\n\n/**\n * Shared chat event fields for all responses (except error response)\n */\nconst chatEventSharedSchema = {\n conversationId: z.string(),\n createdAt: z.string().check(z.iso.datetime()),\n messageId: z.string(),\n modelName: z.string(),\n modelProviderId: z.string(),\n runId: z.string(),\n};\n\nconst errorChunkSchema = z.object({\n chunkType: z.literal(\"error\"),\n /**\n * If the message is not present or very short, it won't be useful to show\n * anyways, so the parser should throw to the generic response error handler.\n */\n message: z.string().check(z.trim(), z.minLength(2)),\n});\n\nconst errorChunkV2Schema = z.object({\n chunkType: z.literal(\"error\"),\n message: z.string().check(z.trim(), z.minLength(2)),\n type: z.string(),\n});\n\nconst conversationUpdateChunkSchema = z.object({\n chunkType: z.literal(\"conversationUpdate\"),\n summary: z.optional(z.string()),\n title: z.optional(z.string()),\n});\n\nconst endOfStreamChunkSchema = z.object({\n chunkType: z.literal(\"endOfStream\"),\n});\n\nconst interruptChunkSchema = z.object({\n chunkType: z.literal(\"interrupt\"),\n});\n\nconst modelChunkSchema = z.object({\n chunkType: z.literal(\"model\"),\n name: z.string().check(z.trim(), z.minLength(1)),\n /**\n * It's useful to indicate (to the type system) that the result contents\n * at this stage can only be data (de)serializable from JSON. Because\n * model responses can vary depending on runtime flags and edition, we can\n * leave this field generic and refine it more precisely in later stages.\n */\n result: z.record(z.string(), z.unknown()),\n});\n\nconst sandboxProgressChunkSchema = z.object({\n chunkType: z.literal(\"sandboxProgress\"),\n stepName: z.string(),\n text: z.string(),\n});\n\nconst toolRequestChunkSchema = z.object({\n arguments: z.record(z.string(), z.unknown()),\n callId: z.string().check(z.trim(), z.minLength(1)),\n chunkType: z.literal(\"toolRequest\"),\n commentary: z.optional(z.string()),\n name: z.string(),\n summarizedTitle: z.optional(z.string()),\n});\n\nconst toolResponseChunkSchema = z.object({\n callId: z.string(),\n chunkType: z.literal(\"toolResponse\"),\n commentary: z.optional(z.string()),\n name: z.string(),\n result: z.record(z.string(), z.unknown()),\n});\n\nconst jobUpdateChunkSchema = z.object({\n chunkType: z.literal(\"jobUpdate\"),\n jobId: z.string(),\n jobState: z.string(),\n toolExecutionId: z.string(),\n toolName: z.string(),\n});\n\nconst userMessageChunkSchema = z.object({\n chunkType: z.literal(\"userMessage\"),\n text: z.string(),\n});\n\n/**\n * Captures all of the possible chunks of data that the Agent can reply\n * with. We're lenient to extra/unexpected fields being present (`z.object`\n * instead of `z.strictObject`), but for the fields that are expected,\n * we validate that they match the most general type category they belong in.\n * For example, it's good enough to validate that the `callId` is a string\n * for type safety -- we don't need to verify that it's also a `z.uuid()`.\n * @deprecated\n */\nexport const chatEventV1Schema = z.discriminatedUnion(\"chunkType\", [\n errorChunkSchema,\n z.extend(modelChunkSchema, chatEventV1SharedSchema),\n z.extend(toolRequestChunkSchema, chatEventV1SharedSchema),\n z.extend(toolResponseChunkSchema, chatEventV1SharedSchema),\n]);\n\n/**\n * @deprecated\n */\nexport type ChatEventV1 = z.infer<typeof chatEventV1Schema>;\n\nconst chatEventInputSchema = z.discriminatedUnion(\"chunkType\", [\n z.extend(errorChunkV2Schema, chatEventSharedSchema),\n z.extend(endOfStreamChunkSchema, chatEventSharedSchema),\n z.extend(interruptChunkSchema, chatEventSharedSchema),\n z.extend(conversationUpdateChunkSchema, chatEventSharedSchema),\n z.extend(jobUpdateChunkSchema, chatEventSharedSchema),\n z.extend(modelChunkSchema, chatEventSharedSchema),\n z.extend(sandboxProgressChunkSchema, chatEventSharedSchema),\n z.extend(toolRequestChunkSchema, chatEventSharedSchema),\n z.extend(toolResponseChunkSchema, chatEventSharedSchema),\n z.extend(userMessageChunkSchema, chatEventSharedSchema),\n]);\n\nconst chatEventOutputSharedSchema = z.extend(\n z.omit(z.strictObject(chatEventSharedSchema), { createdAt: true, messageId: true }),\n {\n createdAt: z.instanceof(Temporal.Instant),\n id: z.string(),\n },\n);\n\nconst chatEventOutputSchema = z.union([\n z.extend(chatEventOutputSharedSchema, {\n content: conversationUpdateChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, { content: errorChunkV2Schema, role: z.literal(\"agent\") }),\n z.extend(chatEventOutputSharedSchema, {\n content: endOfStreamChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, {\n content: interruptChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, {\n content: jobUpdateChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, { content: modelChunkSchema, role: z.literal(\"agent\") }),\n z.extend(chatEventOutputSharedSchema, {\n content: sandboxProgressChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, {\n content: toolRequestChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, {\n content: toolResponseChunkSchema,\n role: z.literal(\"agent\"),\n }),\n z.extend(chatEventOutputSharedSchema, {\n content: userMessageChunkSchema,\n role: z.literal(\"user\"),\n }),\n]);\n\nexport const chatEventCodec = z.codec(chatEventInputSchema, chatEventOutputSchema, {\n decode(v) {\n const sharedProperties = {\n conversationId: v.conversationId,\n createdAt: Temporal.Instant.from(v.createdAt),\n id: v.messageId,\n modelName: v.modelName,\n modelProviderId: v.modelProviderId,\n runId: v.runId,\n } as const satisfies Omit<z.output<typeof chatEventOutputSchema>, \"content\" | \"role\">;\n\n switch (v.chunkType) {\n case \"conversationUpdate\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"conversationUpdate\",\n summary: v.summary,\n title: v.title,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"error\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"error\",\n message: v.message,\n type: v.type,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"endOfStream\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"endOfStream\",\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"interrupt\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"interrupt\",\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"jobUpdate\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"jobUpdate\",\n jobId: v.jobId,\n jobState: v.jobState,\n toolExecutionId: v.toolExecutionId,\n toolName: v.toolName,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"model\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"model\",\n name: v.name,\n result: v.result,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"sandboxProgress\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"sandboxProgress\",\n stepName: v.stepName,\n text: v.text,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"toolRequest\":\n return {\n ...sharedProperties,\n content: {\n arguments: v.arguments,\n callId: v.callId,\n chunkType: \"toolRequest\",\n commentary: v.commentary,\n name: v.name,\n summarizedTitle: v.summarizedTitle,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"toolResponse\":\n return {\n ...sharedProperties,\n content: {\n callId: v.callId,\n chunkType: \"toolResponse\",\n commentary: v.commentary,\n name: v.name,\n result: v.result,\n },\n role: \"agent\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n case \"userMessage\":\n return {\n ...sharedProperties,\n content: { chunkType: \"userMessage\", text: v.text },\n role: \"user\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n }\n },\n encode(v) {\n return {\n conversationId: v.conversationId,\n createdAt: v.createdAt.toString(),\n messageId: v.id,\n modelName: v.modelName,\n modelProviderId: v.modelProviderId,\n runId: v.runId,\n ...v.content,\n } as const satisfies z.infer<typeof chatEventInputSchema>;\n },\n});\n\nexport type ChatEvent = z.output<typeof chatEventCodec>;\nexport type ChatEventWithChunkType<T extends z.input<typeof chatEventCodec>[\"chunkType\"]> = Extract<\n ChatEvent,\n { content: { chunkType: T } }\n>;\n"]}
|
|
@@ -109,6 +109,19 @@ export declare class AgentConversation implements AgentConversationProperties {
|
|
|
109
109
|
result: Record<string, unknown>;
|
|
110
110
|
};
|
|
111
111
|
role: "agent";
|
|
112
|
+
} | {
|
|
113
|
+
conversationId: string;
|
|
114
|
+
modelName: string;
|
|
115
|
+
modelProviderId: string;
|
|
116
|
+
runId: string;
|
|
117
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
118
|
+
id: string;
|
|
119
|
+
content: {
|
|
120
|
+
chunkType: "sandboxProgress";
|
|
121
|
+
stepName: string;
|
|
122
|
+
text: string;
|
|
123
|
+
};
|
|
124
|
+
role: "agent";
|
|
112
125
|
} | {
|
|
113
126
|
conversationId: string;
|
|
114
127
|
modelName: string;
|
|
@@ -229,6 +242,19 @@ export declare class AgentConversation implements AgentConversationProperties {
|
|
|
229
242
|
result: Record<string, unknown>;
|
|
230
243
|
};
|
|
231
244
|
role: "agent";
|
|
245
|
+
} | {
|
|
246
|
+
conversationId: string;
|
|
247
|
+
modelName: string;
|
|
248
|
+
modelProviderId: string;
|
|
249
|
+
runId: string;
|
|
250
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
251
|
+
id: string;
|
|
252
|
+
content: {
|
|
253
|
+
chunkType: "sandboxProgress";
|
|
254
|
+
stepName: string;
|
|
255
|
+
text: string;
|
|
256
|
+
};
|
|
257
|
+
role: "agent";
|
|
232
258
|
} | {
|
|
233
259
|
conversationId: string;
|
|
234
260
|
modelName: string;
|
|
@@ -144,6 +144,19 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
|
|
|
144
144
|
result: Record<string, unknown>;
|
|
145
145
|
};
|
|
146
146
|
role: "agent";
|
|
147
|
+
} | {
|
|
148
|
+
conversationId: string;
|
|
149
|
+
modelName: string;
|
|
150
|
+
modelProviderId: string;
|
|
151
|
+
runId: string;
|
|
152
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
153
|
+
id: string;
|
|
154
|
+
content: {
|
|
155
|
+
chunkType: "sandboxProgress";
|
|
156
|
+
stepName: string;
|
|
157
|
+
text: string;
|
|
158
|
+
};
|
|
159
|
+
role: "agent";
|
|
147
160
|
} | {
|
|
148
161
|
conversationId: string;
|
|
149
162
|
modelName: string;
|
|
@@ -278,6 +291,19 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
|
|
|
278
291
|
result: Record<string, unknown>;
|
|
279
292
|
};
|
|
280
293
|
role: "agent";
|
|
294
|
+
} | {
|
|
295
|
+
conversationId: string;
|
|
296
|
+
modelName: string;
|
|
297
|
+
modelProviderId: string;
|
|
298
|
+
runId: string;
|
|
299
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
300
|
+
id: string;
|
|
301
|
+
content: {
|
|
302
|
+
chunkType: "sandboxProgress";
|
|
303
|
+
stepName: string;
|
|
304
|
+
text: string;
|
|
305
|
+
};
|
|
306
|
+
role: "agent";
|
|
281
307
|
} | {
|
|
282
308
|
conversationId: string;
|
|
283
309
|
modelName: string;
|
|
@@ -419,6 +445,19 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
|
|
|
419
445
|
result: Record<string, unknown>;
|
|
420
446
|
};
|
|
421
447
|
role: "agent";
|
|
448
|
+
} | {
|
|
449
|
+
conversationId: string;
|
|
450
|
+
modelName: string;
|
|
451
|
+
modelProviderId: string;
|
|
452
|
+
runId: string;
|
|
453
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
454
|
+
id: string;
|
|
455
|
+
content: {
|
|
456
|
+
chunkType: "sandboxProgress";
|
|
457
|
+
stepName: string;
|
|
458
|
+
text: string;
|
|
459
|
+
};
|
|
460
|
+
role: "agent";
|
|
422
461
|
} | {
|
|
423
462
|
conversationId: string;
|
|
424
463
|
modelName: string;
|
|
@@ -577,6 +616,19 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
|
|
|
577
616
|
result: Record<string, unknown>;
|
|
578
617
|
};
|
|
579
618
|
role: "agent";
|
|
619
|
+
} | {
|
|
620
|
+
conversationId: string;
|
|
621
|
+
modelName: string;
|
|
622
|
+
modelProviderId: string;
|
|
623
|
+
runId: string;
|
|
624
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
625
|
+
id: string;
|
|
626
|
+
content: {
|
|
627
|
+
chunkType: "sandboxProgress";
|
|
628
|
+
stepName: string;
|
|
629
|
+
text: string;
|
|
630
|
+
};
|
|
631
|
+
role: "agent";
|
|
580
632
|
} | {
|
|
581
633
|
conversationId: string;
|
|
582
634
|
modelName: string;
|
|
@@ -715,6 +767,19 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
|
|
|
715
767
|
result: Record<string, unknown>;
|
|
716
768
|
};
|
|
717
769
|
role: "agent";
|
|
770
|
+
} | {
|
|
771
|
+
conversationId: string;
|
|
772
|
+
modelName: string;
|
|
773
|
+
modelProviderId: string;
|
|
774
|
+
runId: string;
|
|
775
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
776
|
+
id: string;
|
|
777
|
+
content: {
|
|
778
|
+
chunkType: "sandboxProgress";
|
|
779
|
+
stepName: string;
|
|
780
|
+
text: string;
|
|
781
|
+
};
|
|
782
|
+
role: "agent";
|
|
718
783
|
} | {
|
|
719
784
|
conversationId: string;
|
|
720
785
|
modelName: string;
|
|
@@ -868,6 +933,19 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
|
|
|
868
933
|
result: Record<string, unknown>;
|
|
869
934
|
};
|
|
870
935
|
role: "agent";
|
|
936
|
+
} | {
|
|
937
|
+
conversationId: string;
|
|
938
|
+
modelName: string;
|
|
939
|
+
modelProviderId: string;
|
|
940
|
+
runId: string;
|
|
941
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
942
|
+
id: string;
|
|
943
|
+
content: {
|
|
944
|
+
chunkType: "sandboxProgress";
|
|
945
|
+
stepName: string;
|
|
946
|
+
text: string;
|
|
947
|
+
};
|
|
948
|
+
role: "agent";
|
|
871
949
|
} | {
|
|
872
950
|
conversationId: string;
|
|
873
951
|
modelName: string;
|
|
@@ -81,6 +81,19 @@ export declare const retrieveConversationHistory: (config: SonarV4Config) => (id
|
|
|
81
81
|
result: Record<string, unknown>;
|
|
82
82
|
};
|
|
83
83
|
role: "agent";
|
|
84
|
+
} | {
|
|
85
|
+
conversationId: string;
|
|
86
|
+
modelName: string;
|
|
87
|
+
modelProviderId: string;
|
|
88
|
+
runId: string;
|
|
89
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
90
|
+
id: string;
|
|
91
|
+
content: {
|
|
92
|
+
chunkType: "sandboxProgress";
|
|
93
|
+
stepName: string;
|
|
94
|
+
text: string;
|
|
95
|
+
};
|
|
96
|
+
role: "agent";
|
|
84
97
|
} | {
|
|
85
98
|
conversationId: string;
|
|
86
99
|
modelName: string;
|
|
@@ -6,7 +6,7 @@ export type AgentToolCall = {
|
|
|
6
6
|
request: ChatEventWithChunkType<"toolRequest"> | undefined;
|
|
7
7
|
result: ChatEventWithChunkType<"toolResponse"> | undefined;
|
|
8
8
|
};
|
|
9
|
-
export type ConversationExchangeMessage = ChatEventWithChunkType<"error"> | ChatEventWithChunkType<"model"> | ChatEventWithChunkType<"userMessage">;
|
|
9
|
+
export type ConversationExchangeMessage = ChatEventWithChunkType<"error"> | ChatEventWithChunkType<"model"> | ChatEventWithChunkType<"sandboxProgress"> | ChatEventWithChunkType<"userMessage">;
|
|
10
10
|
export type ConversationExchange = {
|
|
11
11
|
id: string;
|
|
12
12
|
messages: Map<string, ConversationExchangeMessage>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduceChatEvents.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/conversations/reduceChatEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"reduceChatEvents.js","sourceRoot":"","sources":["../../../../src/enterprise/ai/conversations/reduceChatEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AA0B9C,SAAS,4BAA4B,CACnC,KAAmC,EACnC,SAAoB;IAEpB,IAAI,oBAAoB,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC;IAEzF,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC1B,oBAAoB,GAAG;YACrB,EAAE,EAAE,SAAS,CAAC,KAAK;YACnB,QAAQ,EAAE,IAAI,GAAG,EAAE;YACnB,SAAS,EAAE,IAAI,GAAG,EAAE;SACrB,CAAC;QAC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MAAM,CAAE,CAAC;YAE7D,QAAQ,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;gBACpC,KAAK,aAAa;oBAChB,QAAQ,CAAC,OAAO,GAAG,SAAoE,CAAC;oBACxF,MAAM;gBACR,KAAK,cAAc;oBACjB,QAAQ,CAAC,MAAM,GAAG,SAAqE,CAAC;oBACxF,IAAI,cAAc,IAAI,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;wBACrD,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAC;oBAC3B,CAAC;yBAAM,CAAC;wBACN,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC;oBAC7B,CAAC;oBACD,MAAM;YACV,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAA+B,EAAE,EAAE,UAAuB;IACzF,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QAC7B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,4BAA4B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAChE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,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 { create, type Draft } from \"mutative\";\nimport type { ChatEvent, ChatEventWithChunkType } from \"../chat/chatEventSchema.ts\";\nimport type { UserChatMessage } from \"../chat/UserChatMessage.ts\";\n\nexport type AgentToolCall = {\n id: string;\n state: \"canceled\" | \"error\" | \"pending\" | \"success\";\n request: ChatEventWithChunkType<\"toolRequest\"> | undefined;\n result: ChatEventWithChunkType<\"toolResponse\"> | undefined;\n};\n\nexport type ConversationExchangeMessage =\n | ChatEventWithChunkType<\"error\">\n | ChatEventWithChunkType<\"model\">\n | ChatEventWithChunkType<\"sandboxProgress\">\n | ChatEventWithChunkType<\"userMessage\">;\n\nexport type ConversationExchange = {\n id: string;\n messages: Map<string, ConversationExchangeMessage>;\n submittedUserMessage?: UserChatMessage;\n toolCalls: Map<string, AgentToolCall>;\n};\n\nexport type ChatEventReducerState = ConversationExchange[];\n\nfunction applyChatEventToConversation(\n draft: Draft<ChatEventReducerState>,\n chatEvent: ChatEvent,\n): void {\n let conversationExchange = draft.findLast((exchange) => exchange.id === chatEvent.runId);\n\n if (!conversationExchange) {\n conversationExchange = {\n id: chatEvent.runId,\n messages: new Map(),\n toolCalls: new Map(),\n };\n draft.push(conversationExchange);\n conversationExchange = draft[draft.length - 1];\n }\n\n applyChatEventToConversationExchange(conversationExchange!, chatEvent);\n}\n\nfunction applyChatEventToConversationExchange(\n conversationExchange: Draft<ConversationExchange>,\n chatEvent: ChatEvent,\n): void {\n switch (chatEvent.content.chunkType) {\n case \"endOfStream\": {\n for (const [, toolCall] of conversationExchange.toolCalls) {\n if (!toolCall.result) {\n toolCall.state = \"canceled\";\n }\n }\n break;\n }\n case \"error\":\n case \"model\":\n case \"sandboxProgress\":\n case \"userMessage\": {\n conversationExchange.messages.set(\n chatEvent.id,\n chatEvent as Draft<ConversationExchangeMessage>,\n );\n break;\n }\n case \"toolRequest\":\n case \"toolResponse\": {\n const callId = chatEvent.content.callId;\n\n if (!conversationExchange.toolCalls.has(callId)) {\n conversationExchange.toolCalls.set(callId, {\n id: callId,\n request: undefined,\n result: undefined,\n state: \"pending\",\n });\n }\n\n const toolCall = conversationExchange.toolCalls.get(callId)!;\n\n switch (chatEvent.content.chunkType) {\n case \"toolRequest\":\n toolCall.request = chatEvent as unknown as Draft<ChatEventWithChunkType<\"toolRequest\">>;\n break;\n case \"toolResponse\":\n toolCall.result = chatEvent as unknown as Draft<ChatEventWithChunkType<\"toolResponse\">>;\n if (\"errorMessage\" in toolCall.result.content.result) {\n toolCall.state = \"error\";\n } else {\n toolCall.state = \"success\";\n }\n break;\n }\n }\n }\n}\n\nexport function reduceChatEvents(state: ChatEventReducerState = [], chatEvents: ChatEvent[]) {\n return create(state, (draft) => {\n for (const chatEvent of chatEvents) {\n applyChatEventToConversation(draft, Object.freeze(chatEvent));\n }\n });\n}\n"]}
|
package/dist-iife/cloud.js
CHANGED
|
@@ -17142,6 +17142,11 @@ var DremioCloud = (() => {
|
|
|
17142
17142
|
*/
|
|
17143
17143
|
result: record(string2(), unknown())
|
|
17144
17144
|
});
|
|
17145
|
+
var sandboxProgressChunkSchema = object({
|
|
17146
|
+
chunkType: literal("sandboxProgress"),
|
|
17147
|
+
stepName: string2(),
|
|
17148
|
+
text: string2()
|
|
17149
|
+
});
|
|
17145
17150
|
var toolRequestChunkSchema = object({
|
|
17146
17151
|
arguments: record(string2(), unknown()),
|
|
17147
17152
|
callId: string2().check(_trim(), _minLength(1)),
|
|
@@ -17181,6 +17186,7 @@ var DremioCloud = (() => {
|
|
|
17181
17186
|
extend2(conversationUpdateChunkSchema, chatEventSharedSchema),
|
|
17182
17187
|
extend2(jobUpdateChunkSchema, chatEventSharedSchema),
|
|
17183
17188
|
extend2(modelChunkSchema, chatEventSharedSchema),
|
|
17189
|
+
extend2(sandboxProgressChunkSchema, chatEventSharedSchema),
|
|
17184
17190
|
extend2(toolRequestChunkSchema, chatEventSharedSchema),
|
|
17185
17191
|
extend2(toolResponseChunkSchema, chatEventSharedSchema),
|
|
17186
17192
|
extend2(userMessageChunkSchema, chatEventSharedSchema)
|
|
@@ -17208,6 +17214,10 @@ var DremioCloud = (() => {
|
|
|
17208
17214
|
role: literal("agent")
|
|
17209
17215
|
}),
|
|
17210
17216
|
extend2(chatEventOutputSharedSchema, { content: modelChunkSchema, role: literal("agent") }),
|
|
17217
|
+
extend2(chatEventOutputSharedSchema, {
|
|
17218
|
+
content: sandboxProgressChunkSchema,
|
|
17219
|
+
role: literal("agent")
|
|
17220
|
+
}),
|
|
17211
17221
|
extend2(chatEventOutputSharedSchema, {
|
|
17212
17222
|
content: toolRequestChunkSchema,
|
|
17213
17223
|
role: literal("agent")
|
|
@@ -17290,6 +17300,16 @@ var DremioCloud = (() => {
|
|
|
17290
17300
|
},
|
|
17291
17301
|
role: "agent"
|
|
17292
17302
|
};
|
|
17303
|
+
case "sandboxProgress":
|
|
17304
|
+
return {
|
|
17305
|
+
...sharedProperties,
|
|
17306
|
+
content: {
|
|
17307
|
+
chunkType: "sandboxProgress",
|
|
17308
|
+
stepName: v2.stepName,
|
|
17309
|
+
text: v2.text
|
|
17310
|
+
},
|
|
17311
|
+
role: "agent"
|
|
17312
|
+
};
|
|
17293
17313
|
case "toolRequest":
|
|
17294
17314
|
return {
|
|
17295
17315
|
...sharedProperties,
|
|
@@ -19347,6 +19367,7 @@ var DremioCloud = (() => {
|
|
|
19347
19367
|
}
|
|
19348
19368
|
case "error":
|
|
19349
19369
|
case "model":
|
|
19370
|
+
case "sandboxProgress":
|
|
19350
19371
|
case "userMessage": {
|
|
19351
19372
|
conversationExchange.messages.set(chatEvent.id, chatEvent);
|
|
19352
19373
|
break;
|
package/dist-iife/enterprise.js
CHANGED
|
@@ -16067,6 +16067,11 @@ var DremioEnterprise = (() => {
|
|
|
16067
16067
|
*/
|
|
16068
16068
|
result: record(string2(), unknown())
|
|
16069
16069
|
});
|
|
16070
|
+
var sandboxProgressChunkSchema = object({
|
|
16071
|
+
chunkType: literal("sandboxProgress"),
|
|
16072
|
+
stepName: string2(),
|
|
16073
|
+
text: string2()
|
|
16074
|
+
});
|
|
16070
16075
|
var toolRequestChunkSchema = object({
|
|
16071
16076
|
arguments: record(string2(), unknown()),
|
|
16072
16077
|
callId: string2().check(_trim(), _minLength(1)),
|
|
@@ -16106,6 +16111,7 @@ var DremioEnterprise = (() => {
|
|
|
16106
16111
|
extend2(conversationUpdateChunkSchema, chatEventSharedSchema),
|
|
16107
16112
|
extend2(jobUpdateChunkSchema, chatEventSharedSchema),
|
|
16108
16113
|
extend2(modelChunkSchema, chatEventSharedSchema),
|
|
16114
|
+
extend2(sandboxProgressChunkSchema, chatEventSharedSchema),
|
|
16109
16115
|
extend2(toolRequestChunkSchema, chatEventSharedSchema),
|
|
16110
16116
|
extend2(toolResponseChunkSchema, chatEventSharedSchema),
|
|
16111
16117
|
extend2(userMessageChunkSchema, chatEventSharedSchema)
|
|
@@ -16133,6 +16139,10 @@ var DremioEnterprise = (() => {
|
|
|
16133
16139
|
role: literal("agent")
|
|
16134
16140
|
}),
|
|
16135
16141
|
extend2(chatEventOutputSharedSchema, { content: modelChunkSchema, role: literal("agent") }),
|
|
16142
|
+
extend2(chatEventOutputSharedSchema, {
|
|
16143
|
+
content: sandboxProgressChunkSchema,
|
|
16144
|
+
role: literal("agent")
|
|
16145
|
+
}),
|
|
16136
16146
|
extend2(chatEventOutputSharedSchema, {
|
|
16137
16147
|
content: toolRequestChunkSchema,
|
|
16138
16148
|
role: literal("agent")
|
|
@@ -16215,6 +16225,16 @@ var DremioEnterprise = (() => {
|
|
|
16215
16225
|
},
|
|
16216
16226
|
role: "agent"
|
|
16217
16227
|
};
|
|
16228
|
+
case "sandboxProgress":
|
|
16229
|
+
return {
|
|
16230
|
+
...sharedProperties,
|
|
16231
|
+
content: {
|
|
16232
|
+
chunkType: "sandboxProgress",
|
|
16233
|
+
stepName: v2.stepName,
|
|
16234
|
+
text: v2.text
|
|
16235
|
+
},
|
|
16236
|
+
role: "agent"
|
|
16237
|
+
};
|
|
16218
16238
|
case "toolRequest":
|
|
16219
16239
|
return {
|
|
16220
16240
|
...sharedProperties,
|
|
@@ -17923,6 +17943,7 @@ var DremioEnterprise = (() => {
|
|
|
17923
17943
|
}
|
|
17924
17944
|
case "error":
|
|
17925
17945
|
case "model":
|
|
17946
|
+
case "sandboxProgress":
|
|
17926
17947
|
case "userMessage": {
|
|
17927
17948
|
conversationExchange.messages.set(chatEvent.id, chatEvent);
|
|
17928
17949
|
break;
|