@copilotkit/runtime 1.5.12-next.6 → 1.5.12
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 +22 -0
- package/__snapshots__/schema/schema.graphql +33 -0
- package/dist/{chunk-XM2VJFL6.mjs → chunk-4LRVKGBI.mjs} +2 -2
- package/dist/{chunk-YGXAWYRB.mjs → chunk-IS3QAGOU.mjs} +2 -2
- package/dist/{chunk-ON4AESON.mjs → chunk-PFELVFS7.mjs} +540 -221
- package/dist/chunk-PFELVFS7.mjs.map +1 -0
- package/dist/{chunk-TPTCSIAR.mjs → chunk-S3KKBII4.mjs} +42 -30
- package/dist/chunk-S3KKBII4.mjs.map +1 -0
- package/dist/{chunk-BKIGYRXE.mjs → chunk-W6EE6OTN.mjs} +2 -2
- package/dist/{copilot-runtime-da917bd5.d.ts → copilot-runtime-8c442d65.d.ts} +16 -5
- package/dist/graphql/types/converted/index.d.ts +1 -1
- package/dist/{groq-adapter-c35c5374.d.ts → groq-adapter-7a82cd22.d.ts} +21 -1
- package/dist/{index-24315d90.d.ts → index-a7f37670.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +628 -297
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/{langserve-a16ef8f4.d.ts → langserve-e308c437.d.ts} +32 -3
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +626 -295
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +6 -6
- package/dist/lib/integrations/index.d.ts +4 -4
- package/dist/lib/integrations/index.js +495 -237
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +5 -5
- package/dist/lib/integrations/nest/index.d.ts +3 -3
- package/dist/lib/integrations/nest/index.js +495 -237
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +3 -3
- package/dist/lib/integrations/node-express/index.d.ts +3 -3
- package/dist/lib/integrations/node-express/index.js +495 -237
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +3 -3
- package/dist/lib/integrations/node-http/index.d.ts +3 -3
- package/dist/lib/integrations/node-http/index.js +495 -237
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +2 -2
- package/dist/service-adapters/index.d.ts +4 -4
- package/dist/service-adapters/index.js +23 -11
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +1 -1
- package/package.json +2 -2
- package/src/graphql/inputs/extensions.input.ts +21 -0
- package/src/graphql/inputs/generate-copilot-response.input.ts +4 -0
- package/src/graphql/inputs/load-agent-state.input.ts +10 -0
- package/src/graphql/resolvers/copilot.resolver.ts +8 -3
- package/src/graphql/resolvers/state.resolver.ts +23 -0
- package/src/graphql/types/agents-response.type.ts +1 -4
- package/src/graphql/types/copilot-response.type.ts +5 -1
- package/src/graphql/types/extensions-response.type.ts +23 -0
- package/src/graphql/types/load-agent-state-response.type.ts +17 -0
- package/src/lib/integrations/shared.ts +2 -1
- package/src/lib/runtime/copilot-runtime.ts +102 -9
- package/src/lib/runtime/remote-lg-action.ts +24 -12
- package/src/service-adapters/anthropic/anthropic-adapter.ts +2 -3
- package/src/service-adapters/empty/empty-adapter.ts +2 -2
- package/src/service-adapters/events.ts +5 -0
- package/src/service-adapters/experimental/ollama/ollama-adapter.ts +2 -2
- package/src/service-adapters/groq/groq-adapter.ts +2 -2
- package/src/service-adapters/langchain/langchain-adapter.ts +10 -3
- package/src/service-adapters/openai/openai-adapter.ts +4 -3
- package/src/service-adapters/openai/openai-assistant-adapter.ts +15 -4
- package/src/service-adapters/service-adapter.ts +4 -0
- package/src/service-adapters/unify/unify-adapter.ts +2 -3
- package/dist/chunk-ON4AESON.mjs.map +0 -1
- package/dist/chunk-TPTCSIAR.mjs.map +0 -1
- /package/dist/{chunk-XM2VJFL6.mjs.map → chunk-4LRVKGBI.mjs.map} +0 -0
- /package/dist/{chunk-YGXAWYRB.mjs.map → chunk-IS3QAGOU.mjs.map} +0 -0
- /package/dist/{chunk-BKIGYRXE.mjs.map → chunk-W6EE6OTN.mjs.map} +0 -0
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.5.12
|
|
47
|
+
version: "1.5.12",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -130,14 +130,14 @@ module.exports = __toCommonJS(node_http_exports);
|
|
|
130
130
|
var import_graphql_yoga2 = require("graphql-yoga");
|
|
131
131
|
|
|
132
132
|
// src/lib/integrations/shared.ts
|
|
133
|
-
var
|
|
133
|
+
var import_type_graphql24 = require("type-graphql");
|
|
134
134
|
|
|
135
135
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
136
|
-
var
|
|
136
|
+
var import_type_graphql18 = require("type-graphql");
|
|
137
137
|
var import_rxjs3 = require("rxjs");
|
|
138
138
|
|
|
139
139
|
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
140
|
-
var
|
|
140
|
+
var import_type_graphql12 = require("type-graphql");
|
|
141
141
|
|
|
142
142
|
// src/graphql/inputs/message.input.ts
|
|
143
143
|
var import_type_graphql3 = require("type-graphql");
|
|
@@ -726,7 +726,8 @@ AgentStateInput = _ts_decorate9([
|
|
|
726
726
|
(0, import_type_graphql10.InputType)()
|
|
727
727
|
], AgentStateInput);
|
|
728
728
|
|
|
729
|
-
// src/graphql/inputs/
|
|
729
|
+
// src/graphql/inputs/extensions.input.ts
|
|
730
|
+
var import_type_graphql11 = require("type-graphql");
|
|
730
731
|
function _ts_decorate10(decorators, target, key, desc) {
|
|
731
732
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
732
733
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -743,18 +744,69 @@ function _ts_metadata10(k, v) {
|
|
|
743
744
|
return Reflect.metadata(k, v);
|
|
744
745
|
}
|
|
745
746
|
__name(_ts_metadata10, "_ts_metadata");
|
|
747
|
+
var ExtensionsInput = class {
|
|
748
|
+
openaiAssistantAPI;
|
|
749
|
+
};
|
|
750
|
+
__name(ExtensionsInput, "ExtensionsInput");
|
|
751
|
+
_ts_decorate10([
|
|
752
|
+
(0, import_type_graphql11.Field)(() => OpenAIApiAssistantAPIInput, {
|
|
753
|
+
nullable: true
|
|
754
|
+
}),
|
|
755
|
+
_ts_metadata10("design:type", typeof OpenAIApiAssistantAPIInput === "undefined" ? Object : OpenAIApiAssistantAPIInput)
|
|
756
|
+
], ExtensionsInput.prototype, "openaiAssistantAPI", void 0);
|
|
757
|
+
ExtensionsInput = _ts_decorate10([
|
|
758
|
+
(0, import_type_graphql11.InputType)()
|
|
759
|
+
], ExtensionsInput);
|
|
760
|
+
var OpenAIApiAssistantAPIInput = class {
|
|
761
|
+
runId;
|
|
762
|
+
threadId;
|
|
763
|
+
};
|
|
764
|
+
__name(OpenAIApiAssistantAPIInput, "OpenAIApiAssistantAPIInput");
|
|
765
|
+
_ts_decorate10([
|
|
766
|
+
(0, import_type_graphql11.Field)(() => String, {
|
|
767
|
+
nullable: true
|
|
768
|
+
}),
|
|
769
|
+
_ts_metadata10("design:type", String)
|
|
770
|
+
], OpenAIApiAssistantAPIInput.prototype, "runId", void 0);
|
|
771
|
+
_ts_decorate10([
|
|
772
|
+
(0, import_type_graphql11.Field)(() => String, {
|
|
773
|
+
nullable: true
|
|
774
|
+
}),
|
|
775
|
+
_ts_metadata10("design:type", String)
|
|
776
|
+
], OpenAIApiAssistantAPIInput.prototype, "threadId", void 0);
|
|
777
|
+
OpenAIApiAssistantAPIInput = _ts_decorate10([
|
|
778
|
+
(0, import_type_graphql11.InputType)()
|
|
779
|
+
], OpenAIApiAssistantAPIInput);
|
|
780
|
+
|
|
781
|
+
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
782
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
783
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
784
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
785
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
786
|
+
else
|
|
787
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
788
|
+
if (d = decorators[i])
|
|
789
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
790
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
791
|
+
}
|
|
792
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
793
|
+
function _ts_metadata11(k, v) {
|
|
794
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
795
|
+
return Reflect.metadata(k, v);
|
|
796
|
+
}
|
|
797
|
+
__name(_ts_metadata11, "_ts_metadata");
|
|
746
798
|
var GenerateCopilotResponseMetadataInput = class {
|
|
747
799
|
requestType;
|
|
748
800
|
};
|
|
749
801
|
__name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
|
|
750
|
-
|
|
751
|
-
(0,
|
|
802
|
+
_ts_decorate11([
|
|
803
|
+
(0, import_type_graphql12.Field)(() => CopilotRequestType, {
|
|
752
804
|
nullable: true
|
|
753
805
|
}),
|
|
754
|
-
|
|
806
|
+
_ts_metadata11("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
|
|
755
807
|
], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
|
|
756
|
-
GenerateCopilotResponseMetadataInput =
|
|
757
|
-
(0,
|
|
808
|
+
GenerateCopilotResponseMetadataInput = _ts_decorate11([
|
|
809
|
+
(0, import_type_graphql12.InputType)()
|
|
758
810
|
], GenerateCopilotResponseMetadataInput);
|
|
759
811
|
var GenerateCopilotResponseInput = class {
|
|
760
812
|
metadata;
|
|
@@ -767,78 +819,85 @@ var GenerateCopilotResponseInput = class {
|
|
|
767
819
|
agentSession;
|
|
768
820
|
agentState;
|
|
769
821
|
agentStates;
|
|
822
|
+
extensions;
|
|
770
823
|
};
|
|
771
824
|
__name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
|
|
772
|
-
|
|
773
|
-
(0,
|
|
825
|
+
_ts_decorate11([
|
|
826
|
+
(0, import_type_graphql12.Field)(() => GenerateCopilotResponseMetadataInput, {
|
|
774
827
|
nullable: false
|
|
775
828
|
}),
|
|
776
|
-
|
|
829
|
+
_ts_metadata11("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
|
|
777
830
|
], GenerateCopilotResponseInput.prototype, "metadata", void 0);
|
|
778
|
-
|
|
779
|
-
(0,
|
|
831
|
+
_ts_decorate11([
|
|
832
|
+
(0, import_type_graphql12.Field)(() => String, {
|
|
780
833
|
nullable: true
|
|
781
834
|
}),
|
|
782
|
-
|
|
835
|
+
_ts_metadata11("design:type", String)
|
|
783
836
|
], GenerateCopilotResponseInput.prototype, "threadId", void 0);
|
|
784
|
-
|
|
785
|
-
(0,
|
|
837
|
+
_ts_decorate11([
|
|
838
|
+
(0, import_type_graphql12.Field)(() => String, {
|
|
786
839
|
nullable: true
|
|
787
840
|
}),
|
|
788
|
-
|
|
841
|
+
_ts_metadata11("design:type", String)
|
|
789
842
|
], GenerateCopilotResponseInput.prototype, "runId", void 0);
|
|
790
|
-
|
|
791
|
-
(0,
|
|
843
|
+
_ts_decorate11([
|
|
844
|
+
(0, import_type_graphql12.Field)(() => [
|
|
792
845
|
MessageInput
|
|
793
846
|
]),
|
|
794
|
-
|
|
847
|
+
_ts_metadata11("design:type", Array)
|
|
795
848
|
], GenerateCopilotResponseInput.prototype, "messages", void 0);
|
|
796
|
-
|
|
797
|
-
(0,
|
|
798
|
-
|
|
849
|
+
_ts_decorate11([
|
|
850
|
+
(0, import_type_graphql12.Field)(() => FrontendInput),
|
|
851
|
+
_ts_metadata11("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
|
|
799
852
|
], GenerateCopilotResponseInput.prototype, "frontend", void 0);
|
|
800
|
-
|
|
801
|
-
(0,
|
|
853
|
+
_ts_decorate11([
|
|
854
|
+
(0, import_type_graphql12.Field)(() => CloudInput, {
|
|
802
855
|
nullable: true
|
|
803
856
|
}),
|
|
804
|
-
|
|
857
|
+
_ts_metadata11("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
|
|
805
858
|
], GenerateCopilotResponseInput.prototype, "cloud", void 0);
|
|
806
|
-
|
|
807
|
-
(0,
|
|
859
|
+
_ts_decorate11([
|
|
860
|
+
(0, import_type_graphql12.Field)(() => ForwardedParametersInput, {
|
|
808
861
|
nullable: true
|
|
809
862
|
}),
|
|
810
|
-
|
|
863
|
+
_ts_metadata11("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
|
|
811
864
|
], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
|
|
812
|
-
|
|
813
|
-
(0,
|
|
865
|
+
_ts_decorate11([
|
|
866
|
+
(0, import_type_graphql12.Field)(() => AgentSessionInput, {
|
|
814
867
|
nullable: true
|
|
815
868
|
}),
|
|
816
|
-
|
|
869
|
+
_ts_metadata11("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
|
|
817
870
|
], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
|
|
818
|
-
|
|
819
|
-
(0,
|
|
871
|
+
_ts_decorate11([
|
|
872
|
+
(0, import_type_graphql12.Field)(() => AgentStateInput, {
|
|
820
873
|
nullable: true
|
|
821
874
|
}),
|
|
822
|
-
|
|
875
|
+
_ts_metadata11("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
|
|
823
876
|
], GenerateCopilotResponseInput.prototype, "agentState", void 0);
|
|
824
|
-
|
|
825
|
-
(0,
|
|
877
|
+
_ts_decorate11([
|
|
878
|
+
(0, import_type_graphql12.Field)(() => [
|
|
826
879
|
AgentStateInput
|
|
827
880
|
], {
|
|
828
881
|
nullable: true
|
|
829
882
|
}),
|
|
830
|
-
|
|
883
|
+
_ts_metadata11("design:type", Array)
|
|
831
884
|
], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
|
|
832
|
-
|
|
833
|
-
(0,
|
|
885
|
+
_ts_decorate11([
|
|
886
|
+
(0, import_type_graphql12.Field)(() => ExtensionsInput, {
|
|
887
|
+
nullable: true
|
|
888
|
+
}),
|
|
889
|
+
_ts_metadata11("design:type", typeof ExtensionsInput === "undefined" ? Object : ExtensionsInput)
|
|
890
|
+
], GenerateCopilotResponseInput.prototype, "extensions", void 0);
|
|
891
|
+
GenerateCopilotResponseInput = _ts_decorate11([
|
|
892
|
+
(0, import_type_graphql12.InputType)()
|
|
834
893
|
], GenerateCopilotResponseInput);
|
|
835
894
|
|
|
836
895
|
// src/graphql/types/copilot-response.type.ts
|
|
837
|
-
var
|
|
896
|
+
var import_type_graphql16 = require("type-graphql");
|
|
838
897
|
|
|
839
898
|
// src/graphql/types/message-status.type.ts
|
|
840
|
-
var
|
|
841
|
-
function
|
|
899
|
+
var import_type_graphql13 = require("type-graphql");
|
|
900
|
+
function _ts_decorate12(decorators, target, key, desc) {
|
|
842
901
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
843
902
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
844
903
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -848,58 +907,58 @@ function _ts_decorate11(decorators, target, key, desc) {
|
|
|
848
907
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
849
908
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
850
909
|
}
|
|
851
|
-
__name(
|
|
852
|
-
function
|
|
910
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
911
|
+
function _ts_metadata12(k, v) {
|
|
853
912
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
854
913
|
return Reflect.metadata(k, v);
|
|
855
914
|
}
|
|
856
|
-
__name(
|
|
915
|
+
__name(_ts_metadata12, "_ts_metadata");
|
|
857
916
|
var MessageStatusCode;
|
|
858
917
|
(function(MessageStatusCode2) {
|
|
859
918
|
MessageStatusCode2["Pending"] = "pending";
|
|
860
919
|
MessageStatusCode2["Success"] = "success";
|
|
861
920
|
MessageStatusCode2["Failed"] = "failed";
|
|
862
921
|
})(MessageStatusCode || (MessageStatusCode = {}));
|
|
863
|
-
(0,
|
|
922
|
+
(0, import_type_graphql13.registerEnumType)(MessageStatusCode, {
|
|
864
923
|
name: "MessageStatusCode"
|
|
865
924
|
});
|
|
866
925
|
var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
|
|
867
926
|
code;
|
|
868
927
|
}, "BaseMessageStatus");
|
|
869
|
-
|
|
870
|
-
(0,
|
|
871
|
-
|
|
928
|
+
_ts_decorate12([
|
|
929
|
+
(0, import_type_graphql13.Field)(() => MessageStatusCode),
|
|
930
|
+
_ts_metadata12("design:type", String)
|
|
872
931
|
], BaseMessageStatus.prototype, "code", void 0);
|
|
873
|
-
BaseMessageStatus =
|
|
874
|
-
(0,
|
|
932
|
+
BaseMessageStatus = _ts_decorate12([
|
|
933
|
+
(0, import_type_graphql13.ObjectType)()
|
|
875
934
|
], BaseMessageStatus);
|
|
876
935
|
var PendingMessageStatus = class extends BaseMessageStatus {
|
|
877
936
|
code = "pending";
|
|
878
937
|
};
|
|
879
938
|
__name(PendingMessageStatus, "PendingMessageStatus");
|
|
880
|
-
PendingMessageStatus =
|
|
881
|
-
(0,
|
|
939
|
+
PendingMessageStatus = _ts_decorate12([
|
|
940
|
+
(0, import_type_graphql13.ObjectType)()
|
|
882
941
|
], PendingMessageStatus);
|
|
883
942
|
var SuccessMessageStatus = class extends BaseMessageStatus {
|
|
884
943
|
code = "success";
|
|
885
944
|
};
|
|
886
945
|
__name(SuccessMessageStatus, "SuccessMessageStatus");
|
|
887
|
-
SuccessMessageStatus =
|
|
888
|
-
(0,
|
|
946
|
+
SuccessMessageStatus = _ts_decorate12([
|
|
947
|
+
(0, import_type_graphql13.ObjectType)()
|
|
889
948
|
], SuccessMessageStatus);
|
|
890
949
|
var FailedMessageStatus = class extends BaseMessageStatus {
|
|
891
950
|
code = "failed";
|
|
892
951
|
reason;
|
|
893
952
|
};
|
|
894
953
|
__name(FailedMessageStatus, "FailedMessageStatus");
|
|
895
|
-
|
|
896
|
-
(0,
|
|
897
|
-
|
|
954
|
+
_ts_decorate12([
|
|
955
|
+
(0, import_type_graphql13.Field)(() => String),
|
|
956
|
+
_ts_metadata12("design:type", String)
|
|
898
957
|
], FailedMessageStatus.prototype, "reason", void 0);
|
|
899
|
-
FailedMessageStatus =
|
|
900
|
-
(0,
|
|
958
|
+
FailedMessageStatus = _ts_decorate12([
|
|
959
|
+
(0, import_type_graphql13.ObjectType)()
|
|
901
960
|
], FailedMessageStatus);
|
|
902
|
-
var MessageStatusUnion = (0,
|
|
961
|
+
var MessageStatusUnion = (0, import_type_graphql13.createUnionType)({
|
|
903
962
|
name: "MessageStatus",
|
|
904
963
|
types: () => [
|
|
905
964
|
PendingMessageStatus,
|
|
@@ -910,8 +969,8 @@ var MessageStatusUnion = (0, import_type_graphql12.createUnionType)({
|
|
|
910
969
|
|
|
911
970
|
// src/graphql/types/response-status.type.ts
|
|
912
971
|
var import_graphql_scalars = require("graphql-scalars");
|
|
913
|
-
var
|
|
914
|
-
function
|
|
972
|
+
var import_type_graphql14 = require("type-graphql");
|
|
973
|
+
function _ts_decorate13(decorators, target, key, desc) {
|
|
915
974
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
916
975
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
917
976
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -921,30 +980,30 @@ function _ts_decorate12(decorators, target, key, desc) {
|
|
|
921
980
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
922
981
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
923
982
|
}
|
|
924
|
-
__name(
|
|
925
|
-
function
|
|
983
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
984
|
+
function _ts_metadata13(k, v) {
|
|
926
985
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
927
986
|
return Reflect.metadata(k, v);
|
|
928
987
|
}
|
|
929
|
-
__name(
|
|
988
|
+
__name(_ts_metadata13, "_ts_metadata");
|
|
930
989
|
var ResponseStatusCode;
|
|
931
990
|
(function(ResponseStatusCode2) {
|
|
932
991
|
ResponseStatusCode2["Pending"] = "pending";
|
|
933
992
|
ResponseStatusCode2["Success"] = "success";
|
|
934
993
|
ResponseStatusCode2["Failed"] = "failed";
|
|
935
994
|
})(ResponseStatusCode || (ResponseStatusCode = {}));
|
|
936
|
-
(0,
|
|
995
|
+
(0, import_type_graphql14.registerEnumType)(ResponseStatusCode, {
|
|
937
996
|
name: "ResponseStatusCode"
|
|
938
997
|
});
|
|
939
998
|
var BaseResponseStatus = /* @__PURE__ */ __name(class BaseResponseStatus2 {
|
|
940
999
|
code;
|
|
941
1000
|
}, "BaseResponseStatus");
|
|
942
|
-
|
|
943
|
-
(0,
|
|
944
|
-
|
|
1001
|
+
_ts_decorate13([
|
|
1002
|
+
(0, import_type_graphql14.Field)(() => ResponseStatusCode),
|
|
1003
|
+
_ts_metadata13("design:type", String)
|
|
945
1004
|
], BaseResponseStatus.prototype, "code", void 0);
|
|
946
|
-
BaseResponseStatus =
|
|
947
|
-
(0,
|
|
1005
|
+
BaseResponseStatus = _ts_decorate13([
|
|
1006
|
+
(0, import_type_graphql14.InterfaceType)({
|
|
948
1007
|
resolveType(value) {
|
|
949
1008
|
if (value.code === "success") {
|
|
950
1009
|
return SuccessResponseStatus;
|
|
@@ -956,14 +1015,14 @@ BaseResponseStatus = _ts_decorate12([
|
|
|
956
1015
|
return void 0;
|
|
957
1016
|
}
|
|
958
1017
|
}),
|
|
959
|
-
(0,
|
|
1018
|
+
(0, import_type_graphql14.ObjectType)()
|
|
960
1019
|
], BaseResponseStatus);
|
|
961
1020
|
var PendingResponseStatus = class extends BaseResponseStatus {
|
|
962
1021
|
code = "pending";
|
|
963
1022
|
};
|
|
964
1023
|
__name(PendingResponseStatus, "PendingResponseStatus");
|
|
965
|
-
PendingResponseStatus =
|
|
966
|
-
(0,
|
|
1024
|
+
PendingResponseStatus = _ts_decorate13([
|
|
1025
|
+
(0, import_type_graphql14.ObjectType)({
|
|
967
1026
|
implements: BaseResponseStatus
|
|
968
1027
|
})
|
|
969
1028
|
], PendingResponseStatus);
|
|
@@ -971,8 +1030,8 @@ var SuccessResponseStatus = class extends BaseResponseStatus {
|
|
|
971
1030
|
code = "success";
|
|
972
1031
|
};
|
|
973
1032
|
__name(SuccessResponseStatus, "SuccessResponseStatus");
|
|
974
|
-
SuccessResponseStatus =
|
|
975
|
-
(0,
|
|
1033
|
+
SuccessResponseStatus = _ts_decorate13([
|
|
1034
|
+
(0, import_type_graphql14.ObjectType)({
|
|
976
1035
|
implements: BaseResponseStatus
|
|
977
1036
|
})
|
|
978
1037
|
], SuccessResponseStatus);
|
|
@@ -982,7 +1041,7 @@ var FailedResponseStatusReason;
|
|
|
982
1041
|
FailedResponseStatusReason2["MESSAGE_STREAM_INTERRUPTED"] = "MESSAGE_STREAM_INTERRUPTED";
|
|
983
1042
|
FailedResponseStatusReason2["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
984
1043
|
})(FailedResponseStatusReason || (FailedResponseStatusReason = {}));
|
|
985
|
-
(0,
|
|
1044
|
+
(0, import_type_graphql14.registerEnumType)(FailedResponseStatusReason, {
|
|
986
1045
|
name: "FailedResponseStatusReason"
|
|
987
1046
|
});
|
|
988
1047
|
var FailedResponseStatus = class extends BaseResponseStatus {
|
|
@@ -991,22 +1050,22 @@ var FailedResponseStatus = class extends BaseResponseStatus {
|
|
|
991
1050
|
details = null;
|
|
992
1051
|
};
|
|
993
1052
|
__name(FailedResponseStatus, "FailedResponseStatus");
|
|
994
|
-
|
|
995
|
-
(0,
|
|
996
|
-
|
|
1053
|
+
_ts_decorate13([
|
|
1054
|
+
(0, import_type_graphql14.Field)(() => FailedResponseStatusReason),
|
|
1055
|
+
_ts_metadata13("design:type", String)
|
|
997
1056
|
], FailedResponseStatus.prototype, "reason", void 0);
|
|
998
|
-
|
|
999
|
-
(0,
|
|
1057
|
+
_ts_decorate13([
|
|
1058
|
+
(0, import_type_graphql14.Field)(() => import_graphql_scalars.GraphQLJSON, {
|
|
1000
1059
|
nullable: true
|
|
1001
1060
|
}),
|
|
1002
|
-
|
|
1061
|
+
_ts_metadata13("design:type", typeof Record === "undefined" ? Object : Record)
|
|
1003
1062
|
], FailedResponseStatus.prototype, "details", void 0);
|
|
1004
|
-
FailedResponseStatus =
|
|
1005
|
-
(0,
|
|
1063
|
+
FailedResponseStatus = _ts_decorate13([
|
|
1064
|
+
(0, import_type_graphql14.ObjectType)({
|
|
1006
1065
|
implements: BaseResponseStatus
|
|
1007
1066
|
})
|
|
1008
1067
|
], FailedResponseStatus);
|
|
1009
|
-
var ResponseStatusUnion = (0,
|
|
1068
|
+
var ResponseStatusUnion = (0, import_type_graphql14.createUnionType)({
|
|
1010
1069
|
name: "ResponseStatus",
|
|
1011
1070
|
types: () => [
|
|
1012
1071
|
PendingResponseStatus,
|
|
@@ -1015,8 +1074,60 @@ var ResponseStatusUnion = (0, import_type_graphql13.createUnionType)({
|
|
|
1015
1074
|
]
|
|
1016
1075
|
});
|
|
1017
1076
|
|
|
1077
|
+
// src/graphql/types/extensions-response.type.ts
|
|
1078
|
+
var import_type_graphql15 = require("type-graphql");
|
|
1079
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
1080
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1081
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1082
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
1083
|
+
else
|
|
1084
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
1085
|
+
if (d = decorators[i])
|
|
1086
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1087
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1088
|
+
}
|
|
1089
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
1090
|
+
function _ts_metadata14(k, v) {
|
|
1091
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1092
|
+
return Reflect.metadata(k, v);
|
|
1093
|
+
}
|
|
1094
|
+
__name(_ts_metadata14, "_ts_metadata");
|
|
1095
|
+
var ExtensionsResponse = class {
|
|
1096
|
+
openaiAssistantAPI;
|
|
1097
|
+
};
|
|
1098
|
+
__name(ExtensionsResponse, "ExtensionsResponse");
|
|
1099
|
+
_ts_decorate14([
|
|
1100
|
+
(0, import_type_graphql15.Field)(() => OpenAIApiAssistantAPIResponse, {
|
|
1101
|
+
nullable: true
|
|
1102
|
+
}),
|
|
1103
|
+
_ts_metadata14("design:type", typeof OpenAIApiAssistantAPIResponse === "undefined" ? Object : OpenAIApiAssistantAPIResponse)
|
|
1104
|
+
], ExtensionsResponse.prototype, "openaiAssistantAPI", void 0);
|
|
1105
|
+
ExtensionsResponse = _ts_decorate14([
|
|
1106
|
+
(0, import_type_graphql15.ObjectType)()
|
|
1107
|
+
], ExtensionsResponse);
|
|
1108
|
+
var OpenAIApiAssistantAPIResponse = class {
|
|
1109
|
+
runId;
|
|
1110
|
+
threadId;
|
|
1111
|
+
};
|
|
1112
|
+
__name(OpenAIApiAssistantAPIResponse, "OpenAIApiAssistantAPIResponse");
|
|
1113
|
+
_ts_decorate14([
|
|
1114
|
+
(0, import_type_graphql15.Field)(() => String, {
|
|
1115
|
+
nullable: true
|
|
1116
|
+
}),
|
|
1117
|
+
_ts_metadata14("design:type", String)
|
|
1118
|
+
], OpenAIApiAssistantAPIResponse.prototype, "runId", void 0);
|
|
1119
|
+
_ts_decorate14([
|
|
1120
|
+
(0, import_type_graphql15.Field)(() => String, {
|
|
1121
|
+
nullable: true
|
|
1122
|
+
}),
|
|
1123
|
+
_ts_metadata14("design:type", String)
|
|
1124
|
+
], OpenAIApiAssistantAPIResponse.prototype, "threadId", void 0);
|
|
1125
|
+
OpenAIApiAssistantAPIResponse = _ts_decorate14([
|
|
1126
|
+
(0, import_type_graphql15.ObjectType)()
|
|
1127
|
+
], OpenAIApiAssistantAPIResponse);
|
|
1128
|
+
|
|
1018
1129
|
// src/graphql/types/copilot-response.type.ts
|
|
1019
|
-
function
|
|
1130
|
+
function _ts_decorate15(decorators, target, key, desc) {
|
|
1020
1131
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1021
1132
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1022
1133
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1026,31 +1137,32 @@ function _ts_decorate13(decorators, target, key, desc) {
|
|
|
1026
1137
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1027
1138
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1028
1139
|
}
|
|
1029
|
-
__name(
|
|
1030
|
-
function
|
|
1140
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
1141
|
+
function _ts_metadata15(k, v) {
|
|
1031
1142
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1032
1143
|
return Reflect.metadata(k, v);
|
|
1033
1144
|
}
|
|
1034
|
-
__name(
|
|
1035
|
-
var BaseMessageOutput =
|
|
1145
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
1146
|
+
var BaseMessageOutput = class {
|
|
1036
1147
|
id;
|
|
1037
1148
|
createdAt;
|
|
1038
1149
|
status;
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1150
|
+
};
|
|
1151
|
+
__name(BaseMessageOutput, "BaseMessageOutput");
|
|
1152
|
+
_ts_decorate15([
|
|
1153
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1154
|
+
_ts_metadata15("design:type", String)
|
|
1043
1155
|
], BaseMessageOutput.prototype, "id", void 0);
|
|
1044
|
-
|
|
1045
|
-
(0,
|
|
1046
|
-
|
|
1156
|
+
_ts_decorate15([
|
|
1157
|
+
(0, import_type_graphql16.Field)(() => Date),
|
|
1158
|
+
_ts_metadata15("design:type", typeof Date === "undefined" ? Object : Date)
|
|
1047
1159
|
], BaseMessageOutput.prototype, "createdAt", void 0);
|
|
1048
|
-
|
|
1049
|
-
(0,
|
|
1050
|
-
|
|
1160
|
+
_ts_decorate15([
|
|
1161
|
+
(0, import_type_graphql16.Field)(() => MessageStatusUnion),
|
|
1162
|
+
_ts_metadata15("design:type", Object)
|
|
1051
1163
|
], BaseMessageOutput.prototype, "status", void 0);
|
|
1052
|
-
BaseMessageOutput =
|
|
1053
|
-
(0,
|
|
1164
|
+
BaseMessageOutput = _ts_decorate15([
|
|
1165
|
+
(0, import_type_graphql16.InterfaceType)({
|
|
1054
1166
|
resolveType(value) {
|
|
1055
1167
|
if (value.hasOwnProperty("content")) {
|
|
1056
1168
|
return TextMessageOutput;
|
|
@@ -1071,24 +1183,24 @@ var TextMessageOutput = class {
|
|
|
1071
1183
|
parentMessageId;
|
|
1072
1184
|
};
|
|
1073
1185
|
__name(TextMessageOutput, "TextMessageOutput");
|
|
1074
|
-
|
|
1075
|
-
(0,
|
|
1076
|
-
|
|
1186
|
+
_ts_decorate15([
|
|
1187
|
+
(0, import_type_graphql16.Field)(() => MessageRole),
|
|
1188
|
+
_ts_metadata15("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
1077
1189
|
], TextMessageOutput.prototype, "role", void 0);
|
|
1078
|
-
|
|
1079
|
-
(0,
|
|
1190
|
+
_ts_decorate15([
|
|
1191
|
+
(0, import_type_graphql16.Field)(() => [
|
|
1080
1192
|
String
|
|
1081
1193
|
]),
|
|
1082
|
-
|
|
1194
|
+
_ts_metadata15("design:type", Array)
|
|
1083
1195
|
], TextMessageOutput.prototype, "content", void 0);
|
|
1084
|
-
|
|
1085
|
-
(0,
|
|
1196
|
+
_ts_decorate15([
|
|
1197
|
+
(0, import_type_graphql16.Field)(() => String, {
|
|
1086
1198
|
nullable: true
|
|
1087
1199
|
}),
|
|
1088
|
-
|
|
1200
|
+
_ts_metadata15("design:type", String)
|
|
1089
1201
|
], TextMessageOutput.prototype, "parentMessageId", void 0);
|
|
1090
|
-
TextMessageOutput =
|
|
1091
|
-
(0,
|
|
1202
|
+
TextMessageOutput = _ts_decorate15([
|
|
1203
|
+
(0, import_type_graphql16.ObjectType)({
|
|
1092
1204
|
implements: BaseMessageOutput
|
|
1093
1205
|
})
|
|
1094
1206
|
], TextMessageOutput);
|
|
@@ -1099,31 +1211,31 @@ var ActionExecutionMessageOutput = class {
|
|
|
1099
1211
|
parentMessageId;
|
|
1100
1212
|
};
|
|
1101
1213
|
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1102
|
-
|
|
1103
|
-
(0,
|
|
1104
|
-
|
|
1214
|
+
_ts_decorate15([
|
|
1215
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1216
|
+
_ts_metadata15("design:type", String)
|
|
1105
1217
|
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1106
|
-
|
|
1107
|
-
(0,
|
|
1218
|
+
_ts_decorate15([
|
|
1219
|
+
(0, import_type_graphql16.Field)(() => String, {
|
|
1108
1220
|
nullable: true,
|
|
1109
1221
|
deprecationReason: "This field will be removed in a future version"
|
|
1110
1222
|
}),
|
|
1111
|
-
|
|
1223
|
+
_ts_metadata15("design:type", String)
|
|
1112
1224
|
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
1113
|
-
|
|
1114
|
-
(0,
|
|
1225
|
+
_ts_decorate15([
|
|
1226
|
+
(0, import_type_graphql16.Field)(() => [
|
|
1115
1227
|
String
|
|
1116
1228
|
]),
|
|
1117
|
-
|
|
1229
|
+
_ts_metadata15("design:type", Array)
|
|
1118
1230
|
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
1119
|
-
|
|
1120
|
-
(0,
|
|
1231
|
+
_ts_decorate15([
|
|
1232
|
+
(0, import_type_graphql16.Field)(() => String, {
|
|
1121
1233
|
nullable: true
|
|
1122
1234
|
}),
|
|
1123
|
-
|
|
1235
|
+
_ts_metadata15("design:type", String)
|
|
1124
1236
|
], ActionExecutionMessageOutput.prototype, "parentMessageId", void 0);
|
|
1125
|
-
ActionExecutionMessageOutput =
|
|
1126
|
-
(0,
|
|
1237
|
+
ActionExecutionMessageOutput = _ts_decorate15([
|
|
1238
|
+
(0, import_type_graphql16.ObjectType)({
|
|
1127
1239
|
implements: BaseMessageOutput
|
|
1128
1240
|
})
|
|
1129
1241
|
], ActionExecutionMessageOutput);
|
|
@@ -1133,20 +1245,20 @@ var ResultMessageOutput = class {
|
|
|
1133
1245
|
result;
|
|
1134
1246
|
};
|
|
1135
1247
|
__name(ResultMessageOutput, "ResultMessageOutput");
|
|
1136
|
-
|
|
1137
|
-
(0,
|
|
1138
|
-
|
|
1248
|
+
_ts_decorate15([
|
|
1249
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1250
|
+
_ts_metadata15("design:type", String)
|
|
1139
1251
|
], ResultMessageOutput.prototype, "actionExecutionId", void 0);
|
|
1140
|
-
|
|
1141
|
-
(0,
|
|
1142
|
-
|
|
1252
|
+
_ts_decorate15([
|
|
1253
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1254
|
+
_ts_metadata15("design:type", String)
|
|
1143
1255
|
], ResultMessageOutput.prototype, "actionName", void 0);
|
|
1144
|
-
|
|
1145
|
-
(0,
|
|
1146
|
-
|
|
1256
|
+
_ts_decorate15([
|
|
1257
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1258
|
+
_ts_metadata15("design:type", String)
|
|
1147
1259
|
], ResultMessageOutput.prototype, "result", void 0);
|
|
1148
|
-
ResultMessageOutput =
|
|
1149
|
-
(0,
|
|
1260
|
+
ResultMessageOutput = _ts_decorate15([
|
|
1261
|
+
(0, import_type_graphql16.ObjectType)({
|
|
1150
1262
|
implements: BaseMessageOutput
|
|
1151
1263
|
})
|
|
1152
1264
|
], ResultMessageOutput);
|
|
@@ -1161,40 +1273,40 @@ var AgentStateMessageOutput = class {
|
|
|
1161
1273
|
running;
|
|
1162
1274
|
};
|
|
1163
1275
|
__name(AgentStateMessageOutput, "AgentStateMessageOutput");
|
|
1164
|
-
|
|
1165
|
-
(0,
|
|
1166
|
-
|
|
1276
|
+
_ts_decorate15([
|
|
1277
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1278
|
+
_ts_metadata15("design:type", String)
|
|
1167
1279
|
], AgentStateMessageOutput.prototype, "threadId", void 0);
|
|
1168
|
-
|
|
1169
|
-
(0,
|
|
1170
|
-
|
|
1280
|
+
_ts_decorate15([
|
|
1281
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1282
|
+
_ts_metadata15("design:type", String)
|
|
1171
1283
|
], AgentStateMessageOutput.prototype, "agentName", void 0);
|
|
1172
|
-
|
|
1173
|
-
(0,
|
|
1174
|
-
|
|
1284
|
+
_ts_decorate15([
|
|
1285
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1286
|
+
_ts_metadata15("design:type", String)
|
|
1175
1287
|
], AgentStateMessageOutput.prototype, "nodeName", void 0);
|
|
1176
|
-
|
|
1177
|
-
(0,
|
|
1178
|
-
|
|
1288
|
+
_ts_decorate15([
|
|
1289
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1290
|
+
_ts_metadata15("design:type", String)
|
|
1179
1291
|
], AgentStateMessageOutput.prototype, "runId", void 0);
|
|
1180
|
-
|
|
1181
|
-
(0,
|
|
1182
|
-
|
|
1292
|
+
_ts_decorate15([
|
|
1293
|
+
(0, import_type_graphql16.Field)(() => Boolean),
|
|
1294
|
+
_ts_metadata15("design:type", Boolean)
|
|
1183
1295
|
], AgentStateMessageOutput.prototype, "active", void 0);
|
|
1184
|
-
|
|
1185
|
-
(0,
|
|
1186
|
-
|
|
1296
|
+
_ts_decorate15([
|
|
1297
|
+
(0, import_type_graphql16.Field)(() => MessageRole),
|
|
1298
|
+
_ts_metadata15("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
1187
1299
|
], AgentStateMessageOutput.prototype, "role", void 0);
|
|
1188
|
-
|
|
1189
|
-
(0,
|
|
1190
|
-
|
|
1300
|
+
_ts_decorate15([
|
|
1301
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1302
|
+
_ts_metadata15("design:type", String)
|
|
1191
1303
|
], AgentStateMessageOutput.prototype, "state", void 0);
|
|
1192
|
-
|
|
1193
|
-
(0,
|
|
1194
|
-
|
|
1304
|
+
_ts_decorate15([
|
|
1305
|
+
(0, import_type_graphql16.Field)(() => Boolean),
|
|
1306
|
+
_ts_metadata15("design:type", Boolean)
|
|
1195
1307
|
], AgentStateMessageOutput.prototype, "running", void 0);
|
|
1196
|
-
AgentStateMessageOutput =
|
|
1197
|
-
(0,
|
|
1308
|
+
AgentStateMessageOutput = _ts_decorate15([
|
|
1309
|
+
(0, import_type_graphql16.ObjectType)({
|
|
1198
1310
|
implements: BaseMessageOutput
|
|
1199
1311
|
})
|
|
1200
1312
|
], AgentStateMessageOutput);
|
|
@@ -1203,30 +1315,37 @@ var CopilotResponse = class {
|
|
|
1203
1315
|
status;
|
|
1204
1316
|
runId;
|
|
1205
1317
|
messages;
|
|
1318
|
+
extensions;
|
|
1206
1319
|
};
|
|
1207
1320
|
__name(CopilotResponse, "CopilotResponse");
|
|
1208
|
-
|
|
1209
|
-
(0,
|
|
1210
|
-
|
|
1321
|
+
_ts_decorate15([
|
|
1322
|
+
(0, import_type_graphql16.Field)(() => String),
|
|
1323
|
+
_ts_metadata15("design:type", String)
|
|
1211
1324
|
], CopilotResponse.prototype, "threadId", void 0);
|
|
1212
|
-
|
|
1213
|
-
(0,
|
|
1214
|
-
|
|
1325
|
+
_ts_decorate15([
|
|
1326
|
+
(0, import_type_graphql16.Field)(() => ResponseStatusUnion),
|
|
1327
|
+
_ts_metadata15("design:type", Object)
|
|
1215
1328
|
], CopilotResponse.prototype, "status", void 0);
|
|
1216
|
-
|
|
1217
|
-
(0,
|
|
1329
|
+
_ts_decorate15([
|
|
1330
|
+
(0, import_type_graphql16.Field)({
|
|
1218
1331
|
nullable: true
|
|
1219
1332
|
}),
|
|
1220
|
-
|
|
1333
|
+
_ts_metadata15("design:type", String)
|
|
1221
1334
|
], CopilotResponse.prototype, "runId", void 0);
|
|
1222
|
-
|
|
1223
|
-
(0,
|
|
1335
|
+
_ts_decorate15([
|
|
1336
|
+
(0, import_type_graphql16.Field)(() => [
|
|
1224
1337
|
BaseMessageOutput
|
|
1225
1338
|
]),
|
|
1226
|
-
|
|
1339
|
+
_ts_metadata15("design:type", Array)
|
|
1227
1340
|
], CopilotResponse.prototype, "messages", void 0);
|
|
1228
|
-
|
|
1229
|
-
(0,
|
|
1341
|
+
_ts_decorate15([
|
|
1342
|
+
(0, import_type_graphql16.Field)(() => ExtensionsResponse, {
|
|
1343
|
+
nullable: true
|
|
1344
|
+
}),
|
|
1345
|
+
_ts_metadata15("design:type", typeof ExtensionsResponse === "undefined" ? Object : ExtensionsResponse)
|
|
1346
|
+
], CopilotResponse.prototype, "extensions", void 0);
|
|
1347
|
+
CopilotResponse = _ts_decorate15([
|
|
1348
|
+
(0, import_type_graphql16.ObjectType)()
|
|
1230
1349
|
], CopilotResponse);
|
|
1231
1350
|
|
|
1232
1351
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
@@ -1252,7 +1371,6 @@ var import_node_crypto = require("crypto");
|
|
|
1252
1371
|
|
|
1253
1372
|
// src/lib/runtime/copilot-runtime.ts
|
|
1254
1373
|
var import_shared2 = require("@copilotkit/shared");
|
|
1255
|
-
var import_langgraph_sdk = require("@langchain/langgraph-sdk");
|
|
1256
1374
|
|
|
1257
1375
|
// src/graphql/types/converted/index.ts
|
|
1258
1376
|
var Message = class extends BaseMessageInput {
|
|
@@ -1370,6 +1488,7 @@ __name(AgentStateMessage, "AgentStateMessage");
|
|
|
1370
1488
|
|
|
1371
1489
|
// src/lib/runtime/copilot-runtime.ts
|
|
1372
1490
|
var import_rxjs = require("rxjs");
|
|
1491
|
+
var import_langgraph_sdk = require("@langchain/langgraph-sdk");
|
|
1373
1492
|
function resolveEndpointType(endpoint) {
|
|
1374
1493
|
if (!endpoint.type) {
|
|
1375
1494
|
if ("langsmithApiKey" in endpoint && "deploymentUrl" in endpoint && "agents" in endpoint) {
|
|
@@ -1484,8 +1603,8 @@ __name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
|
1484
1603
|
var import_shared5 = require("@copilotkit/shared");
|
|
1485
1604
|
|
|
1486
1605
|
// src/graphql/types/agents-response.type.ts
|
|
1487
|
-
var
|
|
1488
|
-
function
|
|
1606
|
+
var import_type_graphql17 = require("type-graphql");
|
|
1607
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
1489
1608
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1490
1609
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1491
1610
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1495,49 +1614,49 @@ function _ts_decorate14(decorators, target, key, desc) {
|
|
|
1495
1614
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1496
1615
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1497
1616
|
}
|
|
1498
|
-
__name(
|
|
1499
|
-
function
|
|
1617
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
1618
|
+
function _ts_metadata16(k, v) {
|
|
1500
1619
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1501
1620
|
return Reflect.metadata(k, v);
|
|
1502
1621
|
}
|
|
1503
|
-
__name(
|
|
1622
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
1504
1623
|
var Agent = class {
|
|
1505
1624
|
id;
|
|
1506
1625
|
name;
|
|
1507
1626
|
description;
|
|
1508
1627
|
};
|
|
1509
1628
|
__name(Agent, "Agent");
|
|
1510
|
-
|
|
1511
|
-
(0,
|
|
1512
|
-
|
|
1629
|
+
_ts_decorate16([
|
|
1630
|
+
(0, import_type_graphql17.Field)(() => String),
|
|
1631
|
+
_ts_metadata16("design:type", String)
|
|
1513
1632
|
], Agent.prototype, "id", void 0);
|
|
1514
|
-
|
|
1515
|
-
(0,
|
|
1516
|
-
|
|
1633
|
+
_ts_decorate16([
|
|
1634
|
+
(0, import_type_graphql17.Field)(() => String),
|
|
1635
|
+
_ts_metadata16("design:type", String)
|
|
1517
1636
|
], Agent.prototype, "name", void 0);
|
|
1518
|
-
|
|
1519
|
-
(0,
|
|
1520
|
-
|
|
1637
|
+
_ts_decorate16([
|
|
1638
|
+
(0, import_type_graphql17.Field)(() => String),
|
|
1639
|
+
_ts_metadata16("design:type", String)
|
|
1521
1640
|
], Agent.prototype, "description", void 0);
|
|
1522
|
-
Agent =
|
|
1523
|
-
(0,
|
|
1641
|
+
Agent = _ts_decorate16([
|
|
1642
|
+
(0, import_type_graphql17.ObjectType)()
|
|
1524
1643
|
], Agent);
|
|
1525
1644
|
var AgentsResponse = class {
|
|
1526
1645
|
agents;
|
|
1527
1646
|
};
|
|
1528
1647
|
__name(AgentsResponse, "AgentsResponse");
|
|
1529
|
-
|
|
1530
|
-
(0,
|
|
1648
|
+
_ts_decorate16([
|
|
1649
|
+
(0, import_type_graphql17.Field)(() => [
|
|
1531
1650
|
Agent
|
|
1532
1651
|
]),
|
|
1533
|
-
|
|
1652
|
+
_ts_metadata16("design:type", Array)
|
|
1534
1653
|
], AgentsResponse.prototype, "agents", void 0);
|
|
1535
|
-
AgentsResponse =
|
|
1536
|
-
(0,
|
|
1654
|
+
AgentsResponse = _ts_decorate16([
|
|
1655
|
+
(0, import_type_graphql17.ObjectType)()
|
|
1537
1656
|
], AgentsResponse);
|
|
1538
1657
|
|
|
1539
1658
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1540
|
-
function
|
|
1659
|
+
function _ts_decorate17(decorators, target, key, desc) {
|
|
1541
1660
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1542
1661
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1543
1662
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1547,12 +1666,12 @@ function _ts_decorate15(decorators, target, key, desc) {
|
|
|
1547
1666
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1548
1667
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1549
1668
|
}
|
|
1550
|
-
__name(
|
|
1551
|
-
function
|
|
1669
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
1670
|
+
function _ts_metadata17(k, v) {
|
|
1552
1671
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1553
1672
|
return Reflect.metadata(k, v);
|
|
1554
1673
|
}
|
|
1555
|
-
__name(
|
|
1674
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
1556
1675
|
function _ts_param(paramIndex, decorator) {
|
|
1557
1676
|
return function(target, key) {
|
|
1558
1677
|
decorator(target, key, paramIndex);
|
|
@@ -1599,10 +1718,10 @@ var CopilotResolver = class {
|
|
|
1599
1718
|
component: "CopilotResolver.availableAgents"
|
|
1600
1719
|
});
|
|
1601
1720
|
logger2.debug("Processing");
|
|
1602
|
-
const
|
|
1721
|
+
const agentsWithEndpoints = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
1603
1722
|
logger2.debug("Event source created, creating response");
|
|
1604
1723
|
return {
|
|
1605
|
-
agents
|
|
1724
|
+
agents: agentsWithEndpoints.map(({ endpoint, ...agentWithoutEndpoint }) => agentWithoutEndpoint)
|
|
1606
1725
|
};
|
|
1607
1726
|
}
|
|
1608
1727
|
async generateCopilotResponse(ctx, data, properties) {
|
|
@@ -1664,7 +1783,7 @@ var CopilotResolver = class {
|
|
|
1664
1783
|
rejectOutputMessagesPromise = reject;
|
|
1665
1784
|
});
|
|
1666
1785
|
logger2.debug("Processing");
|
|
1667
|
-
const { eventSource, threadId = (0, import_shared5.randomId)(), runId, serverSideActions, actionInputsWithoutAgents } = await copilotRuntime.processRuntimeRequest({
|
|
1786
|
+
const { eventSource, threadId = (0, import_shared5.randomId)(), runId, serverSideActions, actionInputsWithoutAgents, extensions } = await copilotRuntime.processRuntimeRequest({
|
|
1668
1787
|
serviceAdapter,
|
|
1669
1788
|
messages: data.messages,
|
|
1670
1789
|
actions: data.frontend.actions.filter((action) => action.available !== ActionInputAvailability.disabled),
|
|
@@ -1676,13 +1795,15 @@ var CopilotResolver = class {
|
|
|
1676
1795
|
forwardedParameters: data.forwardedParameters,
|
|
1677
1796
|
agentSession: data.agentSession,
|
|
1678
1797
|
agentStates: data.agentStates,
|
|
1679
|
-
url: data.frontend.url
|
|
1798
|
+
url: data.frontend.url,
|
|
1799
|
+
extensions: data.extensions
|
|
1680
1800
|
});
|
|
1681
1801
|
logger2.debug("Event source created, creating response");
|
|
1682
1802
|
const response = {
|
|
1683
1803
|
threadId,
|
|
1684
1804
|
runId,
|
|
1685
1805
|
status: (0, import_rxjs3.firstValueFrom)(responseStatus$),
|
|
1806
|
+
extensions,
|
|
1686
1807
|
messages: new import_graphql_yoga.Repeater(async (pushMessage, stopStreamingMessages) => {
|
|
1687
1808
|
var _a2, _b2;
|
|
1688
1809
|
logger2.debug("Messages repeater created");
|
|
@@ -1739,7 +1860,8 @@ var CopilotResolver = class {
|
|
|
1739
1860
|
actionInputsWithoutAgents: actionInputsWithoutAgents.filter(
|
|
1740
1861
|
// TODO-AGENTS: do not exclude ALL server side actions
|
|
1741
1862
|
(action) => !serverSideActions.find((serverSideAction) => serverSideAction.name == action.name)
|
|
1742
|
-
)
|
|
1863
|
+
),
|
|
1864
|
+
threadId
|
|
1743
1865
|
}).pipe(
|
|
1744
1866
|
// shareReplay() ensures that later subscribers will see the whole stream instead of
|
|
1745
1867
|
// just the events that were emitted after the subscriber was added.
|
|
@@ -1957,38 +2079,38 @@ var CopilotResolver = class {
|
|
|
1957
2079
|
}
|
|
1958
2080
|
};
|
|
1959
2081
|
__name(CopilotResolver, "CopilotResolver");
|
|
1960
|
-
|
|
1961
|
-
(0,
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2082
|
+
_ts_decorate17([
|
|
2083
|
+
(0, import_type_graphql18.Query)(() => String),
|
|
2084
|
+
_ts_metadata17("design:type", Function),
|
|
2085
|
+
_ts_metadata17("design:paramtypes", []),
|
|
2086
|
+
_ts_metadata17("design:returntype", Promise)
|
|
1965
2087
|
], CopilotResolver.prototype, "hello", null);
|
|
1966
|
-
|
|
1967
|
-
(0,
|
|
1968
|
-
_ts_param(0, (0,
|
|
1969
|
-
|
|
1970
|
-
|
|
2088
|
+
_ts_decorate17([
|
|
2089
|
+
(0, import_type_graphql18.Query)(() => AgentsResponse),
|
|
2090
|
+
_ts_param(0, (0, import_type_graphql18.Ctx)()),
|
|
2091
|
+
_ts_metadata17("design:type", Function),
|
|
2092
|
+
_ts_metadata17("design:paramtypes", [
|
|
1971
2093
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
1972
2094
|
]),
|
|
1973
|
-
|
|
2095
|
+
_ts_metadata17("design:returntype", Promise)
|
|
1974
2096
|
], CopilotResolver.prototype, "availableAgents", null);
|
|
1975
|
-
|
|
1976
|
-
(0,
|
|
1977
|
-
_ts_param(0, (0,
|
|
1978
|
-
_ts_param(1, (0,
|
|
1979
|
-
_ts_param(2, (0,
|
|
2097
|
+
_ts_decorate17([
|
|
2098
|
+
(0, import_type_graphql18.Mutation)(() => CopilotResponse),
|
|
2099
|
+
_ts_param(0, (0, import_type_graphql18.Ctx)()),
|
|
2100
|
+
_ts_param(1, (0, import_type_graphql18.Arg)("data")),
|
|
2101
|
+
_ts_param(2, (0, import_type_graphql18.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
1980
2102
|
nullable: true
|
|
1981
2103
|
})),
|
|
1982
|
-
|
|
1983
|
-
|
|
2104
|
+
_ts_metadata17("design:type", Function),
|
|
2105
|
+
_ts_metadata17("design:paramtypes", [
|
|
1984
2106
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
1985
2107
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
1986
2108
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
1987
2109
|
]),
|
|
1988
|
-
|
|
2110
|
+
_ts_metadata17("design:returntype", Promise)
|
|
1989
2111
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
1990
|
-
CopilotResolver =
|
|
1991
|
-
(0,
|
|
2112
|
+
CopilotResolver = _ts_decorate17([
|
|
2113
|
+
(0, import_type_graphql18.Resolver)(() => CopilotResponse)
|
|
1992
2114
|
], CopilotResolver);
|
|
1993
2115
|
|
|
1994
2116
|
// src/lib/integrations/shared.ts
|
|
@@ -2022,6 +2144,141 @@ function createLogger(options) {
|
|
|
2022
2144
|
}
|
|
2023
2145
|
__name(createLogger, "createLogger");
|
|
2024
2146
|
|
|
2147
|
+
// src/graphql/resolvers/state.resolver.ts
|
|
2148
|
+
var import_type_graphql21 = require("type-graphql");
|
|
2149
|
+
var import_type_graphql22 = require("type-graphql");
|
|
2150
|
+
var import_type_graphql23 = require("type-graphql");
|
|
2151
|
+
|
|
2152
|
+
// src/graphql/types/load-agent-state-response.type.ts
|
|
2153
|
+
var import_type_graphql19 = require("type-graphql");
|
|
2154
|
+
function _ts_decorate18(decorators, target, key, desc) {
|
|
2155
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2156
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2157
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2158
|
+
else
|
|
2159
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2160
|
+
if (d = decorators[i])
|
|
2161
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2162
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2163
|
+
}
|
|
2164
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
2165
|
+
function _ts_metadata18(k, v) {
|
|
2166
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
2167
|
+
return Reflect.metadata(k, v);
|
|
2168
|
+
}
|
|
2169
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
2170
|
+
var LoadAgentStateResponse = class {
|
|
2171
|
+
threadId;
|
|
2172
|
+
threadExists;
|
|
2173
|
+
state;
|
|
2174
|
+
messages;
|
|
2175
|
+
};
|
|
2176
|
+
__name(LoadAgentStateResponse, "LoadAgentStateResponse");
|
|
2177
|
+
_ts_decorate18([
|
|
2178
|
+
(0, import_type_graphql19.Field)(() => String),
|
|
2179
|
+
_ts_metadata18("design:type", String)
|
|
2180
|
+
], LoadAgentStateResponse.prototype, "threadId", void 0);
|
|
2181
|
+
_ts_decorate18([
|
|
2182
|
+
(0, import_type_graphql19.Field)(() => Boolean),
|
|
2183
|
+
_ts_metadata18("design:type", Boolean)
|
|
2184
|
+
], LoadAgentStateResponse.prototype, "threadExists", void 0);
|
|
2185
|
+
_ts_decorate18([
|
|
2186
|
+
(0, import_type_graphql19.Field)(() => String),
|
|
2187
|
+
_ts_metadata18("design:type", String)
|
|
2188
|
+
], LoadAgentStateResponse.prototype, "state", void 0);
|
|
2189
|
+
_ts_decorate18([
|
|
2190
|
+
(0, import_type_graphql19.Field)(() => String),
|
|
2191
|
+
_ts_metadata18("design:type", String)
|
|
2192
|
+
], LoadAgentStateResponse.prototype, "messages", void 0);
|
|
2193
|
+
LoadAgentStateResponse = _ts_decorate18([
|
|
2194
|
+
(0, import_type_graphql19.ObjectType)()
|
|
2195
|
+
], LoadAgentStateResponse);
|
|
2196
|
+
|
|
2197
|
+
// src/graphql/inputs/load-agent-state.input.ts
|
|
2198
|
+
var import_type_graphql20 = require("type-graphql");
|
|
2199
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
2200
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2201
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2202
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2203
|
+
else
|
|
2204
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2205
|
+
if (d = decorators[i])
|
|
2206
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2207
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2208
|
+
}
|
|
2209
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
2210
|
+
function _ts_metadata19(k, v) {
|
|
2211
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
2212
|
+
return Reflect.metadata(k, v);
|
|
2213
|
+
}
|
|
2214
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
2215
|
+
var LoadAgentStateInput = class {
|
|
2216
|
+
threadId;
|
|
2217
|
+
agentName;
|
|
2218
|
+
};
|
|
2219
|
+
__name(LoadAgentStateInput, "LoadAgentStateInput");
|
|
2220
|
+
_ts_decorate19([
|
|
2221
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
2222
|
+
_ts_metadata19("design:type", String)
|
|
2223
|
+
], LoadAgentStateInput.prototype, "threadId", void 0);
|
|
2224
|
+
_ts_decorate19([
|
|
2225
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
2226
|
+
_ts_metadata19("design:type", String)
|
|
2227
|
+
], LoadAgentStateInput.prototype, "agentName", void 0);
|
|
2228
|
+
LoadAgentStateInput = _ts_decorate19([
|
|
2229
|
+
(0, import_type_graphql20.InputType)()
|
|
2230
|
+
], LoadAgentStateInput);
|
|
2231
|
+
|
|
2232
|
+
// src/graphql/resolvers/state.resolver.ts
|
|
2233
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
2234
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2235
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2236
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2237
|
+
else
|
|
2238
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2239
|
+
if (d = decorators[i])
|
|
2240
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2241
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2242
|
+
}
|
|
2243
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
2244
|
+
function _ts_metadata20(k, v) {
|
|
2245
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
2246
|
+
return Reflect.metadata(k, v);
|
|
2247
|
+
}
|
|
2248
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
2249
|
+
function _ts_param2(paramIndex, decorator) {
|
|
2250
|
+
return function(target, key) {
|
|
2251
|
+
decorator(target, key, paramIndex);
|
|
2252
|
+
};
|
|
2253
|
+
}
|
|
2254
|
+
__name(_ts_param2, "_ts_param");
|
|
2255
|
+
var StateResolver = class {
|
|
2256
|
+
async loadAgentState(ctx, data) {
|
|
2257
|
+
const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
2258
|
+
const agent = agents.find((agent2) => agent2.name === data.agentName);
|
|
2259
|
+
if (!agent) {
|
|
2260
|
+
throw new Error("Agent not found");
|
|
2261
|
+
}
|
|
2262
|
+
const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
|
|
2263
|
+
return state;
|
|
2264
|
+
}
|
|
2265
|
+
};
|
|
2266
|
+
__name(StateResolver, "StateResolver");
|
|
2267
|
+
_ts_decorate20([
|
|
2268
|
+
(0, import_type_graphql23.Query)(() => LoadAgentStateResponse),
|
|
2269
|
+
_ts_param2(0, (0, import_type_graphql22.Ctx)()),
|
|
2270
|
+
_ts_param2(1, (0, import_type_graphql21.Arg)("data")),
|
|
2271
|
+
_ts_metadata20("design:type", Function),
|
|
2272
|
+
_ts_metadata20("design:paramtypes", [
|
|
2273
|
+
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
2274
|
+
typeof LoadAgentStateInput === "undefined" ? Object : LoadAgentStateInput
|
|
2275
|
+
]),
|
|
2276
|
+
_ts_metadata20("design:returntype", Promise)
|
|
2277
|
+
], StateResolver.prototype, "loadAgentState", null);
|
|
2278
|
+
StateResolver = _ts_decorate20([
|
|
2279
|
+
(0, import_type_graphql21.Resolver)(() => LoadAgentStateResponse)
|
|
2280
|
+
], StateResolver);
|
|
2281
|
+
|
|
2025
2282
|
// src/lib/integrations/shared.ts
|
|
2026
2283
|
var logger = createLogger();
|
|
2027
2284
|
async function createContext(initialContext, copilotKitContext, contextLogger, properties = {}) {
|
|
@@ -2043,9 +2300,10 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
2043
2300
|
__name(createContext, "createContext");
|
|
2044
2301
|
function buildSchema(options = {}) {
|
|
2045
2302
|
logger.debug("Building GraphQL schema...");
|
|
2046
|
-
const schema = (0,
|
|
2303
|
+
const schema = (0, import_type_graphql24.buildSchemaSync)({
|
|
2047
2304
|
resolvers: [
|
|
2048
|
-
CopilotResolver
|
|
2305
|
+
CopilotResolver,
|
|
2306
|
+
StateResolver
|
|
2049
2307
|
],
|
|
2050
2308
|
emitSchemaFile: options.emitSchemaFile
|
|
2051
2309
|
});
|