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