@copilotkit/runtime 1.5.1-next.2 → 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 +8 -0
- package/__snapshots__/schema/schema.graphql +9 -19
- package/dist/{chunk-RFF5IIZJ.mjs → chunk-B74M7FXG.mjs} +2 -3
- package/dist/chunk-B74M7FXG.mjs.map +1 -0
- package/dist/{chunk-2FY7EQEE.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-2ZPE55QG.mjs → chunk-U3AYI5XZ.mjs} +2 -2
- package/dist/{chunk-W6E7AVR7.mjs → chunk-U75F2RAQ.mjs} +2 -2
- package/dist/{chunk-2V7BHSFE.mjs → chunk-ZSWCEADS.mjs} +331 -579
- package/dist/chunk-ZSWCEADS.mjs.map +1 -0
- package/dist/{copilot-runtime-36700e00.d.ts → copilot-runtime-12e7ac40.d.ts} +2 -9
- 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-696b5d29.d.ts → groq-adapter-24abe931.d.ts} +1 -1
- package/dist/{index-cc2b17be.d.ts → index-10b1c870.d.ts} +9 -8
- package/dist/index.d.ts +5 -5
- package/dist/index.js +498 -984
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -15
- package/dist/index.mjs.map +1 -1
- package/dist/{langserve-9125a12e.d.ts → langserve-f021ab9c.d.ts} +14 -54
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +477 -886
- 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 +48 -171
- 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 +48 -171
- 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 +48 -171
- 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 +48 -171
- 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 +2 -2
- package/dist/chunk-2V7BHSFE.mjs.map +0 -1
- package/dist/chunk-CLGKEUOA.mjs.map +0 -1
- package/dist/chunk-RFF5IIZJ.mjs.map +0 -1
- /package/dist/{chunk-2FY7EQEE.mjs.map → chunk-M4QD67S3.mjs.map} +0 -0
- /package/dist/{chunk-2ZPE55QG.mjs.map → chunk-U3AYI5XZ.mjs.map} +0 -0
- /package/dist/{chunk-W6E7AVR7.mjs.map → chunk-U75F2RAQ.mjs.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
copilotRuntimeNodeExpressEndpoint
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import "../../../chunk-
|
|
5
|
-
import "../../../chunk-CLGKEUOA.mjs";
|
|
3
|
+
} from "../../../chunk-U75F2RAQ.mjs";
|
|
4
|
+
import "../../../chunk-ZSWCEADS.mjs";
|
|
6
5
|
import "../../../chunk-U3V2BCGI.mjs";
|
|
7
|
-
import "../../../chunk-
|
|
6
|
+
import "../../../chunk-OKQVDDJ2.mjs";
|
|
7
|
+
import "../../../chunk-B74M7FXG.mjs";
|
|
8
8
|
import "../../../chunk-D2WLFQS6.mjs";
|
|
9
9
|
import "../../../chunk-44O2JGUY.mjs";
|
|
10
10
|
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-12e7ac40.js';
|
|
3
3
|
import '@copilotkit/shared';
|
|
4
|
-
import '../../../langserve-
|
|
5
|
-
import '../../../index-
|
|
4
|
+
import '../../../langserve-f021ab9c.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.
|
|
47
|
+
version: "1.4.1-pre.6",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -130,10 +130,10 @@ module.exports = __toCommonJS(node_http_exports);
|
|
|
130
130
|
var import_graphql_yoga2 = require("graphql-yoga");
|
|
131
131
|
|
|
132
132
|
// src/lib/integrations/shared.ts
|
|
133
|
-
var
|
|
133
|
+
var import_type_graphql16 = require("type-graphql");
|
|
134
134
|
|
|
135
135
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
136
|
-
var
|
|
136
|
+
var import_type_graphql15 = require("type-graphql");
|
|
137
137
|
var import_rxjs3 = require("rxjs");
|
|
138
138
|
|
|
139
139
|
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
@@ -151,6 +151,12 @@ var MessageRole;
|
|
|
151
151
|
MessageRole2["system"] = "system";
|
|
152
152
|
MessageRole2["tool"] = "tool";
|
|
153
153
|
})(MessageRole || (MessageRole = {}));
|
|
154
|
+
var ActionExecutionScope;
|
|
155
|
+
(function(ActionExecutionScope2) {
|
|
156
|
+
ActionExecutionScope2["server"] = "server";
|
|
157
|
+
ActionExecutionScope2["client"] = "client";
|
|
158
|
+
ActionExecutionScope2["passThrough"] = "passThrough";
|
|
159
|
+
})(ActionExecutionScope || (ActionExecutionScope = {}));
|
|
154
160
|
var CopilotRequestType;
|
|
155
161
|
(function(CopilotRequestType2) {
|
|
156
162
|
CopilotRequestType2["Chat"] = "Chat";
|
|
@@ -169,6 +175,10 @@ var ActionInputAvailability;
|
|
|
169
175
|
name: "MessageRole",
|
|
170
176
|
description: "The role of the message"
|
|
171
177
|
});
|
|
178
|
+
(0, import_type_graphql.registerEnumType)(ActionExecutionScope, {
|
|
179
|
+
name: "ActionExecutionScope",
|
|
180
|
+
description: "The scope of the action"
|
|
181
|
+
});
|
|
172
182
|
(0, import_type_graphql.registerEnumType)(CopilotRequestType, {
|
|
173
183
|
name: "CopilotRequestType",
|
|
174
184
|
description: "The type of Copilot request"
|
|
@@ -266,7 +276,6 @@ MessageInput = _ts_decorate2([
|
|
|
266
276
|
], MessageInput);
|
|
267
277
|
var TextMessageInput = class {
|
|
268
278
|
content;
|
|
269
|
-
parentMessageId;
|
|
270
279
|
role;
|
|
271
280
|
};
|
|
272
281
|
__name(TextMessageInput, "TextMessageInput");
|
|
@@ -274,12 +283,6 @@ _ts_decorate2([
|
|
|
274
283
|
(0, import_type_graphql3.Field)(() => String),
|
|
275
284
|
_ts_metadata2("design:type", String)
|
|
276
285
|
], TextMessageInput.prototype, "content", void 0);
|
|
277
|
-
_ts_decorate2([
|
|
278
|
-
(0, import_type_graphql3.Field)(() => String, {
|
|
279
|
-
nullable: true
|
|
280
|
-
}),
|
|
281
|
-
_ts_metadata2("design:type", String)
|
|
282
|
-
], TextMessageInput.prototype, "parentMessageId", void 0);
|
|
283
286
|
_ts_decorate2([
|
|
284
287
|
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
285
288
|
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
@@ -290,7 +293,6 @@ TextMessageInput = _ts_decorate2([
|
|
|
290
293
|
var ActionExecutionMessageInput = class {
|
|
291
294
|
name;
|
|
292
295
|
arguments;
|
|
293
|
-
parentMessageId;
|
|
294
296
|
scope;
|
|
295
297
|
};
|
|
296
298
|
__name(ActionExecutionMessageInput, "ActionExecutionMessageInput");
|
|
@@ -303,17 +305,8 @@ _ts_decorate2([
|
|
|
303
305
|
_ts_metadata2("design:type", String)
|
|
304
306
|
], ActionExecutionMessageInput.prototype, "arguments", void 0);
|
|
305
307
|
_ts_decorate2([
|
|
306
|
-
(0, import_type_graphql3.Field)(() =>
|
|
307
|
-
|
|
308
|
-
}),
|
|
309
|
-
_ts_metadata2("design:type", String)
|
|
310
|
-
], ActionExecutionMessageInput.prototype, "parentMessageId", void 0);
|
|
311
|
-
_ts_decorate2([
|
|
312
|
-
(0, import_type_graphql3.Field)(() => String, {
|
|
313
|
-
nullable: true,
|
|
314
|
-
deprecationReason: "This field will be removed in a future version"
|
|
315
|
-
}),
|
|
316
|
-
_ts_metadata2("design:type", typeof String === "undefined" ? Object : String)
|
|
308
|
+
(0, import_type_graphql3.Field)(() => ActionExecutionScope),
|
|
309
|
+
_ts_metadata2("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
317
310
|
], ActionExecutionMessageInput.prototype, "scope", void 0);
|
|
318
311
|
ActionExecutionMessageInput = _ts_decorate2([
|
|
319
312
|
(0, import_type_graphql3.InputType)()
|
|
@@ -321,7 +314,6 @@ ActionExecutionMessageInput = _ts_decorate2([
|
|
|
321
314
|
var ResultMessageInput = class {
|
|
322
315
|
actionExecutionId;
|
|
323
316
|
actionName;
|
|
324
|
-
parentMessageId;
|
|
325
317
|
result;
|
|
326
318
|
};
|
|
327
319
|
__name(ResultMessageInput, "ResultMessageInput");
|
|
@@ -333,12 +325,6 @@ _ts_decorate2([
|
|
|
333
325
|
(0, import_type_graphql3.Field)(() => String),
|
|
334
326
|
_ts_metadata2("design:type", String)
|
|
335
327
|
], ResultMessageInput.prototype, "actionName", void 0);
|
|
336
|
-
_ts_decorate2([
|
|
337
|
-
(0, import_type_graphql3.Field)(() => String, {
|
|
338
|
-
nullable: true
|
|
339
|
-
}),
|
|
340
|
-
_ts_metadata2("design:type", String)
|
|
341
|
-
], ResultMessageInput.prototype, "parentMessageId", void 0);
|
|
342
328
|
_ts_decorate2([
|
|
343
329
|
(0, import_type_graphql3.Field)(() => String),
|
|
344
330
|
_ts_metadata2("design:type", String)
|
|
@@ -602,7 +588,6 @@ var ForwardedParametersInput = class {
|
|
|
602
588
|
stop;
|
|
603
589
|
toolChoice;
|
|
604
590
|
toolChoiceFunctionName;
|
|
605
|
-
temperature;
|
|
606
591
|
};
|
|
607
592
|
__name(ForwardedParametersInput, "ForwardedParametersInput");
|
|
608
593
|
_ts_decorate7([
|
|
@@ -637,12 +622,6 @@ _ts_decorate7([
|
|
|
637
622
|
}),
|
|
638
623
|
_ts_metadata7("design:type", String)
|
|
639
624
|
], ForwardedParametersInput.prototype, "toolChoiceFunctionName", void 0);
|
|
640
|
-
_ts_decorate7([
|
|
641
|
-
(0, import_type_graphql8.Field)(() => Number, {
|
|
642
|
-
nullable: true
|
|
643
|
-
}),
|
|
644
|
-
_ts_metadata7("design:type", Number)
|
|
645
|
-
], ForwardedParametersInput.prototype, "temperature", void 0);
|
|
646
625
|
ForwardedParametersInput = _ts_decorate7([
|
|
647
626
|
(0, import_type_graphql8.InputType)()
|
|
648
627
|
], ForwardedParametersInput);
|
|
@@ -1068,7 +1047,6 @@ BaseMessageOutput = _ts_decorate13([
|
|
|
1068
1047
|
var TextMessageOutput = class {
|
|
1069
1048
|
role;
|
|
1070
1049
|
content;
|
|
1071
|
-
parentMessageId;
|
|
1072
1050
|
};
|
|
1073
1051
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
1074
1052
|
_ts_decorate13([
|
|
@@ -1081,12 +1059,6 @@ _ts_decorate13([
|
|
|
1081
1059
|
]),
|
|
1082
1060
|
_ts_metadata13("design:type", Array)
|
|
1083
1061
|
], 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
1062
|
TextMessageOutput = _ts_decorate13([
|
|
1091
1063
|
(0, import_type_graphql14.ObjectType)({
|
|
1092
1064
|
implements: BaseMessageOutput
|
|
@@ -1096,7 +1068,6 @@ var ActionExecutionMessageOutput = class {
|
|
|
1096
1068
|
name;
|
|
1097
1069
|
scope;
|
|
1098
1070
|
arguments;
|
|
1099
|
-
parentMessageId;
|
|
1100
1071
|
};
|
|
1101
1072
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1102
1073
|
_ts_decorate13([
|
|
@@ -1104,11 +1075,8 @@ _ts_decorate13([
|
|
|
1104
1075
|
_ts_metadata13("design:type", String)
|
|
1105
1076
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1106
1077
|
_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)
|
|
1078
|
+
(0, import_type_graphql14.Field)(() => ActionExecutionScope),
|
|
1079
|
+
_ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
1112
1080
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
1113
1081
|
_ts_decorate13([
|
|
1114
1082
|
(0, import_type_graphql14.Field)(() => [
|
|
@@ -1116,12 +1084,6 @@ _ts_decorate13([
|
|
|
1116
1084
|
]),
|
|
1117
1085
|
_ts_metadata13("design:type", Array)
|
|
1118
1086
|
], 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
1087
|
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1126
1088
|
(0, import_type_graphql14.ObjectType)({
|
|
1127
1089
|
implements: BaseMessageOutput
|
|
@@ -1273,14 +1235,13 @@ var TextMessage = class extends Message {
|
|
|
1273
1235
|
type = "TextMessage";
|
|
1274
1236
|
content;
|
|
1275
1237
|
role;
|
|
1276
|
-
parentMessageId;
|
|
1277
1238
|
};
|
|
1278
1239
|
__name(TextMessage, "TextMessage");
|
|
1279
1240
|
var ActionExecutionMessage = class extends Message {
|
|
1280
1241
|
type = "ActionExecutionMessage";
|
|
1281
1242
|
name;
|
|
1282
1243
|
arguments;
|
|
1283
|
-
|
|
1244
|
+
scope;
|
|
1284
1245
|
};
|
|
1285
1246
|
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1286
1247
|
var ResultMessage = class extends Message {
|
|
@@ -1364,7 +1325,6 @@ __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
|
1364
1325
|
var telemetry_client_default = telemetryClient;
|
|
1365
1326
|
|
|
1366
1327
|
// src/service-adapters/events.ts
|
|
1367
|
-
var import_class_transformer = require("class-transformer");
|
|
1368
1328
|
var RuntimeEventTypes;
|
|
1369
1329
|
(function(RuntimeEventTypes2) {
|
|
1370
1330
|
RuntimeEventTypes2["TextMessageStart"] = "TextMessageStart";
|
|
@@ -1379,7 +1339,7 @@ var RuntimeEventTypes;
|
|
|
1379
1339
|
|
|
1380
1340
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1381
1341
|
var import_graphql_scalars2 = require("graphql-scalars");
|
|
1382
|
-
var
|
|
1342
|
+
var import_class_transformer = require("class-transformer");
|
|
1383
1343
|
var import_graphql = require("graphql");
|
|
1384
1344
|
|
|
1385
1345
|
// src/utils/failed-response-status-reasons.ts
|
|
@@ -1417,9 +1377,6 @@ __name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
|
1417
1377
|
|
|
1418
1378
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1419
1379
|
var import_shared4 = require("@copilotkit/shared");
|
|
1420
|
-
|
|
1421
|
-
// src/graphql/types/agents-response.type.ts
|
|
1422
|
-
var import_type_graphql15 = require("type-graphql");
|
|
1423
1380
|
function _ts_decorate14(decorators, target, key, desc) {
|
|
1424
1381
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1425
1382
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -1436,58 +1393,6 @@ function _ts_metadata14(k, v) {
|
|
|
1436
1393
|
return Reflect.metadata(k, v);
|
|
1437
1394
|
}
|
|
1438
1395
|
__name(_ts_metadata14, "_ts_metadata");
|
|
1439
|
-
var Agent = class {
|
|
1440
|
-
id;
|
|
1441
|
-
name;
|
|
1442
|
-
description;
|
|
1443
|
-
};
|
|
1444
|
-
__name(Agent, "Agent");
|
|
1445
|
-
_ts_decorate14([
|
|
1446
|
-
(0, import_type_graphql15.Field)(() => String),
|
|
1447
|
-
_ts_metadata14("design:type", String)
|
|
1448
|
-
], Agent.prototype, "id", void 0);
|
|
1449
|
-
_ts_decorate14([
|
|
1450
|
-
(0, import_type_graphql15.Field)(() => String),
|
|
1451
|
-
_ts_metadata14("design:type", String)
|
|
1452
|
-
], Agent.prototype, "name", void 0);
|
|
1453
|
-
_ts_decorate14([
|
|
1454
|
-
(0, import_type_graphql15.Field)(() => String),
|
|
1455
|
-
_ts_metadata14("design:type", String)
|
|
1456
|
-
], Agent.prototype, "description", void 0);
|
|
1457
|
-
Agent = _ts_decorate14([
|
|
1458
|
-
(0, import_type_graphql15.ObjectType)()
|
|
1459
|
-
], Agent);
|
|
1460
|
-
var AgentsResponse = class {
|
|
1461
|
-
agents;
|
|
1462
|
-
};
|
|
1463
|
-
__name(AgentsResponse, "AgentsResponse");
|
|
1464
|
-
_ts_decorate14([
|
|
1465
|
-
(0, import_type_graphql15.Field)(() => [
|
|
1466
|
-
Agent
|
|
1467
|
-
]),
|
|
1468
|
-
_ts_metadata14("design:type", Array)
|
|
1469
|
-
], AgentsResponse.prototype, "agents", void 0);
|
|
1470
|
-
AgentsResponse = _ts_decorate14([
|
|
1471
|
-
(0, import_type_graphql15.ObjectType)()
|
|
1472
|
-
], AgentsResponse);
|
|
1473
|
-
|
|
1474
|
-
// src/graphql/resolvers/copilot.resolver.ts
|
|
1475
|
-
function _ts_decorate15(decorators, target, key, desc) {
|
|
1476
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1477
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1478
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
1479
|
-
else
|
|
1480
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1481
|
-
if (d = decorators[i])
|
|
1482
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1483
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1484
|
-
}
|
|
1485
|
-
__name(_ts_decorate15, "_ts_decorate");
|
|
1486
|
-
function _ts_metadata15(k, v) {
|
|
1487
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1488
|
-
return Reflect.metadata(k, v);
|
|
1489
|
-
}
|
|
1490
|
-
__name(_ts_metadata15, "_ts_metadata");
|
|
1491
1396
|
function _ts_param(paramIndex, decorator) {
|
|
1492
1397
|
return function(target, key) {
|
|
1493
1398
|
decorator(target, key, paramIndex);
|
|
@@ -1529,17 +1434,6 @@ var CopilotResolver = class {
|
|
|
1529
1434
|
async hello() {
|
|
1530
1435
|
return "Hello World";
|
|
1531
1436
|
}
|
|
1532
|
-
async availableAgents(ctx) {
|
|
1533
|
-
let logger2 = ctx.logger.child({
|
|
1534
|
-
component: "CopilotResolver.availableAgents"
|
|
1535
|
-
});
|
|
1536
|
-
logger2.debug("Processing");
|
|
1537
|
-
const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
1538
|
-
logger2.debug("Event source created, creating response");
|
|
1539
|
-
return {
|
|
1540
|
-
agents
|
|
1541
|
-
};
|
|
1542
|
-
}
|
|
1543
1437
|
async generateCopilotResponse(ctx, data, properties) {
|
|
1544
1438
|
var _a, _b, _c;
|
|
1545
1439
|
telemetry_client_default.capture("oss.runtime.copilot_request_created", {
|
|
@@ -1643,7 +1537,7 @@ var CopilotResolver = class {
|
|
|
1643
1537
|
reason: `Interrupted due to Guardrails validation failure. Reason: ${result.reason}`
|
|
1644
1538
|
});
|
|
1645
1539
|
outputMessages = [
|
|
1646
|
-
(0,
|
|
1540
|
+
(0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1647
1541
|
id: (0, import_shared4.randomId)(),
|
|
1648
1542
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1649
1543
|
content: result.reason,
|
|
@@ -1692,15 +1586,12 @@ var CopilotResolver = class {
|
|
|
1692
1586
|
// skip until this message start event
|
|
1693
1587
|
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1694
1588
|
// take until the message end event
|
|
1695
|
-
(0, import_rxjs3.takeWhile)((e) =>
|
|
1696
|
-
// filter out any other message events or message ids
|
|
1697
|
-
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.TextMessageContent && e.messageId == event.messageId)
|
|
1589
|
+
(0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.TextMessageEnd)
|
|
1698
1590
|
);
|
|
1699
1591
|
const streamingTextStatus = new import_rxjs3.Subject();
|
|
1700
1592
|
const messageId = event.messageId;
|
|
1701
1593
|
pushMessage({
|
|
1702
1594
|
id: messageId,
|
|
1703
|
-
parentMessageId: event.parentMessageId,
|
|
1704
1595
|
status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
|
|
1705
1596
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1706
1597
|
role: MessageRole.assistant,
|
|
@@ -1713,7 +1604,7 @@ var CopilotResolver = class {
|
|
|
1713
1604
|
reason,
|
|
1714
1605
|
messageId: messageId2
|
|
1715
1606
|
}, "Text streaming interrupted");
|
|
1716
|
-
streamingTextStatus.next((0,
|
|
1607
|
+
streamingTextStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
|
|
1717
1608
|
reason
|
|
1718
1609
|
}));
|
|
1719
1610
|
responseStatus$.next(new MessageStreamInterruptedResponse({
|
|
@@ -1746,7 +1637,7 @@ var CopilotResolver = class {
|
|
|
1746
1637
|
streamingTextStatus.next(new SuccessMessageStatus());
|
|
1747
1638
|
stopStreamingText();
|
|
1748
1639
|
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
1749
|
-
outputMessages.push((0,
|
|
1640
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1750
1641
|
id: messageId,
|
|
1751
1642
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1752
1643
|
content: textChunks.join(""),
|
|
@@ -1759,20 +1650,14 @@ var CopilotResolver = class {
|
|
|
1759
1650
|
break;
|
|
1760
1651
|
case RuntimeEventTypes.ActionExecutionStart:
|
|
1761
1652
|
logger2.debug("Action execution start event received");
|
|
1762
|
-
const actionExecutionArgumentStream = eventStream.pipe(
|
|
1763
|
-
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1764
|
-
// take until the action execution end event
|
|
1765
|
-
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.ActionExecutionEnd && e.actionExecutionId == event.actionExecutionId)),
|
|
1766
|
-
// filter out any other action execution events or action execution ids
|
|
1767
|
-
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.ActionExecutionArgs && e.actionExecutionId == event.actionExecutionId)
|
|
1768
|
-
);
|
|
1653
|
+
const actionExecutionArgumentStream = eventStream.pipe((0, import_rxjs3.skipWhile)((e) => e !== event), (0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.ActionExecutionEnd));
|
|
1769
1654
|
const streamingArgumentsStatus = new import_rxjs3.Subject();
|
|
1770
1655
|
pushMessage({
|
|
1771
1656
|
id: event.actionExecutionId,
|
|
1772
|
-
parentMessageId: event.parentMessageId,
|
|
1773
1657
|
status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
|
|
1774
1658
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1775
1659
|
name: event.actionName,
|
|
1660
|
+
scope: event.scope,
|
|
1776
1661
|
arguments: new import_graphql_yoga.Repeater(async (pushArgumentsChunk, stopStreamingArguments) => {
|
|
1777
1662
|
logger2.debug("Action execution argument stream created");
|
|
1778
1663
|
const argumentChunks = [];
|
|
@@ -1788,7 +1673,7 @@ var CopilotResolver = class {
|
|
|
1788
1673
|
logger2.error({
|
|
1789
1674
|
err
|
|
1790
1675
|
}, "Error in action execution argument stream");
|
|
1791
|
-
streamingArgumentsStatus.next((0,
|
|
1676
|
+
streamingArgumentsStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
|
|
1792
1677
|
reason: "An unknown error has occurred in the action execution argument stream"
|
|
1793
1678
|
}));
|
|
1794
1679
|
stopStreamingArguments();
|
|
@@ -1799,10 +1684,11 @@ var CopilotResolver = class {
|
|
|
1799
1684
|
streamingArgumentsStatus.next(new SuccessMessageStatus());
|
|
1800
1685
|
stopStreamingArguments();
|
|
1801
1686
|
actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
|
|
1802
|
-
outputMessages.push((0,
|
|
1687
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(ActionExecutionMessage, {
|
|
1803
1688
|
id: event.actionExecutionId,
|
|
1804
1689
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1805
1690
|
name: event.actionName,
|
|
1691
|
+
scope: event.scope,
|
|
1806
1692
|
arguments: argumentChunks.join("")
|
|
1807
1693
|
}));
|
|
1808
1694
|
}
|
|
@@ -1815,15 +1701,15 @@ var CopilotResolver = class {
|
|
|
1815
1701
|
result: event.result
|
|
1816
1702
|
}, "Action execution result event received");
|
|
1817
1703
|
pushMessage({
|
|
1818
|
-
id:
|
|
1704
|
+
id: (0, import_shared4.randomId)(),
|
|
1819
1705
|
status: new SuccessMessageStatus(),
|
|
1820
1706
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1821
1707
|
actionExecutionId: event.actionExecutionId,
|
|
1822
1708
|
actionName: event.actionName,
|
|
1823
1709
|
result: event.result
|
|
1824
1710
|
});
|
|
1825
|
-
outputMessages.push((0,
|
|
1826
|
-
id:
|
|
1711
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(ResultMessage, {
|
|
1712
|
+
id: (0, import_shared4.randomId)(),
|
|
1827
1713
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1828
1714
|
actionExecutionId: event.actionExecutionId,
|
|
1829
1715
|
actionName: event.actionName,
|
|
@@ -1847,7 +1733,7 @@ var CopilotResolver = class {
|
|
|
1847
1733
|
role: MessageRole.assistant,
|
|
1848
1734
|
createdAt: /* @__PURE__ */ new Date()
|
|
1849
1735
|
});
|
|
1850
|
-
outputMessages.push((0,
|
|
1736
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
|
|
1851
1737
|
id: (0, import_shared4.randomId)(),
|
|
1852
1738
|
threadId: event.threadId,
|
|
1853
1739
|
agentName: event.agentName,
|
|
@@ -1892,38 +1778,29 @@ var CopilotResolver = class {
|
|
|
1892
1778
|
}
|
|
1893
1779
|
};
|
|
1894
1780
|
__name(CopilotResolver, "CopilotResolver");
|
|
1895
|
-
|
|
1896
|
-
(0,
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1781
|
+
_ts_decorate14([
|
|
1782
|
+
(0, import_type_graphql15.Query)(() => String),
|
|
1783
|
+
_ts_metadata14("design:type", Function),
|
|
1784
|
+
_ts_metadata14("design:paramtypes", []),
|
|
1785
|
+
_ts_metadata14("design:returntype", Promise)
|
|
1900
1786
|
], CopilotResolver.prototype, "hello", null);
|
|
1901
|
-
|
|
1902
|
-
(0,
|
|
1903
|
-
_ts_param(0, (0,
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
1907
|
-
]),
|
|
1908
|
-
_ts_metadata15("design:returntype", Promise)
|
|
1909
|
-
], CopilotResolver.prototype, "availableAgents", null);
|
|
1910
|
-
_ts_decorate15([
|
|
1911
|
-
(0, import_type_graphql16.Mutation)(() => CopilotResponse),
|
|
1912
|
-
_ts_param(0, (0, import_type_graphql16.Ctx)()),
|
|
1913
|
-
_ts_param(1, (0, import_type_graphql16.Arg)("data")),
|
|
1914
|
-
_ts_param(2, (0, import_type_graphql16.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
1787
|
+
_ts_decorate14([
|
|
1788
|
+
(0, import_type_graphql15.Mutation)(() => CopilotResponse),
|
|
1789
|
+
_ts_param(0, (0, import_type_graphql15.Ctx)()),
|
|
1790
|
+
_ts_param(1, (0, import_type_graphql15.Arg)("data")),
|
|
1791
|
+
_ts_param(2, (0, import_type_graphql15.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
1915
1792
|
nullable: true
|
|
1916
1793
|
})),
|
|
1917
|
-
|
|
1918
|
-
|
|
1794
|
+
_ts_metadata14("design:type", Function),
|
|
1795
|
+
_ts_metadata14("design:paramtypes", [
|
|
1919
1796
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
1920
1797
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
1921
1798
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
1922
1799
|
]),
|
|
1923
|
-
|
|
1800
|
+
_ts_metadata14("design:returntype", Promise)
|
|
1924
1801
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
1925
|
-
CopilotResolver =
|
|
1926
|
-
(0,
|
|
1802
|
+
CopilotResolver = _ts_decorate14([
|
|
1803
|
+
(0, import_type_graphql15.Resolver)(() => CopilotResponse)
|
|
1927
1804
|
], CopilotResolver);
|
|
1928
1805
|
|
|
1929
1806
|
// src/lib/integrations/shared.ts
|
|
@@ -1978,7 +1855,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
1978
1855
|
__name(createContext, "createContext");
|
|
1979
1856
|
function buildSchema(options = {}) {
|
|
1980
1857
|
logger.debug("Building GraphQL schema...");
|
|
1981
|
-
const schema = (0,
|
|
1858
|
+
const schema = (0, import_type_graphql16.buildSchemaSync)({
|
|
1982
1859
|
resolvers: [
|
|
1983
1860
|
CopilotResolver
|
|
1984
1861
|
],
|