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