@dremio/js-sdk 0.45.3 → 0.45.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -510,6 +510,63 @@ type ChatEventWithChunkType<T extends ChatEvent["content"]["chunkType"]> =
510
510
  Extract<ChatEvent, { content: { chunkType: T } }>;
511
511
  ```
512
512
 
513
+ #### UI Rendering and React Reconciliation
514
+
515
+ The conversation snapshot produced by the reducer (and automatically managed by the `AgentConversationMachine`) is designed specifically for modern declarative UIs like React, Vue, Svelte, or Ink.
516
+
517
+ **You do not need to manually track message IDs, buffer stream chunks, or manage parallel tool call states.**
518
+
519
+ The reducer performs highly optimized, **immutable updates** as new events arrive. Because the top-level references change only when the underlying data changes, you can directly map over the snapshot in your render function. It is safe to pass these objects into memoized components (e.g., `React.memo`) without writing complex deep-equality checks or manual diffing logic.
520
+
521
+ **React Example:**
522
+
523
+ ```typescript
524
+ import { createActor } from "xstate";
525
+ import { UserChatMessage } from "@dremio/js-sdk/enterprise/ai";
526
+
527
+ const actor = createActor(conversationMachine, {
528
+ input: { conversationId: null },
529
+ });
530
+
531
+ // Subscribe to state changes and update React state
532
+ actor.subscribe((snapshot) => {
533
+ setExchanges(snapshot.context.conversationSnapshot ?? []);
534
+ });
535
+
536
+ actor.start();
537
+
538
+ // In your render function - direct mapping, no manual diffing needed
539
+ return (
540
+ <div>
541
+ {exchanges.map((exchange) => (
542
+ <Exchange key={exchange.id} exchange={exchange} />
543
+ ))}
544
+ </div>
545
+ );
546
+ ```
547
+
548
+ **Why this works:**
549
+
550
+ - The reducer uses **structural sharing** via the `mutative` library, creating new object references only for changed data
551
+ - Unchanged exchanges and messages retain their original references, enabling efficient React reconciliation
552
+ - Maps preserve insertion order and provide O(1) lookups by ID
553
+ - Tool calls are automatically paired and their state is derived, eliminating manual tracking logic
554
+
555
+ **Vue/Svelte Example:**
556
+
557
+ ```typescript
558
+ // The same principle applies - just bind to the snapshot
559
+ actor.subscribe((snapshot) => {
560
+ conversationSnapshot = snapshot.context.conversationSnapshot ?? [];
561
+ });
562
+ ```
563
+
564
+ ```svelte
565
+ {#each conversationSnapshot as exchange (exchange.id)}
566
+ <Exchange {exchange} />
567
+ {/each}
568
+ ```
569
+
513
570
  #### Incremental Updates
514
571
 
515
572
  The reducer is a pure function with signature `(snapshot, events) => newSnapshot`. You can incrementally update a snapshot as new events arrive:
@@ -136,6 +136,17 @@ export declare class AIResource {
136
136
  chunkType: "endOfStream";
137
137
  };
138
138
  role: "agent";
139
+ } | {
140
+ conversationId: string;
141
+ modelName: string;
142
+ modelProviderId: string;
143
+ runId: string;
144
+ createdAt: import("temporal-polyfill").Temporal.Instant;
145
+ id: string;
146
+ content: {
147
+ chunkType: "interrupt";
148
+ };
149
+ role: "agent";
139
150
  } | {
140
151
  conversationId: string;
141
152
  modelName: string;
@@ -243,6 +254,17 @@ export declare class AIResource {
243
254
  chunkType: "endOfStream";
244
255
  };
245
256
  role: "agent";
257
+ } | {
258
+ conversationId: string;
259
+ modelName: string;
260
+ modelProviderId: string;
261
+ runId: string;
262
+ createdAt: import("temporal-polyfill").Temporal.Instant;
263
+ id: string;
264
+ content: {
265
+ chunkType: "interrupt";
266
+ };
267
+ role: "agent";
246
268
  } | {
247
269
  conversationId: string;
248
270
  modelName: string;
@@ -357,6 +379,17 @@ export declare class AIResource {
357
379
  chunkType: "endOfStream";
358
380
  };
359
381
  role: "agent";
382
+ } | {
383
+ conversationId: string;
384
+ modelName: string;
385
+ modelProviderId: string;
386
+ runId: string;
387
+ createdAt: import("temporal-polyfill").Temporal.Instant;
388
+ id: string;
389
+ content: {
390
+ chunkType: "interrupt";
391
+ };
392
+ role: "agent";
360
393
  } | {
361
394
  conversationId: string;
362
395
  modelName: string;
@@ -479,6 +512,17 @@ export declare class AIResource {
479
512
  chunkType: "endOfStream";
480
513
  };
481
514
  role: "agent";
515
+ } | {
516
+ conversationId: string;
517
+ modelName: string;
518
+ modelProviderId: string;
519
+ runId: string;
520
+ createdAt: import("temporal-polyfill").Temporal.Instant;
521
+ id: string;
522
+ content: {
523
+ chunkType: "interrupt";
524
+ };
525
+ role: "agent";
482
526
  } | {
483
527
  conversationId: string;
484
528
  modelName: string;
@@ -590,6 +634,17 @@ export declare class AIResource {
590
634
  chunkType: "endOfStream";
591
635
  };
592
636
  role: "agent";
637
+ } | {
638
+ conversationId: string;
639
+ modelName: string;
640
+ modelProviderId: string;
641
+ runId: string;
642
+ createdAt: import("temporal-polyfill").Temporal.Instant;
643
+ id: string;
644
+ content: {
645
+ chunkType: "interrupt";
646
+ };
647
+ role: "agent";
593
648
  } | {
594
649
  conversationId: string;
595
650
  modelName: string;
@@ -716,6 +771,17 @@ export declare class AIResource {
716
771
  chunkType: "endOfStream";
717
772
  };
718
773
  role: "agent";
774
+ } | {
775
+ conversationId: string;
776
+ modelName: string;
777
+ modelProviderId: string;
778
+ runId: string;
779
+ createdAt: import("temporal-polyfill").Temporal.Instant;
780
+ id: string;
781
+ content: {
782
+ chunkType: "interrupt";
783
+ };
784
+ role: "agent";
719
785
  } | {
720
786
  conversationId: string;
721
787
  modelName: string;
@@ -78,6 +78,17 @@ export declare class AIResource {
78
78
  chunkType: "endOfStream";
79
79
  };
80
80
  role: "agent";
81
+ } | {
82
+ conversationId: string;
83
+ modelName: string;
84
+ modelProviderId: string;
85
+ runId: string;
86
+ createdAt: import("temporal-polyfill").Temporal.Instant;
87
+ id: string;
88
+ content: {
89
+ chunkType: "interrupt";
90
+ };
91
+ role: "agent";
81
92
  } | {
82
93
  conversationId: string;
83
94
  modelName: string;
@@ -185,6 +196,17 @@ export declare class AIResource {
185
196
  chunkType: "endOfStream";
186
197
  };
187
198
  role: "agent";
199
+ } | {
200
+ conversationId: string;
201
+ modelName: string;
202
+ modelProviderId: string;
203
+ runId: string;
204
+ createdAt: import("temporal-polyfill").Temporal.Instant;
205
+ id: string;
206
+ content: {
207
+ chunkType: "interrupt";
208
+ };
209
+ role: "agent";
188
210
  } | {
189
211
  conversationId: string;
190
212
  modelName: string;
@@ -299,6 +321,17 @@ export declare class AIResource {
299
321
  chunkType: "endOfStream";
300
322
  };
301
323
  role: "agent";
324
+ } | {
325
+ conversationId: string;
326
+ modelName: string;
327
+ modelProviderId: string;
328
+ runId: string;
329
+ createdAt: import("temporal-polyfill").Temporal.Instant;
330
+ id: string;
331
+ content: {
332
+ chunkType: "interrupt";
333
+ };
334
+ role: "agent";
302
335
  } | {
303
336
  conversationId: string;
304
337
  modelName: string;
@@ -421,6 +454,17 @@ export declare class AIResource {
421
454
  chunkType: "endOfStream";
422
455
  };
423
456
  role: "agent";
457
+ } | {
458
+ conversationId: string;
459
+ modelName: string;
460
+ modelProviderId: string;
461
+ runId: string;
462
+ createdAt: import("temporal-polyfill").Temporal.Instant;
463
+ id: string;
464
+ content: {
465
+ chunkType: "interrupt";
466
+ };
467
+ role: "agent";
424
468
  } | {
425
469
  conversationId: string;
426
470
  modelName: string;
@@ -532,6 +576,17 @@ export declare class AIResource {
532
576
  chunkType: "endOfStream";
533
577
  };
534
578
  role: "agent";
579
+ } | {
580
+ conversationId: string;
581
+ modelName: string;
582
+ modelProviderId: string;
583
+ runId: string;
584
+ createdAt: import("temporal-polyfill").Temporal.Instant;
585
+ id: string;
586
+ content: {
587
+ chunkType: "interrupt";
588
+ };
589
+ role: "agent";
535
590
  } | {
536
591
  conversationId: string;
537
592
  modelName: string;
@@ -658,6 +713,17 @@ export declare class AIResource {
658
713
  chunkType: "endOfStream";
659
714
  };
660
715
  role: "agent";
716
+ } | {
717
+ conversationId: string;
718
+ modelName: string;
719
+ modelProviderId: string;
720
+ runId: string;
721
+ createdAt: import("temporal-polyfill").Temporal.Instant;
722
+ id: string;
723
+ content: {
724
+ chunkType: "interrupt";
725
+ };
726
+ role: "agent";
661
727
  } | {
662
728
  conversationId: string;
663
729
  modelName: string;
@@ -65,6 +65,14 @@ export declare const chatEventCodec: z.ZodMiniCodec<z.ZodMiniDiscriminatedUnion<
65
65
  modelName: z.ZodMiniString<string>;
66
66
  modelProviderId: z.ZodMiniString<string>;
67
67
  runId: z.ZodMiniString<string>;
68
+ }, z.core.$strip>, z.ZodMiniObject<{
69
+ chunkType: z.ZodMiniLiteral<"interrupt">;
70
+ conversationId: z.ZodMiniString<string>;
71
+ createdAt: z.ZodMiniString<string>;
72
+ messageId: z.ZodMiniString<string>;
73
+ modelName: z.ZodMiniString<string>;
74
+ modelProviderId: z.ZodMiniString<string>;
75
+ runId: z.ZodMiniString<string>;
68
76
  }, z.core.$strip>, z.ZodMiniObject<{
69
77
  chunkType: z.ZodMiniLiteral<"conversationUpdate">;
70
78
  summary: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -159,6 +167,17 @@ export declare const chatEventCodec: z.ZodMiniCodec<z.ZodMiniDiscriminatedUnion<
159
167
  chunkType: z.ZodMiniLiteral<"endOfStream">;
160
168
  }, z.core.$strip>;
161
169
  role: z.ZodMiniLiteral<"agent">;
170
+ }, z.core.$strict>, z.ZodMiniObject<{
171
+ conversationId: z.ZodMiniString<string>;
172
+ modelName: z.ZodMiniString<string>;
173
+ modelProviderId: z.ZodMiniString<string>;
174
+ runId: z.ZodMiniString<string>;
175
+ createdAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
176
+ id: z.ZodMiniString<string>;
177
+ content: z.ZodMiniObject<{
178
+ chunkType: z.ZodMiniLiteral<"interrupt">;
179
+ }, z.core.$strip>;
180
+ role: z.ZodMiniLiteral<"agent">;
162
181
  }, z.core.$strict>, z.ZodMiniObject<{
163
182
  conversationId: z.ZodMiniString<string>;
164
183
  modelName: z.ZodMiniString<string>;
@@ -52,6 +52,9 @@ const conversationUpdateChunkSchema = z.object({
52
52
  const endOfStreamChunkSchema = z.object({
53
53
  chunkType: z.literal("endOfStream"),
54
54
  });
55
+ const interruptChunkSchema = z.object({
56
+ chunkType: z.literal("interrupt"),
57
+ });
55
58
  const modelChunkSchema = z.object({
56
59
  chunkType: z.literal("model"),
57
60
  name: z.string().check(z.trim(), z.minLength(1)),
@@ -100,6 +103,7 @@ export const chatEventV1Schema = z.discriminatedUnion("chunkType", [
100
103
  const chatEventInputSchema = z.discriminatedUnion("chunkType", [
101
104
  errorChunkSchema,
102
105
  z.extend(endOfStreamChunkSchema, chatEventSharedSchema),
106
+ z.extend(interruptChunkSchema, chatEventSharedSchema),
103
107
  z.extend(conversationUpdateChunkSchema, chatEventSharedSchema),
104
108
  z.extend(modelChunkSchema, chatEventSharedSchema),
105
109
  z.extend(toolRequestChunkSchema, chatEventSharedSchema),
@@ -120,6 +124,10 @@ const chatEventOutputSchema = z.union([
120
124
  content: endOfStreamChunkSchema,
121
125
  role: z.literal("agent"),
122
126
  }),
127
+ z.extend(chatEventOutputSharedSchema, {
128
+ content: interruptChunkSchema,
129
+ role: z.literal("agent"),
130
+ }),
123
131
  z.extend(chatEventOutputSharedSchema, { content: modelChunkSchema, role: z.literal("agent") }),
124
132
  z.extend(chatEventOutputSharedSchema, {
125
133
  content: toolRequestChunkSchema,
@@ -178,6 +186,14 @@ export const chatEventCodec = z.codec(chatEventInputSchema, chatEventOutputSchem
178
186
  },
179
187
  role: "agent",
180
188
  };
189
+ case "interrupt":
190
+ return {
191
+ ...sharedProperties,
192
+ content: {
193
+ chunkType: "interrupt",
194
+ },
195
+ role: "agent",
196
+ };
181
197
  case "model":
182
198
  return {
183
199
  ...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,SAA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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 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 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 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 errorChunkSchema,\n z.extend(endOfStreamChunkSchema, chatEventSharedSchema),\n z.extend(conversationUpdateChunkSchema, 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: errorChunkSchema, role: z.literal(\"agent\") }),\n z.extend(chatEventOutputSharedSchema, {\n content: endOfStreamChunkSchema,\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 if (v.chunkType === \"error\") {\n return {\n content: {\n chunkType: \"error\",\n message: v.message,\n },\n conversationId: \"\",\n createdAt: Temporal.Now.instant(),\n id: \"\",\n modelName: \"\",\n modelProviderId: \"\",\n role: \"agent\",\n runId: \"\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n }\n\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 \"endOfStream\":\n return {\n ...sharedProperties,\n content: {\n chunkType: \"endOfStream\",\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 //@ts-ignore\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,GAA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AO,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,YAAY;YACZ,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 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 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 errorChunkSchema,\n z.extend(endOfStreamChunkSchema, chatEventSharedSchema),\n z.extend(interruptChunkSchema, chatEventSharedSchema),\n z.extend(conversationUpdateChunkSchema, 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: errorChunkSchema, 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, { 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 if (v.chunkType === \"error\") {\n return {\n content: {\n chunkType: \"error\",\n message: v.message,\n },\n conversationId: \"\",\n createdAt: Temporal.Now.instant(),\n id: \"\",\n modelName: \"\",\n modelProviderId: \"\",\n role: \"agent\",\n runId: \"\",\n } as const satisfies z.output<typeof chatEventOutputSchema>;\n }\n\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 \"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 \"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 //@ts-ignore\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"]}
@@ -69,6 +69,17 @@ export declare class AgentConversation implements AgentConversationProperties {
69
69
  chunkType: "endOfStream";
70
70
  };
71
71
  role: "agent";
72
+ } | {
73
+ conversationId: string;
74
+ modelName: string;
75
+ modelProviderId: string;
76
+ runId: string;
77
+ createdAt: import("temporal-polyfill").Temporal.Instant;
78
+ id: string;
79
+ content: {
80
+ chunkType: "interrupt";
81
+ };
82
+ role: "agent";
72
83
  } | {
73
84
  conversationId: string;
74
85
  modelName: string;
@@ -162,6 +173,17 @@ export declare class AgentConversation implements AgentConversationProperties {
162
173
  chunkType: "endOfStream";
163
174
  };
164
175
  role: "agent";
176
+ } | {
177
+ conversationId: string;
178
+ modelName: string;
179
+ modelProviderId: string;
180
+ runId: string;
181
+ createdAt: import("temporal-polyfill").Temporal.Instant;
182
+ id: string;
183
+ content: {
184
+ chunkType: "interrupt";
185
+ };
186
+ role: "agent";
165
187
  } | {
166
188
  conversationId: string;
167
189
  modelName: string;
@@ -96,6 +96,17 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
96
96
  chunkType: "endOfStream";
97
97
  };
98
98
  role: "agent";
99
+ } | {
100
+ conversationId: string;
101
+ modelName: string;
102
+ modelProviderId: string;
103
+ runId: string;
104
+ createdAt: import("temporal-polyfill").Temporal.Instant;
105
+ id: string;
106
+ content: {
107
+ chunkType: "interrupt";
108
+ };
109
+ role: "agent";
99
110
  } | {
100
111
  conversationId: string;
101
112
  modelName: string;
@@ -203,6 +214,17 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
203
214
  chunkType: "endOfStream";
204
215
  };
205
216
  role: "agent";
217
+ } | {
218
+ conversationId: string;
219
+ modelName: string;
220
+ modelProviderId: string;
221
+ runId: string;
222
+ createdAt: import("temporal-polyfill").Temporal.Instant;
223
+ id: string;
224
+ content: {
225
+ chunkType: "interrupt";
226
+ };
227
+ role: "agent";
206
228
  } | {
207
229
  conversationId: string;
208
230
  modelName: string;
@@ -317,6 +339,17 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
317
339
  chunkType: "endOfStream";
318
340
  };
319
341
  role: "agent";
342
+ } | {
343
+ conversationId: string;
344
+ modelName: string;
345
+ modelProviderId: string;
346
+ runId: string;
347
+ createdAt: import("temporal-polyfill").Temporal.Instant;
348
+ id: string;
349
+ content: {
350
+ chunkType: "interrupt";
351
+ };
352
+ role: "agent";
320
353
  } | {
321
354
  conversationId: string;
322
355
  modelName: string;
@@ -439,6 +472,17 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
439
472
  chunkType: "endOfStream";
440
473
  };
441
474
  role: "agent";
475
+ } | {
476
+ conversationId: string;
477
+ modelName: string;
478
+ modelProviderId: string;
479
+ runId: string;
480
+ createdAt: import("temporal-polyfill").Temporal.Instant;
481
+ id: string;
482
+ content: {
483
+ chunkType: "interrupt";
484
+ };
485
+ role: "agent";
442
486
  } | {
443
487
  conversationId: string;
444
488
  modelName: string;
@@ -550,6 +594,17 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
550
594
  chunkType: "endOfStream";
551
595
  };
552
596
  role: "agent";
597
+ } | {
598
+ conversationId: string;
599
+ modelName: string;
600
+ modelProviderId: string;
601
+ runId: string;
602
+ createdAt: import("temporal-polyfill").Temporal.Instant;
603
+ id: string;
604
+ content: {
605
+ chunkType: "interrupt";
606
+ };
607
+ role: "agent";
553
608
  } | {
554
609
  conversationId: string;
555
610
  modelName: string;
@@ -676,6 +731,17 @@ export declare const createConversationMachine: (config: SonarV4Config) => impor
676
731
  chunkType: "endOfStream";
677
732
  };
678
733
  role: "agent";
734
+ } | {
735
+ conversationId: string;
736
+ modelName: string;
737
+ modelProviderId: string;
738
+ runId: string;
739
+ createdAt: import("temporal-polyfill").Temporal.Instant;
740
+ id: string;
741
+ content: {
742
+ chunkType: "interrupt";
743
+ };
744
+ role: "agent";
679
745
  } | {
680
746
  conversationId: string;
681
747
  modelName: string;
@@ -37,6 +37,17 @@ export declare const retrieveConversationHistory: (config: SonarV4Config) => (id
37
37
  chunkType: "endOfStream";
38
38
  };
39
39
  role: "agent";
40
+ } | {
41
+ conversationId: string;
42
+ modelName: string;
43
+ modelProviderId: string;
44
+ runId: string;
45
+ createdAt: import("temporal-polyfill").Temporal.Instant;
46
+ id: string;
47
+ content: {
48
+ chunkType: "interrupt";
49
+ };
50
+ role: "agent";
40
51
  } | {
41
52
  conversationId: string;
42
53
  modelName: string;
@@ -23893,6 +23893,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23893
23893
  var endOfStreamChunkSchema = object({
23894
23894
  chunkType: literal("endOfStream")
23895
23895
  });
23896
+ var interruptChunkSchema = object({
23897
+ chunkType: literal("interrupt")
23898
+ });
23896
23899
  var modelChunkSchema = object({
23897
23900
  chunkType: literal("model"),
23898
23901
  name: string2().check(_trim(), _minLength(1)),
@@ -23932,6 +23935,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23932
23935
  var chatEventInputSchema = discriminatedUnion("chunkType", [
23933
23936
  errorChunkSchema,
23934
23937
  extend2(endOfStreamChunkSchema, chatEventSharedSchema),
23938
+ extend2(interruptChunkSchema, chatEventSharedSchema),
23935
23939
  extend2(conversationUpdateChunkSchema, chatEventSharedSchema),
23936
23940
  extend2(modelChunkSchema, chatEventSharedSchema),
23937
23941
  extend2(toolRequestChunkSchema, chatEventSharedSchema),
@@ -23952,6 +23956,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23952
23956
  content: endOfStreamChunkSchema,
23953
23957
  role: literal("agent")
23954
23958
  }),
23959
+ extend2(chatEventOutputSharedSchema, {
23960
+ content: interruptChunkSchema,
23961
+ role: literal("agent")
23962
+ }),
23955
23963
  extend2(chatEventOutputSharedSchema, { content: modelChunkSchema, role: literal("agent") }),
23956
23964
  extend2(chatEventOutputSharedSchema, {
23957
23965
  content: toolRequestChunkSchema,
@@ -24010,6 +24018,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
24010
24018
  },
24011
24019
  role: "agent"
24012
24020
  };
24021
+ case "interrupt":
24022
+ return {
24023
+ ...sharedProperties,
24024
+ content: {
24025
+ chunkType: "interrupt"
24026
+ },
24027
+ role: "agent"
24028
+ };
24013
24029
  case "model":
24014
24030
  return {
24015
24031
  ...sharedProperties,
@@ -24948,6 +24948,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
24948
24948
  var endOfStreamChunkSchema = object({
24949
24949
  chunkType: literal("endOfStream")
24950
24950
  });
24951
+ var interruptChunkSchema = object({
24952
+ chunkType: literal("interrupt")
24953
+ });
24951
24954
  var modelChunkSchema = object({
24952
24955
  chunkType: literal("model"),
24953
24956
  name: string2().check(_trim(), _minLength(1)),
@@ -24987,6 +24990,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
24987
24990
  var chatEventInputSchema = discriminatedUnion("chunkType", [
24988
24991
  errorChunkSchema,
24989
24992
  extend2(endOfStreamChunkSchema, chatEventSharedSchema),
24993
+ extend2(interruptChunkSchema, chatEventSharedSchema),
24990
24994
  extend2(conversationUpdateChunkSchema, chatEventSharedSchema),
24991
24995
  extend2(modelChunkSchema, chatEventSharedSchema),
24992
24996
  extend2(toolRequestChunkSchema, chatEventSharedSchema),
@@ -25007,6 +25011,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
25007
25011
  content: endOfStreamChunkSchema,
25008
25012
  role: literal("agent")
25009
25013
  }),
25014
+ extend2(chatEventOutputSharedSchema, {
25015
+ content: interruptChunkSchema,
25016
+ role: literal("agent")
25017
+ }),
25010
25018
  extend2(chatEventOutputSharedSchema, { content: modelChunkSchema, role: literal("agent") }),
25011
25019
  extend2(chatEventOutputSharedSchema, {
25012
25020
  content: toolRequestChunkSchema,
@@ -25065,6 +25073,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
25065
25073
  },
25066
25074
  role: "agent"
25067
25075
  };
25076
+ case "interrupt":
25077
+ return {
25078
+ ...sharedProperties,
25079
+ content: {
25080
+ chunkType: "interrupt"
25081
+ },
25082
+ role: "agent"
25083
+ };
25068
25084
  case "model":
25069
25085
  return {
25070
25086
  ...sharedProperties,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dremio/js-sdk",
3
- "version": "0.45.3",
3
+ "version": "0.45.5",
4
4
  "description": "JavaScript library for the Dremio API",
5
5
  "keywords": [
6
6
  "dremio",