@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.
- package/README.md +9 -0
- package/dist/cloud/ai/AIResource.d.ts +93 -13
- package/dist/enterprise/ai/AIResource.d.ts +93 -13
- package/dist/enterprise/ai/chat/UserChatMessage.d.ts +0 -2
- package/dist/enterprise/ai/chat/UserChatMessage.js +0 -1
- package/dist/enterprise/ai/chat/UserChatMessage.js.map +1 -1
- package/dist/enterprise/ai/chat/chatEventSchema.d.ts +26 -3
- package/dist/enterprise/ai/chat/chatEventSchema.js +61 -11
- package/dist/enterprise/ai/chat/chatEventSchema.js.map +1 -1
- package/dist/enterprise/ai/conversations/AgentConversation.d.ts +30 -4
- package/dist/enterprise/ai/conversations/createConversationMachine.d.ts +97 -13
- package/dist/enterprise/ai/conversations/createConversationMachine.js +80 -11
- package/dist/enterprise/ai/conversations/createConversationMachine.js.map +1 -1
- package/dist/enterprise/ai/conversations/methods/createConversation.d.ts +0 -1
- package/dist/enterprise/ai/conversations/methods/createConversation.js +0 -2
- package/dist/enterprise/ai/conversations/methods/createConversation.js.map +1 -1
- package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.d.ts +15 -2
- package/dist/enterprise/ai/conversations/reduceChatEvents.d.ts +1 -1
- package/dist/enterprise/ai/conversations/reduceChatEvents.js +4 -1
- package/dist/enterprise/ai/conversations/reduceChatEvents.js.map +1 -1
- package/dist/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.d.ts +7 -0
- package/dist/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.js +3 -0
- package/dist/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.js.map +1 -1
- package/dist-iife/cloud.js +150 -32
- package/dist-iife/enterprise.js +150 -32
- package/package.json +1 -1
package/dist-iife/enterprise.js
CHANGED
|
@@ -4708,9 +4708,11 @@ var DremioEnterprise = (() => {
|
|
|
4708
4708
|
// dist/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.js
|
|
4709
4709
|
var EnterpriseDatasetCatalogObject = class extends DatasetCatalogObject {
|
|
4710
4710
|
owner;
|
|
4711
|
+
vizAttributes;
|
|
4711
4712
|
constructor(properties) {
|
|
4712
4713
|
super(properties);
|
|
4713
4714
|
this.owner = properties.owner;
|
|
4715
|
+
this.vizAttributes = properties.vizAttributes;
|
|
4714
4716
|
}
|
|
4715
4717
|
grants() {
|
|
4716
4718
|
return this.catalogReference.grants();
|
|
@@ -4728,7 +4730,8 @@ var DremioEnterprise = (() => {
|
|
|
4728
4730
|
owner: entity.owner ? {
|
|
4729
4731
|
id: entity.owner.ownerId,
|
|
4730
4732
|
type: entity.owner.ownerType
|
|
4731
|
-
} : void 0
|
|
4733
|
+
} : void 0,
|
|
4734
|
+
vizAttributes: entity.vizAttributes
|
|
4732
4735
|
};
|
|
4733
4736
|
};
|
|
4734
4737
|
|
|
@@ -16053,6 +16056,14 @@ var DremioEnterprise = (() => {
|
|
|
16053
16056
|
var endOfStreamChunkSchema = object({
|
|
16054
16057
|
chunkType: literal("endOfStream")
|
|
16055
16058
|
});
|
|
16059
|
+
var endOfStreamInputSchema = object({
|
|
16060
|
+
chunkType: literal("endOfStream"),
|
|
16061
|
+
conversationId: string2(),
|
|
16062
|
+
createdAt: string2().check(iso_exports.datetime()),
|
|
16063
|
+
modelName: string2(),
|
|
16064
|
+
modelProviderId: string2(),
|
|
16065
|
+
runId: string2()
|
|
16066
|
+
});
|
|
16056
16067
|
var interruptChunkSchema = object({
|
|
16057
16068
|
chunkType: literal("interrupt")
|
|
16058
16069
|
});
|
|
@@ -16072,6 +16083,14 @@ var DremioEnterprise = (() => {
|
|
|
16072
16083
|
stepName: string2(),
|
|
16073
16084
|
text: string2()
|
|
16074
16085
|
});
|
|
16086
|
+
var sandboxStdoutChunkSchema = object({
|
|
16087
|
+
callId: string2().check(_trim(), _minLength(1)),
|
|
16088
|
+
chunkType: literal("sandboxStdout"),
|
|
16089
|
+
isFinal: boolean2(),
|
|
16090
|
+
text: string2()
|
|
16091
|
+
});
|
|
16092
|
+
var sandboxStdoutContentSchema = sandboxStdoutChunkSchema;
|
|
16093
|
+
var sandboxStdoutChatEventSchema = extend2(sandboxStdoutChunkSchema, chatEventSharedSchema);
|
|
16075
16094
|
var toolPlanSchema = record(string2(), unknown());
|
|
16076
16095
|
var toolRequestChunkSchema = object({
|
|
16077
16096
|
arguments: record(string2(), unknown()),
|
|
@@ -16109,12 +16128,13 @@ var DremioEnterprise = (() => {
|
|
|
16109
16128
|
]);
|
|
16110
16129
|
var chatEventInputSchema = discriminatedUnion("chunkType", [
|
|
16111
16130
|
extend2(errorChunkV2Schema, chatEventSharedSchema),
|
|
16112
|
-
|
|
16131
|
+
endOfStreamInputSchema,
|
|
16113
16132
|
extend2(interruptChunkSchema, chatEventSharedSchema),
|
|
16114
16133
|
extend2(conversationUpdateChunkSchema, chatEventSharedSchema),
|
|
16115
16134
|
extend2(jobUpdateChunkSchema, chatEventSharedSchema),
|
|
16116
16135
|
extend2(modelChunkSchema, chatEventSharedSchema),
|
|
16117
16136
|
extend2(sandboxProgressChunkSchema, chatEventSharedSchema),
|
|
16137
|
+
sandboxStdoutChatEventSchema,
|
|
16118
16138
|
extend2(toolRequestChunkSchema, chatEventSharedSchema),
|
|
16119
16139
|
extend2(toolResponseChunkSchema, chatEventSharedSchema),
|
|
16120
16140
|
extend2(userMessageChunkSchema, chatEventSharedSchema)
|
|
@@ -16123,13 +16143,14 @@ var DremioEnterprise = (() => {
|
|
|
16123
16143
|
createdAt: _instanceof(Xn.Instant),
|
|
16124
16144
|
id: string2()
|
|
16125
16145
|
});
|
|
16146
|
+
var endOfStreamOutputSchema = omit2(chatEventOutputSharedSchema, { id: true });
|
|
16126
16147
|
var chatEventOutputSchema = union([
|
|
16127
16148
|
extend2(chatEventOutputSharedSchema, {
|
|
16128
16149
|
content: conversationUpdateChunkSchema,
|
|
16129
16150
|
role: literal("agent")
|
|
16130
16151
|
}),
|
|
16131
16152
|
extend2(chatEventOutputSharedSchema, { content: errorChunkV2Schema, role: literal("agent") }),
|
|
16132
|
-
extend2(
|
|
16153
|
+
extend2(endOfStreamOutputSchema, {
|
|
16133
16154
|
content: endOfStreamChunkSchema,
|
|
16134
16155
|
role: literal("agent")
|
|
16135
16156
|
}),
|
|
@@ -16146,6 +16167,10 @@ var DremioEnterprise = (() => {
|
|
|
16146
16167
|
content: sandboxProgressChunkSchema,
|
|
16147
16168
|
role: literal("agent")
|
|
16148
16169
|
}),
|
|
16170
|
+
extend2(chatEventOutputSharedSchema, {
|
|
16171
|
+
content: sandboxStdoutContentSchema,
|
|
16172
|
+
role: literal("agent")
|
|
16173
|
+
}),
|
|
16149
16174
|
extend2(chatEventOutputSharedSchema, {
|
|
16150
16175
|
content: toolRequestChunkSchema,
|
|
16151
16176
|
role: literal("agent")
|
|
@@ -16161,6 +16186,17 @@ var DremioEnterprise = (() => {
|
|
|
16161
16186
|
]);
|
|
16162
16187
|
var chatEventCodec = codec(chatEventInputSchema, chatEventOutputSchema, {
|
|
16163
16188
|
decode(v2) {
|
|
16189
|
+
if (v2.chunkType === "endOfStream") {
|
|
16190
|
+
return {
|
|
16191
|
+
content: { chunkType: "endOfStream" },
|
|
16192
|
+
conversationId: v2.conversationId,
|
|
16193
|
+
createdAt: Xn.Instant.from(v2.createdAt),
|
|
16194
|
+
modelName: v2.modelName,
|
|
16195
|
+
modelProviderId: v2.modelProviderId,
|
|
16196
|
+
role: "agent",
|
|
16197
|
+
runId: v2.runId
|
|
16198
|
+
};
|
|
16199
|
+
}
|
|
16164
16200
|
const sharedProperties = {
|
|
16165
16201
|
conversationId: v2.conversationId,
|
|
16166
16202
|
createdAt: Xn.Instant.from(v2.createdAt),
|
|
@@ -16190,14 +16226,6 @@ var DremioEnterprise = (() => {
|
|
|
16190
16226
|
},
|
|
16191
16227
|
role: "agent"
|
|
16192
16228
|
};
|
|
16193
|
-
case "endOfStream":
|
|
16194
|
-
return {
|
|
16195
|
-
...sharedProperties,
|
|
16196
|
-
content: {
|
|
16197
|
-
chunkType: "endOfStream"
|
|
16198
|
-
},
|
|
16199
|
-
role: "agent"
|
|
16200
|
-
};
|
|
16201
16229
|
case "interrupt":
|
|
16202
16230
|
return {
|
|
16203
16231
|
...sharedProperties,
|
|
@@ -16238,6 +16266,17 @@ var DremioEnterprise = (() => {
|
|
|
16238
16266
|
},
|
|
16239
16267
|
role: "agent"
|
|
16240
16268
|
};
|
|
16269
|
+
case "sandboxStdout":
|
|
16270
|
+
return {
|
|
16271
|
+
...sharedProperties,
|
|
16272
|
+
content: {
|
|
16273
|
+
callId: v2.callId,
|
|
16274
|
+
chunkType: "sandboxStdout",
|
|
16275
|
+
isFinal: v2.isFinal,
|
|
16276
|
+
text: v2.text
|
|
16277
|
+
},
|
|
16278
|
+
role: "agent"
|
|
16279
|
+
};
|
|
16241
16280
|
case "toolRequest":
|
|
16242
16281
|
return {
|
|
16243
16282
|
...sharedProperties,
|
|
@@ -16274,10 +16313,21 @@ var DremioEnterprise = (() => {
|
|
|
16274
16313
|
}
|
|
16275
16314
|
},
|
|
16276
16315
|
encode(v2) {
|
|
16316
|
+
if (v2.content.chunkType === "endOfStream") {
|
|
16317
|
+
return {
|
|
16318
|
+
chunkType: "endOfStream",
|
|
16319
|
+
conversationId: v2.conversationId,
|
|
16320
|
+
createdAt: v2.createdAt.toString(),
|
|
16321
|
+
modelName: v2.modelName,
|
|
16322
|
+
modelProviderId: v2.modelProviderId,
|
|
16323
|
+
runId: v2.runId
|
|
16324
|
+
};
|
|
16325
|
+
}
|
|
16326
|
+
const id = v2.id;
|
|
16277
16327
|
return {
|
|
16278
16328
|
conversationId: v2.conversationId,
|
|
16279
16329
|
createdAt: v2.createdAt.toString(),
|
|
16280
|
-
messageId:
|
|
16330
|
+
messageId: id,
|
|
16281
16331
|
modelName: v2.modelName,
|
|
16282
16332
|
modelProviderId: v2.modelProviderId,
|
|
16283
16333
|
runId: v2.runId,
|
|
@@ -16510,7 +16560,6 @@ var DremioEnterprise = (() => {
|
|
|
16510
16560
|
};
|
|
16511
16561
|
var createConversationPromptSchema = strictObject({
|
|
16512
16562
|
acceptTaskNames: optional(array(string2())),
|
|
16513
|
-
approvalResponseOnly: optional(boolean2()),
|
|
16514
16563
|
approvals: optional(object({
|
|
16515
16564
|
allToolsAllowed: boolean2(),
|
|
16516
16565
|
approvalNonce: string2(),
|
|
@@ -16556,7 +16605,6 @@ var DremioEnterprise = (() => {
|
|
|
16556
16605
|
modelProviderId: v2.modelProviderId,
|
|
16557
16606
|
prompt: {
|
|
16558
16607
|
acceptTaskNames: v2.message.prompt?.acceptTaskNames,
|
|
16559
|
-
approvalResponseOnly: v2.message.prompt?.approvalResponseOnly,
|
|
16560
16608
|
approvals: v2.message.prompt?.approvals,
|
|
16561
16609
|
context: v2.message.prompt?.context,
|
|
16562
16610
|
skillIds: v2.message.prompt?.skillIds,
|
|
@@ -16568,7 +16616,6 @@ var DremioEnterprise = (() => {
|
|
|
16568
16616
|
return {
|
|
16569
16617
|
message: UserChatMessage.new(v2.prompt.text, {
|
|
16570
16618
|
acceptTaskNames: v2.prompt?.acceptTaskNames,
|
|
16571
|
-
approvalResponseOnly: v2.prompt?.approvalResponseOnly,
|
|
16572
16619
|
approvals: v2.prompt?.approvals,
|
|
16573
16620
|
context: v2.prompt?.context,
|
|
16574
16621
|
skillIds: v2.prompt?.skillIds
|
|
@@ -17952,8 +17999,10 @@ var DremioEnterprise = (() => {
|
|
|
17952
17999
|
case "error":
|
|
17953
18000
|
case "model":
|
|
17954
18001
|
case "sandboxProgress":
|
|
18002
|
+
case "sandboxStdout":
|
|
17955
18003
|
case "userMessage": {
|
|
17956
|
-
|
|
18004
|
+
const event = chatEvent;
|
|
18005
|
+
conversationExchange.messages.set(event.id, event);
|
|
17957
18006
|
break;
|
|
17958
18007
|
}
|
|
17959
18008
|
case "toolRequest":
|
|
@@ -21452,6 +21501,14 @@ ${err.message}`);
|
|
|
21452
21501
|
}
|
|
21453
21502
|
|
|
21454
21503
|
// dist/enterprise/ai/conversations/createConversationMachine.js
|
|
21504
|
+
var RETRIEVE_STATE_TIMEOUT_MS = 1e4;
|
|
21505
|
+
var STREAM_RETRY_DELAY_MS = 2500;
|
|
21506
|
+
var MAX_STREAM_RETRIES = 5;
|
|
21507
|
+
var STREAM_STATE_RESET = {
|
|
21508
|
+
receivedEndOfStream: false,
|
|
21509
|
+
streamRetryCount: 0,
|
|
21510
|
+
userRequestedStop: false
|
|
21511
|
+
};
|
|
21455
21512
|
var createConversationMachine = (config3) => setup({
|
|
21456
21513
|
actors: {
|
|
21457
21514
|
createConversation: fromPromise2(({ input }) => createConversation(config3)(input).then((result) => {
|
|
@@ -21473,9 +21530,13 @@ ${err.message}`);
|
|
|
21473
21530
|
return result.value;
|
|
21474
21531
|
})),
|
|
21475
21532
|
retrieveState: fromPromise2(async ({ input, signal }) => {
|
|
21533
|
+
const timeoutSignal = AbortSignal.any([
|
|
21534
|
+
signal,
|
|
21535
|
+
AbortSignal.timeout(RETRIEVE_STATE_TIMEOUT_MS)
|
|
21536
|
+
]);
|
|
21476
21537
|
const [conversationResult, historyResult] = await Promise.all([
|
|
21477
|
-
retrieveConversation(config3)(input.conversationId, { signal }),
|
|
21478
|
-
retrieveConversationHistory(config3)(input.conversationId, { signal })
|
|
21538
|
+
retrieveConversation(config3)(input.conversationId, { signal: timeoutSignal }),
|
|
21539
|
+
retrieveConversationHistory(config3)(input.conversationId, { signal: timeoutSignal })
|
|
21479
21540
|
]);
|
|
21480
21541
|
if (conversationResult.isErr()) {
|
|
21481
21542
|
throw conversationResult.error;
|
|
@@ -21502,6 +21563,9 @@ ${err.message}`);
|
|
|
21502
21563
|
})),
|
|
21503
21564
|
streamRun: fromObservable(({ input }) => fromTextEventStream(({ signal }) => streamRunEvents(config3)({ conversationId: input.conversationId, runId: input.runId }, { signal })).pipe(map((event) => decode(chatEventCodec, JSON.parse(event.data)))))
|
|
21504
21565
|
},
|
|
21566
|
+
delays: {
|
|
21567
|
+
STREAM_RETRY_DELAY: STREAM_RETRY_DELAY_MS
|
|
21568
|
+
},
|
|
21505
21569
|
types: {
|
|
21506
21570
|
context: {},
|
|
21507
21571
|
emitted: {},
|
|
@@ -21513,7 +21577,8 @@ ${err.message}`);
|
|
|
21513
21577
|
conversationId: input.conversationId,
|
|
21514
21578
|
conversationSnapshot: void 0,
|
|
21515
21579
|
currentRunId: void 0,
|
|
21516
|
-
messageAttempt: void 0
|
|
21580
|
+
messageAttempt: void 0,
|
|
21581
|
+
...STREAM_STATE_RESET
|
|
21517
21582
|
}),
|
|
21518
21583
|
id: "agentConversation",
|
|
21519
21584
|
initial: "uninitialized",
|
|
@@ -21540,7 +21605,8 @@ ${err.message}`);
|
|
|
21540
21605
|
}
|
|
21541
21606
|
],
|
|
21542
21607
|
currentRunId: ({ event }) => event.output.currentRunId,
|
|
21543
|
-
messageAttempt: void 0
|
|
21608
|
+
messageAttempt: void 0,
|
|
21609
|
+
...STREAM_STATE_RESET
|
|
21544
21610
|
}),
|
|
21545
21611
|
emit(({ event }) => ({
|
|
21546
21612
|
id: event.output.id,
|
|
@@ -21603,7 +21669,8 @@ ${err.message}`);
|
|
|
21603
21669
|
{
|
|
21604
21670
|
actions: assign({
|
|
21605
21671
|
conversationSnapshot: ({ context: context2, event }) => AgentConversation.reduceChatEvents(context2.conversationSnapshot, event.output.history.data),
|
|
21606
|
-
currentRunId: ({ event }) => event.output.conversation.currentRunId
|
|
21672
|
+
currentRunId: ({ event }) => event.output.conversation.currentRunId,
|
|
21673
|
+
receivedEndOfStream: false
|
|
21607
21674
|
}),
|
|
21608
21675
|
guard: ({ event }) => !!event.output.conversation.currentRunId,
|
|
21609
21676
|
target: "streaming"
|
|
@@ -21611,7 +21678,8 @@ ${err.message}`);
|
|
|
21611
21678
|
{
|
|
21612
21679
|
actions: assign({
|
|
21613
21680
|
conversationSnapshot: ({ context: context2, event }) => AgentConversation.reduceChatEvents(context2.conversationSnapshot, event.output.history.data),
|
|
21614
|
-
currentRunId: ({ event }) => event.output.conversation.currentRunId
|
|
21681
|
+
currentRunId: ({ event }) => event.output.conversation.currentRunId,
|
|
21682
|
+
...STREAM_STATE_RESET
|
|
21615
21683
|
}),
|
|
21616
21684
|
target: "idle"
|
|
21617
21685
|
}
|
|
@@ -21620,10 +21688,16 @@ ${err.message}`);
|
|
|
21620
21688
|
{
|
|
21621
21689
|
guard: ({ event }) => {
|
|
21622
21690
|
const e2 = event.error;
|
|
21691
|
+
if (e2?.name === "TimeoutError")
|
|
21692
|
+
return false;
|
|
21623
21693
|
return e2?.name === "AbortError" || e2?.message?.includes("aborted") || e2?.code === "ABORT_ERR";
|
|
21624
21694
|
},
|
|
21625
21695
|
target: "uninitialized"
|
|
21626
21696
|
},
|
|
21697
|
+
{
|
|
21698
|
+
guard: ({ context: context2 }) => context2.streamRetryCount > 0,
|
|
21699
|
+
target: "stream_interrupted"
|
|
21700
|
+
},
|
|
21627
21701
|
{
|
|
21628
21702
|
actions: [
|
|
21629
21703
|
assign({
|
|
@@ -21640,6 +21714,30 @@ ${err.message}`);
|
|
|
21640
21714
|
src: "retrieveState"
|
|
21641
21715
|
}
|
|
21642
21716
|
},
|
|
21717
|
+
stream_interrupted: {
|
|
21718
|
+
after: {
|
|
21719
|
+
STREAM_RETRY_DELAY: [
|
|
21720
|
+
{
|
|
21721
|
+
actions: assign({
|
|
21722
|
+
streamRetryCount: ({ context: context2 }) => context2.streamRetryCount + 1
|
|
21723
|
+
}),
|
|
21724
|
+
guard: ({ context: context2 }) => context2.streamRetryCount < MAX_STREAM_RETRIES,
|
|
21725
|
+
target: "retrieving_history"
|
|
21726
|
+
},
|
|
21727
|
+
{
|
|
21728
|
+
target: "stream_recovery_failed"
|
|
21729
|
+
}
|
|
21730
|
+
]
|
|
21731
|
+
}
|
|
21732
|
+
},
|
|
21733
|
+
stream_recovery_failed: {
|
|
21734
|
+
on: {
|
|
21735
|
+
REFRESH_HISTORY: {
|
|
21736
|
+
actions: assign({ lastError: void 0, streamRetryCount: 0 }),
|
|
21737
|
+
target: "retrieving_history"
|
|
21738
|
+
}
|
|
21739
|
+
}
|
|
21740
|
+
},
|
|
21643
21741
|
streaming: {
|
|
21644
21742
|
description: "Manages monitoring and canceling the current run",
|
|
21645
21743
|
initial: "monitoring_replies",
|
|
@@ -21653,20 +21751,37 @@ ${err.message}`);
|
|
|
21653
21751
|
runId: context2.currentRunId
|
|
21654
21752
|
};
|
|
21655
21753
|
},
|
|
21656
|
-
onDone:
|
|
21657
|
-
|
|
21658
|
-
|
|
21659
|
-
|
|
21660
|
-
|
|
21661
|
-
|
|
21662
|
-
|
|
21663
|
-
|
|
21754
|
+
onDone: [
|
|
21755
|
+
{
|
|
21756
|
+
actions: assign({ currentRunId: null, userRequestedStop: false }),
|
|
21757
|
+
guard: ({ context: context2 }) => !!context2.receivedEndOfStream || !!context2.userRequestedStop,
|
|
21758
|
+
target: "idle"
|
|
21759
|
+
},
|
|
21760
|
+
{
|
|
21761
|
+
actions: assign({ currentRunId: null }),
|
|
21762
|
+
target: "stream_interrupted"
|
|
21763
|
+
}
|
|
21764
|
+
],
|
|
21765
|
+
onError: [
|
|
21766
|
+
{
|
|
21767
|
+
actions: assign({ currentRunId: null, userRequestedStop: false }),
|
|
21768
|
+
guard: ({ context: context2 }) => !!context2.receivedEndOfStream || !!context2.userRequestedStop,
|
|
21769
|
+
target: "idle"
|
|
21770
|
+
},
|
|
21771
|
+
{
|
|
21772
|
+
actions: assign({ currentRunId: null }),
|
|
21773
|
+
target: "stream_interrupted"
|
|
21774
|
+
}
|
|
21775
|
+
],
|
|
21664
21776
|
onSnapshot: {
|
|
21665
21777
|
actions: enqueueActions(({ context: context2, enqueue, event }) => {
|
|
21666
21778
|
const chatEvent = event.snapshot.context;
|
|
21667
21779
|
if (!chatEvent) {
|
|
21668
21780
|
return;
|
|
21669
21781
|
}
|
|
21782
|
+
if (chatEvent.content.chunkType === "endOfStream" && !context2.receivedEndOfStream) {
|
|
21783
|
+
enqueue.assign({ receivedEndOfStream: true });
|
|
21784
|
+
}
|
|
21670
21785
|
const nextSnapshot = AgentConversation.reduceChatEvents(context2.conversationSnapshot, [chatEvent]);
|
|
21671
21786
|
enqueue.assign({
|
|
21672
21787
|
conversationSnapshot: nextSnapshot
|
|
@@ -21684,6 +21799,7 @@ ${err.message}`);
|
|
|
21684
21799
|
description: "Attached to the run event stream",
|
|
21685
21800
|
on: {
|
|
21686
21801
|
STOP_RUN: {
|
|
21802
|
+
actions: assign({ userRequestedStop: true }),
|
|
21687
21803
|
target: "stopping"
|
|
21688
21804
|
}
|
|
21689
21805
|
}
|
|
@@ -21696,10 +21812,11 @@ ${err.message}`);
|
|
|
21696
21812
|
runId: context2.currentRunId
|
|
21697
21813
|
}),
|
|
21698
21814
|
onDone: {
|
|
21699
|
-
actions: assign({ currentRunId: void 0 }),
|
|
21815
|
+
actions: assign({ currentRunId: void 0, userRequestedStop: false }),
|
|
21700
21816
|
target: "#agentConversation.idle"
|
|
21701
21817
|
},
|
|
21702
21818
|
onError: {
|
|
21819
|
+
actions: assign({ userRequestedStop: false }),
|
|
21703
21820
|
target: "#agentConversation.retrieving_history"
|
|
21704
21821
|
},
|
|
21705
21822
|
src: "stopRun"
|
|
@@ -21741,7 +21858,8 @@ ${err.message}`);
|
|
|
21741
21858
|
}
|
|
21742
21859
|
],
|
|
21743
21860
|
currentRunId: ({ event }) => event.output.currentRunId,
|
|
21744
|
-
messageAttempt: void 0
|
|
21861
|
+
messageAttempt: void 0,
|
|
21862
|
+
...STREAM_STATE_RESET
|
|
21745
21863
|
}),
|
|
21746
21864
|
target: "streaming"
|
|
21747
21865
|
},
|