@copilotkit/runtime 1.5.12-next.5 → 1.5.12-next.7
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 +17 -0
- package/__snapshots__/schema/schema.graphql +33 -0
- package/dist/{chunk-MFDRA3BJ.mjs → chunk-34276UUU.mjs} +652 -285
- package/dist/chunk-34276UUU.mjs.map +1 -0
- package/dist/{chunk-XRW7ZSWJ.mjs → chunk-DLESGNLO.mjs} +2 -2
- package/dist/{chunk-TPTCSIAR.mjs → chunk-S3KKBII4.mjs} +42 -30
- package/dist/chunk-S3KKBII4.mjs.map +1 -0
- package/dist/{chunk-QDMAQO2C.mjs → chunk-UBYSQI43.mjs} +2 -2
- package/dist/{chunk-NORCONUM.mjs → chunk-WTUPF3W3.mjs} +2 -2
- package/dist/{copilot-runtime-1a224a0f.d.ts → copilot-runtime-8c442d65.d.ts} +16 -3
- 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 +727 -348
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- 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 +725 -346
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/lib/integrations/index.d.ts +4 -4
- package/dist/lib/integrations/index.js +504 -244
- 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 +504 -244
- 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 +504 -244
- 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 +504 -244
- 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 +155 -31
- package/src/lib/runtime/remote-action-constructors.ts +42 -33
- package/src/lib/runtime/remote-actions.ts +12 -7
- 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-MFDRA3BJ.mjs.map +0 -1
- package/dist/chunk-TPTCSIAR.mjs.map +0 -1
- /package/dist/{chunk-XRW7ZSWJ.mjs.map → chunk-DLESGNLO.mjs.map} +0 -0
- /package/dist/{chunk-QDMAQO2C.mjs.map → chunk-UBYSQI43.mjs.map} +0 -0
- /package/dist/{chunk-NORCONUM.mjs.map → chunk-WTUPF3W3.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-next.
|
|
47
|
+
version: "1.5.12-next.7",
|
|
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,43 +1315,51 @@ 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
|
|
1233
1352
|
var import_graphql_yoga = require("graphql-yoga");
|
|
1234
1353
|
|
|
1235
1354
|
// src/service-adapters/events.ts
|
|
1236
|
-
var
|
|
1355
|
+
var import_shared4 = require("@copilotkit/shared");
|
|
1237
1356
|
var import_rxjs2 = require("rxjs");
|
|
1238
1357
|
|
|
1239
1358
|
// src/lib/telemetry-client.ts
|
|
1240
|
-
var
|
|
1359
|
+
var import_shared3 = require("@copilotkit/shared");
|
|
1241
1360
|
|
|
1242
1361
|
// src/lib/runtime/remote-actions.ts
|
|
1362
|
+
var import_shared = require("@copilotkit/shared");
|
|
1243
1363
|
var EndpointType;
|
|
1244
1364
|
(function(EndpointType2) {
|
|
1245
1365
|
EndpointType2["CopilotKit"] = "copilotKit";
|
|
@@ -1250,7 +1370,7 @@ var EndpointType;
|
|
|
1250
1370
|
var import_node_crypto = require("crypto");
|
|
1251
1371
|
|
|
1252
1372
|
// src/lib/runtime/copilot-runtime.ts
|
|
1253
|
-
var
|
|
1373
|
+
var import_shared2 = require("@copilotkit/shared");
|
|
1254
1374
|
|
|
1255
1375
|
// src/graphql/types/converted/index.ts
|
|
1256
1376
|
var Message = class extends BaseMessageInput {
|
|
@@ -1368,6 +1488,7 @@ __name(AgentStateMessage, "AgentStateMessage");
|
|
|
1368
1488
|
|
|
1369
1489
|
// src/lib/runtime/copilot-runtime.ts
|
|
1370
1490
|
var import_rxjs = require("rxjs");
|
|
1491
|
+
var import_langgraph_sdk = require("@langchain/langgraph-sdk");
|
|
1371
1492
|
function resolveEndpointType(endpoint) {
|
|
1372
1493
|
if (!endpoint.type) {
|
|
1373
1494
|
if ("langsmithApiKey" in endpoint && "deploymentUrl" in endpoint && "agents" in endpoint) {
|
|
@@ -1382,7 +1503,7 @@ __name(resolveEndpointType, "resolveEndpointType");
|
|
|
1382
1503
|
|
|
1383
1504
|
// src/lib/telemetry-client.ts
|
|
1384
1505
|
var packageJson = require_package();
|
|
1385
|
-
var telemetryClient = new
|
|
1506
|
+
var telemetryClient = new import_shared3.TelemetryClient({
|
|
1386
1507
|
packageName: packageJson.name,
|
|
1387
1508
|
packageVersion: packageJson.version
|
|
1388
1509
|
});
|
|
@@ -1479,11 +1600,11 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
|
|
|
1479
1600
|
__name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
1480
1601
|
|
|
1481
1602
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1482
|
-
var
|
|
1603
|
+
var import_shared5 = require("@copilotkit/shared");
|
|
1483
1604
|
|
|
1484
1605
|
// src/graphql/types/agents-response.type.ts
|
|
1485
|
-
var
|
|
1486
|
-
function
|
|
1606
|
+
var import_type_graphql17 = require("type-graphql");
|
|
1607
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
1487
1608
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1488
1609
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1489
1610
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1493,49 +1614,49 @@ function _ts_decorate14(decorators, target, key, desc) {
|
|
|
1493
1614
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1494
1615
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1495
1616
|
}
|
|
1496
|
-
__name(
|
|
1497
|
-
function
|
|
1617
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
1618
|
+
function _ts_metadata16(k, v) {
|
|
1498
1619
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1499
1620
|
return Reflect.metadata(k, v);
|
|
1500
1621
|
}
|
|
1501
|
-
__name(
|
|
1622
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
1502
1623
|
var Agent = class {
|
|
1503
1624
|
id;
|
|
1504
1625
|
name;
|
|
1505
1626
|
description;
|
|
1506
1627
|
};
|
|
1507
1628
|
__name(Agent, "Agent");
|
|
1508
|
-
|
|
1509
|
-
(0,
|
|
1510
|
-
|
|
1629
|
+
_ts_decorate16([
|
|
1630
|
+
(0, import_type_graphql17.Field)(() => String),
|
|
1631
|
+
_ts_metadata16("design:type", String)
|
|
1511
1632
|
], Agent.prototype, "id", void 0);
|
|
1512
|
-
|
|
1513
|
-
(0,
|
|
1514
|
-
|
|
1633
|
+
_ts_decorate16([
|
|
1634
|
+
(0, import_type_graphql17.Field)(() => String),
|
|
1635
|
+
_ts_metadata16("design:type", String)
|
|
1515
1636
|
], Agent.prototype, "name", void 0);
|
|
1516
|
-
|
|
1517
|
-
(0,
|
|
1518
|
-
|
|
1637
|
+
_ts_decorate16([
|
|
1638
|
+
(0, import_type_graphql17.Field)(() => String),
|
|
1639
|
+
_ts_metadata16("design:type", String)
|
|
1519
1640
|
], Agent.prototype, "description", void 0);
|
|
1520
|
-
Agent =
|
|
1521
|
-
(0,
|
|
1641
|
+
Agent = _ts_decorate16([
|
|
1642
|
+
(0, import_type_graphql17.ObjectType)()
|
|
1522
1643
|
], Agent);
|
|
1523
1644
|
var AgentsResponse = class {
|
|
1524
1645
|
agents;
|
|
1525
1646
|
};
|
|
1526
1647
|
__name(AgentsResponse, "AgentsResponse");
|
|
1527
|
-
|
|
1528
|
-
(0,
|
|
1648
|
+
_ts_decorate16([
|
|
1649
|
+
(0, import_type_graphql17.Field)(() => [
|
|
1529
1650
|
Agent
|
|
1530
1651
|
]),
|
|
1531
|
-
|
|
1652
|
+
_ts_metadata16("design:type", Array)
|
|
1532
1653
|
], AgentsResponse.prototype, "agents", void 0);
|
|
1533
|
-
AgentsResponse =
|
|
1534
|
-
(0,
|
|
1654
|
+
AgentsResponse = _ts_decorate16([
|
|
1655
|
+
(0, import_type_graphql17.ObjectType)()
|
|
1535
1656
|
], AgentsResponse);
|
|
1536
1657
|
|
|
1537
1658
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1538
|
-
function
|
|
1659
|
+
function _ts_decorate17(decorators, target, key, desc) {
|
|
1539
1660
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1540
1661
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1541
1662
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1545,12 +1666,12 @@ function _ts_decorate15(decorators, target, key, desc) {
|
|
|
1545
1666
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1546
1667
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1547
1668
|
}
|
|
1548
|
-
__name(
|
|
1549
|
-
function
|
|
1669
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
1670
|
+
function _ts_metadata17(k, v) {
|
|
1550
1671
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1551
1672
|
return Reflect.metadata(k, v);
|
|
1552
1673
|
}
|
|
1553
|
-
__name(
|
|
1674
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
1554
1675
|
function _ts_param(paramIndex, decorator) {
|
|
1555
1676
|
return function(target, key) {
|
|
1556
1677
|
decorator(target, key, paramIndex);
|
|
@@ -1597,10 +1718,10 @@ var CopilotResolver = class {
|
|
|
1597
1718
|
component: "CopilotResolver.availableAgents"
|
|
1598
1719
|
});
|
|
1599
1720
|
logger2.debug("Processing");
|
|
1600
|
-
const
|
|
1721
|
+
const agentsWithEndpoints = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
1601
1722
|
logger2.debug("Event source created, creating response");
|
|
1602
1723
|
return {
|
|
1603
|
-
agents
|
|
1724
|
+
agents: agentsWithEndpoints.map(({ endpoint, ...agentWithoutEndpoint }) => agentWithoutEndpoint)
|
|
1604
1725
|
};
|
|
1605
1726
|
}
|
|
1606
1727
|
async generateCopilotResponse(ctx, data, properties) {
|
|
@@ -1662,7 +1783,7 @@ var CopilotResolver = class {
|
|
|
1662
1783
|
rejectOutputMessagesPromise = reject;
|
|
1663
1784
|
});
|
|
1664
1785
|
logger2.debug("Processing");
|
|
1665
|
-
const { eventSource, threadId = (0,
|
|
1786
|
+
const { eventSource, threadId = (0, import_shared5.randomId)(), runId, serverSideActions, actionInputsWithoutAgents, extensions } = await copilotRuntime.processRuntimeRequest({
|
|
1666
1787
|
serviceAdapter,
|
|
1667
1788
|
messages: data.messages,
|
|
1668
1789
|
actions: data.frontend.actions.filter((action) => action.available !== ActionInputAvailability.disabled),
|
|
@@ -1674,13 +1795,15 @@ var CopilotResolver = class {
|
|
|
1674
1795
|
forwardedParameters: data.forwardedParameters,
|
|
1675
1796
|
agentSession: data.agentSession,
|
|
1676
1797
|
agentStates: data.agentStates,
|
|
1677
|
-
url: data.frontend.url
|
|
1798
|
+
url: data.frontend.url,
|
|
1799
|
+
extensions: data.extensions
|
|
1678
1800
|
});
|
|
1679
1801
|
logger2.debug("Event source created, creating response");
|
|
1680
1802
|
const response = {
|
|
1681
1803
|
threadId,
|
|
1682
1804
|
runId,
|
|
1683
1805
|
status: (0, import_rxjs3.firstValueFrom)(responseStatus$),
|
|
1806
|
+
extensions,
|
|
1684
1807
|
messages: new import_graphql_yoga.Repeater(async (pushMessage, stopStreamingMessages) => {
|
|
1685
1808
|
var _a2, _b2;
|
|
1686
1809
|
logger2.debug("Messages repeater created");
|
|
@@ -1707,7 +1830,7 @@ var CopilotResolver = class {
|
|
|
1707
1830
|
});
|
|
1708
1831
|
outputMessages = [
|
|
1709
1832
|
(0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
1710
|
-
id: (0,
|
|
1833
|
+
id: (0, import_shared5.randomId)(),
|
|
1711
1834
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1712
1835
|
content: result.reason,
|
|
1713
1836
|
role: MessageRole.assistant
|
|
@@ -1737,7 +1860,8 @@ var CopilotResolver = class {
|
|
|
1737
1860
|
actionInputsWithoutAgents: actionInputsWithoutAgents.filter(
|
|
1738
1861
|
// TODO-AGENTS: do not exclude ALL server side actions
|
|
1739
1862
|
(action) => !serverSideActions.find((serverSideAction) => serverSideAction.name == action.name)
|
|
1740
|
-
)
|
|
1863
|
+
),
|
|
1864
|
+
threadId
|
|
1741
1865
|
}).pipe(
|
|
1742
1866
|
// shareReplay() ensures that later subscribers will see the whole stream instead of
|
|
1743
1867
|
// just the events that were emitted after the subscriber was added.
|
|
@@ -1898,7 +2022,7 @@ var CopilotResolver = class {
|
|
|
1898
2022
|
event
|
|
1899
2023
|
}, "Agent message event received");
|
|
1900
2024
|
pushMessage({
|
|
1901
|
-
id: (0,
|
|
2025
|
+
id: (0, import_shared5.randomId)(),
|
|
1902
2026
|
status: new SuccessMessageStatus(),
|
|
1903
2027
|
threadId: event.threadId,
|
|
1904
2028
|
agentName: event.agentName,
|
|
@@ -1911,7 +2035,7 @@ var CopilotResolver = class {
|
|
|
1911
2035
|
createdAt: /* @__PURE__ */ new Date()
|
|
1912
2036
|
});
|
|
1913
2037
|
outputMessages.push((0, import_class_transformer2.plainToInstance)(AgentStateMessage, {
|
|
1914
|
-
id: (0,
|
|
2038
|
+
id: (0, import_shared5.randomId)(),
|
|
1915
2039
|
threadId: event.threadId,
|
|
1916
2040
|
agentName: event.agentName,
|
|
1917
2041
|
nodeName: event.nodeName,
|
|
@@ -1955,38 +2079,38 @@ var CopilotResolver = class {
|
|
|
1955
2079
|
}
|
|
1956
2080
|
};
|
|
1957
2081
|
__name(CopilotResolver, "CopilotResolver");
|
|
1958
|
-
|
|
1959
|
-
(0,
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
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)
|
|
1963
2087
|
], CopilotResolver.prototype, "hello", null);
|
|
1964
|
-
|
|
1965
|
-
(0,
|
|
1966
|
-
_ts_param(0, (0,
|
|
1967
|
-
|
|
1968
|
-
|
|
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", [
|
|
1969
2093
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
1970
2094
|
]),
|
|
1971
|
-
|
|
2095
|
+
_ts_metadata17("design:returntype", Promise)
|
|
1972
2096
|
], CopilotResolver.prototype, "availableAgents", null);
|
|
1973
|
-
|
|
1974
|
-
(0,
|
|
1975
|
-
_ts_param(0, (0,
|
|
1976
|
-
_ts_param(1, (0,
|
|
1977
|
-
_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, {
|
|
1978
2102
|
nullable: true
|
|
1979
2103
|
})),
|
|
1980
|
-
|
|
1981
|
-
|
|
2104
|
+
_ts_metadata17("design:type", Function),
|
|
2105
|
+
_ts_metadata17("design:paramtypes", [
|
|
1982
2106
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
1983
2107
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
1984
2108
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
1985
2109
|
]),
|
|
1986
|
-
|
|
2110
|
+
_ts_metadata17("design:returntype", Promise)
|
|
1987
2111
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
1988
|
-
CopilotResolver =
|
|
1989
|
-
(0,
|
|
2112
|
+
CopilotResolver = _ts_decorate17([
|
|
2113
|
+
(0, import_type_graphql18.Resolver)(() => CopilotResponse)
|
|
1990
2114
|
], CopilotResolver);
|
|
1991
2115
|
|
|
1992
2116
|
// src/lib/integrations/shared.ts
|
|
@@ -2020,6 +2144,141 @@ function createLogger(options) {
|
|
|
2020
2144
|
}
|
|
2021
2145
|
__name(createLogger, "createLogger");
|
|
2022
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
|
+
|
|
2023
2282
|
// src/lib/integrations/shared.ts
|
|
2024
2283
|
var logger = createLogger();
|
|
2025
2284
|
async function createContext(initialContext, copilotKitContext, contextLogger, properties = {}) {
|
|
@@ -2041,9 +2300,10 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
2041
2300
|
__name(createContext, "createContext");
|
|
2042
2301
|
function buildSchema(options = {}) {
|
|
2043
2302
|
logger.debug("Building GraphQL schema...");
|
|
2044
|
-
const schema = (0,
|
|
2303
|
+
const schema = (0, import_type_graphql24.buildSchemaSync)({
|
|
2045
2304
|
resolvers: [
|
|
2046
|
-
CopilotResolver
|
|
2305
|
+
CopilotResolver,
|
|
2306
|
+
StateResolver
|
|
2047
2307
|
],
|
|
2048
2308
|
emitSchemaFile: options.emitSchemaFile
|
|
2049
2309
|
});
|