@copilotkit/runtime 1.1.2 → 1.1.3-feat-runtime-remote-actions.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 +14 -0
- package/README.md +32 -37
- package/__snapshots__/schema/schema.graphql +42 -0
- package/dist/chunk-4WFNRUBE.mjs +260 -0
- package/dist/chunk-4WFNRUBE.mjs.map +1 -0
- package/dist/{chunk-MKV3LEJ6.mjs → chunk-6X5MPWIC.mjs} +795 -159
- package/dist/chunk-6X5MPWIC.mjs.map +1 -0
- package/dist/{chunk-URMISMK2.mjs → chunk-73NMP3DI.mjs} +2 -2
- package/dist/{chunk-CUVWSISN.mjs → chunk-BJ2LVHWA.mjs} +22 -4
- package/dist/chunk-BJ2LVHWA.mjs.map +1 -0
- package/dist/{chunk-74B76SMO.mjs → chunk-HYNSUFUM.mjs} +2 -2
- package/dist/{chunk-6PAC74F2.mjs → chunk-JV3CSVW6.mjs} +2 -2
- package/dist/{chunk-NPCP4YZB.mjs → chunk-OYUVLDJF.mjs} +2 -2
- package/dist/{chunk-GEIBJJQ4.mjs → chunk-TBZGOJJX.mjs} +14 -2
- package/dist/chunk-TBZGOJJX.mjs.map +1 -0
- package/dist/{shared-ec6c7db5.d.ts → copilot-runtime-d427e991.d.ts} +68 -37
- package/dist/graphql/types/converted/index.d.ts +1 -1
- package/dist/graphql/types/converted/index.js +13 -0
- package/dist/graphql/types/converted/index.js.map +1 -1
- package/dist/graphql/types/converted/index.mjs +3 -1
- package/dist/{index-aa091e3c.d.ts → index-0476e4f7.d.ts} +24 -2
- package/dist/{groq-adapter-675b30c6.d.ts → index-079752b9.d.ts} +31 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +1012 -246
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/{langserve-a54438c6.d.ts → langserve-d6073a3b.d.ts} +24 -11
- package/dist/lib/index.d.ts +8 -8
- package/dist/lib/index.js +1012 -246
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +8 -8
- package/dist/lib/integrations/index.d.ts +26 -7
- package/dist/lib/integrations/index.js +446 -183
- 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 +5 -5
- package/dist/lib/integrations/nest/index.js +446 -183
- 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 +5 -5
- package/dist/lib/integrations/node-express/index.js +446 -183
- 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 +5 -5
- package/dist/lib/integrations/node-http/index.js +446 -183
- 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 +3 -3
- package/dist/service-adapters/index.js +19 -1
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +3 -3
- package/dist/utils/index.d.ts +49 -1
- package/package.json +7 -5
- package/src/agents/langgraph/event-source.ts +222 -0
- package/src/agents/langgraph/events.ts +309 -0
- package/src/graphql/inputs/agent-session.input.ts +13 -0
- package/src/graphql/inputs/agent-state.input.ts +10 -0
- package/src/graphql/inputs/frontend.input.ts +3 -0
- package/src/graphql/inputs/generate-copilot-response.input.ts +11 -0
- package/src/graphql/inputs/message.input.ts +30 -0
- package/src/graphql/resolvers/copilot.resolver.ts +57 -12
- package/src/graphql/types/converted/index.ts +15 -0
- package/src/graphql/types/copilot-response.type.ts +29 -0
- package/src/graphql/types/enums.ts +1 -0
- package/src/lib/index.ts +1 -1
- package/src/lib/integrations/shared.ts +1 -1
- package/src/lib/runtime/copilot-runtime.ts +360 -0
- package/src/lib/runtime/remote-actions.ts +241 -0
- package/src/service-adapters/conversion.ts +16 -0
- package/src/service-adapters/events.ts +101 -19
- package/src/service-adapters/groq/groq-adapter.ts +13 -0
- package/src/service-adapters/openai/openai-adapter.ts +13 -0
- package/src/service-adapters/openai/openai-assistant-adapter.ts +14 -0
- package/dist/chunk-CUVWSISN.mjs.map +0 -1
- package/dist/chunk-GEIBJJQ4.mjs.map +0 -1
- package/dist/chunk-MKV3LEJ6.mjs.map +0 -1
- package/dist/chunk-RDEOIOQR.mjs +0 -155
- package/dist/chunk-RDEOIOQR.mjs.map +0 -1
- package/dist/failed-response-status-reasons-0ab19e06.d.ts +0 -49
- package/dist/pages-router-df82c666.d.ts +0 -21
- package/src/lib/copilot-runtime.ts +0 -225
- /package/dist/{chunk-URMISMK2.mjs.map → chunk-73NMP3DI.mjs.map} +0 -0
- /package/dist/{chunk-74B76SMO.mjs.map → chunk-HYNSUFUM.mjs.map} +0 -0
- /package/dist/{chunk-6PAC74F2.mjs.map → chunk-JV3CSVW6.mjs.map} +0 -0
- /package/dist/{chunk-NPCP4YZB.mjs.map → chunk-OYUVLDJF.mjs.map} +0 -0
|
@@ -12,11 +12,11 @@ var __export = (target, all) => {
|
|
|
12
12
|
for (var name in all)
|
|
13
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
14
|
};
|
|
15
|
-
var __copyProps = (to,
|
|
16
|
-
if (
|
|
17
|
-
for (let key of __getOwnPropNames(
|
|
15
|
+
var __copyProps = (to, from2, except, desc) => {
|
|
16
|
+
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from2))
|
|
18
18
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
-
__defProp(to, key, { get: () =>
|
|
19
|
+
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
|
|
20
20
|
}
|
|
21
21
|
return to;
|
|
22
22
|
};
|
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.1.
|
|
47
|
+
version: "1.1.3-feat-runtime-remote-actions.0",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -59,7 +59,9 @@ var require_package = __commonJS({
|
|
|
59
59
|
test: "jest --passWithNoTests",
|
|
60
60
|
"check-types": "tsc --noEmit",
|
|
61
61
|
clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist && rm -rf .next && rm -rf __snapshots__",
|
|
62
|
-
"generate-graphql-schema": "rm -rf __snapshots__ && ts-node ./scripts/generate-gql-schema.ts"
|
|
62
|
+
"generate-graphql-schema": "rm -rf __snapshots__ && ts-node ./scripts/generate-gql-schema.ts",
|
|
63
|
+
"link:global": "pnpm link --global",
|
|
64
|
+
"unlink:global": "pnpm unlink --global"
|
|
63
65
|
},
|
|
64
66
|
devDependencies: {
|
|
65
67
|
"@swc/core": "1.5.28",
|
|
@@ -131,14 +133,14 @@ __export(integrations_exports, {
|
|
|
131
133
|
module.exports = __toCommonJS(integrations_exports);
|
|
132
134
|
|
|
133
135
|
// src/lib/integrations/shared.ts
|
|
134
|
-
var
|
|
136
|
+
var import_type_graphql16 = require("type-graphql");
|
|
135
137
|
|
|
136
138
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
137
|
-
var
|
|
139
|
+
var import_type_graphql15 = require("type-graphql");
|
|
138
140
|
var import_rxjs2 = require("rxjs");
|
|
139
141
|
|
|
140
142
|
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
141
|
-
var
|
|
143
|
+
var import_type_graphql11 = require("type-graphql");
|
|
142
144
|
|
|
143
145
|
// src/graphql/inputs/message.input.ts
|
|
144
146
|
var import_type_graphql3 = require("type-graphql");
|
|
@@ -155,6 +157,7 @@ var ActionExecutionScope;
|
|
|
155
157
|
(function(ActionExecutionScope2) {
|
|
156
158
|
ActionExecutionScope2["server"] = "server";
|
|
157
159
|
ActionExecutionScope2["client"] = "client";
|
|
160
|
+
ActionExecutionScope2["passThrough"] = "passThrough";
|
|
158
161
|
})(ActionExecutionScope || (ActionExecutionScope = {}));
|
|
159
162
|
var CopilotRequestType;
|
|
160
163
|
(function(CopilotRequestType2) {
|
|
@@ -233,6 +236,7 @@ var MessageInput = class extends BaseMessage {
|
|
|
233
236
|
textMessage;
|
|
234
237
|
actionExecutionMessage;
|
|
235
238
|
resultMessage;
|
|
239
|
+
agentStateMessage;
|
|
236
240
|
};
|
|
237
241
|
__name(MessageInput, "MessageInput");
|
|
238
242
|
_ts_decorate2([
|
|
@@ -253,6 +257,12 @@ _ts_decorate2([
|
|
|
253
257
|
}),
|
|
254
258
|
_ts_metadata2("design:type", typeof ResultMessageInput === "undefined" ? Object : ResultMessageInput)
|
|
255
259
|
], MessageInput.prototype, "resultMessage", void 0);
|
|
260
|
+
_ts_decorate2([
|
|
261
|
+
(0, import_type_graphql3.Field)(() => AgentStateMessageInput, {
|
|
262
|
+
nullable: true
|
|
263
|
+
}),
|
|
264
|
+
_ts_metadata2("design:type", typeof AgentStateMessageInput === "undefined" ? Object : AgentStateMessageInput)
|
|
265
|
+
], MessageInput.prototype, "agentStateMessage", void 0);
|
|
256
266
|
MessageInput = _ts_decorate2([
|
|
257
267
|
(0, import_type_graphql3.InputType)()
|
|
258
268
|
], MessageInput);
|
|
@@ -314,6 +324,52 @@ _ts_decorate2([
|
|
|
314
324
|
ResultMessageInput = _ts_decorate2([
|
|
315
325
|
(0, import_type_graphql3.InputType)()
|
|
316
326
|
], ResultMessageInput);
|
|
327
|
+
var AgentStateMessageInput = class {
|
|
328
|
+
threadId;
|
|
329
|
+
agentName;
|
|
330
|
+
role;
|
|
331
|
+
state;
|
|
332
|
+
running;
|
|
333
|
+
nodeName;
|
|
334
|
+
runId;
|
|
335
|
+
active;
|
|
336
|
+
};
|
|
337
|
+
__name(AgentStateMessageInput, "AgentStateMessageInput");
|
|
338
|
+
_ts_decorate2([
|
|
339
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
340
|
+
_ts_metadata2("design:type", String)
|
|
341
|
+
], AgentStateMessageInput.prototype, "threadId", void 0);
|
|
342
|
+
_ts_decorate2([
|
|
343
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
344
|
+
_ts_metadata2("design:type", String)
|
|
345
|
+
], AgentStateMessageInput.prototype, "agentName", void 0);
|
|
346
|
+
_ts_decorate2([
|
|
347
|
+
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
348
|
+
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
349
|
+
], AgentStateMessageInput.prototype, "role", void 0);
|
|
350
|
+
_ts_decorate2([
|
|
351
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
352
|
+
_ts_metadata2("design:type", String)
|
|
353
|
+
], AgentStateMessageInput.prototype, "state", void 0);
|
|
354
|
+
_ts_decorate2([
|
|
355
|
+
(0, import_type_graphql3.Field)(() => Boolean),
|
|
356
|
+
_ts_metadata2("design:type", Boolean)
|
|
357
|
+
], AgentStateMessageInput.prototype, "running", void 0);
|
|
358
|
+
_ts_decorate2([
|
|
359
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
360
|
+
_ts_metadata2("design:type", String)
|
|
361
|
+
], AgentStateMessageInput.prototype, "nodeName", void 0);
|
|
362
|
+
_ts_decorate2([
|
|
363
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
364
|
+
_ts_metadata2("design:type", String)
|
|
365
|
+
], AgentStateMessageInput.prototype, "runId", void 0);
|
|
366
|
+
_ts_decorate2([
|
|
367
|
+
(0, import_type_graphql3.Field)(() => Boolean),
|
|
368
|
+
_ts_metadata2("design:type", Boolean)
|
|
369
|
+
], AgentStateMessageInput.prototype, "active", void 0);
|
|
370
|
+
AgentStateMessageInput = _ts_decorate2([
|
|
371
|
+
(0, import_type_graphql3.InputType)()
|
|
372
|
+
], AgentStateMessageInput);
|
|
317
373
|
|
|
318
374
|
// src/graphql/inputs/frontend.input.ts
|
|
319
375
|
var import_type_graphql5 = require("type-graphql");
|
|
@@ -378,6 +434,7 @@ __name(_ts_metadata4, "_ts_metadata");
|
|
|
378
434
|
var FrontendInput = class {
|
|
379
435
|
toDeprecate_fullContext;
|
|
380
436
|
actions;
|
|
437
|
+
url;
|
|
381
438
|
};
|
|
382
439
|
__name(FrontendInput, "FrontendInput");
|
|
383
440
|
_ts_decorate4([
|
|
@@ -392,6 +449,12 @@ _ts_decorate4([
|
|
|
392
449
|
]),
|
|
393
450
|
_ts_metadata4("design:type", Array)
|
|
394
451
|
], FrontendInput.prototype, "actions", void 0);
|
|
452
|
+
_ts_decorate4([
|
|
453
|
+
(0, import_type_graphql5.Field)(() => String, {
|
|
454
|
+
nullable: true
|
|
455
|
+
}),
|
|
456
|
+
_ts_metadata4("design:type", String)
|
|
457
|
+
], FrontendInput.prototype, "url", void 0);
|
|
395
458
|
FrontendInput = _ts_decorate4([
|
|
396
459
|
(0, import_type_graphql5.InputType)()
|
|
397
460
|
], FrontendInput);
|
|
@@ -548,7 +611,8 @@ ForwardedParametersInput = _ts_decorate7([
|
|
|
548
611
|
(0, import_type_graphql8.InputType)()
|
|
549
612
|
], ForwardedParametersInput);
|
|
550
613
|
|
|
551
|
-
// src/graphql/inputs/
|
|
614
|
+
// src/graphql/inputs/agent-session.input.ts
|
|
615
|
+
var import_type_graphql9 = require("type-graphql");
|
|
552
616
|
function _ts_decorate8(decorators, target, key, desc) {
|
|
553
617
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
554
618
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -565,18 +629,96 @@ function _ts_metadata8(k, v) {
|
|
|
565
629
|
return Reflect.metadata(k, v);
|
|
566
630
|
}
|
|
567
631
|
__name(_ts_metadata8, "_ts_metadata");
|
|
632
|
+
var AgentSessionInput = class {
|
|
633
|
+
agentName;
|
|
634
|
+
threadId;
|
|
635
|
+
nodeName;
|
|
636
|
+
};
|
|
637
|
+
__name(AgentSessionInput, "AgentSessionInput");
|
|
638
|
+
_ts_decorate8([
|
|
639
|
+
(0, import_type_graphql9.Field)(() => String),
|
|
640
|
+
_ts_metadata8("design:type", String)
|
|
641
|
+
], AgentSessionInput.prototype, "agentName", void 0);
|
|
642
|
+
_ts_decorate8([
|
|
643
|
+
(0, import_type_graphql9.Field)(() => String, {
|
|
644
|
+
nullable: true
|
|
645
|
+
}),
|
|
646
|
+
_ts_metadata8("design:type", String)
|
|
647
|
+
], AgentSessionInput.prototype, "threadId", void 0);
|
|
648
|
+
_ts_decorate8([
|
|
649
|
+
(0, import_type_graphql9.Field)(() => String, {
|
|
650
|
+
nullable: true
|
|
651
|
+
}),
|
|
652
|
+
_ts_metadata8("design:type", String)
|
|
653
|
+
], AgentSessionInput.prototype, "nodeName", void 0);
|
|
654
|
+
AgentSessionInput = _ts_decorate8([
|
|
655
|
+
(0, import_type_graphql9.InputType)()
|
|
656
|
+
], AgentSessionInput);
|
|
657
|
+
|
|
658
|
+
// src/graphql/inputs/agent-state.input.ts
|
|
659
|
+
var import_type_graphql10 = require("type-graphql");
|
|
660
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
661
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
662
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
663
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
664
|
+
else
|
|
665
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
666
|
+
if (d = decorators[i])
|
|
667
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
668
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
669
|
+
}
|
|
670
|
+
__name(_ts_decorate9, "_ts_decorate");
|
|
671
|
+
function _ts_metadata9(k, v) {
|
|
672
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
673
|
+
return Reflect.metadata(k, v);
|
|
674
|
+
}
|
|
675
|
+
__name(_ts_metadata9, "_ts_metadata");
|
|
676
|
+
var AgentStateInput = class {
|
|
677
|
+
agentName;
|
|
678
|
+
state;
|
|
679
|
+
};
|
|
680
|
+
__name(AgentStateInput, "AgentStateInput");
|
|
681
|
+
_ts_decorate9([
|
|
682
|
+
(0, import_type_graphql10.Field)(() => String),
|
|
683
|
+
_ts_metadata9("design:type", String)
|
|
684
|
+
], AgentStateInput.prototype, "agentName", void 0);
|
|
685
|
+
_ts_decorate9([
|
|
686
|
+
(0, import_type_graphql10.Field)(() => String),
|
|
687
|
+
_ts_metadata9("design:type", String)
|
|
688
|
+
], AgentStateInput.prototype, "state", void 0);
|
|
689
|
+
AgentStateInput = _ts_decorate9([
|
|
690
|
+
(0, import_type_graphql10.InputType)()
|
|
691
|
+
], AgentStateInput);
|
|
692
|
+
|
|
693
|
+
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
694
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
695
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
696
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
697
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
698
|
+
else
|
|
699
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
700
|
+
if (d = decorators[i])
|
|
701
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
702
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
703
|
+
}
|
|
704
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
705
|
+
function _ts_metadata10(k, v) {
|
|
706
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
707
|
+
return Reflect.metadata(k, v);
|
|
708
|
+
}
|
|
709
|
+
__name(_ts_metadata10, "_ts_metadata");
|
|
568
710
|
var GenerateCopilotResponseMetadataInput = class {
|
|
569
711
|
requestType;
|
|
570
712
|
};
|
|
571
713
|
__name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
|
|
572
|
-
|
|
573
|
-
(0,
|
|
714
|
+
_ts_decorate10([
|
|
715
|
+
(0, import_type_graphql11.Field)(() => CopilotRequestType, {
|
|
574
716
|
nullable: true
|
|
575
717
|
}),
|
|
576
|
-
|
|
718
|
+
_ts_metadata10("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
|
|
577
719
|
], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
|
|
578
|
-
GenerateCopilotResponseMetadataInput =
|
|
579
|
-
(0,
|
|
720
|
+
GenerateCopilotResponseMetadataInput = _ts_decorate10([
|
|
721
|
+
(0, import_type_graphql11.InputType)()
|
|
580
722
|
], GenerateCopilotResponseMetadataInput);
|
|
581
723
|
var GenerateCopilotResponseInput = class {
|
|
582
724
|
metadata;
|
|
@@ -586,58 +728,81 @@ var GenerateCopilotResponseInput = class {
|
|
|
586
728
|
frontend;
|
|
587
729
|
cloud;
|
|
588
730
|
forwardedParameters;
|
|
731
|
+
agentSession;
|
|
732
|
+
agentState;
|
|
733
|
+
agentStates;
|
|
589
734
|
};
|
|
590
735
|
__name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
|
|
591
|
-
|
|
592
|
-
(0,
|
|
736
|
+
_ts_decorate10([
|
|
737
|
+
(0, import_type_graphql11.Field)(() => GenerateCopilotResponseMetadataInput, {
|
|
593
738
|
nullable: false
|
|
594
739
|
}),
|
|
595
|
-
|
|
740
|
+
_ts_metadata10("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
|
|
596
741
|
], GenerateCopilotResponseInput.prototype, "metadata", void 0);
|
|
597
|
-
|
|
598
|
-
(0,
|
|
742
|
+
_ts_decorate10([
|
|
743
|
+
(0, import_type_graphql11.Field)(() => String, {
|
|
599
744
|
nullable: true
|
|
600
745
|
}),
|
|
601
|
-
|
|
746
|
+
_ts_metadata10("design:type", String)
|
|
602
747
|
], GenerateCopilotResponseInput.prototype, "threadId", void 0);
|
|
603
|
-
|
|
604
|
-
(0,
|
|
748
|
+
_ts_decorate10([
|
|
749
|
+
(0, import_type_graphql11.Field)(() => String, {
|
|
605
750
|
nullable: true
|
|
606
751
|
}),
|
|
607
|
-
|
|
752
|
+
_ts_metadata10("design:type", String)
|
|
608
753
|
], GenerateCopilotResponseInput.prototype, "runId", void 0);
|
|
609
|
-
|
|
610
|
-
(0,
|
|
754
|
+
_ts_decorate10([
|
|
755
|
+
(0, import_type_graphql11.Field)(() => [
|
|
611
756
|
MessageInput
|
|
612
757
|
]),
|
|
613
|
-
|
|
758
|
+
_ts_metadata10("design:type", Array)
|
|
614
759
|
], GenerateCopilotResponseInput.prototype, "messages", void 0);
|
|
615
|
-
|
|
616
|
-
(0,
|
|
617
|
-
|
|
760
|
+
_ts_decorate10([
|
|
761
|
+
(0, import_type_graphql11.Field)(() => FrontendInput),
|
|
762
|
+
_ts_metadata10("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
|
|
618
763
|
], GenerateCopilotResponseInput.prototype, "frontend", void 0);
|
|
619
|
-
|
|
620
|
-
(0,
|
|
764
|
+
_ts_decorate10([
|
|
765
|
+
(0, import_type_graphql11.Field)(() => CloudInput, {
|
|
621
766
|
nullable: true
|
|
622
767
|
}),
|
|
623
|
-
|
|
768
|
+
_ts_metadata10("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
|
|
624
769
|
], GenerateCopilotResponseInput.prototype, "cloud", void 0);
|
|
625
|
-
|
|
626
|
-
(0,
|
|
770
|
+
_ts_decorate10([
|
|
771
|
+
(0, import_type_graphql11.Field)(() => ForwardedParametersInput, {
|
|
627
772
|
nullable: true
|
|
628
773
|
}),
|
|
629
|
-
|
|
774
|
+
_ts_metadata10("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
|
|
630
775
|
], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
|
|
631
|
-
|
|
632
|
-
(0,
|
|
776
|
+
_ts_decorate10([
|
|
777
|
+
(0, import_type_graphql11.Field)(() => AgentSessionInput, {
|
|
778
|
+
nullable: true
|
|
779
|
+
}),
|
|
780
|
+
_ts_metadata10("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
|
|
781
|
+
], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
|
|
782
|
+
_ts_decorate10([
|
|
783
|
+
(0, import_type_graphql11.Field)(() => AgentStateInput, {
|
|
784
|
+
nullable: true
|
|
785
|
+
}),
|
|
786
|
+
_ts_metadata10("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
|
|
787
|
+
], GenerateCopilotResponseInput.prototype, "agentState", void 0);
|
|
788
|
+
_ts_decorate10([
|
|
789
|
+
(0, import_type_graphql11.Field)(() => [
|
|
790
|
+
AgentStateInput
|
|
791
|
+
], {
|
|
792
|
+
nullable: true
|
|
793
|
+
}),
|
|
794
|
+
_ts_metadata10("design:type", Array)
|
|
795
|
+
], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
|
|
796
|
+
GenerateCopilotResponseInput = _ts_decorate10([
|
|
797
|
+
(0, import_type_graphql11.InputType)()
|
|
633
798
|
], GenerateCopilotResponseInput);
|
|
634
799
|
|
|
635
800
|
// src/graphql/types/copilot-response.type.ts
|
|
636
|
-
var
|
|
801
|
+
var import_type_graphql14 = require("type-graphql");
|
|
637
802
|
|
|
638
803
|
// src/graphql/types/message-status.type.ts
|
|
639
|
-
var
|
|
640
|
-
function
|
|
804
|
+
var import_type_graphql12 = require("type-graphql");
|
|
805
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
641
806
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
642
807
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
643
808
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -647,58 +812,58 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
647
812
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
648
813
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
649
814
|
}
|
|
650
|
-
__name(
|
|
651
|
-
function
|
|
815
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
816
|
+
function _ts_metadata11(k, v) {
|
|
652
817
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
653
818
|
return Reflect.metadata(k, v);
|
|
654
819
|
}
|
|
655
|
-
__name(
|
|
820
|
+
__name(_ts_metadata11, "_ts_metadata");
|
|
656
821
|
var MessageStatusCode;
|
|
657
822
|
(function(MessageStatusCode2) {
|
|
658
823
|
MessageStatusCode2["Pending"] = "pending";
|
|
659
824
|
MessageStatusCode2["Success"] = "success";
|
|
660
825
|
MessageStatusCode2["Failed"] = "failed";
|
|
661
826
|
})(MessageStatusCode || (MessageStatusCode = {}));
|
|
662
|
-
(0,
|
|
827
|
+
(0, import_type_graphql12.registerEnumType)(MessageStatusCode, {
|
|
663
828
|
name: "MessageStatusCode"
|
|
664
829
|
});
|
|
665
830
|
var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
|
|
666
831
|
code;
|
|
667
832
|
}, "BaseMessageStatus");
|
|
668
|
-
|
|
669
|
-
(0,
|
|
670
|
-
|
|
833
|
+
_ts_decorate11([
|
|
834
|
+
(0, import_type_graphql12.Field)(() => MessageStatusCode),
|
|
835
|
+
_ts_metadata11("design:type", String)
|
|
671
836
|
], BaseMessageStatus.prototype, "code", void 0);
|
|
672
|
-
BaseMessageStatus =
|
|
673
|
-
(0,
|
|
837
|
+
BaseMessageStatus = _ts_decorate11([
|
|
838
|
+
(0, import_type_graphql12.ObjectType)()
|
|
674
839
|
], BaseMessageStatus);
|
|
675
840
|
var PendingMessageStatus = class extends BaseMessageStatus {
|
|
676
841
|
code = "pending";
|
|
677
842
|
};
|
|
678
843
|
__name(PendingMessageStatus, "PendingMessageStatus");
|
|
679
|
-
PendingMessageStatus =
|
|
680
|
-
(0,
|
|
844
|
+
PendingMessageStatus = _ts_decorate11([
|
|
845
|
+
(0, import_type_graphql12.ObjectType)()
|
|
681
846
|
], PendingMessageStatus);
|
|
682
847
|
var SuccessMessageStatus = class extends BaseMessageStatus {
|
|
683
848
|
code = "success";
|
|
684
849
|
};
|
|
685
850
|
__name(SuccessMessageStatus, "SuccessMessageStatus");
|
|
686
|
-
SuccessMessageStatus =
|
|
687
|
-
(0,
|
|
851
|
+
SuccessMessageStatus = _ts_decorate11([
|
|
852
|
+
(0, import_type_graphql12.ObjectType)()
|
|
688
853
|
], SuccessMessageStatus);
|
|
689
854
|
var FailedMessageStatus = class extends BaseMessageStatus {
|
|
690
855
|
code = "failed";
|
|
691
856
|
reason;
|
|
692
857
|
};
|
|
693
858
|
__name(FailedMessageStatus, "FailedMessageStatus");
|
|
694
|
-
|
|
695
|
-
(0,
|
|
696
|
-
|
|
859
|
+
_ts_decorate11([
|
|
860
|
+
(0, import_type_graphql12.Field)(() => String),
|
|
861
|
+
_ts_metadata11("design:type", String)
|
|
697
862
|
], FailedMessageStatus.prototype, "reason", void 0);
|
|
698
|
-
FailedMessageStatus =
|
|
699
|
-
(0,
|
|
863
|
+
FailedMessageStatus = _ts_decorate11([
|
|
864
|
+
(0, import_type_graphql12.ObjectType)()
|
|
700
865
|
], FailedMessageStatus);
|
|
701
|
-
var MessageStatusUnion = (0,
|
|
866
|
+
var MessageStatusUnion = (0, import_type_graphql12.createUnionType)({
|
|
702
867
|
name: "MessageStatus",
|
|
703
868
|
types: () => [
|
|
704
869
|
PendingMessageStatus,
|
|
@@ -709,8 +874,8 @@ var MessageStatusUnion = (0, import_type_graphql10.createUnionType)({
|
|
|
709
874
|
|
|
710
875
|
// src/graphql/types/response-status.type.ts
|
|
711
876
|
var import_graphql_scalars = require("graphql-scalars");
|
|
712
|
-
var
|
|
713
|
-
function
|
|
877
|
+
var import_type_graphql13 = require("type-graphql");
|
|
878
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
714
879
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
715
880
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
716
881
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -720,30 +885,30 @@ function _ts_decorate10(decorators, target, key, desc) {
|
|
|
720
885
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
721
886
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
722
887
|
}
|
|
723
|
-
__name(
|
|
724
|
-
function
|
|
888
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
889
|
+
function _ts_metadata12(k, v) {
|
|
725
890
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
726
891
|
return Reflect.metadata(k, v);
|
|
727
892
|
}
|
|
728
|
-
__name(
|
|
893
|
+
__name(_ts_metadata12, "_ts_metadata");
|
|
729
894
|
var ResponseStatusCode;
|
|
730
895
|
(function(ResponseStatusCode2) {
|
|
731
896
|
ResponseStatusCode2["Pending"] = "pending";
|
|
732
897
|
ResponseStatusCode2["Success"] = "success";
|
|
733
898
|
ResponseStatusCode2["Failed"] = "failed";
|
|
734
899
|
})(ResponseStatusCode || (ResponseStatusCode = {}));
|
|
735
|
-
(0,
|
|
900
|
+
(0, import_type_graphql13.registerEnumType)(ResponseStatusCode, {
|
|
736
901
|
name: "ResponseStatusCode"
|
|
737
902
|
});
|
|
738
903
|
var BaseResponseStatus = /* @__PURE__ */ __name(class BaseResponseStatus2 {
|
|
739
904
|
code;
|
|
740
905
|
}, "BaseResponseStatus");
|
|
741
|
-
|
|
742
|
-
(0,
|
|
743
|
-
|
|
906
|
+
_ts_decorate12([
|
|
907
|
+
(0, import_type_graphql13.Field)(() => ResponseStatusCode),
|
|
908
|
+
_ts_metadata12("design:type", String)
|
|
744
909
|
], BaseResponseStatus.prototype, "code", void 0);
|
|
745
|
-
BaseResponseStatus =
|
|
746
|
-
(0,
|
|
910
|
+
BaseResponseStatus = _ts_decorate12([
|
|
911
|
+
(0, import_type_graphql13.InterfaceType)({
|
|
747
912
|
resolveType(value) {
|
|
748
913
|
if (value.code === "success") {
|
|
749
914
|
return SuccessResponseStatus;
|
|
@@ -755,14 +920,14 @@ BaseResponseStatus = _ts_decorate10([
|
|
|
755
920
|
return void 0;
|
|
756
921
|
}
|
|
757
922
|
}),
|
|
758
|
-
(0,
|
|
923
|
+
(0, import_type_graphql13.ObjectType)()
|
|
759
924
|
], BaseResponseStatus);
|
|
760
925
|
var PendingResponseStatus = class extends BaseResponseStatus {
|
|
761
926
|
code = "pending";
|
|
762
927
|
};
|
|
763
928
|
__name(PendingResponseStatus, "PendingResponseStatus");
|
|
764
|
-
PendingResponseStatus =
|
|
765
|
-
(0,
|
|
929
|
+
PendingResponseStatus = _ts_decorate12([
|
|
930
|
+
(0, import_type_graphql13.ObjectType)({
|
|
766
931
|
implements: BaseResponseStatus
|
|
767
932
|
})
|
|
768
933
|
], PendingResponseStatus);
|
|
@@ -770,8 +935,8 @@ var SuccessResponseStatus = class extends BaseResponseStatus {
|
|
|
770
935
|
code = "success";
|
|
771
936
|
};
|
|
772
937
|
__name(SuccessResponseStatus, "SuccessResponseStatus");
|
|
773
|
-
SuccessResponseStatus =
|
|
774
|
-
(0,
|
|
938
|
+
SuccessResponseStatus = _ts_decorate12([
|
|
939
|
+
(0, import_type_graphql13.ObjectType)({
|
|
775
940
|
implements: BaseResponseStatus
|
|
776
941
|
})
|
|
777
942
|
], SuccessResponseStatus);
|
|
@@ -781,7 +946,7 @@ var FailedResponseStatusReason;
|
|
|
781
946
|
FailedResponseStatusReason2["MESSAGE_STREAM_INTERRUPTED"] = "MESSAGE_STREAM_INTERRUPTED";
|
|
782
947
|
FailedResponseStatusReason2["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
783
948
|
})(FailedResponseStatusReason || (FailedResponseStatusReason = {}));
|
|
784
|
-
(0,
|
|
949
|
+
(0, import_type_graphql13.registerEnumType)(FailedResponseStatusReason, {
|
|
785
950
|
name: "FailedResponseStatusReason"
|
|
786
951
|
});
|
|
787
952
|
var FailedResponseStatus = class extends BaseResponseStatus {
|
|
@@ -790,22 +955,22 @@ var FailedResponseStatus = class extends BaseResponseStatus {
|
|
|
790
955
|
details = null;
|
|
791
956
|
};
|
|
792
957
|
__name(FailedResponseStatus, "FailedResponseStatus");
|
|
793
|
-
|
|
794
|
-
(0,
|
|
795
|
-
|
|
958
|
+
_ts_decorate12([
|
|
959
|
+
(0, import_type_graphql13.Field)(() => FailedResponseStatusReason),
|
|
960
|
+
_ts_metadata12("design:type", String)
|
|
796
961
|
], FailedResponseStatus.prototype, "reason", void 0);
|
|
797
|
-
|
|
798
|
-
(0,
|
|
962
|
+
_ts_decorate12([
|
|
963
|
+
(0, import_type_graphql13.Field)(() => import_graphql_scalars.GraphQLJSON, {
|
|
799
964
|
nullable: true
|
|
800
965
|
}),
|
|
801
|
-
|
|
966
|
+
_ts_metadata12("design:type", typeof Record === "undefined" ? Object : Record)
|
|
802
967
|
], FailedResponseStatus.prototype, "details", void 0);
|
|
803
|
-
FailedResponseStatus =
|
|
804
|
-
(0,
|
|
968
|
+
FailedResponseStatus = _ts_decorate12([
|
|
969
|
+
(0, import_type_graphql13.ObjectType)({
|
|
805
970
|
implements: BaseResponseStatus
|
|
806
971
|
})
|
|
807
972
|
], FailedResponseStatus);
|
|
808
|
-
var ResponseStatusUnion = (0,
|
|
973
|
+
var ResponseStatusUnion = (0, import_type_graphql13.createUnionType)({
|
|
809
974
|
name: "ResponseStatus",
|
|
810
975
|
types: () => [
|
|
811
976
|
PendingResponseStatus,
|
|
@@ -815,7 +980,7 @@ var ResponseStatusUnion = (0, import_type_graphql11.createUnionType)({
|
|
|
815
980
|
});
|
|
816
981
|
|
|
817
982
|
// src/graphql/types/copilot-response.type.ts
|
|
818
|
-
function
|
|
983
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
819
984
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
820
985
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
821
986
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -825,31 +990,31 @@ function _ts_decorate11(decorators, target, key, desc) {
|
|
|
825
990
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
826
991
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
827
992
|
}
|
|
828
|
-
__name(
|
|
829
|
-
function
|
|
993
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
994
|
+
function _ts_metadata13(k, v) {
|
|
830
995
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
831
996
|
return Reflect.metadata(k, v);
|
|
832
997
|
}
|
|
833
|
-
__name(
|
|
998
|
+
__name(_ts_metadata13, "_ts_metadata");
|
|
834
999
|
var BaseMessageOutput = /* @__PURE__ */ __name(class BaseMessageOutput2 {
|
|
835
1000
|
id;
|
|
836
1001
|
createdAt;
|
|
837
1002
|
status;
|
|
838
1003
|
}, "BaseMessageOutput");
|
|
839
|
-
|
|
840
|
-
(0,
|
|
841
|
-
|
|
1004
|
+
_ts_decorate13([
|
|
1005
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1006
|
+
_ts_metadata13("design:type", String)
|
|
842
1007
|
], BaseMessageOutput.prototype, "id", void 0);
|
|
843
|
-
|
|
844
|
-
(0,
|
|
845
|
-
|
|
1008
|
+
_ts_decorate13([
|
|
1009
|
+
(0, import_type_graphql14.Field)(() => Date),
|
|
1010
|
+
_ts_metadata13("design:type", typeof Date === "undefined" ? Object : Date)
|
|
846
1011
|
], BaseMessageOutput.prototype, "createdAt", void 0);
|
|
847
|
-
|
|
848
|
-
(0,
|
|
849
|
-
|
|
1012
|
+
_ts_decorate13([
|
|
1013
|
+
(0, import_type_graphql14.Field)(() => MessageStatusUnion),
|
|
1014
|
+
_ts_metadata13("design:type", Object)
|
|
850
1015
|
], BaseMessageOutput.prototype, "status", void 0);
|
|
851
|
-
BaseMessageOutput =
|
|
852
|
-
(0,
|
|
1016
|
+
BaseMessageOutput = _ts_decorate13([
|
|
1017
|
+
(0, import_type_graphql14.InterfaceType)({
|
|
853
1018
|
resolveType(value) {
|
|
854
1019
|
if (value.hasOwnProperty("content")) {
|
|
855
1020
|
return TextMessageOutput;
|
|
@@ -857,6 +1022,8 @@ BaseMessageOutput = _ts_decorate11([
|
|
|
857
1022
|
return ActionExecutionMessageOutput;
|
|
858
1023
|
} else if (value.hasOwnProperty("result")) {
|
|
859
1024
|
return ResultMessageOutput;
|
|
1025
|
+
} else if (value.hasOwnProperty("state")) {
|
|
1026
|
+
return AgentStateMessageOutput;
|
|
860
1027
|
}
|
|
861
1028
|
return void 0;
|
|
862
1029
|
}
|
|
@@ -867,18 +1034,18 @@ var TextMessageOutput = class {
|
|
|
867
1034
|
content;
|
|
868
1035
|
};
|
|
869
1036
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
870
|
-
|
|
871
|
-
(0,
|
|
872
|
-
|
|
1037
|
+
_ts_decorate13([
|
|
1038
|
+
(0, import_type_graphql14.Field)(() => MessageRole),
|
|
1039
|
+
_ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
873
1040
|
], TextMessageOutput.prototype, "role", void 0);
|
|
874
|
-
|
|
875
|
-
(0,
|
|
1041
|
+
_ts_decorate13([
|
|
1042
|
+
(0, import_type_graphql14.Field)(() => [
|
|
876
1043
|
String
|
|
877
1044
|
]),
|
|
878
|
-
|
|
1045
|
+
_ts_metadata13("design:type", Array)
|
|
879
1046
|
], TextMessageOutput.prototype, "content", void 0);
|
|
880
|
-
TextMessageOutput =
|
|
881
|
-
(0,
|
|
1047
|
+
TextMessageOutput = _ts_decorate13([
|
|
1048
|
+
(0, import_type_graphql14.ObjectType)({
|
|
882
1049
|
implements: BaseMessageOutput
|
|
883
1050
|
})
|
|
884
1051
|
], TextMessageOutput);
|
|
@@ -888,22 +1055,22 @@ var ActionExecutionMessageOutput = class {
|
|
|
888
1055
|
arguments;
|
|
889
1056
|
};
|
|
890
1057
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
891
|
-
|
|
892
|
-
(0,
|
|
893
|
-
|
|
1058
|
+
_ts_decorate13([
|
|
1059
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1060
|
+
_ts_metadata13("design:type", String)
|
|
894
1061
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
895
|
-
|
|
896
|
-
(0,
|
|
897
|
-
|
|
1062
|
+
_ts_decorate13([
|
|
1063
|
+
(0, import_type_graphql14.Field)(() => ActionExecutionScope),
|
|
1064
|
+
_ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
898
1065
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
899
|
-
|
|
900
|
-
(0,
|
|
1066
|
+
_ts_decorate13([
|
|
1067
|
+
(0, import_type_graphql14.Field)(() => [
|
|
901
1068
|
String
|
|
902
1069
|
]),
|
|
903
|
-
|
|
1070
|
+
_ts_metadata13("design:type", Array)
|
|
904
1071
|
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
905
|
-
ActionExecutionMessageOutput =
|
|
906
|
-
(0,
|
|
1072
|
+
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1073
|
+
(0, import_type_graphql14.ObjectType)({
|
|
907
1074
|
implements: BaseMessageOutput
|
|
908
1075
|
})
|
|
909
1076
|
], ActionExecutionMessageOutput);
|
|
@@ -913,23 +1080,71 @@ var ResultMessageOutput = class {
|
|
|
913
1080
|
result;
|
|
914
1081
|
};
|
|
915
1082
|
__name(ResultMessageOutput, "ResultMessageOutput");
|
|
916
|
-
|
|
917
|
-
(0,
|
|
918
|
-
|
|
1083
|
+
_ts_decorate13([
|
|
1084
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1085
|
+
_ts_metadata13("design:type", String)
|
|
919
1086
|
], ResultMessageOutput.prototype, "actionExecutionId", void 0);
|
|
920
|
-
|
|
921
|
-
(0,
|
|
922
|
-
|
|
1087
|
+
_ts_decorate13([
|
|
1088
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1089
|
+
_ts_metadata13("design:type", String)
|
|
923
1090
|
], ResultMessageOutput.prototype, "actionName", void 0);
|
|
924
|
-
|
|
925
|
-
(0,
|
|
926
|
-
|
|
1091
|
+
_ts_decorate13([
|
|
1092
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1093
|
+
_ts_metadata13("design:type", String)
|
|
927
1094
|
], ResultMessageOutput.prototype, "result", void 0);
|
|
928
|
-
ResultMessageOutput =
|
|
929
|
-
(0,
|
|
1095
|
+
ResultMessageOutput = _ts_decorate13([
|
|
1096
|
+
(0, import_type_graphql14.ObjectType)({
|
|
930
1097
|
implements: BaseMessageOutput
|
|
931
1098
|
})
|
|
932
1099
|
], ResultMessageOutput);
|
|
1100
|
+
var AgentStateMessageOutput = class {
|
|
1101
|
+
threadId;
|
|
1102
|
+
agentName;
|
|
1103
|
+
nodeName;
|
|
1104
|
+
runId;
|
|
1105
|
+
active;
|
|
1106
|
+
role;
|
|
1107
|
+
state;
|
|
1108
|
+
running;
|
|
1109
|
+
};
|
|
1110
|
+
__name(AgentStateMessageOutput, "AgentStateMessageOutput");
|
|
1111
|
+
_ts_decorate13([
|
|
1112
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1113
|
+
_ts_metadata13("design:type", String)
|
|
1114
|
+
], AgentStateMessageOutput.prototype, "threadId", void 0);
|
|
1115
|
+
_ts_decorate13([
|
|
1116
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1117
|
+
_ts_metadata13("design:type", String)
|
|
1118
|
+
], AgentStateMessageOutput.prototype, "agentName", void 0);
|
|
1119
|
+
_ts_decorate13([
|
|
1120
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1121
|
+
_ts_metadata13("design:type", String)
|
|
1122
|
+
], AgentStateMessageOutput.prototype, "nodeName", void 0);
|
|
1123
|
+
_ts_decorate13([
|
|
1124
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1125
|
+
_ts_metadata13("design:type", String)
|
|
1126
|
+
], AgentStateMessageOutput.prototype, "runId", void 0);
|
|
1127
|
+
_ts_decorate13([
|
|
1128
|
+
(0, import_type_graphql14.Field)(() => Boolean),
|
|
1129
|
+
_ts_metadata13("design:type", Boolean)
|
|
1130
|
+
], AgentStateMessageOutput.prototype, "active", void 0);
|
|
1131
|
+
_ts_decorate13([
|
|
1132
|
+
(0, import_type_graphql14.Field)(() => MessageRole),
|
|
1133
|
+
_ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
1134
|
+
], AgentStateMessageOutput.prototype, "role", void 0);
|
|
1135
|
+
_ts_decorate13([
|
|
1136
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1137
|
+
_ts_metadata13("design:type", String)
|
|
1138
|
+
], AgentStateMessageOutput.prototype, "state", void 0);
|
|
1139
|
+
_ts_decorate13([
|
|
1140
|
+
(0, import_type_graphql14.Field)(() => Boolean),
|
|
1141
|
+
_ts_metadata13("design:type", Boolean)
|
|
1142
|
+
], AgentStateMessageOutput.prototype, "running", void 0);
|
|
1143
|
+
AgentStateMessageOutput = _ts_decorate13([
|
|
1144
|
+
(0, import_type_graphql14.ObjectType)({
|
|
1145
|
+
implements: BaseMessageOutput
|
|
1146
|
+
})
|
|
1147
|
+
], AgentStateMessageOutput);
|
|
933
1148
|
var CopilotResponse = class {
|
|
934
1149
|
threadId;
|
|
935
1150
|
status;
|
|
@@ -937,28 +1152,28 @@ var CopilotResponse = class {
|
|
|
937
1152
|
messages;
|
|
938
1153
|
};
|
|
939
1154
|
__name(CopilotResponse, "CopilotResponse");
|
|
940
|
-
|
|
941
|
-
(0,
|
|
942
|
-
|
|
1155
|
+
_ts_decorate13([
|
|
1156
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1157
|
+
_ts_metadata13("design:type", String)
|
|
943
1158
|
], CopilotResponse.prototype, "threadId", void 0);
|
|
944
|
-
|
|
945
|
-
(0,
|
|
946
|
-
|
|
1159
|
+
_ts_decorate13([
|
|
1160
|
+
(0, import_type_graphql14.Field)(() => ResponseStatusUnion),
|
|
1161
|
+
_ts_metadata13("design:type", Object)
|
|
947
1162
|
], CopilotResponse.prototype, "status", void 0);
|
|
948
|
-
|
|
949
|
-
(0,
|
|
1163
|
+
_ts_decorate13([
|
|
1164
|
+
(0, import_type_graphql14.Field)({
|
|
950
1165
|
nullable: true
|
|
951
1166
|
}),
|
|
952
|
-
|
|
1167
|
+
_ts_metadata13("design:type", String)
|
|
953
1168
|
], CopilotResponse.prototype, "runId", void 0);
|
|
954
|
-
|
|
955
|
-
(0,
|
|
1169
|
+
_ts_decorate13([
|
|
1170
|
+
(0, import_type_graphql14.Field)(() => [
|
|
956
1171
|
BaseMessageOutput
|
|
957
1172
|
]),
|
|
958
|
-
|
|
1173
|
+
_ts_metadata13("design:type", Array)
|
|
959
1174
|
], CopilotResponse.prototype, "messages", void 0);
|
|
960
|
-
CopilotResponse =
|
|
961
|
-
(0,
|
|
1175
|
+
CopilotResponse = _ts_decorate13([
|
|
1176
|
+
(0, import_type_graphql14.ObjectType)()
|
|
962
1177
|
], CopilotResponse);
|
|
963
1178
|
|
|
964
1179
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
@@ -985,6 +1200,26 @@ var ResultMessage = class extends BaseMessage {
|
|
|
985
1200
|
result;
|
|
986
1201
|
};
|
|
987
1202
|
__name(ResultMessage, "ResultMessage");
|
|
1203
|
+
var AgentStateMessage = class extends BaseMessage {
|
|
1204
|
+
threadId;
|
|
1205
|
+
agentName;
|
|
1206
|
+
nodeName;
|
|
1207
|
+
runId;
|
|
1208
|
+
active;
|
|
1209
|
+
role;
|
|
1210
|
+
state;
|
|
1211
|
+
running;
|
|
1212
|
+
};
|
|
1213
|
+
__name(AgentStateMessage, "AgentStateMessage");
|
|
1214
|
+
|
|
1215
|
+
// src/lib/telemetry-client.ts
|
|
1216
|
+
var import_shared = require("@copilotkit/shared");
|
|
1217
|
+
var packageJson = require_package();
|
|
1218
|
+
var telemetryClient = new import_shared.TelemetryClient({
|
|
1219
|
+
packageName: packageJson.name,
|
|
1220
|
+
packageVersion: packageJson.version
|
|
1221
|
+
});
|
|
1222
|
+
var telemetry_client_default = telemetryClient;
|
|
988
1223
|
|
|
989
1224
|
// src/service-adapters/events.ts
|
|
990
1225
|
var RuntimeEventTypes;
|
|
@@ -996,6 +1231,7 @@ var RuntimeEventTypes;
|
|
|
996
1231
|
RuntimeEventTypes2["ActionExecutionArgs"] = "ActionExecutionArgs";
|
|
997
1232
|
RuntimeEventTypes2["ActionExecutionEnd"] = "ActionExecutionEnd";
|
|
998
1233
|
RuntimeEventTypes2["ActionExecutionResult"] = "ActionExecutionResult";
|
|
1234
|
+
RuntimeEventTypes2["AgentStateMessage"] = "AgentStateMessage";
|
|
999
1235
|
})(RuntimeEventTypes || (RuntimeEventTypes = {}));
|
|
1000
1236
|
|
|
1001
1237
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
@@ -1036,18 +1272,9 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
|
|
|
1036
1272
|
};
|
|
1037
1273
|
__name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
1038
1274
|
|
|
1039
|
-
// src/lib/telemetry-client.ts
|
|
1040
|
-
var import_shared = require("@copilotkit/shared");
|
|
1041
|
-
var packageJson = require_package();
|
|
1042
|
-
var telemetryClient = new import_shared.TelemetryClient({
|
|
1043
|
-
packageName: packageJson.name,
|
|
1044
|
-
packageVersion: packageJson.version
|
|
1045
|
-
});
|
|
1046
|
-
var telemetry_client_default = telemetryClient;
|
|
1047
|
-
|
|
1048
1275
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1049
1276
|
var import_shared2 = require("@copilotkit/shared");
|
|
1050
|
-
function
|
|
1277
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
1051
1278
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1052
1279
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1053
1280
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1057,12 +1284,12 @@ function _ts_decorate12(decorators, target, key, desc) {
|
|
|
1057
1284
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1058
1285
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1059
1286
|
}
|
|
1060
|
-
__name(
|
|
1061
|
-
function
|
|
1287
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
1288
|
+
function _ts_metadata14(k, v) {
|
|
1062
1289
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1063
1290
|
return Reflect.metadata(k, v);
|
|
1064
1291
|
}
|
|
1065
|
-
__name(
|
|
1292
|
+
__name(_ts_metadata14, "_ts_metadata");
|
|
1066
1293
|
function _ts_param(paramIndex, decorator) {
|
|
1067
1294
|
return function(target, key) {
|
|
1068
1295
|
decorator(target, key, paramIndex);
|
|
@@ -1071,7 +1298,6 @@ function _ts_param(paramIndex, decorator) {
|
|
|
1071
1298
|
__name(_ts_param, "_ts_param");
|
|
1072
1299
|
var invokeGuardrails = /* @__PURE__ */ __name(async ({ baseUrl, copilotCloudPublicApiKey, data, onResult, onError }) => {
|
|
1073
1300
|
var _a;
|
|
1074
|
-
console.log("invokeGuardrails.baseUrl", baseUrl);
|
|
1075
1301
|
if (data.messages.length && ((_a = data.messages[data.messages.length - 1].textMessage) == null ? void 0 : _a.role) === MessageRole.user) {
|
|
1076
1302
|
const messages = data.messages.filter((m) => m.textMessage !== void 0 && (m.textMessage.role === MessageRole.user || m.textMessage.role === MessageRole.assistant)).map((m) => ({
|
|
1077
1303
|
role: m.textMessage.role,
|
|
@@ -1117,8 +1343,6 @@ var CopilotResolver = class {
|
|
|
1117
1343
|
logger2.debug({
|
|
1118
1344
|
data
|
|
1119
1345
|
}, "Generating Copilot response");
|
|
1120
|
-
const copilotRuntime = ctx._copilotkit.runtime;
|
|
1121
|
-
const serviceAdapter = ctx._copilotkit.serviceAdapter;
|
|
1122
1346
|
if (properties) {
|
|
1123
1347
|
logger2.debug("Properties provided, merging with context properties");
|
|
1124
1348
|
ctx.properties = {
|
|
@@ -1126,6 +1350,8 @@ var CopilotResolver = class {
|
|
|
1126
1350
|
...properties
|
|
1127
1351
|
};
|
|
1128
1352
|
}
|
|
1353
|
+
const copilotRuntime = ctx._copilotkit.runtime;
|
|
1354
|
+
const serviceAdapter = ctx._copilotkit.serviceAdapter;
|
|
1129
1355
|
let copilotCloudPublicApiKey = null;
|
|
1130
1356
|
let copilotCloudBaseUrl;
|
|
1131
1357
|
if (data.cloud) {
|
|
@@ -1164,16 +1390,19 @@ var CopilotResolver = class {
|
|
|
1164
1390
|
rejectOutputMessagesPromise = reject;
|
|
1165
1391
|
});
|
|
1166
1392
|
logger2.debug("Processing");
|
|
1167
|
-
const { eventSource, threadId = (0, import_shared2.randomId)(), runId,
|
|
1393
|
+
const { eventSource, threadId = (0, import_shared2.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
|
|
1168
1394
|
serviceAdapter,
|
|
1169
1395
|
messages: data.messages,
|
|
1170
1396
|
actions: data.frontend.actions,
|
|
1171
1397
|
threadId: data.threadId,
|
|
1172
1398
|
runId: data.runId,
|
|
1173
1399
|
publicApiKey: void 0,
|
|
1174
|
-
properties: ctx.properties || {},
|
|
1175
1400
|
outputMessagesPromise,
|
|
1176
|
-
|
|
1401
|
+
graphqlContext: ctx,
|
|
1402
|
+
forwardedParameters: data.forwardedParameters,
|
|
1403
|
+
agentSession: data.agentSession,
|
|
1404
|
+
agentStates: data.agentStates,
|
|
1405
|
+
url: data.frontend.url
|
|
1177
1406
|
});
|
|
1178
1407
|
logger2.debug("Event source created, creating response");
|
|
1179
1408
|
const response = {
|
|
@@ -1230,9 +1459,13 @@ var CopilotResolver = class {
|
|
|
1230
1459
|
});
|
|
1231
1460
|
}
|
|
1232
1461
|
let eventStreamSubscription;
|
|
1233
|
-
const eventStream = eventSource.
|
|
1234
|
-
|
|
1235
|
-
guardrailsResult$: ((_b2 = data.cloud) == null ? void 0 : _b2.guardrails) ? guardrailsResult$ : null
|
|
1462
|
+
const eventStream = eventSource.processRuntimeEvents({
|
|
1463
|
+
serverSideActions,
|
|
1464
|
+
guardrailsResult$: ((_b2 = data.cloud) == null ? void 0 : _b2.guardrails) ? guardrailsResult$ : null,
|
|
1465
|
+
actionInputsWithoutAgents: actionInputsWithoutAgents.filter(
|
|
1466
|
+
// TODO-AGENTS: do not exclude ALL server side actions
|
|
1467
|
+
(action) => !serverSideActions.find((serverSideAction) => serverSideAction.name == action.name)
|
|
1468
|
+
)
|
|
1236
1469
|
}).pipe(
|
|
1237
1470
|
// shareReplay() ensures that later subscribers will see the whole stream instead of
|
|
1238
1471
|
// just the events that were emitted after the subscriber was added.
|
|
@@ -1380,6 +1613,36 @@ var CopilotResolver = class {
|
|
|
1380
1613
|
result: event.result
|
|
1381
1614
|
}));
|
|
1382
1615
|
break;
|
|
1616
|
+
case RuntimeEventTypes.AgentStateMessage:
|
|
1617
|
+
logger2.debug({
|
|
1618
|
+
event
|
|
1619
|
+
}, "Agent message event received");
|
|
1620
|
+
pushMessage({
|
|
1621
|
+
id: (0, import_shared2.randomId)(),
|
|
1622
|
+
status: new SuccessMessageStatus(),
|
|
1623
|
+
threadId: event.threadId,
|
|
1624
|
+
agentName: event.agentName,
|
|
1625
|
+
nodeName: event.nodeName,
|
|
1626
|
+
runId: event.runId,
|
|
1627
|
+
active: event.active,
|
|
1628
|
+
state: event.state,
|
|
1629
|
+
running: event.running,
|
|
1630
|
+
role: MessageRole.assistant,
|
|
1631
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
1632
|
+
});
|
|
1633
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
|
|
1634
|
+
id: (0, import_shared2.randomId)(),
|
|
1635
|
+
threadId: event.threadId,
|
|
1636
|
+
agentName: event.agentName,
|
|
1637
|
+
nodeName: event.nodeName,
|
|
1638
|
+
runId: event.runId,
|
|
1639
|
+
active: event.active,
|
|
1640
|
+
state: event.state,
|
|
1641
|
+
running: event.running,
|
|
1642
|
+
role: MessageRole.assistant,
|
|
1643
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
1644
|
+
}));
|
|
1645
|
+
break;
|
|
1383
1646
|
}
|
|
1384
1647
|
},
|
|
1385
1648
|
error: (err) => {
|
|
@@ -1412,29 +1675,29 @@ var CopilotResolver = class {
|
|
|
1412
1675
|
}
|
|
1413
1676
|
};
|
|
1414
1677
|
__name(CopilotResolver, "CopilotResolver");
|
|
1415
|
-
|
|
1416
|
-
(0,
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1678
|
+
_ts_decorate14([
|
|
1679
|
+
(0, import_type_graphql15.Query)(() => String),
|
|
1680
|
+
_ts_metadata14("design:type", Function),
|
|
1681
|
+
_ts_metadata14("design:paramtypes", []),
|
|
1682
|
+
_ts_metadata14("design:returntype", Promise)
|
|
1420
1683
|
], CopilotResolver.prototype, "hello", null);
|
|
1421
|
-
|
|
1422
|
-
(0,
|
|
1423
|
-
_ts_param(0, (0,
|
|
1424
|
-
_ts_param(1, (0,
|
|
1425
|
-
_ts_param(2, (0,
|
|
1684
|
+
_ts_decorate14([
|
|
1685
|
+
(0, import_type_graphql15.Mutation)(() => CopilotResponse),
|
|
1686
|
+
_ts_param(0, (0, import_type_graphql15.Ctx)()),
|
|
1687
|
+
_ts_param(1, (0, import_type_graphql15.Arg)("data")),
|
|
1688
|
+
_ts_param(2, (0, import_type_graphql15.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
1426
1689
|
nullable: true
|
|
1427
1690
|
})),
|
|
1428
|
-
|
|
1429
|
-
|
|
1691
|
+
_ts_metadata14("design:type", Function),
|
|
1692
|
+
_ts_metadata14("design:paramtypes", [
|
|
1430
1693
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
1431
1694
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
1432
1695
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
1433
1696
|
]),
|
|
1434
|
-
|
|
1697
|
+
_ts_metadata14("design:returntype", Promise)
|
|
1435
1698
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
1436
|
-
CopilotResolver =
|
|
1437
|
-
(0,
|
|
1699
|
+
CopilotResolver = _ts_decorate14([
|
|
1700
|
+
(0, import_type_graphql15.Resolver)(() => CopilotResponse)
|
|
1438
1701
|
], CopilotResolver);
|
|
1439
1702
|
|
|
1440
1703
|
// src/lib/integrations/shared.ts
|
|
@@ -1489,7 +1752,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
1489
1752
|
__name(createContext, "createContext");
|
|
1490
1753
|
function buildSchema(options = {}) {
|
|
1491
1754
|
logger.debug("Building GraphQL schema...");
|
|
1492
|
-
const schema = (0,
|
|
1755
|
+
const schema = (0, import_type_graphql16.buildSchemaSync)({
|
|
1493
1756
|
resolvers: [
|
|
1494
1757
|
CopilotResolver
|
|
1495
1758
|
],
|