@copilotkit/runtime 1.2.1 → 1.2.2-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 +26 -0
- package/__snapshots__/schema/schema.graphql +41 -0
- package/dist/{chunk-YMUS43FR.mjs → chunk-2N45GS3P.mjs} +2 -2
- package/dist/{chunk-URMISMK2.mjs → chunk-73NMP3DI.mjs} +2 -2
- package/dist/{chunk-736EEICU.mjs → chunk-BJ2LVHWA.mjs} +3 -3
- package/dist/{chunk-DMO6FA25.mjs → chunk-T6O5FSTK.mjs} +2 -2
- package/dist/{chunk-GEIBJJQ4.mjs → chunk-TBZGOJJX.mjs} +14 -2
- package/dist/chunk-TBZGOJJX.mjs.map +1 -0
- package/dist/{chunk-DYF5MUAH.mjs → chunk-X5QBBMCJ.mjs} +2 -2
- package/dist/{chunk-Q5ZTE7WH.mjs → chunk-XROLDARH.mjs} +786 -158
- package/dist/chunk-XROLDARH.mjs.map +1 -0
- package/dist/chunk-ZNZGATLW.mjs +260 -0
- package/dist/chunk-ZNZGATLW.mjs.map +1 -0
- package/dist/{shared-c5362338.d.ts → copilot-runtime-d427e991.d.ts} +65 -38
- 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/{index-13aa818e.d.ts → index-079752b9.d.ts} +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +982 -245
- 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 +7 -7
- package/dist/lib/index.js +982 -245
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +8 -8
- package/dist/lib/integrations/index.d.ts +6 -6
- package/dist/lib/integrations/index.js +437 -182
- 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 +437 -182
- 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 +437 -182
- 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 +437 -182
- 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.map +1 -1
- package/dist/service-adapters/index.mjs +3 -3
- 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/generate-copilot-response.input.ts +11 -0
- package/src/graphql/inputs/message.input.ts +30 -0
- package/src/graphql/resolvers/copilot.resolver.ts +56 -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/dist/chunk-GEIBJJQ4.mjs.map +0 -1
- package/dist/chunk-PB24CCIJ.mjs +0 -158
- package/dist/chunk-PB24CCIJ.mjs.map +0 -1
- package/dist/chunk-Q5ZTE7WH.mjs.map +0 -1
- package/src/lib/copilot-runtime.ts +0 -231
- /package/dist/{chunk-YMUS43FR.mjs.map → chunk-2N45GS3P.mjs.map} +0 -0
- /package/dist/{chunk-URMISMK2.mjs.map → chunk-73NMP3DI.mjs.map} +0 -0
- /package/dist/{chunk-736EEICU.mjs.map → chunk-BJ2LVHWA.mjs.map} +0 -0
- /package/dist/{chunk-DMO6FA25.mjs.map → chunk-T6O5FSTK.mjs.map} +0 -0
- /package/dist/{chunk-DYF5MUAH.mjs.map → chunk-X5QBBMCJ.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.2.
|
|
47
|
+
version: "1.2.2-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");
|
|
@@ -555,7 +611,8 @@ ForwardedParametersInput = _ts_decorate7([
|
|
|
555
611
|
(0, import_type_graphql8.InputType)()
|
|
556
612
|
], ForwardedParametersInput);
|
|
557
613
|
|
|
558
|
-
// src/graphql/inputs/
|
|
614
|
+
// src/graphql/inputs/agent-session.input.ts
|
|
615
|
+
var import_type_graphql9 = require("type-graphql");
|
|
559
616
|
function _ts_decorate8(decorators, target, key, desc) {
|
|
560
617
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
561
618
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -572,18 +629,96 @@ function _ts_metadata8(k, v) {
|
|
|
572
629
|
return Reflect.metadata(k, v);
|
|
573
630
|
}
|
|
574
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");
|
|
575
710
|
var GenerateCopilotResponseMetadataInput = class {
|
|
576
711
|
requestType;
|
|
577
712
|
};
|
|
578
713
|
__name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
|
|
579
|
-
|
|
580
|
-
(0,
|
|
714
|
+
_ts_decorate10([
|
|
715
|
+
(0, import_type_graphql11.Field)(() => CopilotRequestType, {
|
|
581
716
|
nullable: true
|
|
582
717
|
}),
|
|
583
|
-
|
|
718
|
+
_ts_metadata10("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
|
|
584
719
|
], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
|
|
585
|
-
GenerateCopilotResponseMetadataInput =
|
|
586
|
-
(0,
|
|
720
|
+
GenerateCopilotResponseMetadataInput = _ts_decorate10([
|
|
721
|
+
(0, import_type_graphql11.InputType)()
|
|
587
722
|
], GenerateCopilotResponseMetadataInput);
|
|
588
723
|
var GenerateCopilotResponseInput = class {
|
|
589
724
|
metadata;
|
|
@@ -593,58 +728,81 @@ var GenerateCopilotResponseInput = class {
|
|
|
593
728
|
frontend;
|
|
594
729
|
cloud;
|
|
595
730
|
forwardedParameters;
|
|
731
|
+
agentSession;
|
|
732
|
+
agentState;
|
|
733
|
+
agentStates;
|
|
596
734
|
};
|
|
597
735
|
__name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
|
|
598
|
-
|
|
599
|
-
(0,
|
|
736
|
+
_ts_decorate10([
|
|
737
|
+
(0, import_type_graphql11.Field)(() => GenerateCopilotResponseMetadataInput, {
|
|
600
738
|
nullable: false
|
|
601
739
|
}),
|
|
602
|
-
|
|
740
|
+
_ts_metadata10("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
|
|
603
741
|
], GenerateCopilotResponseInput.prototype, "metadata", void 0);
|
|
604
|
-
|
|
605
|
-
(0,
|
|
742
|
+
_ts_decorate10([
|
|
743
|
+
(0, import_type_graphql11.Field)(() => String, {
|
|
606
744
|
nullable: true
|
|
607
745
|
}),
|
|
608
|
-
|
|
746
|
+
_ts_metadata10("design:type", String)
|
|
609
747
|
], GenerateCopilotResponseInput.prototype, "threadId", void 0);
|
|
610
|
-
|
|
611
|
-
(0,
|
|
748
|
+
_ts_decorate10([
|
|
749
|
+
(0, import_type_graphql11.Field)(() => String, {
|
|
612
750
|
nullable: true
|
|
613
751
|
}),
|
|
614
|
-
|
|
752
|
+
_ts_metadata10("design:type", String)
|
|
615
753
|
], GenerateCopilotResponseInput.prototype, "runId", void 0);
|
|
616
|
-
|
|
617
|
-
(0,
|
|
754
|
+
_ts_decorate10([
|
|
755
|
+
(0, import_type_graphql11.Field)(() => [
|
|
618
756
|
MessageInput
|
|
619
757
|
]),
|
|
620
|
-
|
|
758
|
+
_ts_metadata10("design:type", Array)
|
|
621
759
|
], GenerateCopilotResponseInput.prototype, "messages", void 0);
|
|
622
|
-
|
|
623
|
-
(0,
|
|
624
|
-
|
|
760
|
+
_ts_decorate10([
|
|
761
|
+
(0, import_type_graphql11.Field)(() => FrontendInput),
|
|
762
|
+
_ts_metadata10("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
|
|
625
763
|
], GenerateCopilotResponseInput.prototype, "frontend", void 0);
|
|
626
|
-
|
|
627
|
-
(0,
|
|
764
|
+
_ts_decorate10([
|
|
765
|
+
(0, import_type_graphql11.Field)(() => CloudInput, {
|
|
628
766
|
nullable: true
|
|
629
767
|
}),
|
|
630
|
-
|
|
768
|
+
_ts_metadata10("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
|
|
631
769
|
], GenerateCopilotResponseInput.prototype, "cloud", void 0);
|
|
632
|
-
|
|
633
|
-
(0,
|
|
770
|
+
_ts_decorate10([
|
|
771
|
+
(0, import_type_graphql11.Field)(() => ForwardedParametersInput, {
|
|
634
772
|
nullable: true
|
|
635
773
|
}),
|
|
636
|
-
|
|
774
|
+
_ts_metadata10("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
|
|
637
775
|
], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
|
|
638
|
-
|
|
639
|
-
(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)()
|
|
640
798
|
], GenerateCopilotResponseInput);
|
|
641
799
|
|
|
642
800
|
// src/graphql/types/copilot-response.type.ts
|
|
643
|
-
var
|
|
801
|
+
var import_type_graphql14 = require("type-graphql");
|
|
644
802
|
|
|
645
803
|
// src/graphql/types/message-status.type.ts
|
|
646
|
-
var
|
|
647
|
-
function
|
|
804
|
+
var import_type_graphql12 = require("type-graphql");
|
|
805
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
648
806
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
649
807
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
650
808
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -654,58 +812,58 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
654
812
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
655
813
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
656
814
|
}
|
|
657
|
-
__name(
|
|
658
|
-
function
|
|
815
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
816
|
+
function _ts_metadata11(k, v) {
|
|
659
817
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
660
818
|
return Reflect.metadata(k, v);
|
|
661
819
|
}
|
|
662
|
-
__name(
|
|
820
|
+
__name(_ts_metadata11, "_ts_metadata");
|
|
663
821
|
var MessageStatusCode;
|
|
664
822
|
(function(MessageStatusCode2) {
|
|
665
823
|
MessageStatusCode2["Pending"] = "pending";
|
|
666
824
|
MessageStatusCode2["Success"] = "success";
|
|
667
825
|
MessageStatusCode2["Failed"] = "failed";
|
|
668
826
|
})(MessageStatusCode || (MessageStatusCode = {}));
|
|
669
|
-
(0,
|
|
827
|
+
(0, import_type_graphql12.registerEnumType)(MessageStatusCode, {
|
|
670
828
|
name: "MessageStatusCode"
|
|
671
829
|
});
|
|
672
830
|
var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
|
|
673
831
|
code;
|
|
674
832
|
}, "BaseMessageStatus");
|
|
675
|
-
|
|
676
|
-
(0,
|
|
677
|
-
|
|
833
|
+
_ts_decorate11([
|
|
834
|
+
(0, import_type_graphql12.Field)(() => MessageStatusCode),
|
|
835
|
+
_ts_metadata11("design:type", String)
|
|
678
836
|
], BaseMessageStatus.prototype, "code", void 0);
|
|
679
|
-
BaseMessageStatus =
|
|
680
|
-
(0,
|
|
837
|
+
BaseMessageStatus = _ts_decorate11([
|
|
838
|
+
(0, import_type_graphql12.ObjectType)()
|
|
681
839
|
], BaseMessageStatus);
|
|
682
840
|
var PendingMessageStatus = class extends BaseMessageStatus {
|
|
683
841
|
code = "pending";
|
|
684
842
|
};
|
|
685
843
|
__name(PendingMessageStatus, "PendingMessageStatus");
|
|
686
|
-
PendingMessageStatus =
|
|
687
|
-
(0,
|
|
844
|
+
PendingMessageStatus = _ts_decorate11([
|
|
845
|
+
(0, import_type_graphql12.ObjectType)()
|
|
688
846
|
], PendingMessageStatus);
|
|
689
847
|
var SuccessMessageStatus = class extends BaseMessageStatus {
|
|
690
848
|
code = "success";
|
|
691
849
|
};
|
|
692
850
|
__name(SuccessMessageStatus, "SuccessMessageStatus");
|
|
693
|
-
SuccessMessageStatus =
|
|
694
|
-
(0,
|
|
851
|
+
SuccessMessageStatus = _ts_decorate11([
|
|
852
|
+
(0, import_type_graphql12.ObjectType)()
|
|
695
853
|
], SuccessMessageStatus);
|
|
696
854
|
var FailedMessageStatus = class extends BaseMessageStatus {
|
|
697
855
|
code = "failed";
|
|
698
856
|
reason;
|
|
699
857
|
};
|
|
700
858
|
__name(FailedMessageStatus, "FailedMessageStatus");
|
|
701
|
-
|
|
702
|
-
(0,
|
|
703
|
-
|
|
859
|
+
_ts_decorate11([
|
|
860
|
+
(0, import_type_graphql12.Field)(() => String),
|
|
861
|
+
_ts_metadata11("design:type", String)
|
|
704
862
|
], FailedMessageStatus.prototype, "reason", void 0);
|
|
705
|
-
FailedMessageStatus =
|
|
706
|
-
(0,
|
|
863
|
+
FailedMessageStatus = _ts_decorate11([
|
|
864
|
+
(0, import_type_graphql12.ObjectType)()
|
|
707
865
|
], FailedMessageStatus);
|
|
708
|
-
var MessageStatusUnion = (0,
|
|
866
|
+
var MessageStatusUnion = (0, import_type_graphql12.createUnionType)({
|
|
709
867
|
name: "MessageStatus",
|
|
710
868
|
types: () => [
|
|
711
869
|
PendingMessageStatus,
|
|
@@ -716,8 +874,8 @@ var MessageStatusUnion = (0, import_type_graphql10.createUnionType)({
|
|
|
716
874
|
|
|
717
875
|
// src/graphql/types/response-status.type.ts
|
|
718
876
|
var import_graphql_scalars = require("graphql-scalars");
|
|
719
|
-
var
|
|
720
|
-
function
|
|
877
|
+
var import_type_graphql13 = require("type-graphql");
|
|
878
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
721
879
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
722
880
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
723
881
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -727,30 +885,30 @@ function _ts_decorate10(decorators, target, key, desc) {
|
|
|
727
885
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
728
886
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
729
887
|
}
|
|
730
|
-
__name(
|
|
731
|
-
function
|
|
888
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
889
|
+
function _ts_metadata12(k, v) {
|
|
732
890
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
733
891
|
return Reflect.metadata(k, v);
|
|
734
892
|
}
|
|
735
|
-
__name(
|
|
893
|
+
__name(_ts_metadata12, "_ts_metadata");
|
|
736
894
|
var ResponseStatusCode;
|
|
737
895
|
(function(ResponseStatusCode2) {
|
|
738
896
|
ResponseStatusCode2["Pending"] = "pending";
|
|
739
897
|
ResponseStatusCode2["Success"] = "success";
|
|
740
898
|
ResponseStatusCode2["Failed"] = "failed";
|
|
741
899
|
})(ResponseStatusCode || (ResponseStatusCode = {}));
|
|
742
|
-
(0,
|
|
900
|
+
(0, import_type_graphql13.registerEnumType)(ResponseStatusCode, {
|
|
743
901
|
name: "ResponseStatusCode"
|
|
744
902
|
});
|
|
745
903
|
var BaseResponseStatus = /* @__PURE__ */ __name(class BaseResponseStatus2 {
|
|
746
904
|
code;
|
|
747
905
|
}, "BaseResponseStatus");
|
|
748
|
-
|
|
749
|
-
(0,
|
|
750
|
-
|
|
906
|
+
_ts_decorate12([
|
|
907
|
+
(0, import_type_graphql13.Field)(() => ResponseStatusCode),
|
|
908
|
+
_ts_metadata12("design:type", String)
|
|
751
909
|
], BaseResponseStatus.prototype, "code", void 0);
|
|
752
|
-
BaseResponseStatus =
|
|
753
|
-
(0,
|
|
910
|
+
BaseResponseStatus = _ts_decorate12([
|
|
911
|
+
(0, import_type_graphql13.InterfaceType)({
|
|
754
912
|
resolveType(value) {
|
|
755
913
|
if (value.code === "success") {
|
|
756
914
|
return SuccessResponseStatus;
|
|
@@ -762,14 +920,14 @@ BaseResponseStatus = _ts_decorate10([
|
|
|
762
920
|
return void 0;
|
|
763
921
|
}
|
|
764
922
|
}),
|
|
765
|
-
(0,
|
|
923
|
+
(0, import_type_graphql13.ObjectType)()
|
|
766
924
|
], BaseResponseStatus);
|
|
767
925
|
var PendingResponseStatus = class extends BaseResponseStatus {
|
|
768
926
|
code = "pending";
|
|
769
927
|
};
|
|
770
928
|
__name(PendingResponseStatus, "PendingResponseStatus");
|
|
771
|
-
PendingResponseStatus =
|
|
772
|
-
(0,
|
|
929
|
+
PendingResponseStatus = _ts_decorate12([
|
|
930
|
+
(0, import_type_graphql13.ObjectType)({
|
|
773
931
|
implements: BaseResponseStatus
|
|
774
932
|
})
|
|
775
933
|
], PendingResponseStatus);
|
|
@@ -777,8 +935,8 @@ var SuccessResponseStatus = class extends BaseResponseStatus {
|
|
|
777
935
|
code = "success";
|
|
778
936
|
};
|
|
779
937
|
__name(SuccessResponseStatus, "SuccessResponseStatus");
|
|
780
|
-
SuccessResponseStatus =
|
|
781
|
-
(0,
|
|
938
|
+
SuccessResponseStatus = _ts_decorate12([
|
|
939
|
+
(0, import_type_graphql13.ObjectType)({
|
|
782
940
|
implements: BaseResponseStatus
|
|
783
941
|
})
|
|
784
942
|
], SuccessResponseStatus);
|
|
@@ -788,7 +946,7 @@ var FailedResponseStatusReason;
|
|
|
788
946
|
FailedResponseStatusReason2["MESSAGE_STREAM_INTERRUPTED"] = "MESSAGE_STREAM_INTERRUPTED";
|
|
789
947
|
FailedResponseStatusReason2["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
790
948
|
})(FailedResponseStatusReason || (FailedResponseStatusReason = {}));
|
|
791
|
-
(0,
|
|
949
|
+
(0, import_type_graphql13.registerEnumType)(FailedResponseStatusReason, {
|
|
792
950
|
name: "FailedResponseStatusReason"
|
|
793
951
|
});
|
|
794
952
|
var FailedResponseStatus = class extends BaseResponseStatus {
|
|
@@ -797,22 +955,22 @@ var FailedResponseStatus = class extends BaseResponseStatus {
|
|
|
797
955
|
details = null;
|
|
798
956
|
};
|
|
799
957
|
__name(FailedResponseStatus, "FailedResponseStatus");
|
|
800
|
-
|
|
801
|
-
(0,
|
|
802
|
-
|
|
958
|
+
_ts_decorate12([
|
|
959
|
+
(0, import_type_graphql13.Field)(() => FailedResponseStatusReason),
|
|
960
|
+
_ts_metadata12("design:type", String)
|
|
803
961
|
], FailedResponseStatus.prototype, "reason", void 0);
|
|
804
|
-
|
|
805
|
-
(0,
|
|
962
|
+
_ts_decorate12([
|
|
963
|
+
(0, import_type_graphql13.Field)(() => import_graphql_scalars.GraphQLJSON, {
|
|
806
964
|
nullable: true
|
|
807
965
|
}),
|
|
808
|
-
|
|
966
|
+
_ts_metadata12("design:type", typeof Record === "undefined" ? Object : Record)
|
|
809
967
|
], FailedResponseStatus.prototype, "details", void 0);
|
|
810
|
-
FailedResponseStatus =
|
|
811
|
-
(0,
|
|
968
|
+
FailedResponseStatus = _ts_decorate12([
|
|
969
|
+
(0, import_type_graphql13.ObjectType)({
|
|
812
970
|
implements: BaseResponseStatus
|
|
813
971
|
})
|
|
814
972
|
], FailedResponseStatus);
|
|
815
|
-
var ResponseStatusUnion = (0,
|
|
973
|
+
var ResponseStatusUnion = (0, import_type_graphql13.createUnionType)({
|
|
816
974
|
name: "ResponseStatus",
|
|
817
975
|
types: () => [
|
|
818
976
|
PendingResponseStatus,
|
|
@@ -822,7 +980,7 @@ var ResponseStatusUnion = (0, import_type_graphql11.createUnionType)({
|
|
|
822
980
|
});
|
|
823
981
|
|
|
824
982
|
// src/graphql/types/copilot-response.type.ts
|
|
825
|
-
function
|
|
983
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
826
984
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
827
985
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
828
986
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -832,31 +990,31 @@ function _ts_decorate11(decorators, target, key, desc) {
|
|
|
832
990
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
833
991
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
834
992
|
}
|
|
835
|
-
__name(
|
|
836
|
-
function
|
|
993
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
994
|
+
function _ts_metadata13(k, v) {
|
|
837
995
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
838
996
|
return Reflect.metadata(k, v);
|
|
839
997
|
}
|
|
840
|
-
__name(
|
|
998
|
+
__name(_ts_metadata13, "_ts_metadata");
|
|
841
999
|
var BaseMessageOutput = /* @__PURE__ */ __name(class BaseMessageOutput2 {
|
|
842
1000
|
id;
|
|
843
1001
|
createdAt;
|
|
844
1002
|
status;
|
|
845
1003
|
}, "BaseMessageOutput");
|
|
846
|
-
|
|
847
|
-
(0,
|
|
848
|
-
|
|
1004
|
+
_ts_decorate13([
|
|
1005
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1006
|
+
_ts_metadata13("design:type", String)
|
|
849
1007
|
], BaseMessageOutput.prototype, "id", void 0);
|
|
850
|
-
|
|
851
|
-
(0,
|
|
852
|
-
|
|
1008
|
+
_ts_decorate13([
|
|
1009
|
+
(0, import_type_graphql14.Field)(() => Date),
|
|
1010
|
+
_ts_metadata13("design:type", typeof Date === "undefined" ? Object : Date)
|
|
853
1011
|
], BaseMessageOutput.prototype, "createdAt", void 0);
|
|
854
|
-
|
|
855
|
-
(0,
|
|
856
|
-
|
|
1012
|
+
_ts_decorate13([
|
|
1013
|
+
(0, import_type_graphql14.Field)(() => MessageStatusUnion),
|
|
1014
|
+
_ts_metadata13("design:type", Object)
|
|
857
1015
|
], BaseMessageOutput.prototype, "status", void 0);
|
|
858
|
-
BaseMessageOutput =
|
|
859
|
-
(0,
|
|
1016
|
+
BaseMessageOutput = _ts_decorate13([
|
|
1017
|
+
(0, import_type_graphql14.InterfaceType)({
|
|
860
1018
|
resolveType(value) {
|
|
861
1019
|
if (value.hasOwnProperty("content")) {
|
|
862
1020
|
return TextMessageOutput;
|
|
@@ -864,6 +1022,8 @@ BaseMessageOutput = _ts_decorate11([
|
|
|
864
1022
|
return ActionExecutionMessageOutput;
|
|
865
1023
|
} else if (value.hasOwnProperty("result")) {
|
|
866
1024
|
return ResultMessageOutput;
|
|
1025
|
+
} else if (value.hasOwnProperty("state")) {
|
|
1026
|
+
return AgentStateMessageOutput;
|
|
867
1027
|
}
|
|
868
1028
|
return void 0;
|
|
869
1029
|
}
|
|
@@ -874,18 +1034,18 @@ var TextMessageOutput = class {
|
|
|
874
1034
|
content;
|
|
875
1035
|
};
|
|
876
1036
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
877
|
-
|
|
878
|
-
(0,
|
|
879
|
-
|
|
1037
|
+
_ts_decorate13([
|
|
1038
|
+
(0, import_type_graphql14.Field)(() => MessageRole),
|
|
1039
|
+
_ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
880
1040
|
], TextMessageOutput.prototype, "role", void 0);
|
|
881
|
-
|
|
882
|
-
(0,
|
|
1041
|
+
_ts_decorate13([
|
|
1042
|
+
(0, import_type_graphql14.Field)(() => [
|
|
883
1043
|
String
|
|
884
1044
|
]),
|
|
885
|
-
|
|
1045
|
+
_ts_metadata13("design:type", Array)
|
|
886
1046
|
], TextMessageOutput.prototype, "content", void 0);
|
|
887
|
-
TextMessageOutput =
|
|
888
|
-
(0,
|
|
1047
|
+
TextMessageOutput = _ts_decorate13([
|
|
1048
|
+
(0, import_type_graphql14.ObjectType)({
|
|
889
1049
|
implements: BaseMessageOutput
|
|
890
1050
|
})
|
|
891
1051
|
], TextMessageOutput);
|
|
@@ -895,22 +1055,22 @@ var ActionExecutionMessageOutput = class {
|
|
|
895
1055
|
arguments;
|
|
896
1056
|
};
|
|
897
1057
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
898
|
-
|
|
899
|
-
(0,
|
|
900
|
-
|
|
1058
|
+
_ts_decorate13([
|
|
1059
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1060
|
+
_ts_metadata13("design:type", String)
|
|
901
1061
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
902
|
-
|
|
903
|
-
(0,
|
|
904
|
-
|
|
1062
|
+
_ts_decorate13([
|
|
1063
|
+
(0, import_type_graphql14.Field)(() => ActionExecutionScope),
|
|
1064
|
+
_ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
905
1065
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
906
|
-
|
|
907
|
-
(0,
|
|
1066
|
+
_ts_decorate13([
|
|
1067
|
+
(0, import_type_graphql14.Field)(() => [
|
|
908
1068
|
String
|
|
909
1069
|
]),
|
|
910
|
-
|
|
1070
|
+
_ts_metadata13("design:type", Array)
|
|
911
1071
|
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
912
|
-
ActionExecutionMessageOutput =
|
|
913
|
-
(0,
|
|
1072
|
+
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1073
|
+
(0, import_type_graphql14.ObjectType)({
|
|
914
1074
|
implements: BaseMessageOutput
|
|
915
1075
|
})
|
|
916
1076
|
], ActionExecutionMessageOutput);
|
|
@@ -920,23 +1080,71 @@ var ResultMessageOutput = class {
|
|
|
920
1080
|
result;
|
|
921
1081
|
};
|
|
922
1082
|
__name(ResultMessageOutput, "ResultMessageOutput");
|
|
923
|
-
|
|
924
|
-
(0,
|
|
925
|
-
|
|
1083
|
+
_ts_decorate13([
|
|
1084
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1085
|
+
_ts_metadata13("design:type", String)
|
|
926
1086
|
], ResultMessageOutput.prototype, "actionExecutionId", void 0);
|
|
927
|
-
|
|
928
|
-
(0,
|
|
929
|
-
|
|
1087
|
+
_ts_decorate13([
|
|
1088
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1089
|
+
_ts_metadata13("design:type", String)
|
|
930
1090
|
], ResultMessageOutput.prototype, "actionName", void 0);
|
|
931
|
-
|
|
932
|
-
(0,
|
|
933
|
-
|
|
1091
|
+
_ts_decorate13([
|
|
1092
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1093
|
+
_ts_metadata13("design:type", String)
|
|
934
1094
|
], ResultMessageOutput.prototype, "result", void 0);
|
|
935
|
-
ResultMessageOutput =
|
|
936
|
-
(0,
|
|
1095
|
+
ResultMessageOutput = _ts_decorate13([
|
|
1096
|
+
(0, import_type_graphql14.ObjectType)({
|
|
937
1097
|
implements: BaseMessageOutput
|
|
938
1098
|
})
|
|
939
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);
|
|
940
1148
|
var CopilotResponse = class {
|
|
941
1149
|
threadId;
|
|
942
1150
|
status;
|
|
@@ -944,28 +1152,28 @@ var CopilotResponse = class {
|
|
|
944
1152
|
messages;
|
|
945
1153
|
};
|
|
946
1154
|
__name(CopilotResponse, "CopilotResponse");
|
|
947
|
-
|
|
948
|
-
(0,
|
|
949
|
-
|
|
1155
|
+
_ts_decorate13([
|
|
1156
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1157
|
+
_ts_metadata13("design:type", String)
|
|
950
1158
|
], CopilotResponse.prototype, "threadId", void 0);
|
|
951
|
-
|
|
952
|
-
(0,
|
|
953
|
-
|
|
1159
|
+
_ts_decorate13([
|
|
1160
|
+
(0, import_type_graphql14.Field)(() => ResponseStatusUnion),
|
|
1161
|
+
_ts_metadata13("design:type", Object)
|
|
954
1162
|
], CopilotResponse.prototype, "status", void 0);
|
|
955
|
-
|
|
956
|
-
(0,
|
|
1163
|
+
_ts_decorate13([
|
|
1164
|
+
(0, import_type_graphql14.Field)({
|
|
957
1165
|
nullable: true
|
|
958
1166
|
}),
|
|
959
|
-
|
|
1167
|
+
_ts_metadata13("design:type", String)
|
|
960
1168
|
], CopilotResponse.prototype, "runId", void 0);
|
|
961
|
-
|
|
962
|
-
(0,
|
|
1169
|
+
_ts_decorate13([
|
|
1170
|
+
(0, import_type_graphql14.Field)(() => [
|
|
963
1171
|
BaseMessageOutput
|
|
964
1172
|
]),
|
|
965
|
-
|
|
1173
|
+
_ts_metadata13("design:type", Array)
|
|
966
1174
|
], CopilotResponse.prototype, "messages", void 0);
|
|
967
|
-
CopilotResponse =
|
|
968
|
-
(0,
|
|
1175
|
+
CopilotResponse = _ts_decorate13([
|
|
1176
|
+
(0, import_type_graphql14.ObjectType)()
|
|
969
1177
|
], CopilotResponse);
|
|
970
1178
|
|
|
971
1179
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
@@ -992,6 +1200,26 @@ var ResultMessage = class extends BaseMessage {
|
|
|
992
1200
|
result;
|
|
993
1201
|
};
|
|
994
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;
|
|
995
1223
|
|
|
996
1224
|
// src/service-adapters/events.ts
|
|
997
1225
|
var RuntimeEventTypes;
|
|
@@ -1003,6 +1231,7 @@ var RuntimeEventTypes;
|
|
|
1003
1231
|
RuntimeEventTypes2["ActionExecutionArgs"] = "ActionExecutionArgs";
|
|
1004
1232
|
RuntimeEventTypes2["ActionExecutionEnd"] = "ActionExecutionEnd";
|
|
1005
1233
|
RuntimeEventTypes2["ActionExecutionResult"] = "ActionExecutionResult";
|
|
1234
|
+
RuntimeEventTypes2["AgentStateMessage"] = "AgentStateMessage";
|
|
1006
1235
|
})(RuntimeEventTypes || (RuntimeEventTypes = {}));
|
|
1007
1236
|
|
|
1008
1237
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
@@ -1043,18 +1272,9 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
|
|
|
1043
1272
|
};
|
|
1044
1273
|
__name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
1045
1274
|
|
|
1046
|
-
// src/lib/telemetry-client.ts
|
|
1047
|
-
var import_shared = require("@copilotkit/shared");
|
|
1048
|
-
var packageJson = require_package();
|
|
1049
|
-
var telemetryClient = new import_shared.TelemetryClient({
|
|
1050
|
-
packageName: packageJson.name,
|
|
1051
|
-
packageVersion: packageJson.version
|
|
1052
|
-
});
|
|
1053
|
-
var telemetry_client_default = telemetryClient;
|
|
1054
|
-
|
|
1055
1275
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1056
1276
|
var import_shared2 = require("@copilotkit/shared");
|
|
1057
|
-
function
|
|
1277
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
1058
1278
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1059
1279
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1060
1280
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1064,12 +1284,12 @@ function _ts_decorate12(decorators, target, key, desc) {
|
|
|
1064
1284
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1065
1285
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1066
1286
|
}
|
|
1067
|
-
__name(
|
|
1068
|
-
function
|
|
1287
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
1288
|
+
function _ts_metadata14(k, v) {
|
|
1069
1289
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1070
1290
|
return Reflect.metadata(k, v);
|
|
1071
1291
|
}
|
|
1072
|
-
__name(
|
|
1292
|
+
__name(_ts_metadata14, "_ts_metadata");
|
|
1073
1293
|
function _ts_param(paramIndex, decorator) {
|
|
1074
1294
|
return function(target, key) {
|
|
1075
1295
|
decorator(target, key, paramIndex);
|
|
@@ -1078,7 +1298,6 @@ function _ts_param(paramIndex, decorator) {
|
|
|
1078
1298
|
__name(_ts_param, "_ts_param");
|
|
1079
1299
|
var invokeGuardrails = /* @__PURE__ */ __name(async ({ baseUrl, copilotCloudPublicApiKey, data, onResult, onError }) => {
|
|
1080
1300
|
var _a;
|
|
1081
|
-
console.log("invokeGuardrails.baseUrl", baseUrl);
|
|
1082
1301
|
if (data.messages.length && ((_a = data.messages[data.messages.length - 1].textMessage) == null ? void 0 : _a.role) === MessageRole.user) {
|
|
1083
1302
|
const messages = data.messages.filter((m) => m.textMessage !== void 0 && (m.textMessage.role === MessageRole.user || m.textMessage.role === MessageRole.assistant)).map((m) => ({
|
|
1084
1303
|
role: m.textMessage.role,
|
|
@@ -1124,8 +1343,6 @@ var CopilotResolver = class {
|
|
|
1124
1343
|
logger2.debug({
|
|
1125
1344
|
data
|
|
1126
1345
|
}, "Generating Copilot response");
|
|
1127
|
-
const copilotRuntime = ctx._copilotkit.runtime;
|
|
1128
|
-
const serviceAdapter = ctx._copilotkit.serviceAdapter;
|
|
1129
1346
|
if (properties) {
|
|
1130
1347
|
logger2.debug("Properties provided, merging with context properties");
|
|
1131
1348
|
ctx.properties = {
|
|
@@ -1133,6 +1350,8 @@ var CopilotResolver = class {
|
|
|
1133
1350
|
...properties
|
|
1134
1351
|
};
|
|
1135
1352
|
}
|
|
1353
|
+
const copilotRuntime = ctx._copilotkit.runtime;
|
|
1354
|
+
const serviceAdapter = ctx._copilotkit.serviceAdapter;
|
|
1136
1355
|
let copilotCloudPublicApiKey = null;
|
|
1137
1356
|
let copilotCloudBaseUrl;
|
|
1138
1357
|
if (data.cloud) {
|
|
@@ -1171,16 +1390,18 @@ var CopilotResolver = class {
|
|
|
1171
1390
|
rejectOutputMessagesPromise = reject;
|
|
1172
1391
|
});
|
|
1173
1392
|
logger2.debug("Processing");
|
|
1174
|
-
const { eventSource, threadId = (0, import_shared2.randomId)(), runId,
|
|
1393
|
+
const { eventSource, threadId = (0, import_shared2.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
|
|
1175
1394
|
serviceAdapter,
|
|
1176
1395
|
messages: data.messages,
|
|
1177
1396
|
actions: data.frontend.actions,
|
|
1178
1397
|
threadId: data.threadId,
|
|
1179
1398
|
runId: data.runId,
|
|
1180
1399
|
publicApiKey: void 0,
|
|
1181
|
-
properties: ctx.properties || {},
|
|
1182
1400
|
outputMessagesPromise,
|
|
1401
|
+
graphqlContext: ctx,
|
|
1183
1402
|
forwardedParameters: data.forwardedParameters,
|
|
1403
|
+
agentSession: data.agentSession,
|
|
1404
|
+
agentStates: data.agentStates,
|
|
1184
1405
|
url: data.frontend.url
|
|
1185
1406
|
});
|
|
1186
1407
|
logger2.debug("Event source created, creating response");
|
|
@@ -1238,9 +1459,13 @@ var CopilotResolver = class {
|
|
|
1238
1459
|
});
|
|
1239
1460
|
}
|
|
1240
1461
|
let eventStreamSubscription;
|
|
1241
|
-
const eventStream = eventSource.
|
|
1242
|
-
|
|
1243
|
-
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
|
+
)
|
|
1244
1469
|
}).pipe(
|
|
1245
1470
|
// shareReplay() ensures that later subscribers will see the whole stream instead of
|
|
1246
1471
|
// just the events that were emitted after the subscriber was added.
|
|
@@ -1388,6 +1613,36 @@ var CopilotResolver = class {
|
|
|
1388
1613
|
result: event.result
|
|
1389
1614
|
}));
|
|
1390
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;
|
|
1391
1646
|
}
|
|
1392
1647
|
},
|
|
1393
1648
|
error: (err) => {
|
|
@@ -1420,29 +1675,29 @@ var CopilotResolver = class {
|
|
|
1420
1675
|
}
|
|
1421
1676
|
};
|
|
1422
1677
|
__name(CopilotResolver, "CopilotResolver");
|
|
1423
|
-
|
|
1424
|
-
(0,
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
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)
|
|
1428
1683
|
], CopilotResolver.prototype, "hello", null);
|
|
1429
|
-
|
|
1430
|
-
(0,
|
|
1431
|
-
_ts_param(0, (0,
|
|
1432
|
-
_ts_param(1, (0,
|
|
1433
|
-
_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, {
|
|
1434
1689
|
nullable: true
|
|
1435
1690
|
})),
|
|
1436
|
-
|
|
1437
|
-
|
|
1691
|
+
_ts_metadata14("design:type", Function),
|
|
1692
|
+
_ts_metadata14("design:paramtypes", [
|
|
1438
1693
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
1439
1694
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
1440
1695
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
1441
1696
|
]),
|
|
1442
|
-
|
|
1697
|
+
_ts_metadata14("design:returntype", Promise)
|
|
1443
1698
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
1444
|
-
CopilotResolver =
|
|
1445
|
-
(0,
|
|
1699
|
+
CopilotResolver = _ts_decorate14([
|
|
1700
|
+
(0, import_type_graphql15.Resolver)(() => CopilotResponse)
|
|
1446
1701
|
], CopilotResolver);
|
|
1447
1702
|
|
|
1448
1703
|
// src/lib/integrations/shared.ts
|
|
@@ -1497,7 +1752,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
1497
1752
|
__name(createContext, "createContext");
|
|
1498
1753
|
function buildSchema(options = {}) {
|
|
1499
1754
|
logger.debug("Building GraphQL schema...");
|
|
1500
|
-
const schema = (0,
|
|
1755
|
+
const schema = (0, import_type_graphql16.buildSchemaSync)({
|
|
1501
1756
|
resolvers: [
|
|
1502
1757
|
CopilotResolver
|
|
1503
1758
|
],
|