@copilotkit/runtime 1.5.0-tyler-reset-chat.0 → 1.5.1-custom-tag-pre.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/CHANGELOG.md +150 -3
- package/__snapshots__/schema/schema.graphql +8 -9
- package/dist/{chunk-K67A6XOJ.mjs → chunk-3ECBC2K2.mjs} +462 -328
- package/dist/chunk-3ECBC2K2.mjs.map +1 -0
- package/dist/{chunk-QNQ6UT3D.mjs → chunk-5E6LOP76.mjs} +2 -2
- package/dist/{chunk-OKQVDDJ2.mjs → chunk-CLGKEUOA.mjs} +298 -63
- package/dist/chunk-CLGKEUOA.mjs.map +1 -0
- package/dist/{chunk-ZBG4KJW5.mjs → chunk-MKDG5ZHT.mjs} +2 -2
- package/dist/{chunk-AGSBOD2T.mjs → chunk-MYZB2EKG.mjs} +2 -2
- package/dist/{chunk-B74M7FXG.mjs → chunk-RFF5IIZJ.mjs} +3 -2
- package/dist/chunk-RFF5IIZJ.mjs.map +1 -0
- package/dist/{copilot-runtime-12e7ac40.d.ts → copilot-runtime-6285d897.d.ts} +2 -2
- package/dist/graphql/types/converted/index.d.ts +1 -1
- package/dist/graphql/types/converted/index.js +2 -1
- package/dist/graphql/types/converted/index.js.map +1 -1
- package/dist/graphql/types/converted/index.mjs +1 -1
- package/dist/{groq-adapter-24abe931.d.ts → groq-adapter-15d41154.d.ts} +1 -1
- package/dist/{index-10b1c870.d.ts → index-ff3fbc33.d.ts} +7 -8
- package/dist/index.d.ts +5 -5
- package/dist/index.js +852 -480
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{langserve-f021ab9c.d.ts → langserve-48e976ac.d.ts} +54 -14
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +754 -459
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +6 -6
- package/dist/lib/integrations/index.d.ts +4 -4
- package/dist/lib/integrations/index.js +78 -30
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +6 -6
- package/dist/lib/integrations/nest/index.d.ts +3 -3
- package/dist/lib/integrations/nest/index.js +78 -30
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +4 -4
- package/dist/lib/integrations/node-express/index.d.ts +3 -3
- package/dist/lib/integrations/node-express/index.js +78 -30
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +4 -4
- package/dist/lib/integrations/node-http/index.d.ts +3 -3
- package/dist/lib/integrations/node-http/index.js +78 -30
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +3 -3
- package/dist/service-adapters/index.d.ts +36 -5
- package/dist/service-adapters/index.js +298 -61
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +5 -1
- package/package.json +4 -4
- package/src/agents/langgraph/event-source.ts +140 -148
- package/src/agents/langgraph/events.ts +1 -1
- package/src/graphql/inputs/forwarded-parameters.input.ts +3 -0
- package/src/graphql/inputs/message.input.ts +15 -3
- package/src/graphql/resolvers/copilot.resolver.ts +32 -6
- package/src/graphql/types/converted/index.ts +4 -3
- package/src/graphql/types/copilot-response.type.ts +12 -3
- package/src/graphql/types/enums.ts +0 -11
- package/src/lib/runtime/copilot-runtime.ts +1 -7
- package/src/lib/runtime/remote-action-constructors.ts +64 -58
- package/src/lib/runtime/remote-actions.ts +1 -0
- package/src/lib/runtime/remote-lg-action.ts +184 -154
- package/src/service-adapters/anthropic/anthropic-adapter.ts +17 -6
- package/src/service-adapters/conversion.ts +2 -1
- package/src/service-adapters/events.ts +118 -54
- package/src/service-adapters/experimental/empty/empty-adapter.ts +33 -0
- package/src/service-adapters/experimental/ollama/ollama-adapter.ts +7 -3
- package/src/service-adapters/groq/groq-adapter.ts +24 -8
- package/src/service-adapters/index.ts +7 -1
- package/src/service-adapters/langchain/utils.ts +55 -32
- package/src/service-adapters/openai/openai-adapter.ts +23 -9
- package/src/service-adapters/openai/openai-assistant-adapter.ts +22 -8
- package/src/service-adapters/unify/unify-adapter.ts +30 -11
- package/dist/chunk-B74M7FXG.mjs.map +0 -1
- package/dist/chunk-K67A6XOJ.mjs.map +0 -1
- package/dist/chunk-OKQVDDJ2.mjs.map +0 -1
- /package/dist/{chunk-QNQ6UT3D.mjs.map → chunk-5E6LOP76.mjs.map} +0 -0
- /package/dist/{chunk-ZBG4KJW5.mjs.map → chunk-MKDG5ZHT.mjs.map} +0 -0
- /package/dist/{chunk-AGSBOD2T.mjs.map → chunk-MYZB2EKG.mjs.map} +0 -0
package/dist/lib/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
config,
|
|
4
4
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
5
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-MKDG5ZHT.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-5E6LOP76.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-MYZB2EKG.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
buildSchema,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getCommonConfig,
|
|
21
21
|
langGraphPlatformEndpoint,
|
|
22
22
|
resolveEndpointType
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-3ECBC2K2.mjs";
|
|
24
24
|
import {
|
|
25
25
|
GoogleGenerativeAIAdapter,
|
|
26
26
|
GroqAdapter,
|
|
@@ -28,9 +28,9 @@ import {
|
|
|
28
28
|
OpenAIAdapter,
|
|
29
29
|
OpenAIAssistantAdapter,
|
|
30
30
|
UnifyAdapter
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-CLGKEUOA.mjs";
|
|
32
32
|
import "../chunk-U3V2BCGI.mjs";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-RFF5IIZJ.mjs";
|
|
34
34
|
import "../chunk-D2WLFQS6.mjs";
|
|
35
35
|
import "../chunk-44O2JGUY.mjs";
|
|
36
36
|
export {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../copilot-runtime-
|
|
2
|
-
export { h as CommonConfig, b as CopilotRequestContextProperties, g as buildSchema, e as createContext, i as getCommonConfig } from '../../copilot-runtime-
|
|
1
|
+
import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../copilot-runtime-6285d897.js';
|
|
2
|
+
export { h as CommonConfig, b as CopilotRequestContextProperties, g as buildSchema, e as createContext, i as getCommonConfig } from '../../copilot-runtime-6285d897.js';
|
|
3
3
|
import * as graphql_yoga from 'graphql-yoga';
|
|
4
4
|
import { YogaServerInstance } from 'graphql-yoga';
|
|
5
5
|
export { copilotRuntimeNodeHttpEndpoint } from './node-http/index.js';
|
|
6
6
|
export { copilotRuntimeNodeExpressEndpoint } from './node-express/index.js';
|
|
7
7
|
export { copilotRuntimeNestEndpoint } from './nest/index.js';
|
|
8
8
|
import '@copilotkit/shared';
|
|
9
|
-
import '../../langserve-
|
|
10
|
-
import '../../index-
|
|
9
|
+
import '../../langserve-48e976ac.js';
|
|
10
|
+
import '../../index-ff3fbc33.js';
|
|
11
11
|
import '../../graphql/types/base/index.js';
|
|
12
12
|
import 'rxjs';
|
|
13
13
|
import 'graphql';
|
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.5.
|
|
47
|
+
version: "1.5.1-custom-tag-pre.0",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -158,12 +158,6 @@ var MessageRole;
|
|
|
158
158
|
MessageRole2["system"] = "system";
|
|
159
159
|
MessageRole2["tool"] = "tool";
|
|
160
160
|
})(MessageRole || (MessageRole = {}));
|
|
161
|
-
var ActionExecutionScope;
|
|
162
|
-
(function(ActionExecutionScope2) {
|
|
163
|
-
ActionExecutionScope2["server"] = "server";
|
|
164
|
-
ActionExecutionScope2["client"] = "client";
|
|
165
|
-
ActionExecutionScope2["passThrough"] = "passThrough";
|
|
166
|
-
})(ActionExecutionScope || (ActionExecutionScope = {}));
|
|
167
161
|
var CopilotRequestType;
|
|
168
162
|
(function(CopilotRequestType2) {
|
|
169
163
|
CopilotRequestType2["Chat"] = "Chat";
|
|
@@ -182,10 +176,6 @@ var ActionInputAvailability;
|
|
|
182
176
|
name: "MessageRole",
|
|
183
177
|
description: "The role of the message"
|
|
184
178
|
});
|
|
185
|
-
(0, import_type_graphql.registerEnumType)(ActionExecutionScope, {
|
|
186
|
-
name: "ActionExecutionScope",
|
|
187
|
-
description: "The scope of the action"
|
|
188
|
-
});
|
|
189
179
|
(0, import_type_graphql.registerEnumType)(CopilotRequestType, {
|
|
190
180
|
name: "CopilotRequestType",
|
|
191
181
|
description: "The type of Copilot request"
|
|
@@ -283,6 +273,7 @@ MessageInput = _ts_decorate2([
|
|
|
283
273
|
], MessageInput);
|
|
284
274
|
var TextMessageInput = class {
|
|
285
275
|
content;
|
|
276
|
+
parentMessageId;
|
|
286
277
|
role;
|
|
287
278
|
};
|
|
288
279
|
__name(TextMessageInput, "TextMessageInput");
|
|
@@ -290,6 +281,12 @@ _ts_decorate2([
|
|
|
290
281
|
(0, import_type_graphql3.Field)(() => String),
|
|
291
282
|
_ts_metadata2("design:type", String)
|
|
292
283
|
], TextMessageInput.prototype, "content", void 0);
|
|
284
|
+
_ts_decorate2([
|
|
285
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
286
|
+
nullable: true
|
|
287
|
+
}),
|
|
288
|
+
_ts_metadata2("design:type", String)
|
|
289
|
+
], TextMessageInput.prototype, "parentMessageId", void 0);
|
|
293
290
|
_ts_decorate2([
|
|
294
291
|
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
295
292
|
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
@@ -300,6 +297,7 @@ TextMessageInput = _ts_decorate2([
|
|
|
300
297
|
var ActionExecutionMessageInput = class {
|
|
301
298
|
name;
|
|
302
299
|
arguments;
|
|
300
|
+
parentMessageId;
|
|
303
301
|
scope;
|
|
304
302
|
};
|
|
305
303
|
__name(ActionExecutionMessageInput, "ActionExecutionMessageInput");
|
|
@@ -312,8 +310,17 @@ _ts_decorate2([
|
|
|
312
310
|
_ts_metadata2("design:type", String)
|
|
313
311
|
], ActionExecutionMessageInput.prototype, "arguments", void 0);
|
|
314
312
|
_ts_decorate2([
|
|
315
|
-
(0, import_type_graphql3.Field)(() =>
|
|
316
|
-
|
|
313
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
314
|
+
nullable: true
|
|
315
|
+
}),
|
|
316
|
+
_ts_metadata2("design:type", String)
|
|
317
|
+
], ActionExecutionMessageInput.prototype, "parentMessageId", void 0);
|
|
318
|
+
_ts_decorate2([
|
|
319
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
320
|
+
nullable: true,
|
|
321
|
+
deprecationReason: "This field will be removed in a future version"
|
|
322
|
+
}),
|
|
323
|
+
_ts_metadata2("design:type", typeof String === "undefined" ? Object : String)
|
|
317
324
|
], ActionExecutionMessageInput.prototype, "scope", void 0);
|
|
318
325
|
ActionExecutionMessageInput = _ts_decorate2([
|
|
319
326
|
(0, import_type_graphql3.InputType)()
|
|
@@ -321,6 +328,7 @@ ActionExecutionMessageInput = _ts_decorate2([
|
|
|
321
328
|
var ResultMessageInput = class {
|
|
322
329
|
actionExecutionId;
|
|
323
330
|
actionName;
|
|
331
|
+
parentMessageId;
|
|
324
332
|
result;
|
|
325
333
|
};
|
|
326
334
|
__name(ResultMessageInput, "ResultMessageInput");
|
|
@@ -332,6 +340,12 @@ _ts_decorate2([
|
|
|
332
340
|
(0, import_type_graphql3.Field)(() => String),
|
|
333
341
|
_ts_metadata2("design:type", String)
|
|
334
342
|
], ResultMessageInput.prototype, "actionName", void 0);
|
|
343
|
+
_ts_decorate2([
|
|
344
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
345
|
+
nullable: true
|
|
346
|
+
}),
|
|
347
|
+
_ts_metadata2("design:type", String)
|
|
348
|
+
], ResultMessageInput.prototype, "parentMessageId", void 0);
|
|
335
349
|
_ts_decorate2([
|
|
336
350
|
(0, import_type_graphql3.Field)(() => String),
|
|
337
351
|
_ts_metadata2("design:type", String)
|
|
@@ -595,6 +609,7 @@ var ForwardedParametersInput = class {
|
|
|
595
609
|
stop;
|
|
596
610
|
toolChoice;
|
|
597
611
|
toolChoiceFunctionName;
|
|
612
|
+
temperature;
|
|
598
613
|
};
|
|
599
614
|
__name(ForwardedParametersInput, "ForwardedParametersInput");
|
|
600
615
|
_ts_decorate7([
|
|
@@ -629,6 +644,12 @@ _ts_decorate7([
|
|
|
629
644
|
}),
|
|
630
645
|
_ts_metadata7("design:type", String)
|
|
631
646
|
], ForwardedParametersInput.prototype, "toolChoiceFunctionName", void 0);
|
|
647
|
+
_ts_decorate7([
|
|
648
|
+
(0, import_type_graphql8.Field)(() => Number, {
|
|
649
|
+
nullable: true
|
|
650
|
+
}),
|
|
651
|
+
_ts_metadata7("design:type", Number)
|
|
652
|
+
], ForwardedParametersInput.prototype, "temperature", void 0);
|
|
632
653
|
ForwardedParametersInput = _ts_decorate7([
|
|
633
654
|
(0, import_type_graphql8.InputType)()
|
|
634
655
|
], ForwardedParametersInput);
|
|
@@ -1054,6 +1075,7 @@ BaseMessageOutput = _ts_decorate13([
|
|
|
1054
1075
|
var TextMessageOutput = class {
|
|
1055
1076
|
role;
|
|
1056
1077
|
content;
|
|
1078
|
+
parentMessageId;
|
|
1057
1079
|
};
|
|
1058
1080
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
1059
1081
|
_ts_decorate13([
|
|
@@ -1066,6 +1088,12 @@ _ts_decorate13([
|
|
|
1066
1088
|
]),
|
|
1067
1089
|
_ts_metadata13("design:type", Array)
|
|
1068
1090
|
], TextMessageOutput.prototype, "content", void 0);
|
|
1091
|
+
_ts_decorate13([
|
|
1092
|
+
(0, import_type_graphql14.Field)(() => String, {
|
|
1093
|
+
nullable: true
|
|
1094
|
+
}),
|
|
1095
|
+
_ts_metadata13("design:type", String)
|
|
1096
|
+
], TextMessageOutput.prototype, "parentMessageId", void 0);
|
|
1069
1097
|
TextMessageOutput = _ts_decorate13([
|
|
1070
1098
|
(0, import_type_graphql14.ObjectType)({
|
|
1071
1099
|
implements: BaseMessageOutput
|
|
@@ -1075,6 +1103,7 @@ var ActionExecutionMessageOutput = class {
|
|
|
1075
1103
|
name;
|
|
1076
1104
|
scope;
|
|
1077
1105
|
arguments;
|
|
1106
|
+
parentMessageId;
|
|
1078
1107
|
};
|
|
1079
1108
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1080
1109
|
_ts_decorate13([
|
|
@@ -1082,8 +1111,11 @@ _ts_decorate13([
|
|
|
1082
1111
|
_ts_metadata13("design:type", String)
|
|
1083
1112
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1084
1113
|
_ts_decorate13([
|
|
1085
|
-
(0, import_type_graphql14.Field)(() =>
|
|
1086
|
-
|
|
1114
|
+
(0, import_type_graphql14.Field)(() => String, {
|
|
1115
|
+
nullable: true,
|
|
1116
|
+
deprecationReason: "This field will be removed in a future version"
|
|
1117
|
+
}),
|
|
1118
|
+
_ts_metadata13("design:type", String)
|
|
1087
1119
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
1088
1120
|
_ts_decorate13([
|
|
1089
1121
|
(0, import_type_graphql14.Field)(() => [
|
|
@@ -1091,6 +1123,12 @@ _ts_decorate13([
|
|
|
1091
1123
|
]),
|
|
1092
1124
|
_ts_metadata13("design:type", Array)
|
|
1093
1125
|
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
1126
|
+
_ts_decorate13([
|
|
1127
|
+
(0, import_type_graphql14.Field)(() => String, {
|
|
1128
|
+
nullable: true
|
|
1129
|
+
}),
|
|
1130
|
+
_ts_metadata13("design:type", String)
|
|
1131
|
+
], ActionExecutionMessageOutput.prototype, "parentMessageId", void 0);
|
|
1094
1132
|
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1095
1133
|
(0, import_type_graphql14.ObjectType)({
|
|
1096
1134
|
implements: BaseMessageOutput
|
|
@@ -1242,13 +1280,14 @@ var TextMessage = class extends Message {
|
|
|
1242
1280
|
type = "TextMessage";
|
|
1243
1281
|
content;
|
|
1244
1282
|
role;
|
|
1283
|
+
parentMessageId;
|
|
1245
1284
|
};
|
|
1246
1285
|
__name(TextMessage, "TextMessage");
|
|
1247
1286
|
var ActionExecutionMessage = class extends Message {
|
|
1248
1287
|
type = "ActionExecutionMessage";
|
|
1249
1288
|
name;
|
|
1250
1289
|
arguments;
|
|
1251
|
-
|
|
1290
|
+
parentMessageId;
|
|
1252
1291
|
};
|
|
1253
1292
|
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1254
1293
|
var ResultMessage = class extends Message {
|
|
@@ -1332,6 +1371,7 @@ __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
|
1332
1371
|
var telemetry_client_default = telemetryClient;
|
|
1333
1372
|
|
|
1334
1373
|
// src/service-adapters/events.ts
|
|
1374
|
+
var import_class_transformer = require("class-transformer");
|
|
1335
1375
|
var RuntimeEventTypes;
|
|
1336
1376
|
(function(RuntimeEventTypes2) {
|
|
1337
1377
|
RuntimeEventTypes2["TextMessageStart"] = "TextMessageStart";
|
|
@@ -1346,7 +1386,7 @@ var RuntimeEventTypes;
|
|
|
1346
1386
|
|
|
1347
1387
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1348
1388
|
var import_graphql_scalars2 = require("graphql-scalars");
|
|
1349
|
-
var
|
|
1389
|
+
var import_class_transformer2 = require("class-transformer");
|
|
1350
1390
|
var import_graphql = require("graphql");
|
|
1351
1391
|
|
|
1352
1392
|
// src/utils/failed-response-status-reasons.ts
|
|
@@ -1544,7 +1584,7 @@ var CopilotResolver = class {
|
|
|
1544
1584
|
reason: `Interrupted due to Guardrails validation failure. Reason: ${result.reason}`
|
|
1545
1585
|
});
|
|
1546
1586
|
outputMessages = [
|
|
1547
|
-
(0,
|
|
1587
|
+
(0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
1548
1588
|
id: (0, import_shared4.randomId)(),
|
|
1549
1589
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1550
1590
|
content: result.reason,
|
|
@@ -1593,12 +1633,15 @@ var CopilotResolver = class {
|
|
|
1593
1633
|
// skip until this message start event
|
|
1594
1634
|
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1595
1635
|
// take until the message end event
|
|
1596
|
-
(0, import_rxjs3.takeWhile)((e) => e.type
|
|
1636
|
+
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.TextMessageEnd && e.messageId == event.messageId)),
|
|
1637
|
+
// filter out any other message events or message ids
|
|
1638
|
+
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.TextMessageContent && e.messageId == event.messageId)
|
|
1597
1639
|
);
|
|
1598
1640
|
const streamingTextStatus = new import_rxjs3.Subject();
|
|
1599
1641
|
const messageId = event.messageId;
|
|
1600
1642
|
pushMessage({
|
|
1601
1643
|
id: messageId,
|
|
1644
|
+
parentMessageId: event.parentMessageId,
|
|
1602
1645
|
status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
|
|
1603
1646
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1604
1647
|
role: MessageRole.assistant,
|
|
@@ -1611,7 +1654,7 @@ var CopilotResolver = class {
|
|
|
1611
1654
|
reason,
|
|
1612
1655
|
messageId: messageId2
|
|
1613
1656
|
}, "Text streaming interrupted");
|
|
1614
|
-
streamingTextStatus.next((0,
|
|
1657
|
+
streamingTextStatus.next((0, import_class_transformer2.plainToInstance)(FailedMessageStatus, {
|
|
1615
1658
|
reason
|
|
1616
1659
|
}));
|
|
1617
1660
|
responseStatus$.next(new MessageStreamInterruptedResponse({
|
|
@@ -1644,7 +1687,7 @@ var CopilotResolver = class {
|
|
|
1644
1687
|
streamingTextStatus.next(new SuccessMessageStatus());
|
|
1645
1688
|
stopStreamingText();
|
|
1646
1689
|
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
1647
|
-
outputMessages.push((0,
|
|
1690
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
1648
1691
|
id: messageId,
|
|
1649
1692
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1650
1693
|
content: textChunks.join(""),
|
|
@@ -1657,14 +1700,20 @@ var CopilotResolver = class {
|
|
|
1657
1700
|
break;
|
|
1658
1701
|
case RuntimeEventTypes.ActionExecutionStart:
|
|
1659
1702
|
logger2.debug("Action execution start event received");
|
|
1660
|
-
const actionExecutionArgumentStream = eventStream.pipe(
|
|
1703
|
+
const actionExecutionArgumentStream = eventStream.pipe(
|
|
1704
|
+
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1705
|
+
// take until the action execution end event
|
|
1706
|
+
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.ActionExecutionEnd && e.actionExecutionId == event.actionExecutionId)),
|
|
1707
|
+
// filter out any other action execution events or action execution ids
|
|
1708
|
+
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.ActionExecutionArgs && e.actionExecutionId == event.actionExecutionId)
|
|
1709
|
+
);
|
|
1661
1710
|
const streamingArgumentsStatus = new import_rxjs3.Subject();
|
|
1662
1711
|
pushMessage({
|
|
1663
1712
|
id: event.actionExecutionId,
|
|
1713
|
+
parentMessageId: event.parentMessageId,
|
|
1664
1714
|
status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
|
|
1665
1715
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1666
1716
|
name: event.actionName,
|
|
1667
|
-
scope: event.scope,
|
|
1668
1717
|
arguments: new import_graphql_yoga.Repeater(async (pushArgumentsChunk, stopStreamingArguments) => {
|
|
1669
1718
|
logger2.debug("Action execution argument stream created");
|
|
1670
1719
|
const argumentChunks = [];
|
|
@@ -1680,7 +1729,7 @@ var CopilotResolver = class {
|
|
|
1680
1729
|
logger2.error({
|
|
1681
1730
|
err
|
|
1682
1731
|
}, "Error in action execution argument stream");
|
|
1683
|
-
streamingArgumentsStatus.next((0,
|
|
1732
|
+
streamingArgumentsStatus.next((0, import_class_transformer2.plainToInstance)(FailedMessageStatus, {
|
|
1684
1733
|
reason: "An unknown error has occurred in the action execution argument stream"
|
|
1685
1734
|
}));
|
|
1686
1735
|
stopStreamingArguments();
|
|
@@ -1691,11 +1740,10 @@ var CopilotResolver = class {
|
|
|
1691
1740
|
streamingArgumentsStatus.next(new SuccessMessageStatus());
|
|
1692
1741
|
stopStreamingArguments();
|
|
1693
1742
|
actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
|
|
1694
|
-
outputMessages.push((0,
|
|
1743
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(ActionExecutionMessage, {
|
|
1695
1744
|
id: event.actionExecutionId,
|
|
1696
1745
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1697
1746
|
name: event.actionName,
|
|
1698
|
-
scope: event.scope,
|
|
1699
1747
|
arguments: argumentChunks.join("")
|
|
1700
1748
|
}));
|
|
1701
1749
|
}
|
|
@@ -1708,15 +1756,15 @@ var CopilotResolver = class {
|
|
|
1708
1756
|
result: event.result
|
|
1709
1757
|
}, "Action execution result event received");
|
|
1710
1758
|
pushMessage({
|
|
1711
|
-
id:
|
|
1759
|
+
id: "result-" + event.actionExecutionId,
|
|
1712
1760
|
status: new SuccessMessageStatus(),
|
|
1713
1761
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1714
1762
|
actionExecutionId: event.actionExecutionId,
|
|
1715
1763
|
actionName: event.actionName,
|
|
1716
1764
|
result: event.result
|
|
1717
1765
|
});
|
|
1718
|
-
outputMessages.push((0,
|
|
1719
|
-
id:
|
|
1766
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(ResultMessage, {
|
|
1767
|
+
id: "result-" + event.actionExecutionId,
|
|
1720
1768
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1721
1769
|
actionExecutionId: event.actionExecutionId,
|
|
1722
1770
|
actionName: event.actionName,
|
|
@@ -1740,7 +1788,7 @@ var CopilotResolver = class {
|
|
|
1740
1788
|
role: MessageRole.assistant,
|
|
1741
1789
|
createdAt: /* @__PURE__ */ new Date()
|
|
1742
1790
|
});
|
|
1743
|
-
outputMessages.push((0,
|
|
1791
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(AgentStateMessage, {
|
|
1744
1792
|
id: (0, import_shared4.randomId)(),
|
|
1745
1793
|
threadId: event.threadId,
|
|
1746
1794
|
agentName: event.agentName,
|