@copilotkit/runtime 1.5.1-next.1 → 1.5.1-next.3
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 +17 -0
- package/__snapshots__/schema/schema.graphql +9 -8
- package/dist/{chunk-RFF5IIZJ.mjs → chunk-B74M7FXG.mjs} +2 -3
- package/dist/chunk-B74M7FXG.mjs.map +1 -0
- package/dist/{chunk-L4VT7Z25.mjs → chunk-M4QD67S3.mjs} +2 -2
- package/dist/{chunk-CLGKEUOA.mjs → chunk-OKQVDDJ2.mjs} +63 -298
- package/dist/chunk-OKQVDDJ2.mjs.map +1 -0
- package/dist/{chunk-G2PTXSIW.mjs → chunk-U3AYI5XZ.mjs} +2 -2
- package/dist/{chunk-Z3MD5FQ4.mjs → chunk-U75F2RAQ.mjs} +2 -2
- package/dist/{chunk-6N4ZHRRC.mjs → chunk-ZSWCEADS.mjs} +331 -465
- package/dist/chunk-ZSWCEADS.mjs.map +1 -0
- package/dist/{copilot-runtime-6285d897.d.ts → copilot-runtime-12e7ac40.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-15d41154.d.ts → groq-adapter-24abe931.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 +480 -852
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -15
- package/dist/index.mjs.map +1 -1
- package/dist/{langserve-48e976ac.d.ts → langserve-f021ab9c.d.ts} +14 -54
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +459 -754
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +7 -7
- package/dist/lib/integrations/index.d.ts +4 -4
- package/dist/lib/integrations/index.js +30 -78
- 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 +30 -78
- 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 +30 -78
- 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 +30 -78
- 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 +5 -36
- package/dist/service-adapters/index.js +61 -298
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +1 -5
- package/package.json +4 -4
- package/src/graphql/resolvers/copilot.resolver.ts +16 -0
- package/src/graphql/types/agents-response.type.ts +22 -0
- package/src/lib/runtime/copilot-runtime.ts +50 -0
- package/dist/chunk-6N4ZHRRC.mjs.map +0 -1
- package/dist/chunk-CLGKEUOA.mjs.map +0 -1
- package/dist/chunk-RFF5IIZJ.mjs.map +0 -1
- /package/dist/{chunk-L4VT7Z25.mjs.map → chunk-M4QD67S3.mjs.map} +0 -0
- /package/dist/{chunk-G2PTXSIW.mjs.map → chunk-U3AYI5XZ.mjs.map} +0 -0
- /package/dist/{chunk-Z3MD5FQ4.mjs.map → chunk-U75F2RAQ.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-M4QD67S3.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-U3AYI5XZ.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-U75F2RAQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
buildSchema,
|
|
@@ -20,7 +20,8 @@ import {
|
|
|
20
20
|
getCommonConfig,
|
|
21
21
|
langGraphPlatformEndpoint,
|
|
22
22
|
resolveEndpointType
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-ZSWCEADS.mjs";
|
|
24
|
+
import "../chunk-U3V2BCGI.mjs";
|
|
24
25
|
import {
|
|
25
26
|
GoogleGenerativeAIAdapter,
|
|
26
27
|
GroqAdapter,
|
|
@@ -28,9 +29,8 @@ import {
|
|
|
28
29
|
OpenAIAdapter,
|
|
29
30
|
OpenAIAssistantAdapter,
|
|
30
31
|
UnifyAdapter
|
|
31
|
-
} from "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-RFF5IIZJ.mjs";
|
|
32
|
+
} from "../chunk-OKQVDDJ2.mjs";
|
|
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-12e7ac40.js';
|
|
2
|
+
export { h as CommonConfig, b as CopilotRequestContextProperties, g as buildSchema, e as createContext, i as getCommonConfig } from '../../copilot-runtime-12e7ac40.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-f021ab9c.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.
|
|
47
|
+
version: "1.4.1-pre.6",
|
|
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,7 +595,6 @@ var ForwardedParametersInput = class {
|
|
|
609
595
|
stop;
|
|
610
596
|
toolChoice;
|
|
611
597
|
toolChoiceFunctionName;
|
|
612
|
-
temperature;
|
|
613
598
|
};
|
|
614
599
|
__name(ForwardedParametersInput, "ForwardedParametersInput");
|
|
615
600
|
_ts_decorate7([
|
|
@@ -644,12 +629,6 @@ _ts_decorate7([
|
|
|
644
629
|
}),
|
|
645
630
|
_ts_metadata7("design:type", String)
|
|
646
631
|
], 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);
|
|
653
632
|
ForwardedParametersInput = _ts_decorate7([
|
|
654
633
|
(0, import_type_graphql8.InputType)()
|
|
655
634
|
], ForwardedParametersInput);
|
|
@@ -1075,7 +1054,6 @@ BaseMessageOutput = _ts_decorate13([
|
|
|
1075
1054
|
var TextMessageOutput = class {
|
|
1076
1055
|
role;
|
|
1077
1056
|
content;
|
|
1078
|
-
parentMessageId;
|
|
1079
1057
|
};
|
|
1080
1058
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
1081
1059
|
_ts_decorate13([
|
|
@@ -1088,12 +1066,6 @@ _ts_decorate13([
|
|
|
1088
1066
|
]),
|
|
1089
1067
|
_ts_metadata13("design:type", Array)
|
|
1090
1068
|
], 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);
|
|
1097
1069
|
TextMessageOutput = _ts_decorate13([
|
|
1098
1070
|
(0, import_type_graphql14.ObjectType)({
|
|
1099
1071
|
implements: BaseMessageOutput
|
|
@@ -1103,7 +1075,6 @@ var ActionExecutionMessageOutput = class {
|
|
|
1103
1075
|
name;
|
|
1104
1076
|
scope;
|
|
1105
1077
|
arguments;
|
|
1106
|
-
parentMessageId;
|
|
1107
1078
|
};
|
|
1108
1079
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1109
1080
|
_ts_decorate13([
|
|
@@ -1111,11 +1082,8 @@ _ts_decorate13([
|
|
|
1111
1082
|
_ts_metadata13("design:type", String)
|
|
1112
1083
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1113
1084
|
_ts_decorate13([
|
|
1114
|
-
(0, import_type_graphql14.Field)(() =>
|
|
1115
|
-
|
|
1116
|
-
deprecationReason: "This field will be removed in a future version"
|
|
1117
|
-
}),
|
|
1118
|
-
_ts_metadata13("design:type", String)
|
|
1085
|
+
(0, import_type_graphql14.Field)(() => ActionExecutionScope),
|
|
1086
|
+
_ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
1119
1087
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
1120
1088
|
_ts_decorate13([
|
|
1121
1089
|
(0, import_type_graphql14.Field)(() => [
|
|
@@ -1123,12 +1091,6 @@ _ts_decorate13([
|
|
|
1123
1091
|
]),
|
|
1124
1092
|
_ts_metadata13("design:type", Array)
|
|
1125
1093
|
], 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);
|
|
1132
1094
|
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1133
1095
|
(0, import_type_graphql14.ObjectType)({
|
|
1134
1096
|
implements: BaseMessageOutput
|
|
@@ -1280,14 +1242,13 @@ var TextMessage = class extends Message {
|
|
|
1280
1242
|
type = "TextMessage";
|
|
1281
1243
|
content;
|
|
1282
1244
|
role;
|
|
1283
|
-
parentMessageId;
|
|
1284
1245
|
};
|
|
1285
1246
|
__name(TextMessage, "TextMessage");
|
|
1286
1247
|
var ActionExecutionMessage = class extends Message {
|
|
1287
1248
|
type = "ActionExecutionMessage";
|
|
1288
1249
|
name;
|
|
1289
1250
|
arguments;
|
|
1290
|
-
|
|
1251
|
+
scope;
|
|
1291
1252
|
};
|
|
1292
1253
|
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1293
1254
|
var ResultMessage = class extends Message {
|
|
@@ -1371,7 +1332,6 @@ __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
|
1371
1332
|
var telemetry_client_default = telemetryClient;
|
|
1372
1333
|
|
|
1373
1334
|
// src/service-adapters/events.ts
|
|
1374
|
-
var import_class_transformer = require("class-transformer");
|
|
1375
1335
|
var RuntimeEventTypes;
|
|
1376
1336
|
(function(RuntimeEventTypes2) {
|
|
1377
1337
|
RuntimeEventTypes2["TextMessageStart"] = "TextMessageStart";
|
|
@@ -1386,7 +1346,7 @@ var RuntimeEventTypes;
|
|
|
1386
1346
|
|
|
1387
1347
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1388
1348
|
var import_graphql_scalars2 = require("graphql-scalars");
|
|
1389
|
-
var
|
|
1349
|
+
var import_class_transformer = require("class-transformer");
|
|
1390
1350
|
var import_graphql = require("graphql");
|
|
1391
1351
|
|
|
1392
1352
|
// src/utils/failed-response-status-reasons.ts
|
|
@@ -1584,7 +1544,7 @@ var CopilotResolver = class {
|
|
|
1584
1544
|
reason: `Interrupted due to Guardrails validation failure. Reason: ${result.reason}`
|
|
1585
1545
|
});
|
|
1586
1546
|
outputMessages = [
|
|
1587
|
-
(0,
|
|
1547
|
+
(0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1588
1548
|
id: (0, import_shared4.randomId)(),
|
|
1589
1549
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1590
1550
|
content: result.reason,
|
|
@@ -1633,15 +1593,12 @@ var CopilotResolver = class {
|
|
|
1633
1593
|
// skip until this message start event
|
|
1634
1594
|
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1635
1595
|
// take until the message end event
|
|
1636
|
-
(0, import_rxjs3.takeWhile)((e) =>
|
|
1637
|
-
// filter out any other message events or message ids
|
|
1638
|
-
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.TextMessageContent && e.messageId == event.messageId)
|
|
1596
|
+
(0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.TextMessageEnd)
|
|
1639
1597
|
);
|
|
1640
1598
|
const streamingTextStatus = new import_rxjs3.Subject();
|
|
1641
1599
|
const messageId = event.messageId;
|
|
1642
1600
|
pushMessage({
|
|
1643
1601
|
id: messageId,
|
|
1644
|
-
parentMessageId: event.parentMessageId,
|
|
1645
1602
|
status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
|
|
1646
1603
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1647
1604
|
role: MessageRole.assistant,
|
|
@@ -1654,7 +1611,7 @@ var CopilotResolver = class {
|
|
|
1654
1611
|
reason,
|
|
1655
1612
|
messageId: messageId2
|
|
1656
1613
|
}, "Text streaming interrupted");
|
|
1657
|
-
streamingTextStatus.next((0,
|
|
1614
|
+
streamingTextStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
|
|
1658
1615
|
reason
|
|
1659
1616
|
}));
|
|
1660
1617
|
responseStatus$.next(new MessageStreamInterruptedResponse({
|
|
@@ -1687,7 +1644,7 @@ var CopilotResolver = class {
|
|
|
1687
1644
|
streamingTextStatus.next(new SuccessMessageStatus());
|
|
1688
1645
|
stopStreamingText();
|
|
1689
1646
|
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
1690
|
-
outputMessages.push((0,
|
|
1647
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1691
1648
|
id: messageId,
|
|
1692
1649
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1693
1650
|
content: textChunks.join(""),
|
|
@@ -1700,20 +1657,14 @@ var CopilotResolver = class {
|
|
|
1700
1657
|
break;
|
|
1701
1658
|
case RuntimeEventTypes.ActionExecutionStart:
|
|
1702
1659
|
logger2.debug("Action execution start event received");
|
|
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
|
-
);
|
|
1660
|
+
const actionExecutionArgumentStream = eventStream.pipe((0, import_rxjs3.skipWhile)((e) => e !== event), (0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.ActionExecutionEnd));
|
|
1710
1661
|
const streamingArgumentsStatus = new import_rxjs3.Subject();
|
|
1711
1662
|
pushMessage({
|
|
1712
1663
|
id: event.actionExecutionId,
|
|
1713
|
-
parentMessageId: event.parentMessageId,
|
|
1714
1664
|
status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
|
|
1715
1665
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1716
1666
|
name: event.actionName,
|
|
1667
|
+
scope: event.scope,
|
|
1717
1668
|
arguments: new import_graphql_yoga.Repeater(async (pushArgumentsChunk, stopStreamingArguments) => {
|
|
1718
1669
|
logger2.debug("Action execution argument stream created");
|
|
1719
1670
|
const argumentChunks = [];
|
|
@@ -1729,7 +1680,7 @@ var CopilotResolver = class {
|
|
|
1729
1680
|
logger2.error({
|
|
1730
1681
|
err
|
|
1731
1682
|
}, "Error in action execution argument stream");
|
|
1732
|
-
streamingArgumentsStatus.next((0,
|
|
1683
|
+
streamingArgumentsStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
|
|
1733
1684
|
reason: "An unknown error has occurred in the action execution argument stream"
|
|
1734
1685
|
}));
|
|
1735
1686
|
stopStreamingArguments();
|
|
@@ -1740,10 +1691,11 @@ var CopilotResolver = class {
|
|
|
1740
1691
|
streamingArgumentsStatus.next(new SuccessMessageStatus());
|
|
1741
1692
|
stopStreamingArguments();
|
|
1742
1693
|
actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
|
|
1743
|
-
outputMessages.push((0,
|
|
1694
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(ActionExecutionMessage, {
|
|
1744
1695
|
id: event.actionExecutionId,
|
|
1745
1696
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1746
1697
|
name: event.actionName,
|
|
1698
|
+
scope: event.scope,
|
|
1747
1699
|
arguments: argumentChunks.join("")
|
|
1748
1700
|
}));
|
|
1749
1701
|
}
|
|
@@ -1756,15 +1708,15 @@ var CopilotResolver = class {
|
|
|
1756
1708
|
result: event.result
|
|
1757
1709
|
}, "Action execution result event received");
|
|
1758
1710
|
pushMessage({
|
|
1759
|
-
id:
|
|
1711
|
+
id: (0, import_shared4.randomId)(),
|
|
1760
1712
|
status: new SuccessMessageStatus(),
|
|
1761
1713
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1762
1714
|
actionExecutionId: event.actionExecutionId,
|
|
1763
1715
|
actionName: event.actionName,
|
|
1764
1716
|
result: event.result
|
|
1765
1717
|
});
|
|
1766
|
-
outputMessages.push((0,
|
|
1767
|
-
id:
|
|
1718
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(ResultMessage, {
|
|
1719
|
+
id: (0, import_shared4.randomId)(),
|
|
1768
1720
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1769
1721
|
actionExecutionId: event.actionExecutionId,
|
|
1770
1722
|
actionName: event.actionName,
|
|
@@ -1788,7 +1740,7 @@ var CopilotResolver = class {
|
|
|
1788
1740
|
role: MessageRole.assistant,
|
|
1789
1741
|
createdAt: /* @__PURE__ */ new Date()
|
|
1790
1742
|
});
|
|
1791
|
-
outputMessages.push((0,
|
|
1743
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
|
|
1792
1744
|
id: (0, import_shared4.randomId)(),
|
|
1793
1745
|
threadId: event.threadId,
|
|
1794
1746
|
agentName: event.agentName,
|