@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
|
@@ -2,22 +2,22 @@ import {
|
|
|
2
2
|
config,
|
|
3
3
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
4
4
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-M4QD67S3.mjs";
|
|
6
6
|
import {
|
|
7
7
|
copilotRuntimeNestEndpoint
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-U3AYI5XZ.mjs";
|
|
9
9
|
import {
|
|
10
10
|
copilotRuntimeNodeExpressEndpoint
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-U75F2RAQ.mjs";
|
|
12
12
|
import {
|
|
13
13
|
buildSchema,
|
|
14
14
|
copilotRuntimeNodeHttpEndpoint,
|
|
15
15
|
createContext,
|
|
16
16
|
getCommonConfig
|
|
17
|
-
} from "../../chunk-
|
|
18
|
-
import "../../chunk-CLGKEUOA.mjs";
|
|
17
|
+
} from "../../chunk-ZSWCEADS.mjs";
|
|
19
18
|
import "../../chunk-U3V2BCGI.mjs";
|
|
20
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-OKQVDDJ2.mjs";
|
|
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-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",
|
|
@@ -132,10 +132,10 @@ module.exports = __toCommonJS(nest_exports);
|
|
|
132
132
|
var import_graphql_yoga2 = require("graphql-yoga");
|
|
133
133
|
|
|
134
134
|
// src/lib/integrations/shared.ts
|
|
135
|
-
var
|
|
135
|
+
var import_type_graphql16 = require("type-graphql");
|
|
136
136
|
|
|
137
137
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
138
|
-
var
|
|
138
|
+
var import_type_graphql15 = require("type-graphql");
|
|
139
139
|
var import_rxjs3 = require("rxjs");
|
|
140
140
|
|
|
141
141
|
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
@@ -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,7 +590,6 @@ var ForwardedParametersInput = class {
|
|
|
604
590
|
stop;
|
|
605
591
|
toolChoice;
|
|
606
592
|
toolChoiceFunctionName;
|
|
607
|
-
temperature;
|
|
608
593
|
};
|
|
609
594
|
__name(ForwardedParametersInput, "ForwardedParametersInput");
|
|
610
595
|
_ts_decorate7([
|
|
@@ -639,12 +624,6 @@ _ts_decorate7([
|
|
|
639
624
|
}),
|
|
640
625
|
_ts_metadata7("design:type", String)
|
|
641
626
|
], ForwardedParametersInput.prototype, "toolChoiceFunctionName", void 0);
|
|
642
|
-
_ts_decorate7([
|
|
643
|
-
(0, import_type_graphql8.Field)(() => Number, {
|
|
644
|
-
nullable: true
|
|
645
|
-
}),
|
|
646
|
-
_ts_metadata7("design:type", Number)
|
|
647
|
-
], ForwardedParametersInput.prototype, "temperature", void 0);
|
|
648
627
|
ForwardedParametersInput = _ts_decorate7([
|
|
649
628
|
(0, import_type_graphql8.InputType)()
|
|
650
629
|
], ForwardedParametersInput);
|
|
@@ -1070,7 +1049,6 @@ BaseMessageOutput = _ts_decorate13([
|
|
|
1070
1049
|
var TextMessageOutput = class {
|
|
1071
1050
|
role;
|
|
1072
1051
|
content;
|
|
1073
|
-
parentMessageId;
|
|
1074
1052
|
};
|
|
1075
1053
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
1076
1054
|
_ts_decorate13([
|
|
@@ -1083,12 +1061,6 @@ _ts_decorate13([
|
|
|
1083
1061
|
]),
|
|
1084
1062
|
_ts_metadata13("design:type", Array)
|
|
1085
1063
|
], TextMessageOutput.prototype, "content", void 0);
|
|
1086
|
-
_ts_decorate13([
|
|
1087
|
-
(0, import_type_graphql14.Field)(() => String, {
|
|
1088
|
-
nullable: true
|
|
1089
|
-
}),
|
|
1090
|
-
_ts_metadata13("design:type", String)
|
|
1091
|
-
], TextMessageOutput.prototype, "parentMessageId", void 0);
|
|
1092
1064
|
TextMessageOutput = _ts_decorate13([
|
|
1093
1065
|
(0, import_type_graphql14.ObjectType)({
|
|
1094
1066
|
implements: BaseMessageOutput
|
|
@@ -1098,7 +1070,6 @@ var ActionExecutionMessageOutput = class {
|
|
|
1098
1070
|
name;
|
|
1099
1071
|
scope;
|
|
1100
1072
|
arguments;
|
|
1101
|
-
parentMessageId;
|
|
1102
1073
|
};
|
|
1103
1074
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1104
1075
|
_ts_decorate13([
|
|
@@ -1106,11 +1077,8 @@ _ts_decorate13([
|
|
|
1106
1077
|
_ts_metadata13("design:type", String)
|
|
1107
1078
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1108
1079
|
_ts_decorate13([
|
|
1109
|
-
(0, import_type_graphql14.Field)(() =>
|
|
1110
|
-
|
|
1111
|
-
deprecationReason: "This field will be removed in a future version"
|
|
1112
|
-
}),
|
|
1113
|
-
_ts_metadata13("design:type", String)
|
|
1080
|
+
(0, import_type_graphql14.Field)(() => ActionExecutionScope),
|
|
1081
|
+
_ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
1114
1082
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
1115
1083
|
_ts_decorate13([
|
|
1116
1084
|
(0, import_type_graphql14.Field)(() => [
|
|
@@ -1118,12 +1086,6 @@ _ts_decorate13([
|
|
|
1118
1086
|
]),
|
|
1119
1087
|
_ts_metadata13("design:type", Array)
|
|
1120
1088
|
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
1121
|
-
_ts_decorate13([
|
|
1122
|
-
(0, import_type_graphql14.Field)(() => String, {
|
|
1123
|
-
nullable: true
|
|
1124
|
-
}),
|
|
1125
|
-
_ts_metadata13("design:type", String)
|
|
1126
|
-
], ActionExecutionMessageOutput.prototype, "parentMessageId", void 0);
|
|
1127
1089
|
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1128
1090
|
(0, import_type_graphql14.ObjectType)({
|
|
1129
1091
|
implements: BaseMessageOutput
|
|
@@ -1275,14 +1237,13 @@ var TextMessage = class extends Message {
|
|
|
1275
1237
|
type = "TextMessage";
|
|
1276
1238
|
content;
|
|
1277
1239
|
role;
|
|
1278
|
-
parentMessageId;
|
|
1279
1240
|
};
|
|
1280
1241
|
__name(TextMessage, "TextMessage");
|
|
1281
1242
|
var ActionExecutionMessage = class extends Message {
|
|
1282
1243
|
type = "ActionExecutionMessage";
|
|
1283
1244
|
name;
|
|
1284
1245
|
arguments;
|
|
1285
|
-
|
|
1246
|
+
scope;
|
|
1286
1247
|
};
|
|
1287
1248
|
__name(ActionExecutionMessage, "ActionExecutionMessage");
|
|
1288
1249
|
var ResultMessage = class extends Message {
|
|
@@ -1366,7 +1327,6 @@ __name(getRuntimeInstanceTelemetryInfo, "getRuntimeInstanceTelemetryInfo");
|
|
|
1366
1327
|
var telemetry_client_default = telemetryClient;
|
|
1367
1328
|
|
|
1368
1329
|
// src/service-adapters/events.ts
|
|
1369
|
-
var import_class_transformer = require("class-transformer");
|
|
1370
1330
|
var RuntimeEventTypes;
|
|
1371
1331
|
(function(RuntimeEventTypes2) {
|
|
1372
1332
|
RuntimeEventTypes2["TextMessageStart"] = "TextMessageStart";
|
|
@@ -1381,7 +1341,7 @@ var RuntimeEventTypes;
|
|
|
1381
1341
|
|
|
1382
1342
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1383
1343
|
var import_graphql_scalars2 = require("graphql-scalars");
|
|
1384
|
-
var
|
|
1344
|
+
var import_class_transformer = require("class-transformer");
|
|
1385
1345
|
var import_graphql = require("graphql");
|
|
1386
1346
|
|
|
1387
1347
|
// src/utils/failed-response-status-reasons.ts
|
|
@@ -1419,9 +1379,6 @@ __name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
|
1419
1379
|
|
|
1420
1380
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1421
1381
|
var import_shared4 = require("@copilotkit/shared");
|
|
1422
|
-
|
|
1423
|
-
// src/graphql/types/agents-response.type.ts
|
|
1424
|
-
var import_type_graphql15 = require("type-graphql");
|
|
1425
1382
|
function _ts_decorate14(decorators, target, key, desc) {
|
|
1426
1383
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1427
1384
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -1438,58 +1395,6 @@ function _ts_metadata14(k, v) {
|
|
|
1438
1395
|
return Reflect.metadata(k, v);
|
|
1439
1396
|
}
|
|
1440
1397
|
__name(_ts_metadata14, "_ts_metadata");
|
|
1441
|
-
var Agent = class {
|
|
1442
|
-
id;
|
|
1443
|
-
name;
|
|
1444
|
-
description;
|
|
1445
|
-
};
|
|
1446
|
-
__name(Agent, "Agent");
|
|
1447
|
-
_ts_decorate14([
|
|
1448
|
-
(0, import_type_graphql15.Field)(() => String),
|
|
1449
|
-
_ts_metadata14("design:type", String)
|
|
1450
|
-
], Agent.prototype, "id", void 0);
|
|
1451
|
-
_ts_decorate14([
|
|
1452
|
-
(0, import_type_graphql15.Field)(() => String),
|
|
1453
|
-
_ts_metadata14("design:type", String)
|
|
1454
|
-
], Agent.prototype, "name", void 0);
|
|
1455
|
-
_ts_decorate14([
|
|
1456
|
-
(0, import_type_graphql15.Field)(() => String),
|
|
1457
|
-
_ts_metadata14("design:type", String)
|
|
1458
|
-
], Agent.prototype, "description", void 0);
|
|
1459
|
-
Agent = _ts_decorate14([
|
|
1460
|
-
(0, import_type_graphql15.ObjectType)()
|
|
1461
|
-
], Agent);
|
|
1462
|
-
var AgentsResponse = class {
|
|
1463
|
-
agents;
|
|
1464
|
-
};
|
|
1465
|
-
__name(AgentsResponse, "AgentsResponse");
|
|
1466
|
-
_ts_decorate14([
|
|
1467
|
-
(0, import_type_graphql15.Field)(() => [
|
|
1468
|
-
Agent
|
|
1469
|
-
]),
|
|
1470
|
-
_ts_metadata14("design:type", Array)
|
|
1471
|
-
], AgentsResponse.prototype, "agents", void 0);
|
|
1472
|
-
AgentsResponse = _ts_decorate14([
|
|
1473
|
-
(0, import_type_graphql15.ObjectType)()
|
|
1474
|
-
], AgentsResponse);
|
|
1475
|
-
|
|
1476
|
-
// src/graphql/resolvers/copilot.resolver.ts
|
|
1477
|
-
function _ts_decorate15(decorators, target, key, desc) {
|
|
1478
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1479
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1480
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
1481
|
-
else
|
|
1482
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1483
|
-
if (d = decorators[i])
|
|
1484
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1485
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1486
|
-
}
|
|
1487
|
-
__name(_ts_decorate15, "_ts_decorate");
|
|
1488
|
-
function _ts_metadata15(k, v) {
|
|
1489
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1490
|
-
return Reflect.metadata(k, v);
|
|
1491
|
-
}
|
|
1492
|
-
__name(_ts_metadata15, "_ts_metadata");
|
|
1493
1398
|
function _ts_param(paramIndex, decorator) {
|
|
1494
1399
|
return function(target, key) {
|
|
1495
1400
|
decorator(target, key, paramIndex);
|
|
@@ -1531,17 +1436,6 @@ var CopilotResolver = class {
|
|
|
1531
1436
|
async hello() {
|
|
1532
1437
|
return "Hello World";
|
|
1533
1438
|
}
|
|
1534
|
-
async availableAgents(ctx) {
|
|
1535
|
-
let logger2 = ctx.logger.child({
|
|
1536
|
-
component: "CopilotResolver.availableAgents"
|
|
1537
|
-
});
|
|
1538
|
-
logger2.debug("Processing");
|
|
1539
|
-
const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
1540
|
-
logger2.debug("Event source created, creating response");
|
|
1541
|
-
return {
|
|
1542
|
-
agents
|
|
1543
|
-
};
|
|
1544
|
-
}
|
|
1545
1439
|
async generateCopilotResponse(ctx, data, properties) {
|
|
1546
1440
|
var _a, _b, _c;
|
|
1547
1441
|
telemetry_client_default.capture("oss.runtime.copilot_request_created", {
|
|
@@ -1645,7 +1539,7 @@ var CopilotResolver = class {
|
|
|
1645
1539
|
reason: `Interrupted due to Guardrails validation failure. Reason: ${result.reason}`
|
|
1646
1540
|
});
|
|
1647
1541
|
outputMessages = [
|
|
1648
|
-
(0,
|
|
1542
|
+
(0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1649
1543
|
id: (0, import_shared4.randomId)(),
|
|
1650
1544
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1651
1545
|
content: result.reason,
|
|
@@ -1694,15 +1588,12 @@ var CopilotResolver = class {
|
|
|
1694
1588
|
// skip until this message start event
|
|
1695
1589
|
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1696
1590
|
// take until the message end event
|
|
1697
|
-
(0, import_rxjs3.takeWhile)((e) =>
|
|
1698
|
-
// filter out any other message events or message ids
|
|
1699
|
-
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.TextMessageContent && e.messageId == event.messageId)
|
|
1591
|
+
(0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.TextMessageEnd)
|
|
1700
1592
|
);
|
|
1701
1593
|
const streamingTextStatus = new import_rxjs3.Subject();
|
|
1702
1594
|
const messageId = event.messageId;
|
|
1703
1595
|
pushMessage({
|
|
1704
1596
|
id: messageId,
|
|
1705
|
-
parentMessageId: event.parentMessageId,
|
|
1706
1597
|
status: (0, import_rxjs3.firstValueFrom)(streamingTextStatus),
|
|
1707
1598
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1708
1599
|
role: MessageRole.assistant,
|
|
@@ -1715,7 +1606,7 @@ var CopilotResolver = class {
|
|
|
1715
1606
|
reason,
|
|
1716
1607
|
messageId: messageId2
|
|
1717
1608
|
}, "Text streaming interrupted");
|
|
1718
|
-
streamingTextStatus.next((0,
|
|
1609
|
+
streamingTextStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
|
|
1719
1610
|
reason
|
|
1720
1611
|
}));
|
|
1721
1612
|
responseStatus$.next(new MessageStreamInterruptedResponse({
|
|
@@ -1748,7 +1639,7 @@ var CopilotResolver = class {
|
|
|
1748
1639
|
streamingTextStatus.next(new SuccessMessageStatus());
|
|
1749
1640
|
stopStreamingText();
|
|
1750
1641
|
textSubscription == null ? void 0 : textSubscription.unsubscribe();
|
|
1751
|
-
outputMessages.push((0,
|
|
1642
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(TextMessage, {
|
|
1752
1643
|
id: messageId,
|
|
1753
1644
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1754
1645
|
content: textChunks.join(""),
|
|
@@ -1761,20 +1652,14 @@ var CopilotResolver = class {
|
|
|
1761
1652
|
break;
|
|
1762
1653
|
case RuntimeEventTypes.ActionExecutionStart:
|
|
1763
1654
|
logger2.debug("Action execution start event received");
|
|
1764
|
-
const actionExecutionArgumentStream = eventStream.pipe(
|
|
1765
|
-
(0, import_rxjs3.skipWhile)((e) => e !== event),
|
|
1766
|
-
// take until the action execution end event
|
|
1767
|
-
(0, import_rxjs3.takeWhile)((e) => !(e.type === RuntimeEventTypes.ActionExecutionEnd && e.actionExecutionId == event.actionExecutionId)),
|
|
1768
|
-
// filter out any other action execution events or action execution ids
|
|
1769
|
-
(0, import_rxjs3.filter)((e) => e.type == RuntimeEventTypes.ActionExecutionArgs && e.actionExecutionId == event.actionExecutionId)
|
|
1770
|
-
);
|
|
1655
|
+
const actionExecutionArgumentStream = eventStream.pipe((0, import_rxjs3.skipWhile)((e) => e !== event), (0, import_rxjs3.takeWhile)((e) => e.type != RuntimeEventTypes.ActionExecutionEnd));
|
|
1771
1656
|
const streamingArgumentsStatus = new import_rxjs3.Subject();
|
|
1772
1657
|
pushMessage({
|
|
1773
1658
|
id: event.actionExecutionId,
|
|
1774
|
-
parentMessageId: event.parentMessageId,
|
|
1775
1659
|
status: (0, import_rxjs3.firstValueFrom)(streamingArgumentsStatus),
|
|
1776
1660
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1777
1661
|
name: event.actionName,
|
|
1662
|
+
scope: event.scope,
|
|
1778
1663
|
arguments: new import_graphql_yoga.Repeater(async (pushArgumentsChunk, stopStreamingArguments) => {
|
|
1779
1664
|
logger2.debug("Action execution argument stream created");
|
|
1780
1665
|
const argumentChunks = [];
|
|
@@ -1790,7 +1675,7 @@ var CopilotResolver = class {
|
|
|
1790
1675
|
logger2.error({
|
|
1791
1676
|
err
|
|
1792
1677
|
}, "Error in action execution argument stream");
|
|
1793
|
-
streamingArgumentsStatus.next((0,
|
|
1678
|
+
streamingArgumentsStatus.next((0, import_class_transformer.plainToInstance)(FailedMessageStatus, {
|
|
1794
1679
|
reason: "An unknown error has occurred in the action execution argument stream"
|
|
1795
1680
|
}));
|
|
1796
1681
|
stopStreamingArguments();
|
|
@@ -1801,10 +1686,11 @@ var CopilotResolver = class {
|
|
|
1801
1686
|
streamingArgumentsStatus.next(new SuccessMessageStatus());
|
|
1802
1687
|
stopStreamingArguments();
|
|
1803
1688
|
actionExecutionArgumentSubscription == null ? void 0 : actionExecutionArgumentSubscription.unsubscribe();
|
|
1804
|
-
outputMessages.push((0,
|
|
1689
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(ActionExecutionMessage, {
|
|
1805
1690
|
id: event.actionExecutionId,
|
|
1806
1691
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1807
1692
|
name: event.actionName,
|
|
1693
|
+
scope: event.scope,
|
|
1808
1694
|
arguments: argumentChunks.join("")
|
|
1809
1695
|
}));
|
|
1810
1696
|
}
|
|
@@ -1817,15 +1703,15 @@ var CopilotResolver = class {
|
|
|
1817
1703
|
result: event.result
|
|
1818
1704
|
}, "Action execution result event received");
|
|
1819
1705
|
pushMessage({
|
|
1820
|
-
id:
|
|
1706
|
+
id: (0, import_shared4.randomId)(),
|
|
1821
1707
|
status: new SuccessMessageStatus(),
|
|
1822
1708
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1823
1709
|
actionExecutionId: event.actionExecutionId,
|
|
1824
1710
|
actionName: event.actionName,
|
|
1825
1711
|
result: event.result
|
|
1826
1712
|
});
|
|
1827
|
-
outputMessages.push((0,
|
|
1828
|
-
id:
|
|
1713
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(ResultMessage, {
|
|
1714
|
+
id: (0, import_shared4.randomId)(),
|
|
1829
1715
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1830
1716
|
actionExecutionId: event.actionExecutionId,
|
|
1831
1717
|
actionName: event.actionName,
|
|
@@ -1849,7 +1735,7 @@ var CopilotResolver = class {
|
|
|
1849
1735
|
role: MessageRole.assistant,
|
|
1850
1736
|
createdAt: /* @__PURE__ */ new Date()
|
|
1851
1737
|
});
|
|
1852
|
-
outputMessages.push((0,
|
|
1738
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
|
|
1853
1739
|
id: (0, import_shared4.randomId)(),
|
|
1854
1740
|
threadId: event.threadId,
|
|
1855
1741
|
agentName: event.agentName,
|
|
@@ -1894,38 +1780,29 @@ var CopilotResolver = class {
|
|
|
1894
1780
|
}
|
|
1895
1781
|
};
|
|
1896
1782
|
__name(CopilotResolver, "CopilotResolver");
|
|
1897
|
-
|
|
1898
|
-
(0,
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1783
|
+
_ts_decorate14([
|
|
1784
|
+
(0, import_type_graphql15.Query)(() => String),
|
|
1785
|
+
_ts_metadata14("design:type", Function),
|
|
1786
|
+
_ts_metadata14("design:paramtypes", []),
|
|
1787
|
+
_ts_metadata14("design:returntype", Promise)
|
|
1902
1788
|
], CopilotResolver.prototype, "hello", null);
|
|
1903
|
-
|
|
1904
|
-
(0,
|
|
1905
|
-
_ts_param(0, (0,
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
1909
|
-
]),
|
|
1910
|
-
_ts_metadata15("design:returntype", Promise)
|
|
1911
|
-
], CopilotResolver.prototype, "availableAgents", null);
|
|
1912
|
-
_ts_decorate15([
|
|
1913
|
-
(0, import_type_graphql16.Mutation)(() => CopilotResponse),
|
|
1914
|
-
_ts_param(0, (0, import_type_graphql16.Ctx)()),
|
|
1915
|
-
_ts_param(1, (0, import_type_graphql16.Arg)("data")),
|
|
1916
|
-
_ts_param(2, (0, import_type_graphql16.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
1789
|
+
_ts_decorate14([
|
|
1790
|
+
(0, import_type_graphql15.Mutation)(() => CopilotResponse),
|
|
1791
|
+
_ts_param(0, (0, import_type_graphql15.Ctx)()),
|
|
1792
|
+
_ts_param(1, (0, import_type_graphql15.Arg)("data")),
|
|
1793
|
+
_ts_param(2, (0, import_type_graphql15.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
1917
1794
|
nullable: true
|
|
1918
1795
|
})),
|
|
1919
|
-
|
|
1920
|
-
|
|
1796
|
+
_ts_metadata14("design:type", Function),
|
|
1797
|
+
_ts_metadata14("design:paramtypes", [
|
|
1921
1798
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
1922
1799
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
1923
1800
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
1924
1801
|
]),
|
|
1925
|
-
|
|
1802
|
+
_ts_metadata14("design:returntype", Promise)
|
|
1926
1803
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
1927
|
-
CopilotResolver =
|
|
1928
|
-
(0,
|
|
1804
|
+
CopilotResolver = _ts_decorate14([
|
|
1805
|
+
(0, import_type_graphql15.Resolver)(() => CopilotResponse)
|
|
1929
1806
|
], CopilotResolver);
|
|
1930
1807
|
|
|
1931
1808
|
// src/lib/integrations/shared.ts
|
|
@@ -1980,7 +1857,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
1980
1857
|
__name(createContext, "createContext");
|
|
1981
1858
|
function buildSchema(options = {}) {
|
|
1982
1859
|
logger.debug("Building GraphQL schema...");
|
|
1983
|
-
const schema = (0,
|
|
1860
|
+
const schema = (0, import_type_graphql16.buildSchemaSync)({
|
|
1984
1861
|
resolvers: [
|
|
1985
1862
|
CopilotResolver
|
|
1986
1863
|
],
|