@copilotkit/runtime 1.4.8-coagents-v0-3.1 → 1.4.8-next.1
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 +5 -4
- package/__snapshots__/schema/schema.graphql +10 -7
- package/dist/{chunk-FVYNRYIB.mjs → chunk-5KJYPVQJ.mjs} +307 -423
- package/dist/chunk-5KJYPVQJ.mjs.map +1 -0
- package/dist/{chunk-RFF5IIZJ.mjs → chunk-B74M7FXG.mjs} +2 -3
- package/dist/chunk-B74M7FXG.mjs.map +1 -0
- package/dist/{chunk-BACNNHHI.mjs → chunk-CGGI46KC.mjs} +2 -2
- package/dist/{chunk-YFG3Q3YH.mjs → chunk-EU52BTKR.mjs} +2 -2
- package/dist/{chunk-MQJNZYAH.mjs → chunk-KO4QCMY4.mjs} +2 -2
- package/dist/{chunk-2PK2SFRB.mjs → chunk-W7GP2EOT.mjs} +106 -221
- package/dist/chunk-W7GP2EOT.mjs.map +1 -0
- package/dist/{copilot-runtime-b15b683d.d.ts → copilot-runtime-1c5bf72b.d.ts} +2 -2
- package/dist/graphql/types/converted/index.d.ts +1 -1
- package/dist/graphql/types/converted/index.js +1 -2
- package/dist/graphql/types/converted/index.js.map +1 -1
- package/dist/graphql/types/converted/index.mjs +1 -1
- package/dist/{groq-adapter-50aa9621.d.ts → groq-adapter-b6a40422.d.ts} +1 -1
- package/dist/{index-ff3fbc33.d.ts → index-10b1c870.d.ts} +8 -7
- package/dist/index.d.ts +5 -5
- package/dist/index.js +515 -745
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{langserve-8ec29cba.d.ts → langserve-6245df39.d.ts} +14 -52
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +442 -706
- 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 +37 -71
- 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 +37 -71
- 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 +37 -71
- 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 +37 -71
- 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 +106 -219
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +5 -1
- package/package.json +2 -2
- package/src/agents/langgraph/event-source.ts +148 -140
- 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 +3 -15
- package/src/graphql/resolvers/copilot.resolver.ts +6 -32
- package/src/graphql/types/converted/index.ts +3 -4
- package/src/graphql/types/copilot-response.type.ts +3 -12
- package/src/graphql/types/enums.ts +11 -0
- package/src/lib/runtime/remote-action-constructors.ts +62 -60
- package/src/lib/runtime/remote-actions.ts +0 -1
- package/src/lib/runtime/remote-lg-action.ts +140 -161
- package/src/service-adapters/anthropic/anthropic-adapter.ts +6 -16
- package/src/service-adapters/conversion.ts +1 -2
- package/src/service-adapters/events.ts +52 -111
- package/src/service-adapters/experimental/empty/empty-adapter.ts +33 -0
- package/src/service-adapters/experimental/ollama/ollama-adapter.ts +3 -7
- package/src/service-adapters/groq/groq-adapter.ts +8 -23
- package/src/service-adapters/index.ts +7 -1
- package/src/service-adapters/langchain/utils.ts +31 -49
- package/src/service-adapters/openai/openai-adapter.ts +9 -22
- package/src/service-adapters/openai/openai-assistant-adapter.ts +8 -22
- package/src/service-adapters/unify/unify-adapter.ts +11 -28
- package/dist/chunk-2PK2SFRB.mjs.map +0 -1
- package/dist/chunk-FVYNRYIB.mjs.map +0 -1
- package/dist/chunk-RFF5IIZJ.mjs.map +0 -1
- /package/dist/{chunk-BACNNHHI.mjs.map → chunk-CGGI46KC.mjs.map} +0 -0
- /package/dist/{chunk-YFG3Q3YH.mjs.map → chunk-EU52BTKR.mjs.map} +0 -0
- /package/dist/{chunk-MQJNZYAH.mjs.map → chunk-KO4QCMY4.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-EU52BTKR.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-KO4QCMY4.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-CGGI46KC.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-5KJYPVQJ.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-W7GP2EOT.mjs";
|
|
32
32
|
import "../chunk-U3V2BCGI.mjs";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-B74M7FXG.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-1c5bf72b.js';
|
|
2
|
+
export { h as CommonConfig, b as CopilotRequestContextProperties, g as buildSchema, e as createContext, i as getCommonConfig } from '../../copilot-runtime-1c5bf72b.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-6245df39.js';
|
|
10
|
+
import '../../index-10b1c870.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.4.8-
|
|
47
|
+
version: "1.4.8-next.1",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -158,6 +158,12 @@ 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 = {}));
|
|
161
167
|
var CopilotRequestType;
|
|
162
168
|
(function(CopilotRequestType2) {
|
|
163
169
|
CopilotRequestType2["Chat"] = "Chat";
|
|
@@ -176,6 +182,10 @@ var ActionInputAvailability;
|
|
|
176
182
|
name: "MessageRole",
|
|
177
183
|
description: "The role of the message"
|
|
178
184
|
});
|
|
185
|
+
(0, import_type_graphql.registerEnumType)(ActionExecutionScope, {
|
|
186
|
+
name: "ActionExecutionScope",
|
|
187
|
+
description: "The scope of the action"
|
|
188
|
+
});
|
|
179
189
|
(0, import_type_graphql.registerEnumType)(CopilotRequestType, {
|
|
180
190
|
name: "CopilotRequestType",
|
|
181
191
|
description: "The type of Copilot request"
|
|
@@ -273,7 +283,6 @@ MessageInput = _ts_decorate2([
|
|
|
273
283
|
], MessageInput);
|
|
274
284
|
var TextMessageInput = class {
|
|
275
285
|
content;
|
|
276
|
-
parentMessageId;
|
|
277
286
|
role;
|
|
278
287
|
};
|
|
279
288
|
__name(TextMessageInput, "TextMessageInput");
|
|
@@ -281,12 +290,6 @@ _ts_decorate2([
|
|
|
281
290
|
(0, import_type_graphql3.Field)(() => String),
|
|
282
291
|
_ts_metadata2("design:type", String)
|
|
283
292
|
], 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);
|
|
290
293
|
_ts_decorate2([
|
|
291
294
|
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
292
295
|
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
@@ -297,7 +300,6 @@ TextMessageInput = _ts_decorate2([
|
|
|
297
300
|
var ActionExecutionMessageInput = class {
|
|
298
301
|
name;
|
|
299
302
|
arguments;
|
|
300
|
-
parentMessageId;
|
|
301
303
|
scope;
|
|
302
304
|
};
|
|
303
305
|
__name(ActionExecutionMessageInput, "ActionExecutionMessageInput");
|
|
@@ -310,17 +312,8 @@ _ts_decorate2([
|
|
|
310
312
|
_ts_metadata2("design:type", String)
|
|
311
313
|
], ActionExecutionMessageInput.prototype, "arguments", void 0);
|
|
312
314
|
_ts_decorate2([
|
|
313
|
-
(0, import_type_graphql3.Field)(() =>
|
|
314
|
-
|
|
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)
|
|
315
|
+
(0, import_type_graphql3.Field)(() => ActionExecutionScope),
|
|
316
|
+
_ts_metadata2("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
324
317
|
], ActionExecutionMessageInput.prototype, "scope", void 0);
|
|
325
318
|
ActionExecutionMessageInput = _ts_decorate2([
|
|
326
319
|
(0, import_type_graphql3.InputType)()
|
|
@@ -328,7 +321,6 @@ ActionExecutionMessageInput = _ts_decorate2([
|
|
|
328
321
|
var ResultMessageInput = class {
|
|
329
322
|
actionExecutionId;
|
|
330
323
|
actionName;
|
|
331
|
-
parentMessageId;
|
|
332
324
|
result;
|
|
333
325
|
};
|
|
334
326
|
__name(ResultMessageInput, "ResultMessageInput");
|
|
@@ -340,12 +332,6 @@ _ts_decorate2([
|
|
|
340
332
|
(0, import_type_graphql3.Field)(() => String),
|
|
341
333
|
_ts_metadata2("design:type", String)
|
|
342
334
|
], 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);
|
|
349
335
|
_ts_decorate2([
|
|
350
336
|
(0, import_type_graphql3.Field)(() => String),
|
|
351
337
|
_ts_metadata2("design:type", String)
|
|
@@ -609,6 +595,7 @@ var ForwardedParametersInput = class {
|
|
|
609
595
|
stop;
|
|
610
596
|
toolChoice;
|
|
611
597
|
toolChoiceFunctionName;
|
|
598
|
+
temperature;
|
|
612
599
|
};
|
|
613
600
|
__name(ForwardedParametersInput, "ForwardedParametersInput");
|
|
614
601
|
_ts_decorate7([
|
|
@@ -643,6 +630,12 @@ _ts_decorate7([
|
|
|
643
630
|
}),
|
|
644
631
|
_ts_metadata7("design:type", String)
|
|
645
632
|
], ForwardedParametersInput.prototype, "toolChoiceFunctionName", void 0);
|
|
633
|
+
_ts_decorate7([
|
|
634
|
+
(0, import_type_graphql8.Field)(() => Number, {
|
|
635
|
+
nullable: true
|
|
636
|
+
}),
|
|
637
|
+
_ts_metadata7("design:type", Number)
|
|
638
|
+
], ForwardedParametersInput.prototype, "temperature", void 0);
|
|
646
639
|
ForwardedParametersInput = _ts_decorate7([
|
|
647
640
|
(0, import_type_graphql8.InputType)()
|
|
648
641
|
], ForwardedParametersInput);
|
|
@@ -1068,7 +1061,6 @@ BaseMessageOutput = _ts_decorate13([
|
|
|
1068
1061
|
var TextMessageOutput = class {
|
|
1069
1062
|
role;
|
|
1070
1063
|
content;
|
|
1071
|
-
parentMessageId;
|
|
1072
1064
|
};
|
|
1073
1065
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
1074
1066
|
_ts_decorate13([
|
|
@@ -1081,12 +1073,6 @@ _ts_decorate13([
|
|
|
1081
1073
|
]),
|
|
1082
1074
|
_ts_metadata13("design:type", Array)
|
|
1083
1075
|
], TextMessageOutput.prototype, "content", void 0);
|
|
1084
|
-
_ts_decorate13([
|
|
1085
|
-
(0, import_type_graphql14.Field)(() => String, {
|
|
1086
|
-
nullable: true
|
|
1087
|
-
}),
|
|
1088
|
-
_ts_metadata13("design:type", String)
|
|
1089
|
-
], TextMessageOutput.prototype, "parentMessageId", void 0);
|
|
1090
1076
|
TextMessageOutput = _ts_decorate13([
|
|
1091
1077
|
(0, import_type_graphql14.ObjectType)({
|
|
1092
1078
|
implements: BaseMessageOutput
|
|
@@ -1096,7 +1082,6 @@ var ActionExecutionMessageOutput = class {
|
|
|
1096
1082
|
name;
|
|
1097
1083
|
scope;
|
|
1098
1084
|
arguments;
|
|
1099
|
-
parentMessageId;
|
|
1100
1085
|
};
|
|
1101
1086
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1102
1087
|
_ts_decorate13([
|
|
@@ -1104,11 +1089,8 @@ _ts_decorate13([
|
|
|
1104
1089
|
_ts_metadata13("design:type", String)
|
|
1105
1090
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1106
1091
|
_ts_decorate13([
|
|
1107
|
-
(0, import_type_graphql14.Field)(() =>
|
|
1108
|
-
|
|
1109
|
-
deprecationReason: "This field will be removed in a future version"
|
|
1110
|
-
}),
|
|
1111
|
-
_ts_metadata13("design:type", String)
|
|
1092
|
+
(0, import_type_graphql14.Field)(() => ActionExecutionScope),
|
|
1093
|
+
_ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
1112
1094
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
1113
1095
|
_ts_decorate13([
|
|
1114
1096
|
(0, import_type_graphql14.Field)(() => [
|
|
@@ -1116,12 +1098,6 @@ _ts_decorate13([
|
|
|
1116
1098
|
]),
|
|
1117
1099
|
_ts_metadata13("design:type", Array)
|
|
1118
1100
|
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
1119
|
-
_ts_decorate13([
|
|
1120
|
-
(0, import_type_graphql14.Field)(() => String, {
|
|
1121
|
-
nullable: true
|
|
1122
|
-
}),
|
|
1123
|
-
_ts_metadata13("design:type", String)
|
|
1124
|
-
], ActionExecutionMessageOutput.prototype, "parentMessageId", void 0);
|
|
1125
1101
|
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1126
1102
|
(0, import_type_graphql14.ObjectType)({
|
|
1127
1103
|
implements: BaseMessageOutput
|
|
@@ -1273,14 +1249,13 @@ var TextMessage = class extends Message {
|
|
|
1273
1249
|
type = "TextMessage";
|
|
1274
1250
|
content;
|
|
1275
1251
|
role;
|
|
1276
|
-
parentMessageId;
|
|
1277
1252
|
};
|
|
1278
1253
|
__name(TextMessage, "TextMessage");
|
|
1279
1254
|
var ActionExecutionMessage = class extends Message {
|
|
1280
1255
|
type = "ActionExecutionMessage";
|
|
1281
1256
|
name;
|
|
1282
1257
|
arguments;
|
|
1283
|
-
|
|
1258
|
+
scope;
|
|
1284
1259
|
};
|
|
1285
1260
|
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1286
1261
|
var ResultMessage = class extends Message {
|
|
@@ -1364,7 +1339,6 @@ __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
|
1364
1339
|
var telemetry_client_default = telemetryClient;
|
|
1365
1340
|
|
|
1366
1341
|
// src/service-adapters/events.ts
|
|
1367
|
-
var import_class_transformer = require("class-transformer");
|
|
1368
1342
|
var RuntimeEventTypes;
|
|
1369
1343
|
(function(RuntimeEventTypes2) {
|
|
1370
1344
|
RuntimeEventTypes2["TextMessageStart"] = "TextMessageStart";
|
|
@@ -1379,7 +1353,7 @@ var RuntimeEventTypes;
|
|
|
1379
1353
|
|
|
1380
1354
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1381
1355
|
var import_graphql_scalars2 = require("graphql-scalars");
|
|
1382
|
-
var
|
|
1356
|
+
var import_class_transformer = require("class-transformer");
|
|
1383
1357
|
var import_graphql = require("graphql");
|
|
1384
1358
|
|
|
1385
1359
|
// src/utils/failed-response-status-reasons.ts
|
|
@@ -1577,7 +1551,7 @@ var CopilotResolver = class {
|
|
|
1577
1551
|
reason: `Interrupted due to Guardrails validation failure. Reason: ${result.reason}`
|
|
1578
1552
|
});
|
|
1579
1553
|
outputMessages = [
|
|
1580
|
-
(0,
|
|
1554
|
+
(0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1581
1555
|
id: (0, import_shared4.randomId)(),
|
|
1582
1556
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1583
1557
|
content: result.reason,
|
|
@@ -1626,15 +1600,12 @@ var CopilotResolver = class {
|
|
|
1626
1600
|
// skip until this message start event
|
|
1627
1601
|
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1628
1602
|
// take until the message end event
|
|
1629
|
-
(0, import_rxjs3.takeWhile)((e) =>
|
|
1630
|
-
// filter out any other message events or message ids
|
|
1631
|
-
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.TextMessageContent && e.messageId == event.messageId)
|
|
1603
|
+
(0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.TextMessageEnd)
|
|
1632
1604
|
);
|
|
1633
1605
|
const streamingTextStatus = new import_rxjs3.Subject();
|
|
1634
1606
|
const messageId = event.messageId;
|
|
1635
1607
|
pushMessage({
|
|
1636
1608
|
id: messageId,
|
|
1637
|
-
parentMessageId: event.parentMessageId,
|
|
1638
1609
|
status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
|
|
1639
1610
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1640
1611
|
role: MessageRole.assistant,
|
|
@@ -1647,7 +1618,7 @@ var CopilotResolver = class {
|
|
|
1647
1618
|
reason,
|
|
1648
1619
|
messageId: messageId2
|
|
1649
1620
|
}, "Text streaming interrupted");
|
|
1650
|
-
streamingTextStatus.next((0,
|
|
1621
|
+
streamingTextStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
|
|
1651
1622
|
reason
|
|
1652
1623
|
}));
|
|
1653
1624
|
responseStatus$.next(new MessageStreamInterruptedResponse({
|
|
@@ -1680,7 +1651,7 @@ var CopilotResolver = class {
|
|
|
1680
1651
|
streamingTextStatus.next(new SuccessMessageStatus());
|
|
1681
1652
|
stopStreamingText();
|
|
1682
1653
|
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
1683
|
-
outputMessages.push((0,
|
|
1654
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1684
1655
|
id: messageId,
|
|
1685
1656
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1686
1657
|
content: textChunks.join(""),
|
|
@@ -1693,20 +1664,14 @@ var CopilotResolver = class {
|
|
|
1693
1664
|
break;
|
|
1694
1665
|
case RuntimeEventTypes.ActionExecutionStart:
|
|
1695
1666
|
logger2.debug("Action execution start event received");
|
|
1696
|
-
const actionExecutionArgumentStream = eventStream.pipe(
|
|
1697
|
-
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1698
|
-
// take until the action execution end event
|
|
1699
|
-
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.ActionExecutionEnd && e.actionExecutionId == event.actionExecutionId)),
|
|
1700
|
-
// filter out any other action execution events or action execution ids
|
|
1701
|
-
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.ActionExecutionArgs && e.actionExecutionId == event.actionExecutionId)
|
|
1702
|
-
);
|
|
1667
|
+
const actionExecutionArgumentStream = eventStream.pipe((0, import_rxjs3.skipWhile)((e) => e !== event), (0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.ActionExecutionEnd));
|
|
1703
1668
|
const streamingArgumentsStatus = new import_rxjs3.Subject();
|
|
1704
1669
|
pushMessage({
|
|
1705
1670
|
id: event.actionExecutionId,
|
|
1706
|
-
parentMessageId: event.parentMessageId,
|
|
1707
1671
|
status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
|
|
1708
1672
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1709
1673
|
name: event.actionName,
|
|
1674
|
+
scope: event.scope,
|
|
1710
1675
|
arguments: new import_graphql_yoga.Repeater(async (pushArgumentsChunk, stopStreamingArguments) => {
|
|
1711
1676
|
logger2.debug("Action execution argument stream created");
|
|
1712
1677
|
const argumentChunks = [];
|
|
@@ -1722,7 +1687,7 @@ var CopilotResolver = class {
|
|
|
1722
1687
|
logger2.error({
|
|
1723
1688
|
err
|
|
1724
1689
|
}, "Error in action execution argument stream");
|
|
1725
|
-
streamingArgumentsStatus.next((0,
|
|
1690
|
+
streamingArgumentsStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
|
|
1726
1691
|
reason: "An unknown error has occurred in the action execution argument stream"
|
|
1727
1692
|
}));
|
|
1728
1693
|
stopStreamingArguments();
|
|
@@ -1733,10 +1698,11 @@ var CopilotResolver = class {
|
|
|
1733
1698
|
streamingArgumentsStatus.next(new SuccessMessageStatus());
|
|
1734
1699
|
stopStreamingArguments();
|
|
1735
1700
|
actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
|
|
1736
|
-
outputMessages.push((0,
|
|
1701
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(ActionExecutionMessage, {
|
|
1737
1702
|
id: event.actionExecutionId,
|
|
1738
1703
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1739
1704
|
name: event.actionName,
|
|
1705
|
+
scope: event.scope,
|
|
1740
1706
|
arguments: argumentChunks.join("")
|
|
1741
1707
|
}));
|
|
1742
1708
|
}
|
|
@@ -1749,15 +1715,15 @@ var CopilotResolver = class {
|
|
|
1749
1715
|
result: event.result
|
|
1750
1716
|
}, "Action execution result event received");
|
|
1751
1717
|
pushMessage({
|
|
1752
|
-
id:
|
|
1718
|
+
id: (0, import_shared4.randomId)(),
|
|
1753
1719
|
status: new SuccessMessageStatus(),
|
|
1754
1720
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1755
1721
|
actionExecutionId: event.actionExecutionId,
|
|
1756
1722
|
actionName: event.actionName,
|
|
1757
1723
|
result: event.result
|
|
1758
1724
|
});
|
|
1759
|
-
outputMessages.push((0,
|
|
1760
|
-
id:
|
|
1725
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(ResultMessage, {
|
|
1726
|
+
id: (0, import_shared4.randomId)(),
|
|
1761
1727
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1762
1728
|
actionExecutionId: event.actionExecutionId,
|
|
1763
1729
|
actionName: event.actionName,
|
|
@@ -1781,7 +1747,7 @@ var CopilotResolver = class {
|
|
|
1781
1747
|
role: MessageRole.assistant,
|
|
1782
1748
|
createdAt: /* @__PURE__ */ new Date()
|
|
1783
1749
|
});
|
|
1784
|
-
outputMessages.push((0,
|
|
1750
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
|
|
1785
1751
|
id: (0, import_shared4.randomId)(),
|
|
1786
1752
|
threadId: event.threadId,
|
|
1787
1753
|
agentName: event.agentName,
|