@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
|
@@ -2,22 +2,22 @@ import {
|
|
|
2
2
|
config,
|
|
3
3
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
4
4
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-EU52BTKR.mjs";
|
|
6
6
|
import {
|
|
7
7
|
copilotRuntimeNestEndpoint
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-KO4QCMY4.mjs";
|
|
9
9
|
import {
|
|
10
10
|
copilotRuntimeNodeExpressEndpoint
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-CGGI46KC.mjs";
|
|
12
12
|
import {
|
|
13
13
|
buildSchema,
|
|
14
14
|
copilotRuntimeNodeHttpEndpoint,
|
|
15
15
|
createContext,
|
|
16
16
|
getCommonConfig
|
|
17
|
-
} from "../../chunk-
|
|
18
|
-
import "../../chunk-
|
|
17
|
+
} from "../../chunk-5KJYPVQJ.mjs";
|
|
18
|
+
import "../../chunk-W7GP2EOT.mjs";
|
|
19
19
|
import "../../chunk-U3V2BCGI.mjs";
|
|
20
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-B74M7FXG.mjs";
|
|
21
21
|
import "../../chunk-D2WLFQS6.mjs";
|
|
22
22
|
import "../../chunk-44O2JGUY.mjs";
|
|
23
23
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as graphql_yoga from 'graphql-yoga';
|
|
2
|
-
import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../../copilot-runtime-
|
|
2
|
+
import { d as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../../copilot-runtime-1c5bf72b.js';
|
|
3
3
|
import '@copilotkit/shared';
|
|
4
|
-
import '../../../langserve-
|
|
5
|
-
import '../../../index-
|
|
4
|
+
import '../../../langserve-6245df39.js';
|
|
5
|
+
import '../../../index-10b1c870.js';
|
|
6
6
|
import '../../../graphql/types/base/index.js';
|
|
7
7
|
import 'rxjs';
|
|
8
8
|
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",
|
|
@@ -153,6 +153,12 @@ var MessageRole;
|
|
|
153
153
|
MessageRole2["system"] = "system";
|
|
154
154
|
MessageRole2["tool"] = "tool";
|
|
155
155
|
})(MessageRole || (MessageRole = {}));
|
|
156
|
+
var ActionExecutionScope;
|
|
157
|
+
(function(ActionExecutionScope2) {
|
|
158
|
+
ActionExecutionScope2["server"] = "server";
|
|
159
|
+
ActionExecutionScope2["client"] = "client";
|
|
160
|
+
ActionExecutionScope2["passThrough"] = "passThrough";
|
|
161
|
+
})(ActionExecutionScope || (ActionExecutionScope = {}));
|
|
156
162
|
var CopilotRequestType;
|
|
157
163
|
(function(CopilotRequestType2) {
|
|
158
164
|
CopilotRequestType2["Chat"] = "Chat";
|
|
@@ -171,6 +177,10 @@ var ActionInputAvailability;
|
|
|
171
177
|
name: "MessageRole",
|
|
172
178
|
description: "The role of the message"
|
|
173
179
|
});
|
|
180
|
+
(0, import_type_graphql.registerEnumType)(ActionExecutionScope, {
|
|
181
|
+
name: "ActionExecutionScope",
|
|
182
|
+
description: "The scope of the action"
|
|
183
|
+
});
|
|
174
184
|
(0, import_type_graphql.registerEnumType)(CopilotRequestType, {
|
|
175
185
|
name: "CopilotRequestType",
|
|
176
186
|
description: "The type of Copilot request"
|
|
@@ -268,7 +278,6 @@ MessageInput = _ts_decorate2([
|
|
|
268
278
|
], MessageInput);
|
|
269
279
|
var TextMessageInput = class {
|
|
270
280
|
content;
|
|
271
|
-
parentMessageId;
|
|
272
281
|
role;
|
|
273
282
|
};
|
|
274
283
|
__name(TextMessageInput, "TextMessageInput");
|
|
@@ -276,12 +285,6 @@ _ts_decorate2([
|
|
|
276
285
|
(0, import_type_graphql3.Field)(() => String),
|
|
277
286
|
_ts_metadata2("design:type", String)
|
|
278
287
|
], TextMessageInput.prototype, "content", void 0);
|
|
279
|
-
_ts_decorate2([
|
|
280
|
-
(0, import_type_graphql3.Field)(() => String, {
|
|
281
|
-
nullable: true
|
|
282
|
-
}),
|
|
283
|
-
_ts_metadata2("design:type", String)
|
|
284
|
-
], TextMessageInput.prototype, "parentMessageId", void 0);
|
|
285
288
|
_ts_decorate2([
|
|
286
289
|
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
287
290
|
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
@@ -292,7 +295,6 @@ TextMessageInput = _ts_decorate2([
|
|
|
292
295
|
var ActionExecutionMessageInput = class {
|
|
293
296
|
name;
|
|
294
297
|
arguments;
|
|
295
|
-
parentMessageId;
|
|
296
298
|
scope;
|
|
297
299
|
};
|
|
298
300
|
__name(ActionExecutionMessageInput, "ActionExecutionMessageInput");
|
|
@@ -305,17 +307,8 @@ _ts_decorate2([
|
|
|
305
307
|
_ts_metadata2("design:type", String)
|
|
306
308
|
], ActionExecutionMessageInput.prototype, "arguments", void 0);
|
|
307
309
|
_ts_decorate2([
|
|
308
|
-
(0, import_type_graphql3.Field)(() =>
|
|
309
|
-
|
|
310
|
-
}),
|
|
311
|
-
_ts_metadata2("design:type", String)
|
|
312
|
-
], ActionExecutionMessageInput.prototype, "parentMessageId", void 0);
|
|
313
|
-
_ts_decorate2([
|
|
314
|
-
(0, import_type_graphql3.Field)(() => String, {
|
|
315
|
-
nullable: true,
|
|
316
|
-
deprecationReason: "This field will be removed in a future version"
|
|
317
|
-
}),
|
|
318
|
-
_ts_metadata2("design:type", typeof String === "undefined" ? Object : String)
|
|
310
|
+
(0, import_type_graphql3.Field)(() => ActionExecutionScope),
|
|
311
|
+
_ts_metadata2("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
319
312
|
], ActionExecutionMessageInput.prototype, "scope", void 0);
|
|
320
313
|
ActionExecutionMessageInput = _ts_decorate2([
|
|
321
314
|
(0, import_type_graphql3.InputType)()
|
|
@@ -323,7 +316,6 @@ ActionExecutionMessageInput = _ts_decorate2([
|
|
|
323
316
|
var ResultMessageInput = class {
|
|
324
317
|
actionExecutionId;
|
|
325
318
|
actionName;
|
|
326
|
-
parentMessageId;
|
|
327
319
|
result;
|
|
328
320
|
};
|
|
329
321
|
__name(ResultMessageInput, "ResultMessageInput");
|
|
@@ -335,12 +327,6 @@ _ts_decorate2([
|
|
|
335
327
|
(0, import_type_graphql3.Field)(() => String),
|
|
336
328
|
_ts_metadata2("design:type", String)
|
|
337
329
|
], ResultMessageInput.prototype, "actionName", void 0);
|
|
338
|
-
_ts_decorate2([
|
|
339
|
-
(0, import_type_graphql3.Field)(() => String, {
|
|
340
|
-
nullable: true
|
|
341
|
-
}),
|
|
342
|
-
_ts_metadata2("design:type", String)
|
|
343
|
-
], ResultMessageInput.prototype, "parentMessageId", void 0);
|
|
344
330
|
_ts_decorate2([
|
|
345
331
|
(0, import_type_graphql3.Field)(() => String),
|
|
346
332
|
_ts_metadata2("design:type", String)
|
|
@@ -604,6 +590,7 @@ var ForwardedParametersInput = class {
|
|
|
604
590
|
stop;
|
|
605
591
|
toolChoice;
|
|
606
592
|
toolChoiceFunctionName;
|
|
593
|
+
temperature;
|
|
607
594
|
};
|
|
608
595
|
__name(ForwardedParametersInput, "ForwardedParametersInput");
|
|
609
596
|
_ts_decorate7([
|
|
@@ -638,6 +625,12 @@ _ts_decorate7([
|
|
|
638
625
|
}),
|
|
639
626
|
_ts_metadata7("design:type", String)
|
|
640
627
|
], ForwardedParametersInput.prototype, "toolChoiceFunctionName", void 0);
|
|
628
|
+
_ts_decorate7([
|
|
629
|
+
(0, import_type_graphql8.Field)(() => Number, {
|
|
630
|
+
nullable: true
|
|
631
|
+
}),
|
|
632
|
+
_ts_metadata7("design:type", Number)
|
|
633
|
+
], ForwardedParametersInput.prototype, "temperature", void 0);
|
|
641
634
|
ForwardedParametersInput = _ts_decorate7([
|
|
642
635
|
(0, import_type_graphql8.InputType)()
|
|
643
636
|
], ForwardedParametersInput);
|
|
@@ -1063,7 +1056,6 @@ BaseMessageOutput = _ts_decorate13([
|
|
|
1063
1056
|
var TextMessageOutput = class {
|
|
1064
1057
|
role;
|
|
1065
1058
|
content;
|
|
1066
|
-
parentMessageId;
|
|
1067
1059
|
};
|
|
1068
1060
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
1069
1061
|
_ts_decorate13([
|
|
@@ -1076,12 +1068,6 @@ _ts_decorate13([
|
|
|
1076
1068
|
]),
|
|
1077
1069
|
_ts_metadata13("design:type", Array)
|
|
1078
1070
|
], TextMessageOutput.prototype, "content", void 0);
|
|
1079
|
-
_ts_decorate13([
|
|
1080
|
-
(0, import_type_graphql14.Field)(() => String, {
|
|
1081
|
-
nullable: true
|
|
1082
|
-
}),
|
|
1083
|
-
_ts_metadata13("design:type", String)
|
|
1084
|
-
], TextMessageOutput.prototype, "parentMessageId", void 0);
|
|
1085
1071
|
TextMessageOutput = _ts_decorate13([
|
|
1086
1072
|
(0, import_type_graphql14.ObjectType)({
|
|
1087
1073
|
implements: BaseMessageOutput
|
|
@@ -1091,7 +1077,6 @@ var ActionExecutionMessageOutput = class {
|
|
|
1091
1077
|
name;
|
|
1092
1078
|
scope;
|
|
1093
1079
|
arguments;
|
|
1094
|
-
parentMessageId;
|
|
1095
1080
|
};
|
|
1096
1081
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1097
1082
|
_ts_decorate13([
|
|
@@ -1099,11 +1084,8 @@ _ts_decorate13([
|
|
|
1099
1084
|
_ts_metadata13("design:type", String)
|
|
1100
1085
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1101
1086
|
_ts_decorate13([
|
|
1102
|
-
(0, import_type_graphql14.Field)(() =>
|
|
1103
|
-
|
|
1104
|
-
deprecationReason: "This field will be removed in a future version"
|
|
1105
|
-
}),
|
|
1106
|
-
_ts_metadata13("design:type", String)
|
|
1087
|
+
(0, import_type_graphql14.Field)(() => ActionExecutionScope),
|
|
1088
|
+
_ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
1107
1089
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
1108
1090
|
_ts_decorate13([
|
|
1109
1091
|
(0, import_type_graphql14.Field)(() => [
|
|
@@ -1111,12 +1093,6 @@ _ts_decorate13([
|
|
|
1111
1093
|
]),
|
|
1112
1094
|
_ts_metadata13("design:type", Array)
|
|
1113
1095
|
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
1114
|
-
_ts_decorate13([
|
|
1115
|
-
(0, import_type_graphql14.Field)(() => String, {
|
|
1116
|
-
nullable: true
|
|
1117
|
-
}),
|
|
1118
|
-
_ts_metadata13("design:type", String)
|
|
1119
|
-
], ActionExecutionMessageOutput.prototype, "parentMessageId", void 0);
|
|
1120
1096
|
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1121
1097
|
(0, import_type_graphql14.ObjectType)({
|
|
1122
1098
|
implements: BaseMessageOutput
|
|
@@ -1268,14 +1244,13 @@ var TextMessage = class extends Message {
|
|
|
1268
1244
|
type = "TextMessage";
|
|
1269
1245
|
content;
|
|
1270
1246
|
role;
|
|
1271
|
-
parentMessageId;
|
|
1272
1247
|
};
|
|
1273
1248
|
__name(TextMessage, "TextMessage");
|
|
1274
1249
|
var ActionExecutionMessage = class extends Message {
|
|
1275
1250
|
type = "ActionExecutionMessage";
|
|
1276
1251
|
name;
|
|
1277
1252
|
arguments;
|
|
1278
|
-
|
|
1253
|
+
scope;
|
|
1279
1254
|
};
|
|
1280
1255
|
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1281
1256
|
var ResultMessage = class extends Message {
|
|
@@ -1359,7 +1334,6 @@ __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
|
1359
1334
|
var telemetry_client_default = telemetryClient;
|
|
1360
1335
|
|
|
1361
1336
|
// src/service-adapters/events.ts
|
|
1362
|
-
var import_class_transformer = require("class-transformer");
|
|
1363
1337
|
var RuntimeEventTypes;
|
|
1364
1338
|
(function(RuntimeEventTypes2) {
|
|
1365
1339
|
RuntimeEventTypes2["TextMessageStart"] = "TextMessageStart";
|
|
@@ -1374,7 +1348,7 @@ var RuntimeEventTypes;
|
|
|
1374
1348
|
|
|
1375
1349
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1376
1350
|
var import_graphql_scalars2 = require("graphql-scalars");
|
|
1377
|
-
var
|
|
1351
|
+
var import_class_transformer = require("class-transformer");
|
|
1378
1352
|
var import_graphql = require("graphql");
|
|
1379
1353
|
|
|
1380
1354
|
// src/utils/failed-response-status-reasons.ts
|
|
@@ -1572,7 +1546,7 @@ var CopilotResolver = class {
|
|
|
1572
1546
|
reason: `Interrupted due to Guardrails validation failure. Reason: ${result.reason}`
|
|
1573
1547
|
});
|
|
1574
1548
|
outputMessages = [
|
|
1575
|
-
(0,
|
|
1549
|
+
(0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1576
1550
|
id: (0, import_shared4.randomId)(),
|
|
1577
1551
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1578
1552
|
content: result.reason,
|
|
@@ -1621,15 +1595,12 @@ var CopilotResolver = class {
|
|
|
1621
1595
|
// skip until this message start event
|
|
1622
1596
|
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1623
1597
|
// take until the message end event
|
|
1624
|
-
(0, import_rxjs3.takeWhile)((e) =>
|
|
1625
|
-
// filter out any other message events or message ids
|
|
1626
|
-
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.TextMessageContent && e.messageId == event.messageId)
|
|
1598
|
+
(0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.TextMessageEnd)
|
|
1627
1599
|
);
|
|
1628
1600
|
const streamingTextStatus = new import_rxjs3.Subject();
|
|
1629
1601
|
const messageId = event.messageId;
|
|
1630
1602
|
pushMessage({
|
|
1631
1603
|
id: messageId,
|
|
1632
|
-
parentMessageId: event.parentMessageId,
|
|
1633
1604
|
status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
|
|
1634
1605
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1635
1606
|
role: MessageRole.assistant,
|
|
@@ -1642,7 +1613,7 @@ var CopilotResolver = class {
|
|
|
1642
1613
|
reason,
|
|
1643
1614
|
messageId: messageId2
|
|
1644
1615
|
}, "Text streaming interrupted");
|
|
1645
|
-
streamingTextStatus.next((0,
|
|
1616
|
+
streamingTextStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
|
|
1646
1617
|
reason
|
|
1647
1618
|
}));
|
|
1648
1619
|
responseStatus$.next(new MessageStreamInterruptedResponse({
|
|
@@ -1675,7 +1646,7 @@ var CopilotResolver = class {
|
|
|
1675
1646
|
streamingTextStatus.next(new SuccessMessageStatus());
|
|
1676
1647
|
stopStreamingText();
|
|
1677
1648
|
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
1678
|
-
outputMessages.push((0,
|
|
1649
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1679
1650
|
id: messageId,
|
|
1680
1651
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1681
1652
|
content: textChunks.join(""),
|
|
@@ -1688,20 +1659,14 @@ var CopilotResolver = class {
|
|
|
1688
1659
|
break;
|
|
1689
1660
|
case RuntimeEventTypes.ActionExecutionStart:
|
|
1690
1661
|
logger2.debug("Action execution start event received");
|
|
1691
|
-
const actionExecutionArgumentStream = eventStream.pipe(
|
|
1692
|
-
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1693
|
-
// take until the action execution end event
|
|
1694
|
-
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.ActionExecutionEnd && e.actionExecutionId == event.actionExecutionId)),
|
|
1695
|
-
// filter out any other action execution events or action execution ids
|
|
1696
|
-
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.ActionExecutionArgs && e.actionExecutionId == event.actionExecutionId)
|
|
1697
|
-
);
|
|
1662
|
+
const actionExecutionArgumentStream = eventStream.pipe((0, import_rxjs3.skipWhile)((e) => e !== event), (0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.ActionExecutionEnd));
|
|
1698
1663
|
const streamingArgumentsStatus = new import_rxjs3.Subject();
|
|
1699
1664
|
pushMessage({
|
|
1700
1665
|
id: event.actionExecutionId,
|
|
1701
|
-
parentMessageId: event.parentMessageId,
|
|
1702
1666
|
status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
|
|
1703
1667
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1704
1668
|
name: event.actionName,
|
|
1669
|
+
scope: event.scope,
|
|
1705
1670
|
arguments: new import_graphql_yoga.Repeater(async (pushArgumentsChunk, stopStreamingArguments) => {
|
|
1706
1671
|
logger2.debug("Action execution argument stream created");
|
|
1707
1672
|
const argumentChunks = [];
|
|
@@ -1717,7 +1682,7 @@ var CopilotResolver = class {
|
|
|
1717
1682
|
logger2.error({
|
|
1718
1683
|
err
|
|
1719
1684
|
}, "Error in action execution argument stream");
|
|
1720
|
-
streamingArgumentsStatus.next((0,
|
|
1685
|
+
streamingArgumentsStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
|
|
1721
1686
|
reason: "An unknown error has occurred in the action execution argument stream"
|
|
1722
1687
|
}));
|
|
1723
1688
|
stopStreamingArguments();
|
|
@@ -1728,10 +1693,11 @@ var CopilotResolver = class {
|
|
|
1728
1693
|
streamingArgumentsStatus.next(new SuccessMessageStatus());
|
|
1729
1694
|
stopStreamingArguments();
|
|
1730
1695
|
actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
|
|
1731
|
-
outputMessages.push((0,
|
|
1696
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(ActionExecutionMessage, {
|
|
1732
1697
|
id: event.actionExecutionId,
|
|
1733
1698
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1734
1699
|
name: event.actionName,
|
|
1700
|
+
scope: event.scope,
|
|
1735
1701
|
arguments: argumentChunks.join("")
|
|
1736
1702
|
}));
|
|
1737
1703
|
}
|
|
@@ -1744,15 +1710,15 @@ var CopilotResolver = class {
|
|
|
1744
1710
|
result: event.result
|
|
1745
1711
|
}, "Action execution result event received");
|
|
1746
1712
|
pushMessage({
|
|
1747
|
-
id:
|
|
1713
|
+
id: (0, import_shared4.randomId)(),
|
|
1748
1714
|
status: new SuccessMessageStatus(),
|
|
1749
1715
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1750
1716
|
actionExecutionId: event.actionExecutionId,
|
|
1751
1717
|
actionName: event.actionName,
|
|
1752
1718
|
result: event.result
|
|
1753
1719
|
});
|
|
1754
|
-
outputMessages.push((0,
|
|
1755
|
-
id:
|
|
1720
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(ResultMessage, {
|
|
1721
|
+
id: (0, import_shared4.randomId)(),
|
|
1756
1722
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1757
1723
|
actionExecutionId: event.actionExecutionId,
|
|
1758
1724
|
actionName: event.actionName,
|
|
@@ -1776,7 +1742,7 @@ var CopilotResolver = class {
|
|
|
1776
1742
|
role: MessageRole.assistant,
|
|
1777
1743
|
createdAt: /* @__PURE__ */ new Date()
|
|
1778
1744
|
});
|
|
1779
|
-
outputMessages.push((0,
|
|
1745
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
|
|
1780
1746
|
id: (0, import_shared4.randomId)(),
|
|
1781
1747
|
threadId: event.threadId,
|
|
1782
1748
|
agentName: event.agentName,
|