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