@copilotkit/runtime 1.5.0-tyler-reset-chat.0 → 1.5.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 +141 -3
- package/__snapshots__/schema/schema.graphql +7 -9
- package/dist/{chunk-K67A6XOJ.mjs → chunk-25G6SHWM.mjs} +458 -331
- package/dist/chunk-25G6SHWM.mjs.map +1 -0
- package/dist/{chunk-OKQVDDJ2.mjs → chunk-4AYRDPWK.mjs} +285 -63
- package/dist/chunk-4AYRDPWK.mjs.map +1 -0
- package/dist/{chunk-ZBG4KJW5.mjs → chunk-AFKLCW76.mjs} +2 -2
- package/dist/{chunk-AGSBOD2T.mjs → chunk-D6J2N5ZQ.mjs} +2 -2
- package/dist/{chunk-QNQ6UT3D.mjs → chunk-PIUHAIBR.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-2e46a7b6.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-7bf6824b.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 +832 -480
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -11
- package/dist/index.mjs.map +1 -1
- package/dist/{langserve-f021ab9c.d.ts → langserve-f318db89.d.ts} +53 -14
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +737 -459
- 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 +71 -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 +71 -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 +71 -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 +71 -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 +285 -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/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 +16 -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 +23 -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 +22 -9
- package/src/service-adapters/openai/openai-assistant-adapter.ts +22 -8
- package/src/service-adapters/unify/unify-adapter.ts +28 -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-ZBG4KJW5.mjs.map → chunk-AFKLCW76.mjs.map} +0 -0
- /package/dist/{chunk-AGSBOD2T.mjs.map → chunk-D6J2N5ZQ.mjs.map} +0 -0
- /package/dist/{chunk-QNQ6UT3D.mjs.map → chunk-PIUHAIBR.mjs.map} +0 -0
|
@@ -2,22 +2,22 @@ import {
|
|
|
2
2
|
config,
|
|
3
3
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
4
4
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-AFKLCW76.mjs";
|
|
6
6
|
import {
|
|
7
7
|
copilotRuntimeNestEndpoint
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-PIUHAIBR.mjs";
|
|
9
9
|
import {
|
|
10
10
|
copilotRuntimeNodeExpressEndpoint
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-D6J2N5ZQ.mjs";
|
|
12
12
|
import {
|
|
13
13
|
buildSchema,
|
|
14
14
|
copilotRuntimeNodeHttpEndpoint,
|
|
15
15
|
createContext,
|
|
16
16
|
getCommonConfig
|
|
17
|
-
} from "../../chunk-
|
|
18
|
-
import "../../chunk-OKQVDDJ2.mjs";
|
|
17
|
+
} from "../../chunk-25G6SHWM.mjs";
|
|
19
18
|
import "../../chunk-U3V2BCGI.mjs";
|
|
20
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-4AYRDPWK.mjs";
|
|
20
|
+
import "../../chunk-RFF5IIZJ.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-2e46a7b6.js';
|
|
3
3
|
import '@copilotkit/shared';
|
|
4
|
-
import '../../../langserve-
|
|
5
|
-
import '../../../index-
|
|
4
|
+
import '../../../langserve-f318db89.js';
|
|
5
|
+
import '../../../index-ff3fbc33.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.5.0
|
|
47
|
+
version: "1.5.0",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -153,12 +153,6 @@ 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 = {}));
|
|
162
156
|
var CopilotRequestType;
|
|
163
157
|
(function(CopilotRequestType2) {
|
|
164
158
|
CopilotRequestType2["Chat"] = "Chat";
|
|
@@ -177,10 +171,6 @@ var ActionInputAvailability;
|
|
|
177
171
|
name: "MessageRole",
|
|
178
172
|
description: "The role of the message"
|
|
179
173
|
});
|
|
180
|
-
(0, import_type_graphql.registerEnumType)(ActionExecutionScope, {
|
|
181
|
-
name: "ActionExecutionScope",
|
|
182
|
-
description: "The scope of the action"
|
|
183
|
-
});
|
|
184
174
|
(0, import_type_graphql.registerEnumType)(CopilotRequestType, {
|
|
185
175
|
name: "CopilotRequestType",
|
|
186
176
|
description: "The type of Copilot request"
|
|
@@ -278,6 +268,7 @@ MessageInput = _ts_decorate2([
|
|
|
278
268
|
], MessageInput);
|
|
279
269
|
var TextMessageInput = class {
|
|
280
270
|
content;
|
|
271
|
+
parentMessageId;
|
|
281
272
|
role;
|
|
282
273
|
};
|
|
283
274
|
__name(TextMessageInput, "TextMessageInput");
|
|
@@ -285,6 +276,12 @@ _ts_decorate2([
|
|
|
285
276
|
(0, import_type_graphql3.Field)(() => String),
|
|
286
277
|
_ts_metadata2("design:type", String)
|
|
287
278
|
], 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);
|
|
288
285
|
_ts_decorate2([
|
|
289
286
|
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
290
287
|
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
@@ -295,6 +292,7 @@ TextMessageInput = _ts_decorate2([
|
|
|
295
292
|
var ActionExecutionMessageInput = class {
|
|
296
293
|
name;
|
|
297
294
|
arguments;
|
|
295
|
+
parentMessageId;
|
|
298
296
|
scope;
|
|
299
297
|
};
|
|
300
298
|
__name(ActionExecutionMessageInput, "ActionExecutionMessageInput");
|
|
@@ -307,8 +305,17 @@ _ts_decorate2([
|
|
|
307
305
|
_ts_metadata2("design:type", String)
|
|
308
306
|
], ActionExecutionMessageInput.prototype, "arguments", void 0);
|
|
309
307
|
_ts_decorate2([
|
|
310
|
-
(0, import_type_graphql3.Field)(() =>
|
|
311
|
-
|
|
308
|
+
(0, import_type_graphql3.Field)(() => String, {
|
|
309
|
+
nullable: true
|
|
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)
|
|
312
319
|
], ActionExecutionMessageInput.prototype, "scope", void 0);
|
|
313
320
|
ActionExecutionMessageInput = _ts_decorate2([
|
|
314
321
|
(0, import_type_graphql3.InputType)()
|
|
@@ -316,6 +323,7 @@ ActionExecutionMessageInput = _ts_decorate2([
|
|
|
316
323
|
var ResultMessageInput = class {
|
|
317
324
|
actionExecutionId;
|
|
318
325
|
actionName;
|
|
326
|
+
parentMessageId;
|
|
319
327
|
result;
|
|
320
328
|
};
|
|
321
329
|
__name(ResultMessageInput, "ResultMessageInput");
|
|
@@ -327,6 +335,12 @@ _ts_decorate2([
|
|
|
327
335
|
(0, import_type_graphql3.Field)(() => String),
|
|
328
336
|
_ts_metadata2("design:type", String)
|
|
329
337
|
], 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);
|
|
330
344
|
_ts_decorate2([
|
|
331
345
|
(0, import_type_graphql3.Field)(() => String),
|
|
332
346
|
_ts_metadata2("design:type", String)
|
|
@@ -1049,6 +1063,7 @@ BaseMessageOutput = _ts_decorate13([
|
|
|
1049
1063
|
var TextMessageOutput = class {
|
|
1050
1064
|
role;
|
|
1051
1065
|
content;
|
|
1066
|
+
parentMessageId;
|
|
1052
1067
|
};
|
|
1053
1068
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
1054
1069
|
_ts_decorate13([
|
|
@@ -1061,6 +1076,12 @@ _ts_decorate13([
|
|
|
1061
1076
|
]),
|
|
1062
1077
|
_ts_metadata13("design:type", Array)
|
|
1063
1078
|
], 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);
|
|
1064
1085
|
TextMessageOutput = _ts_decorate13([
|
|
1065
1086
|
(0, import_type_graphql14.ObjectType)({
|
|
1066
1087
|
implements: BaseMessageOutput
|
|
@@ -1070,6 +1091,7 @@ var ActionExecutionMessageOutput = class {
|
|
|
1070
1091
|
name;
|
|
1071
1092
|
scope;
|
|
1072
1093
|
arguments;
|
|
1094
|
+
parentMessageId;
|
|
1073
1095
|
};
|
|
1074
1096
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1075
1097
|
_ts_decorate13([
|
|
@@ -1077,8 +1099,11 @@ _ts_decorate13([
|
|
|
1077
1099
|
_ts_metadata13("design:type", String)
|
|
1078
1100
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1079
1101
|
_ts_decorate13([
|
|
1080
|
-
(0, import_type_graphql14.Field)(() =>
|
|
1081
|
-
|
|
1102
|
+
(0, import_type_graphql14.Field)(() => String, {
|
|
1103
|
+
nullable: true,
|
|
1104
|
+
deprecationReason: "This field will be removed in a future version"
|
|
1105
|
+
}),
|
|
1106
|
+
_ts_metadata13("design:type", String)
|
|
1082
1107
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
1083
1108
|
_ts_decorate13([
|
|
1084
1109
|
(0, import_type_graphql14.Field)(() => [
|
|
@@ -1086,6 +1111,12 @@ _ts_decorate13([
|
|
|
1086
1111
|
]),
|
|
1087
1112
|
_ts_metadata13("design:type", Array)
|
|
1088
1113
|
], 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);
|
|
1089
1120
|
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1090
1121
|
(0, import_type_graphql14.ObjectType)({
|
|
1091
1122
|
implements: BaseMessageOutput
|
|
@@ -1237,13 +1268,14 @@ var TextMessage = class extends Message {
|
|
|
1237
1268
|
type = "TextMessage";
|
|
1238
1269
|
content;
|
|
1239
1270
|
role;
|
|
1271
|
+
parentMessageId;
|
|
1240
1272
|
};
|
|
1241
1273
|
__name(TextMessage, "TextMessage");
|
|
1242
1274
|
var ActionExecutionMessage = class extends Message {
|
|
1243
1275
|
type = "ActionExecutionMessage";
|
|
1244
1276
|
name;
|
|
1245
1277
|
arguments;
|
|
1246
|
-
|
|
1278
|
+
parentMessageId;
|
|
1247
1279
|
};
|
|
1248
1280
|
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1249
1281
|
var ResultMessage = class extends Message {
|
|
@@ -1327,6 +1359,7 @@ __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
|
1327
1359
|
var telemetry_client_default = telemetryClient;
|
|
1328
1360
|
|
|
1329
1361
|
// src/service-adapters/events.ts
|
|
1362
|
+
var import_class_transformer = require("class-transformer");
|
|
1330
1363
|
var RuntimeEventTypes;
|
|
1331
1364
|
(function(RuntimeEventTypes2) {
|
|
1332
1365
|
RuntimeEventTypes2["TextMessageStart"] = "TextMessageStart";
|
|
@@ -1341,7 +1374,7 @@ var RuntimeEventTypes;
|
|
|
1341
1374
|
|
|
1342
1375
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1343
1376
|
var import_graphql_scalars2 = require("graphql-scalars");
|
|
1344
|
-
var
|
|
1377
|
+
var import_class_transformer2 = require("class-transformer");
|
|
1345
1378
|
var import_graphql = require("graphql");
|
|
1346
1379
|
|
|
1347
1380
|
// src/utils/failed-response-status-reasons.ts
|
|
@@ -1539,7 +1572,7 @@ var CopilotResolver = class {
|
|
|
1539
1572
|
reason: `Interrupted due to Guardrails validation failure. Reason: ${result.reason}`
|
|
1540
1573
|
});
|
|
1541
1574
|
outputMessages = [
|
|
1542
|
-
(0,
|
|
1575
|
+
(0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
1543
1576
|
id: (0, import_shared4.randomId)(),
|
|
1544
1577
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1545
1578
|
content: result.reason,
|
|
@@ -1588,12 +1621,15 @@ var CopilotResolver = class {
|
|
|
1588
1621
|
// skip until this message start event
|
|
1589
1622
|
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1590
1623
|
// take until the message end event
|
|
1591
|
-
(0, import_rxjs3.takeWhile)((e) => e.type
|
|
1624
|
+
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.TextMessageEnd && e.messageId == event.messageId)),
|
|
1625
|
+
// filter out any other message events or message ids
|
|
1626
|
+
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.TextMessageContent && e.messageId == event.messageId)
|
|
1592
1627
|
);
|
|
1593
1628
|
const streamingTextStatus = new import_rxjs3.Subject();
|
|
1594
1629
|
const messageId = event.messageId;
|
|
1595
1630
|
pushMessage({
|
|
1596
1631
|
id: messageId,
|
|
1632
|
+
parentMessageId: event.parentMessageId,
|
|
1597
1633
|
status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
|
|
1598
1634
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1599
1635
|
role: MessageRole.assistant,
|
|
@@ -1606,7 +1642,7 @@ var CopilotResolver = class {
|
|
|
1606
1642
|
reason,
|
|
1607
1643
|
messageId: messageId2
|
|
1608
1644
|
}, "Text streaming interrupted");
|
|
1609
|
-
streamingTextStatus.next((0,
|
|
1645
|
+
streamingTextStatus.next((0, import_class_transformer2.plainToInstance)(FailedMessageStatus, {
|
|
1610
1646
|
reason
|
|
1611
1647
|
}));
|
|
1612
1648
|
responseStatus$.next(new MessageStreamInterruptedResponse({
|
|
@@ -1639,7 +1675,7 @@ var CopilotResolver = class {
|
|
|
1639
1675
|
streamingTextStatus.next(new SuccessMessageStatus());
|
|
1640
1676
|
stopStreamingText();
|
|
1641
1677
|
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
1642
|
-
outputMessages.push((0,
|
|
1678
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
1643
1679
|
id: messageId,
|
|
1644
1680
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1645
1681
|
content: textChunks.join(""),
|
|
@@ -1652,14 +1688,20 @@ var CopilotResolver = class {
|
|
|
1652
1688
|
break;
|
|
1653
1689
|
case RuntimeEventTypes.ActionExecutionStart:
|
|
1654
1690
|
logger2.debug("Action execution start event received");
|
|
1655
|
-
const actionExecutionArgumentStream = eventStream.pipe(
|
|
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
|
+
);
|
|
1656
1698
|
const streamingArgumentsStatus = new import_rxjs3.Subject();
|
|
1657
1699
|
pushMessage({
|
|
1658
1700
|
id: event.actionExecutionId,
|
|
1701
|
+
parentMessageId: event.parentMessageId,
|
|
1659
1702
|
status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
|
|
1660
1703
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1661
1704
|
name: event.actionName,
|
|
1662
|
-
scope: event.scope,
|
|
1663
1705
|
arguments: new import_graphql_yoga.Repeater(async (pushArgumentsChunk, stopStreamingArguments) => {
|
|
1664
1706
|
logger2.debug("Action execution argument stream created");
|
|
1665
1707
|
const argumentChunks = [];
|
|
@@ -1675,7 +1717,7 @@ var CopilotResolver = class {
|
|
|
1675
1717
|
logger2.error({
|
|
1676
1718
|
err
|
|
1677
1719
|
}, "Error in action execution argument stream");
|
|
1678
|
-
streamingArgumentsStatus.next((0,
|
|
1720
|
+
streamingArgumentsStatus.next((0, import_class_transformer2.plainToInstance)(FailedMessageStatus, {
|
|
1679
1721
|
reason: "An unknown error has occurred in the action execution argument stream"
|
|
1680
1722
|
}));
|
|
1681
1723
|
stopStreamingArguments();
|
|
@@ -1686,11 +1728,10 @@ var CopilotResolver = class {
|
|
|
1686
1728
|
streamingArgumentsStatus.next(new SuccessMessageStatus());
|
|
1687
1729
|
stopStreamingArguments();
|
|
1688
1730
|
actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
|
|
1689
|
-
outputMessages.push((0,
|
|
1731
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(ActionExecutionMessage, {
|
|
1690
1732
|
id: event.actionExecutionId,
|
|
1691
1733
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1692
1734
|
name: event.actionName,
|
|
1693
|
-
scope: event.scope,
|
|
1694
1735
|
arguments: argumentChunks.join("")
|
|
1695
1736
|
}));
|
|
1696
1737
|
}
|
|
@@ -1703,15 +1744,15 @@ var CopilotResolver = class {
|
|
|
1703
1744
|
result: event.result
|
|
1704
1745
|
}, "Action execution result event received");
|
|
1705
1746
|
pushMessage({
|
|
1706
|
-
id:
|
|
1747
|
+
id: "result-" + event.actionExecutionId,
|
|
1707
1748
|
status: new SuccessMessageStatus(),
|
|
1708
1749
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1709
1750
|
actionExecutionId: event.actionExecutionId,
|
|
1710
1751
|
actionName: event.actionName,
|
|
1711
1752
|
result: event.result
|
|
1712
1753
|
});
|
|
1713
|
-
outputMessages.push((0,
|
|
1714
|
-
id:
|
|
1754
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(ResultMessage, {
|
|
1755
|
+
id: "result-" + event.actionExecutionId,
|
|
1715
1756
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1716
1757
|
actionExecutionId: event.actionExecutionId,
|
|
1717
1758
|
actionName: event.actionName,
|
|
@@ -1735,7 +1776,7 @@ var CopilotResolver = class {
|
|
|
1735
1776
|
role: MessageRole.assistant,
|
|
1736
1777
|
createdAt: /* @__PURE__ */ new Date()
|
|
1737
1778
|
});
|
|
1738
|
-
outputMessages.push((0,
|
|
1779
|
+
outputMessages.push((0, import_class_transformer2.plainToInstance)(AgentStateMessage, {
|
|
1739
1780
|
id: (0, import_shared4.randomId)(),
|
|
1740
1781
|
threadId: event.threadId,
|
|
1741
1782
|
agentName: event.agentName,
|