@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",
|
|
@@ -124,14 +126,14 @@ module.exports = __toCommonJS(node_http_exports);
|
|
|
124
126
|
var import_graphql_yoga2 = require("graphql-yoga");
|
|
125
127
|
|
|
126
128
|
// src/lib/integrations/shared.ts
|
|
127
|
-
var
|
|
129
|
+
var import_type_graphql16 = require("type-graphql");
|
|
128
130
|
|
|
129
131
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
130
|
-
var
|
|
132
|
+
var import_type_graphql15 = require("type-graphql");
|
|
131
133
|
var import_rxjs2 = require("rxjs");
|
|
132
134
|
|
|
133
135
|
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
134
|
-
var
|
|
136
|
+
var import_type_graphql11 = require("type-graphql");
|
|
135
137
|
|
|
136
138
|
// src/graphql/inputs/message.input.ts
|
|
137
139
|
var import_type_graphql3 = require("type-graphql");
|
|
@@ -148,6 +150,7 @@ var ActionExecutionScope;
|
|
|
148
150
|
(function(ActionExecutionScope2) {
|
|
149
151
|
ActionExecutionScope2["server"] = "server";
|
|
150
152
|
ActionExecutionScope2["client"] = "client";
|
|
153
|
+
ActionExecutionScope2["passThrough"] = "passThrough";
|
|
151
154
|
})(ActionExecutionScope || (ActionExecutionScope = {}));
|
|
152
155
|
var CopilotRequestType;
|
|
153
156
|
(function(CopilotRequestType2) {
|
|
@@ -226,6 +229,7 @@ var MessageInput = class extends BaseMessage {
|
|
|
226
229
|
textMessage;
|
|
227
230
|
actionExecutionMessage;
|
|
228
231
|
resultMessage;
|
|
232
|
+
agentStateMessage;
|
|
229
233
|
};
|
|
230
234
|
__name(MessageInput, "MessageInput");
|
|
231
235
|
_ts_decorate2([
|
|
@@ -246,6 +250,12 @@ _ts_decorate2([
|
|
|
246
250
|
}),
|
|
247
251
|
_ts_metadata2("design:type", typeof ResultMessageInput === "undefined" ? Object : ResultMessageInput)
|
|
248
252
|
], MessageInput.prototype, "resultMessage", void 0);
|
|
253
|
+
_ts_decorate2([
|
|
254
|
+
(0, import_type_graphql3.Field)(() => AgentStateMessageInput, {
|
|
255
|
+
nullable: true
|
|
256
|
+
}),
|
|
257
|
+
_ts_metadata2("design:type", typeof AgentStateMessageInput === "undefined" ? Object : AgentStateMessageInput)
|
|
258
|
+
], MessageInput.prototype, "agentStateMessage", void 0);
|
|
249
259
|
MessageInput = _ts_decorate2([
|
|
250
260
|
(0, import_type_graphql3.InputType)()
|
|
251
261
|
], MessageInput);
|
|
@@ -307,6 +317,52 @@ _ts_decorate2([
|
|
|
307
317
|
ResultMessageInput = _ts_decorate2([
|
|
308
318
|
(0, import_type_graphql3.InputType)()
|
|
309
319
|
], ResultMessageInput);
|
|
320
|
+
var AgentStateMessageInput = class {
|
|
321
|
+
threadId;
|
|
322
|
+
agentName;
|
|
323
|
+
role;
|
|
324
|
+
state;
|
|
325
|
+
running;
|
|
326
|
+
nodeName;
|
|
327
|
+
runId;
|
|
328
|
+
active;
|
|
329
|
+
};
|
|
330
|
+
__name(AgentStateMessageInput, "AgentStateMessageInput");
|
|
331
|
+
_ts_decorate2([
|
|
332
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
333
|
+
_ts_metadata2("design:type", String)
|
|
334
|
+
], AgentStateMessageInput.prototype, "threadId", void 0);
|
|
335
|
+
_ts_decorate2([
|
|
336
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
337
|
+
_ts_metadata2("design:type", String)
|
|
338
|
+
], AgentStateMessageInput.prototype, "agentName", void 0);
|
|
339
|
+
_ts_decorate2([
|
|
340
|
+
(0, import_type_graphql3.Field)(() => MessageRole),
|
|
341
|
+
_ts_metadata2("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
342
|
+
], AgentStateMessageInput.prototype, "role", void 0);
|
|
343
|
+
_ts_decorate2([
|
|
344
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
345
|
+
_ts_metadata2("design:type", String)
|
|
346
|
+
], AgentStateMessageInput.prototype, "state", void 0);
|
|
347
|
+
_ts_decorate2([
|
|
348
|
+
(0, import_type_graphql3.Field)(() => Boolean),
|
|
349
|
+
_ts_metadata2("design:type", Boolean)
|
|
350
|
+
], AgentStateMessageInput.prototype, "running", void 0);
|
|
351
|
+
_ts_decorate2([
|
|
352
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
353
|
+
_ts_metadata2("design:type", String)
|
|
354
|
+
], AgentStateMessageInput.prototype, "nodeName", void 0);
|
|
355
|
+
_ts_decorate2([
|
|
356
|
+
(0, import_type_graphql3.Field)(() => String),
|
|
357
|
+
_ts_metadata2("design:type", String)
|
|
358
|
+
], AgentStateMessageInput.prototype, "runId", void 0);
|
|
359
|
+
_ts_decorate2([
|
|
360
|
+
(0, import_type_graphql3.Field)(() => Boolean),
|
|
361
|
+
_ts_metadata2("design:type", Boolean)
|
|
362
|
+
], AgentStateMessageInput.prototype, "active", void 0);
|
|
363
|
+
AgentStateMessageInput = _ts_decorate2([
|
|
364
|
+
(0, import_type_graphql3.InputType)()
|
|
365
|
+
], AgentStateMessageInput);
|
|
310
366
|
|
|
311
367
|
// src/graphql/inputs/frontend.input.ts
|
|
312
368
|
var import_type_graphql5 = require("type-graphql");
|
|
@@ -548,7 +604,8 @@ ForwardedParametersInput = _ts_decorate7([
|
|
|
548
604
|
(0, import_type_graphql8.InputType)()
|
|
549
605
|
], ForwardedParametersInput);
|
|
550
606
|
|
|
551
|
-
// src/graphql/inputs/
|
|
607
|
+
// src/graphql/inputs/agent-session.input.ts
|
|
608
|
+
var import_type_graphql9 = require("type-graphql");
|
|
552
609
|
function _ts_decorate8(decorators, target, key, desc) {
|
|
553
610
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
554
611
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -565,18 +622,96 @@ function _ts_metadata8(k, v) {
|
|
|
565
622
|
return Reflect.metadata(k, v);
|
|
566
623
|
}
|
|
567
624
|
__name(_ts_metadata8, "_ts_metadata");
|
|
625
|
+
var AgentSessionInput = class {
|
|
626
|
+
agentName;
|
|
627
|
+
threadId;
|
|
628
|
+
nodeName;
|
|
629
|
+
};
|
|
630
|
+
__name(AgentSessionInput, "AgentSessionInput");
|
|
631
|
+
_ts_decorate8([
|
|
632
|
+
(0, import_type_graphql9.Field)(() => String),
|
|
633
|
+
_ts_metadata8("design:type", String)
|
|
634
|
+
], AgentSessionInput.prototype, "agentName", void 0);
|
|
635
|
+
_ts_decorate8([
|
|
636
|
+
(0, import_type_graphql9.Field)(() => String, {
|
|
637
|
+
nullable: true
|
|
638
|
+
}),
|
|
639
|
+
_ts_metadata8("design:type", String)
|
|
640
|
+
], AgentSessionInput.prototype, "threadId", void 0);
|
|
641
|
+
_ts_decorate8([
|
|
642
|
+
(0, import_type_graphql9.Field)(() => String, {
|
|
643
|
+
nullable: true
|
|
644
|
+
}),
|
|
645
|
+
_ts_metadata8("design:type", String)
|
|
646
|
+
], AgentSessionInput.prototype, "nodeName", void 0);
|
|
647
|
+
AgentSessionInput = _ts_decorate8([
|
|
648
|
+
(0, import_type_graphql9.InputType)()
|
|
649
|
+
], AgentSessionInput);
|
|
650
|
+
|
|
651
|
+
// src/graphql/inputs/agent-state.input.ts
|
|
652
|
+
var import_type_graphql10 = require("type-graphql");
|
|
653
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
654
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
655
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
656
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
657
|
+
else
|
|
658
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
659
|
+
if (d = decorators[i])
|
|
660
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
661
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
662
|
+
}
|
|
663
|
+
__name(_ts_decorate9, "_ts_decorate");
|
|
664
|
+
function _ts_metadata9(k, v) {
|
|
665
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
666
|
+
return Reflect.metadata(k, v);
|
|
667
|
+
}
|
|
668
|
+
__name(_ts_metadata9, "_ts_metadata");
|
|
669
|
+
var AgentStateInput = class {
|
|
670
|
+
agentName;
|
|
671
|
+
state;
|
|
672
|
+
};
|
|
673
|
+
__name(AgentStateInput, "AgentStateInput");
|
|
674
|
+
_ts_decorate9([
|
|
675
|
+
(0, import_type_graphql10.Field)(() => String),
|
|
676
|
+
_ts_metadata9("design:type", String)
|
|
677
|
+
], AgentStateInput.prototype, "agentName", void 0);
|
|
678
|
+
_ts_decorate9([
|
|
679
|
+
(0, import_type_graphql10.Field)(() => String),
|
|
680
|
+
_ts_metadata9("design:type", String)
|
|
681
|
+
], AgentStateInput.prototype, "state", void 0);
|
|
682
|
+
AgentStateInput = _ts_decorate9([
|
|
683
|
+
(0, import_type_graphql10.InputType)()
|
|
684
|
+
], AgentStateInput);
|
|
685
|
+
|
|
686
|
+
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
687
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
688
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
689
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
690
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
691
|
+
else
|
|
692
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
693
|
+
if (d = decorators[i])
|
|
694
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
695
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
696
|
+
}
|
|
697
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
698
|
+
function _ts_metadata10(k, v) {
|
|
699
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
700
|
+
return Reflect.metadata(k, v);
|
|
701
|
+
}
|
|
702
|
+
__name(_ts_metadata10, "_ts_metadata");
|
|
568
703
|
var GenerateCopilotResponseMetadataInput = class {
|
|
569
704
|
requestType;
|
|
570
705
|
};
|
|
571
706
|
__name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
|
|
572
|
-
|
|
573
|
-
(0,
|
|
707
|
+
_ts_decorate10([
|
|
708
|
+
(0, import_type_graphql11.Field)(() => CopilotRequestType, {
|
|
574
709
|
nullable: true
|
|
575
710
|
}),
|
|
576
|
-
|
|
711
|
+
_ts_metadata10("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
|
|
577
712
|
], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
|
|
578
|
-
GenerateCopilotResponseMetadataInput =
|
|
579
|
-
(0,
|
|
713
|
+
GenerateCopilotResponseMetadataInput = _ts_decorate10([
|
|
714
|
+
(0, import_type_graphql11.InputType)()
|
|
580
715
|
], GenerateCopilotResponseMetadataInput);
|
|
581
716
|
var GenerateCopilotResponseInput = class {
|
|
582
717
|
metadata;
|
|
@@ -586,58 +721,81 @@ var GenerateCopilotResponseInput = class {
|
|
|
586
721
|
frontend;
|
|
587
722
|
cloud;
|
|
588
723
|
forwardedParameters;
|
|
724
|
+
agentSession;
|
|
725
|
+
agentState;
|
|
726
|
+
agentStates;
|
|
589
727
|
};
|
|
590
728
|
__name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
|
|
591
|
-
|
|
592
|
-
(0,
|
|
729
|
+
_ts_decorate10([
|
|
730
|
+
(0, import_type_graphql11.Field)(() => GenerateCopilotResponseMetadataInput, {
|
|
593
731
|
nullable: false
|
|
594
732
|
}),
|
|
595
|
-
|
|
733
|
+
_ts_metadata10("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
|
|
596
734
|
], GenerateCopilotResponseInput.prototype, "metadata", void 0);
|
|
597
|
-
|
|
598
|
-
(0,
|
|
735
|
+
_ts_decorate10([
|
|
736
|
+
(0, import_type_graphql11.Field)(() => String, {
|
|
599
737
|
nullable: true
|
|
600
738
|
}),
|
|
601
|
-
|
|
739
|
+
_ts_metadata10("design:type", String)
|
|
602
740
|
], GenerateCopilotResponseInput.prototype, "threadId", void 0);
|
|
603
|
-
|
|
604
|
-
(0,
|
|
741
|
+
_ts_decorate10([
|
|
742
|
+
(0, import_type_graphql11.Field)(() => String, {
|
|
605
743
|
nullable: true
|
|
606
744
|
}),
|
|
607
|
-
|
|
745
|
+
_ts_metadata10("design:type", String)
|
|
608
746
|
], GenerateCopilotResponseInput.prototype, "runId", void 0);
|
|
609
|
-
|
|
610
|
-
(0,
|
|
747
|
+
_ts_decorate10([
|
|
748
|
+
(0, import_type_graphql11.Field)(() => [
|
|
611
749
|
MessageInput
|
|
612
750
|
]),
|
|
613
|
-
|
|
751
|
+
_ts_metadata10("design:type", Array)
|
|
614
752
|
], GenerateCopilotResponseInput.prototype, "messages", void 0);
|
|
615
|
-
|
|
616
|
-
(0,
|
|
617
|
-
|
|
753
|
+
_ts_decorate10([
|
|
754
|
+
(0, import_type_graphql11.Field)(() => FrontendInput),
|
|
755
|
+
_ts_metadata10("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
|
|
618
756
|
], GenerateCopilotResponseInput.prototype, "frontend", void 0);
|
|
619
|
-
|
|
620
|
-
(0,
|
|
757
|
+
_ts_decorate10([
|
|
758
|
+
(0, import_type_graphql11.Field)(() => CloudInput, {
|
|
621
759
|
nullable: true
|
|
622
760
|
}),
|
|
623
|
-
|
|
761
|
+
_ts_metadata10("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
|
|
624
762
|
], GenerateCopilotResponseInput.prototype, "cloud", void 0);
|
|
625
|
-
|
|
626
|
-
(0,
|
|
763
|
+
_ts_decorate10([
|
|
764
|
+
(0, import_type_graphql11.Field)(() => ForwardedParametersInput, {
|
|
627
765
|
nullable: true
|
|
628
766
|
}),
|
|
629
|
-
|
|
767
|
+
_ts_metadata10("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
|
|
630
768
|
], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
|
|
631
|
-
|
|
632
|
-
(0,
|
|
769
|
+
_ts_decorate10([
|
|
770
|
+
(0, import_type_graphql11.Field)(() => AgentSessionInput, {
|
|
771
|
+
nullable: true
|
|
772
|
+
}),
|
|
773
|
+
_ts_metadata10("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
|
|
774
|
+
], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
|
|
775
|
+
_ts_decorate10([
|
|
776
|
+
(0, import_type_graphql11.Field)(() => AgentStateInput, {
|
|
777
|
+
nullable: true
|
|
778
|
+
}),
|
|
779
|
+
_ts_metadata10("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
|
|
780
|
+
], GenerateCopilotResponseInput.prototype, "agentState", void 0);
|
|
781
|
+
_ts_decorate10([
|
|
782
|
+
(0, import_type_graphql11.Field)(() => [
|
|
783
|
+
AgentStateInput
|
|
784
|
+
], {
|
|
785
|
+
nullable: true
|
|
786
|
+
}),
|
|
787
|
+
_ts_metadata10("design:type", Array)
|
|
788
|
+
], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
|
|
789
|
+
GenerateCopilotResponseInput = _ts_decorate10([
|
|
790
|
+
(0, import_type_graphql11.InputType)()
|
|
633
791
|
], GenerateCopilotResponseInput);
|
|
634
792
|
|
|
635
793
|
// src/graphql/types/copilot-response.type.ts
|
|
636
|
-
var
|
|
794
|
+
var import_type_graphql14 = require("type-graphql");
|
|
637
795
|
|
|
638
796
|
// src/graphql/types/message-status.type.ts
|
|
639
|
-
var
|
|
640
|
-
function
|
|
797
|
+
var import_type_graphql12 = require("type-graphql");
|
|
798
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
641
799
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
642
800
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
643
801
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -647,58 +805,58 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
647
805
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
648
806
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
649
807
|
}
|
|
650
|
-
__name(
|
|
651
|
-
function
|
|
808
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
809
|
+
function _ts_metadata11(k, v) {
|
|
652
810
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
653
811
|
return Reflect.metadata(k, v);
|
|
654
812
|
}
|
|
655
|
-
__name(
|
|
813
|
+
__name(_ts_metadata11, "_ts_metadata");
|
|
656
814
|
var MessageStatusCode;
|
|
657
815
|
(function(MessageStatusCode2) {
|
|
658
816
|
MessageStatusCode2["Pending"] = "pending";
|
|
659
817
|
MessageStatusCode2["Success"] = "success";
|
|
660
818
|
MessageStatusCode2["Failed"] = "failed";
|
|
661
819
|
})(MessageStatusCode || (MessageStatusCode = {}));
|
|
662
|
-
(0,
|
|
820
|
+
(0, import_type_graphql12.registerEnumType)(MessageStatusCode, {
|
|
663
821
|
name: "MessageStatusCode"
|
|
664
822
|
});
|
|
665
823
|
var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
|
|
666
824
|
code;
|
|
667
825
|
}, "BaseMessageStatus");
|
|
668
|
-
|
|
669
|
-
(0,
|
|
670
|
-
|
|
826
|
+
_ts_decorate11([
|
|
827
|
+
(0, import_type_graphql12.Field)(() => MessageStatusCode),
|
|
828
|
+
_ts_metadata11("design:type", String)
|
|
671
829
|
], BaseMessageStatus.prototype, "code", void 0);
|
|
672
|
-
BaseMessageStatus =
|
|
673
|
-
(0,
|
|
830
|
+
BaseMessageStatus = _ts_decorate11([
|
|
831
|
+
(0, import_type_graphql12.ObjectType)()
|
|
674
832
|
], BaseMessageStatus);
|
|
675
833
|
var PendingMessageStatus = class extends BaseMessageStatus {
|
|
676
834
|
code = "pending";
|
|
677
835
|
};
|
|
678
836
|
__name(PendingMessageStatus, "PendingMessageStatus");
|
|
679
|
-
PendingMessageStatus =
|
|
680
|
-
(0,
|
|
837
|
+
PendingMessageStatus = _ts_decorate11([
|
|
838
|
+
(0, import_type_graphql12.ObjectType)()
|
|
681
839
|
], PendingMessageStatus);
|
|
682
840
|
var SuccessMessageStatus = class extends BaseMessageStatus {
|
|
683
841
|
code = "success";
|
|
684
842
|
};
|
|
685
843
|
__name(SuccessMessageStatus, "SuccessMessageStatus");
|
|
686
|
-
SuccessMessageStatus =
|
|
687
|
-
(0,
|
|
844
|
+
SuccessMessageStatus = _ts_decorate11([
|
|
845
|
+
(0, import_type_graphql12.ObjectType)()
|
|
688
846
|
], SuccessMessageStatus);
|
|
689
847
|
var FailedMessageStatus = class extends BaseMessageStatus {
|
|
690
848
|
code = "failed";
|
|
691
849
|
reason;
|
|
692
850
|
};
|
|
693
851
|
__name(FailedMessageStatus, "FailedMessageStatus");
|
|
694
|
-
|
|
695
|
-
(0,
|
|
696
|
-
|
|
852
|
+
_ts_decorate11([
|
|
853
|
+
(0, import_type_graphql12.Field)(() => String),
|
|
854
|
+
_ts_metadata11("design:type", String)
|
|
697
855
|
], FailedMessageStatus.prototype, "reason", void 0);
|
|
698
|
-
FailedMessageStatus =
|
|
699
|
-
(0,
|
|
856
|
+
FailedMessageStatus = _ts_decorate11([
|
|
857
|
+
(0, import_type_graphql12.ObjectType)()
|
|
700
858
|
], FailedMessageStatus);
|
|
701
|
-
var MessageStatusUnion = (0,
|
|
859
|
+
var MessageStatusUnion = (0, import_type_graphql12.createUnionType)({
|
|
702
860
|
name: "MessageStatus",
|
|
703
861
|
types: () => [
|
|
704
862
|
PendingMessageStatus,
|
|
@@ -709,8 +867,8 @@ var MessageStatusUnion = (0, import_type_graphql10.createUnionType)({
|
|
|
709
867
|
|
|
710
868
|
// src/graphql/types/response-status.type.ts
|
|
711
869
|
var import_graphql_scalars = require("graphql-scalars");
|
|
712
|
-
var
|
|
713
|
-
function
|
|
870
|
+
var import_type_graphql13 = require("type-graphql");
|
|
871
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
714
872
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
715
873
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
716
874
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -720,30 +878,30 @@ function _ts_decorate10(decorators, target, key, desc) {
|
|
|
720
878
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
721
879
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
722
880
|
}
|
|
723
|
-
__name(
|
|
724
|
-
function
|
|
881
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
882
|
+
function _ts_metadata12(k, v) {
|
|
725
883
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
726
884
|
return Reflect.metadata(k, v);
|
|
727
885
|
}
|
|
728
|
-
__name(
|
|
886
|
+
__name(_ts_metadata12, "_ts_metadata");
|
|
729
887
|
var ResponseStatusCode;
|
|
730
888
|
(function(ResponseStatusCode2) {
|
|
731
889
|
ResponseStatusCode2["Pending"] = "pending";
|
|
732
890
|
ResponseStatusCode2["Success"] = "success";
|
|
733
891
|
ResponseStatusCode2["Failed"] = "failed";
|
|
734
892
|
})(ResponseStatusCode || (ResponseStatusCode = {}));
|
|
735
|
-
(0,
|
|
893
|
+
(0, import_type_graphql13.registerEnumType)(ResponseStatusCode, {
|
|
736
894
|
name: "ResponseStatusCode"
|
|
737
895
|
});
|
|
738
896
|
var BaseResponseStatus = /* @__PURE__ */ __name(class BaseResponseStatus2 {
|
|
739
897
|
code;
|
|
740
898
|
}, "BaseResponseStatus");
|
|
741
|
-
|
|
742
|
-
(0,
|
|
743
|
-
|
|
899
|
+
_ts_decorate12([
|
|
900
|
+
(0, import_type_graphql13.Field)(() => ResponseStatusCode),
|
|
901
|
+
_ts_metadata12("design:type", String)
|
|
744
902
|
], BaseResponseStatus.prototype, "code", void 0);
|
|
745
|
-
BaseResponseStatus =
|
|
746
|
-
(0,
|
|
903
|
+
BaseResponseStatus = _ts_decorate12([
|
|
904
|
+
(0, import_type_graphql13.InterfaceType)({
|
|
747
905
|
resolveType(value) {
|
|
748
906
|
if (value.code === "success") {
|
|
749
907
|
return SuccessResponseStatus;
|
|
@@ -755,14 +913,14 @@ BaseResponseStatus = _ts_decorate10([
|
|
|
755
913
|
return void 0;
|
|
756
914
|
}
|
|
757
915
|
}),
|
|
758
|
-
(0,
|
|
916
|
+
(0, import_type_graphql13.ObjectType)()
|
|
759
917
|
], BaseResponseStatus);
|
|
760
918
|
var PendingResponseStatus = class extends BaseResponseStatus {
|
|
761
919
|
code = "pending";
|
|
762
920
|
};
|
|
763
921
|
__name(PendingResponseStatus, "PendingResponseStatus");
|
|
764
|
-
PendingResponseStatus =
|
|
765
|
-
(0,
|
|
922
|
+
PendingResponseStatus = _ts_decorate12([
|
|
923
|
+
(0, import_type_graphql13.ObjectType)({
|
|
766
924
|
implements: BaseResponseStatus
|
|
767
925
|
})
|
|
768
926
|
], PendingResponseStatus);
|
|
@@ -770,8 +928,8 @@ var SuccessResponseStatus = class extends BaseResponseStatus {
|
|
|
770
928
|
code = "success";
|
|
771
929
|
};
|
|
772
930
|
__name(SuccessResponseStatus, "SuccessResponseStatus");
|
|
773
|
-
SuccessResponseStatus =
|
|
774
|
-
(0,
|
|
931
|
+
SuccessResponseStatus = _ts_decorate12([
|
|
932
|
+
(0, import_type_graphql13.ObjectType)({
|
|
775
933
|
implements: BaseResponseStatus
|
|
776
934
|
})
|
|
777
935
|
], SuccessResponseStatus);
|
|
@@ -781,7 +939,7 @@ var FailedResponseStatusReason;
|
|
|
781
939
|
FailedResponseStatusReason2["MESSAGE_STREAM_INTERRUPTED"] = "MESSAGE_STREAM_INTERRUPTED";
|
|
782
940
|
FailedResponseStatusReason2["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
783
941
|
})(FailedResponseStatusReason || (FailedResponseStatusReason = {}));
|
|
784
|
-
(0,
|
|
942
|
+
(0, import_type_graphql13.registerEnumType)(FailedResponseStatusReason, {
|
|
785
943
|
name: "FailedResponseStatusReason"
|
|
786
944
|
});
|
|
787
945
|
var FailedResponseStatus = class extends BaseResponseStatus {
|
|
@@ -790,22 +948,22 @@ var FailedResponseStatus = class extends BaseResponseStatus {
|
|
|
790
948
|
details = null;
|
|
791
949
|
};
|
|
792
950
|
__name(FailedResponseStatus, "FailedResponseStatus");
|
|
793
|
-
|
|
794
|
-
(0,
|
|
795
|
-
|
|
951
|
+
_ts_decorate12([
|
|
952
|
+
(0, import_type_graphql13.Field)(() => FailedResponseStatusReason),
|
|
953
|
+
_ts_metadata12("design:type", String)
|
|
796
954
|
], FailedResponseStatus.prototype, "reason", void 0);
|
|
797
|
-
|
|
798
|
-
(0,
|
|
955
|
+
_ts_decorate12([
|
|
956
|
+
(0, import_type_graphql13.Field)(() => import_graphql_scalars.GraphQLJSON, {
|
|
799
957
|
nullable: true
|
|
800
958
|
}),
|
|
801
|
-
|
|
959
|
+
_ts_metadata12("design:type", typeof Record === "undefined" ? Object : Record)
|
|
802
960
|
], FailedResponseStatus.prototype, "details", void 0);
|
|
803
|
-
FailedResponseStatus =
|
|
804
|
-
(0,
|
|
961
|
+
FailedResponseStatus = _ts_decorate12([
|
|
962
|
+
(0, import_type_graphql13.ObjectType)({
|
|
805
963
|
implements: BaseResponseStatus
|
|
806
964
|
})
|
|
807
965
|
], FailedResponseStatus);
|
|
808
|
-
var ResponseStatusUnion = (0,
|
|
966
|
+
var ResponseStatusUnion = (0, import_type_graphql13.createUnionType)({
|
|
809
967
|
name: "ResponseStatus",
|
|
810
968
|
types: () => [
|
|
811
969
|
PendingResponseStatus,
|
|
@@ -815,7 +973,7 @@ var ResponseStatusUnion = (0, import_type_graphql11.createUnionType)({
|
|
|
815
973
|
});
|
|
816
974
|
|
|
817
975
|
// src/graphql/types/copilot-response.type.ts
|
|
818
|
-
function
|
|
976
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
819
977
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
820
978
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
821
979
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -825,31 +983,31 @@ function _ts_decorate11(decorators, target, key, desc) {
|
|
|
825
983
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
826
984
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
827
985
|
}
|
|
828
|
-
__name(
|
|
829
|
-
function
|
|
986
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
987
|
+
function _ts_metadata13(k, v) {
|
|
830
988
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
831
989
|
return Reflect.metadata(k, v);
|
|
832
990
|
}
|
|
833
|
-
__name(
|
|
991
|
+
__name(_ts_metadata13, "_ts_metadata");
|
|
834
992
|
var BaseMessageOutput = /* @__PURE__ */ __name(class BaseMessageOutput2 {
|
|
835
993
|
id;
|
|
836
994
|
createdAt;
|
|
837
995
|
status;
|
|
838
996
|
}, "BaseMessageOutput");
|
|
839
|
-
|
|
840
|
-
(0,
|
|
841
|
-
|
|
997
|
+
_ts_decorate13([
|
|
998
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
999
|
+
_ts_metadata13("design:type", String)
|
|
842
1000
|
], BaseMessageOutput.prototype, "id", void 0);
|
|
843
|
-
|
|
844
|
-
(0,
|
|
845
|
-
|
|
1001
|
+
_ts_decorate13([
|
|
1002
|
+
(0, import_type_graphql14.Field)(() => Date),
|
|
1003
|
+
_ts_metadata13("design:type", typeof Date === "undefined" ? Object : Date)
|
|
846
1004
|
], BaseMessageOutput.prototype, "createdAt", void 0);
|
|
847
|
-
|
|
848
|
-
(0,
|
|
849
|
-
|
|
1005
|
+
_ts_decorate13([
|
|
1006
|
+
(0, import_type_graphql14.Field)(() => MessageStatusUnion),
|
|
1007
|
+
_ts_metadata13("design:type", Object)
|
|
850
1008
|
], BaseMessageOutput.prototype, "status", void 0);
|
|
851
|
-
BaseMessageOutput =
|
|
852
|
-
(0,
|
|
1009
|
+
BaseMessageOutput = _ts_decorate13([
|
|
1010
|
+
(0, import_type_graphql14.InterfaceType)({
|
|
853
1011
|
resolveType(value) {
|
|
854
1012
|
if (value.hasOwnProperty("content")) {
|
|
855
1013
|
return TextMessageOutput;
|
|
@@ -857,6 +1015,8 @@ BaseMessageOutput = _ts_decorate11([
|
|
|
857
1015
|
return ActionExecutionMessageOutput;
|
|
858
1016
|
} else if (value.hasOwnProperty("result")) {
|
|
859
1017
|
return ResultMessageOutput;
|
|
1018
|
+
} else if (value.hasOwnProperty("state")) {
|
|
1019
|
+
return AgentStateMessageOutput;
|
|
860
1020
|
}
|
|
861
1021
|
return void 0;
|
|
862
1022
|
}
|
|
@@ -867,18 +1027,18 @@ var TextMessageOutput = class {
|
|
|
867
1027
|
content;
|
|
868
1028
|
};
|
|
869
1029
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
870
|
-
|
|
871
|
-
(0,
|
|
872
|
-
|
|
1030
|
+
_ts_decorate13([
|
|
1031
|
+
(0, import_type_graphql14.Field)(() => MessageRole),
|
|
1032
|
+
_ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
873
1033
|
], TextMessageOutput.prototype, "role", void 0);
|
|
874
|
-
|
|
875
|
-
(0,
|
|
1034
|
+
_ts_decorate13([
|
|
1035
|
+
(0, import_type_graphql14.Field)(() => [
|
|
876
1036
|
String
|
|
877
1037
|
]),
|
|
878
|
-
|
|
1038
|
+
_ts_metadata13("design:type", Array)
|
|
879
1039
|
], TextMessageOutput.prototype, "content", void 0);
|
|
880
|
-
TextMessageOutput =
|
|
881
|
-
(0,
|
|
1040
|
+
TextMessageOutput = _ts_decorate13([
|
|
1041
|
+
(0, import_type_graphql14.ObjectType)({
|
|
882
1042
|
implements: BaseMessageOutput
|
|
883
1043
|
})
|
|
884
1044
|
], TextMessageOutput);
|
|
@@ -888,22 +1048,22 @@ var ActionExecutionMessageOutput = class {
|
|
|
888
1048
|
arguments;
|
|
889
1049
|
};
|
|
890
1050
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
891
|
-
|
|
892
|
-
(0,
|
|
893
|
-
|
|
1051
|
+
_ts_decorate13([
|
|
1052
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1053
|
+
_ts_metadata13("design:type", String)
|
|
894
1054
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
895
|
-
|
|
896
|
-
(0,
|
|
897
|
-
|
|
1055
|
+
_ts_decorate13([
|
|
1056
|
+
(0, import_type_graphql14.Field)(() => ActionExecutionScope),
|
|
1057
|
+
_ts_metadata13("design:type", typeof ActionExecutionScope === "undefined" ? Object : ActionExecutionScope)
|
|
898
1058
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
899
|
-
|
|
900
|
-
(0,
|
|
1059
|
+
_ts_decorate13([
|
|
1060
|
+
(0, import_type_graphql14.Field)(() => [
|
|
901
1061
|
String
|
|
902
1062
|
]),
|
|
903
|
-
|
|
1063
|
+
_ts_metadata13("design:type", Array)
|
|
904
1064
|
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
905
|
-
ActionExecutionMessageOutput =
|
|
906
|
-
(0,
|
|
1065
|
+
ActionExecutionMessageOutput = _ts_decorate13([
|
|
1066
|
+
(0, import_type_graphql14.ObjectType)({
|
|
907
1067
|
implements: BaseMessageOutput
|
|
908
1068
|
})
|
|
909
1069
|
], ActionExecutionMessageOutput);
|
|
@@ -913,23 +1073,71 @@ var ResultMessageOutput = class {
|
|
|
913
1073
|
result;
|
|
914
1074
|
};
|
|
915
1075
|
__name(ResultMessageOutput, "ResultMessageOutput");
|
|
916
|
-
|
|
917
|
-
(0,
|
|
918
|
-
|
|
1076
|
+
_ts_decorate13([
|
|
1077
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1078
|
+
_ts_metadata13("design:type", String)
|
|
919
1079
|
], ResultMessageOutput.prototype, "actionExecutionId", void 0);
|
|
920
|
-
|
|
921
|
-
(0,
|
|
922
|
-
|
|
1080
|
+
_ts_decorate13([
|
|
1081
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1082
|
+
_ts_metadata13("design:type", String)
|
|
923
1083
|
], ResultMessageOutput.prototype, "actionName", void 0);
|
|
924
|
-
|
|
925
|
-
(0,
|
|
926
|
-
|
|
1084
|
+
_ts_decorate13([
|
|
1085
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1086
|
+
_ts_metadata13("design:type", String)
|
|
927
1087
|
], ResultMessageOutput.prototype, "result", void 0);
|
|
928
|
-
ResultMessageOutput =
|
|
929
|
-
(0,
|
|
1088
|
+
ResultMessageOutput = _ts_decorate13([
|
|
1089
|
+
(0, import_type_graphql14.ObjectType)({
|
|
930
1090
|
implements: BaseMessageOutput
|
|
931
1091
|
})
|
|
932
1092
|
], ResultMessageOutput);
|
|
1093
|
+
var AgentStateMessageOutput = class {
|
|
1094
|
+
threadId;
|
|
1095
|
+
agentName;
|
|
1096
|
+
nodeName;
|
|
1097
|
+
runId;
|
|
1098
|
+
active;
|
|
1099
|
+
role;
|
|
1100
|
+
state;
|
|
1101
|
+
running;
|
|
1102
|
+
};
|
|
1103
|
+
__name(AgentStateMessageOutput, "AgentStateMessageOutput");
|
|
1104
|
+
_ts_decorate13([
|
|
1105
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1106
|
+
_ts_metadata13("design:type", String)
|
|
1107
|
+
], AgentStateMessageOutput.prototype, "threadId", void 0);
|
|
1108
|
+
_ts_decorate13([
|
|
1109
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1110
|
+
_ts_metadata13("design:type", String)
|
|
1111
|
+
], AgentStateMessageOutput.prototype, "agentName", void 0);
|
|
1112
|
+
_ts_decorate13([
|
|
1113
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1114
|
+
_ts_metadata13("design:type", String)
|
|
1115
|
+
], AgentStateMessageOutput.prototype, "nodeName", void 0);
|
|
1116
|
+
_ts_decorate13([
|
|
1117
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1118
|
+
_ts_metadata13("design:type", String)
|
|
1119
|
+
], AgentStateMessageOutput.prototype, "runId", void 0);
|
|
1120
|
+
_ts_decorate13([
|
|
1121
|
+
(0, import_type_graphql14.Field)(() => Boolean),
|
|
1122
|
+
_ts_metadata13("design:type", Boolean)
|
|
1123
|
+
], AgentStateMessageOutput.prototype, "active", void 0);
|
|
1124
|
+
_ts_decorate13([
|
|
1125
|
+
(0, import_type_graphql14.Field)(() => MessageRole),
|
|
1126
|
+
_ts_metadata13("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
1127
|
+
], AgentStateMessageOutput.prototype, "role", void 0);
|
|
1128
|
+
_ts_decorate13([
|
|
1129
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1130
|
+
_ts_metadata13("design:type", String)
|
|
1131
|
+
], AgentStateMessageOutput.prototype, "state", void 0);
|
|
1132
|
+
_ts_decorate13([
|
|
1133
|
+
(0, import_type_graphql14.Field)(() => Boolean),
|
|
1134
|
+
_ts_metadata13("design:type", Boolean)
|
|
1135
|
+
], AgentStateMessageOutput.prototype, "running", void 0);
|
|
1136
|
+
AgentStateMessageOutput = _ts_decorate13([
|
|
1137
|
+
(0, import_type_graphql14.ObjectType)({
|
|
1138
|
+
implements: BaseMessageOutput
|
|
1139
|
+
})
|
|
1140
|
+
], AgentStateMessageOutput);
|
|
933
1141
|
var CopilotResponse = class {
|
|
934
1142
|
threadId;
|
|
935
1143
|
status;
|
|
@@ -937,28 +1145,28 @@ var CopilotResponse = class {
|
|
|
937
1145
|
messages;
|
|
938
1146
|
};
|
|
939
1147
|
__name(CopilotResponse, "CopilotResponse");
|
|
940
|
-
|
|
941
|
-
(0,
|
|
942
|
-
|
|
1148
|
+
_ts_decorate13([
|
|
1149
|
+
(0, import_type_graphql14.Field)(() => String),
|
|
1150
|
+
_ts_metadata13("design:type", String)
|
|
943
1151
|
], CopilotResponse.prototype, "threadId", void 0);
|
|
944
|
-
|
|
945
|
-
(0,
|
|
946
|
-
|
|
1152
|
+
_ts_decorate13([
|
|
1153
|
+
(0, import_type_graphql14.Field)(() => ResponseStatusUnion),
|
|
1154
|
+
_ts_metadata13("design:type", Object)
|
|
947
1155
|
], CopilotResponse.prototype, "status", void 0);
|
|
948
|
-
|
|
949
|
-
(0,
|
|
1156
|
+
_ts_decorate13([
|
|
1157
|
+
(0, import_type_graphql14.Field)({
|
|
950
1158
|
nullable: true
|
|
951
1159
|
}),
|
|
952
|
-
|
|
1160
|
+
_ts_metadata13("design:type", String)
|
|
953
1161
|
], CopilotResponse.prototype, "runId", void 0);
|
|
954
|
-
|
|
955
|
-
(0,
|
|
1162
|
+
_ts_decorate13([
|
|
1163
|
+
(0, import_type_graphql14.Field)(() => [
|
|
956
1164
|
BaseMessageOutput
|
|
957
1165
|
]),
|
|
958
|
-
|
|
1166
|
+
_ts_metadata13("design:type", Array)
|
|
959
1167
|
], CopilotResponse.prototype, "messages", void 0);
|
|
960
|
-
CopilotResponse =
|
|
961
|
-
(0,
|
|
1168
|
+
CopilotResponse = _ts_decorate13([
|
|
1169
|
+
(0, import_type_graphql14.ObjectType)()
|
|
962
1170
|
], CopilotResponse);
|
|
963
1171
|
|
|
964
1172
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
@@ -985,6 +1193,26 @@ var ResultMessage = class extends BaseMessage {
|
|
|
985
1193
|
result;
|
|
986
1194
|
};
|
|
987
1195
|
__name(ResultMessage, "ResultMessage");
|
|
1196
|
+
var AgentStateMessage = class extends BaseMessage {
|
|
1197
|
+
threadId;
|
|
1198
|
+
agentName;
|
|
1199
|
+
nodeName;
|
|
1200
|
+
runId;
|
|
1201
|
+
active;
|
|
1202
|
+
role;
|
|
1203
|
+
state;
|
|
1204
|
+
running;
|
|
1205
|
+
};
|
|
1206
|
+
__name(AgentStateMessage, "AgentStateMessage");
|
|
1207
|
+
|
|
1208
|
+
// src/lib/telemetry-client.ts
|
|
1209
|
+
var import_shared = require("@copilotkit/shared");
|
|
1210
|
+
var packageJson = require_package();
|
|
1211
|
+
var telemetryClient = new import_shared.TelemetryClient({
|
|
1212
|
+
packageName: packageJson.name,
|
|
1213
|
+
packageVersion: packageJson.version
|
|
1214
|
+
});
|
|
1215
|
+
var telemetry_client_default = telemetryClient;
|
|
988
1216
|
|
|
989
1217
|
// src/service-adapters/events.ts
|
|
990
1218
|
var RuntimeEventTypes;
|
|
@@ -996,6 +1224,7 @@ var RuntimeEventTypes;
|
|
|
996
1224
|
RuntimeEventTypes2["ActionExecutionArgs"] = "ActionExecutionArgs";
|
|
997
1225
|
RuntimeEventTypes2["ActionExecutionEnd"] = "ActionExecutionEnd";
|
|
998
1226
|
RuntimeEventTypes2["ActionExecutionResult"] = "ActionExecutionResult";
|
|
1227
|
+
RuntimeEventTypes2["AgentStateMessage"] = "AgentStateMessage";
|
|
999
1228
|
})(RuntimeEventTypes || (RuntimeEventTypes = {}));
|
|
1000
1229
|
|
|
1001
1230
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
@@ -1036,18 +1265,9 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
|
|
|
1036
1265
|
};
|
|
1037
1266
|
__name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
1038
1267
|
|
|
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
1268
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1049
1269
|
var import_shared2 = require("@copilotkit/shared");
|
|
1050
|
-
function
|
|
1270
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
1051
1271
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1052
1272
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1053
1273
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1057,12 +1277,12 @@ function _ts_decorate12(decorators, target, key, desc) {
|
|
|
1057
1277
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1058
1278
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1059
1279
|
}
|
|
1060
|
-
__name(
|
|
1061
|
-
function
|
|
1280
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
1281
|
+
function _ts_metadata14(k, v) {
|
|
1062
1282
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1063
1283
|
return Reflect.metadata(k, v);
|
|
1064
1284
|
}
|
|
1065
|
-
__name(
|
|
1285
|
+
__name(_ts_metadata14, "_ts_metadata");
|
|
1066
1286
|
function _ts_param(paramIndex, decorator) {
|
|
1067
1287
|
return function(target, key) {
|
|
1068
1288
|
decorator(target, key, paramIndex);
|
|
@@ -1071,7 +1291,6 @@ function _ts_param(paramIndex, decorator) {
|
|
|
1071
1291
|
__name(_ts_param, "_ts_param");
|
|
1072
1292
|
var invokeGuardrails = /* @__PURE__ */ __name(async ({ baseUrl, copilotCloudPublicApiKey, data, onResult, onError }) => {
|
|
1073
1293
|
var _a;
|
|
1074
|
-
console.log("invokeGuardrails.baseUrl", baseUrl);
|
|
1075
1294
|
if (data.messages.length && ((_a = data.messages[data.messages.length - 1].textMessage) == null ? void 0 : _a.role) === MessageRole.user) {
|
|
1076
1295
|
const messages = data.messages.filter((m) => m.textMessage !== void 0 && (m.textMessage.role === MessageRole.user || m.textMessage.role === MessageRole.assistant)).map((m) => ({
|
|
1077
1296
|
role: m.textMessage.role,
|
|
@@ -1117,8 +1336,6 @@ var CopilotResolver = class {
|
|
|
1117
1336
|
logger2.debug({
|
|
1118
1337
|
data
|
|
1119
1338
|
}, "Generating Copilot response");
|
|
1120
|
-
const copilotRuntime = ctx._copilotkit.runtime;
|
|
1121
|
-
const serviceAdapter = ctx._copilotkit.serviceAdapter;
|
|
1122
1339
|
if (properties) {
|
|
1123
1340
|
logger2.debug("Properties provided, merging with context properties");
|
|
1124
1341
|
ctx.properties = {
|
|
@@ -1126,6 +1343,8 @@ var CopilotResolver = class {
|
|
|
1126
1343
|
...properties
|
|
1127
1344
|
};
|
|
1128
1345
|
}
|
|
1346
|
+
const copilotRuntime = ctx._copilotkit.runtime;
|
|
1347
|
+
const serviceAdapter = ctx._copilotkit.serviceAdapter;
|
|
1129
1348
|
let copilotCloudPublicApiKey = null;
|
|
1130
1349
|
let copilotCloudBaseUrl;
|
|
1131
1350
|
if (data.cloud) {
|
|
@@ -1164,16 +1383,18 @@ var CopilotResolver = class {
|
|
|
1164
1383
|
rejectOutputMessagesPromise = reject;
|
|
1165
1384
|
});
|
|
1166
1385
|
logger2.debug("Processing");
|
|
1167
|
-
const { eventSource, threadId = (0, import_shared2.randomId)(), runId,
|
|
1386
|
+
const { eventSource, threadId = (0, import_shared2.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
|
|
1168
1387
|
serviceAdapter,
|
|
1169
1388
|
messages: data.messages,
|
|
1170
1389
|
actions: data.frontend.actions,
|
|
1171
1390
|
threadId: data.threadId,
|
|
1172
1391
|
runId: data.runId,
|
|
1173
1392
|
publicApiKey: void 0,
|
|
1174
|
-
properties: ctx.properties || {},
|
|
1175
1393
|
outputMessagesPromise,
|
|
1394
|
+
graphqlContext: ctx,
|
|
1176
1395
|
forwardedParameters: data.forwardedParameters,
|
|
1396
|
+
agentSession: data.agentSession,
|
|
1397
|
+
agentStates: data.agentStates,
|
|
1177
1398
|
url: data.frontend.url
|
|
1178
1399
|
});
|
|
1179
1400
|
logger2.debug("Event source created, creating response");
|
|
@@ -1231,9 +1452,13 @@ var CopilotResolver = class {
|
|
|
1231
1452
|
});
|
|
1232
1453
|
}
|
|
1233
1454
|
let eventStreamSubscription;
|
|
1234
|
-
const eventStream = eventSource.
|
|
1235
|
-
|
|
1236
|
-
guardrailsResult$: ((_b2 = data.cloud) == null ? void 0 : _b2.guardrails) ? guardrailsResult$ : null
|
|
1455
|
+
const eventStream = eventSource.processRuntimeEvents({
|
|
1456
|
+
serverSideActions,
|
|
1457
|
+
guardrailsResult$: ((_b2 = data.cloud) == null ? void 0 : _b2.guardrails) ? guardrailsResult$ : null,
|
|
1458
|
+
actionInputsWithoutAgents: actionInputsWithoutAgents.filter(
|
|
1459
|
+
// TODO-AGENTS: do not exclude ALL server side actions
|
|
1460
|
+
(action) => !serverSideActions.find((serverSideAction) => serverSideAction.name == action.name)
|
|
1461
|
+
)
|
|
1237
1462
|
}).pipe(
|
|
1238
1463
|
// shareReplay() ensures that later subscribers will see the whole stream instead of
|
|
1239
1464
|
// just the events that were emitted after the subscriber was added.
|
|
@@ -1381,6 +1606,36 @@ var CopilotResolver = class {
|
|
|
1381
1606
|
result: event.result
|
|
1382
1607
|
}));
|
|
1383
1608
|
break;
|
|
1609
|
+
case RuntimeEventTypes.AgentStateMessage:
|
|
1610
|
+
logger2.debug({
|
|
1611
|
+
event
|
|
1612
|
+
}, "Agent message event received");
|
|
1613
|
+
pushMessage({
|
|
1614
|
+
id: (0, import_shared2.randomId)(),
|
|
1615
|
+
status: new SuccessMessageStatus(),
|
|
1616
|
+
threadId: event.threadId,
|
|
1617
|
+
agentName: event.agentName,
|
|
1618
|
+
nodeName: event.nodeName,
|
|
1619
|
+
runId: event.runId,
|
|
1620
|
+
active: event.active,
|
|
1621
|
+
state: event.state,
|
|
1622
|
+
running: event.running,
|
|
1623
|
+
role: MessageRole.assistant,
|
|
1624
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
1625
|
+
});
|
|
1626
|
+
outputMessages.push((0, import_class_transformer.plainToInstance)(AgentStateMessage, {
|
|
1627
|
+
id: (0, import_shared2.randomId)(),
|
|
1628
|
+
threadId: event.threadId,
|
|
1629
|
+
agentName: event.agentName,
|
|
1630
|
+
nodeName: event.nodeName,
|
|
1631
|
+
runId: event.runId,
|
|
1632
|
+
active: event.active,
|
|
1633
|
+
state: event.state,
|
|
1634
|
+
running: event.running,
|
|
1635
|
+
role: MessageRole.assistant,
|
|
1636
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
1637
|
+
}));
|
|
1638
|
+
break;
|
|
1384
1639
|
}
|
|
1385
1640
|
},
|
|
1386
1641
|
error: (err) => {
|
|
@@ -1413,29 +1668,29 @@ var CopilotResolver = class {
|
|
|
1413
1668
|
}
|
|
1414
1669
|
};
|
|
1415
1670
|
__name(CopilotResolver, "CopilotResolver");
|
|
1416
|
-
|
|
1417
|
-
(0,
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1671
|
+
_ts_decorate14([
|
|
1672
|
+
(0, import_type_graphql15.Query)(() => String),
|
|
1673
|
+
_ts_metadata14("design:type", Function),
|
|
1674
|
+
_ts_metadata14("design:paramtypes", []),
|
|
1675
|
+
_ts_metadata14("design:returntype", Promise)
|
|
1421
1676
|
], CopilotResolver.prototype, "hello", null);
|
|
1422
|
-
|
|
1423
|
-
(0,
|
|
1424
|
-
_ts_param(0, (0,
|
|
1425
|
-
_ts_param(1, (0,
|
|
1426
|
-
_ts_param(2, (0,
|
|
1677
|
+
_ts_decorate14([
|
|
1678
|
+
(0, import_type_graphql15.Mutation)(() => CopilotResponse),
|
|
1679
|
+
_ts_param(0, (0, import_type_graphql15.Ctx)()),
|
|
1680
|
+
_ts_param(1, (0, import_type_graphql15.Arg)("data")),
|
|
1681
|
+
_ts_param(2, (0, import_type_graphql15.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
1427
1682
|
nullable: true
|
|
1428
1683
|
})),
|
|
1429
|
-
|
|
1430
|
-
|
|
1684
|
+
_ts_metadata14("design:type", Function),
|
|
1685
|
+
_ts_metadata14("design:paramtypes", [
|
|
1431
1686
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
1432
1687
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
1433
1688
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
1434
1689
|
]),
|
|
1435
|
-
|
|
1690
|
+
_ts_metadata14("design:returntype", Promise)
|
|
1436
1691
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
1437
|
-
CopilotResolver =
|
|
1438
|
-
(0,
|
|
1692
|
+
CopilotResolver = _ts_decorate14([
|
|
1693
|
+
(0, import_type_graphql15.Resolver)(() => CopilotResponse)
|
|
1439
1694
|
], CopilotResolver);
|
|
1440
1695
|
|
|
1441
1696
|
// src/lib/integrations/shared.ts
|
|
@@ -1490,7 +1745,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
1490
1745
|
__name(createContext, "createContext");
|
|
1491
1746
|
function buildSchema(options = {}) {
|
|
1492
1747
|
logger.debug("Building GraphQL schema...");
|
|
1493
|
-
const schema = (0,
|
|
1748
|
+
const schema = (0, import_type_graphql16.buildSchemaSync)({
|
|
1494
1749
|
resolvers: [
|
|
1495
1750
|
CopilotResolver
|
|
1496
1751
|
],
|