@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",
|
|
@@ -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,43 +1322,51 @@ 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
|
|
1240
1359
|
var import_graphql_yoga = require("graphql-yoga");
|
|
1241
1360
|
|
|
1242
1361
|
// src/service-adapters/events.ts
|
|
1243
|
-
var
|
|
1362
|
+
var import_shared4 = require("@copilotkit/shared");
|
|
1244
1363
|
var import_rxjs2 = require("rxjs");
|
|
1245
1364
|
|
|
1246
1365
|
// src/lib/telemetry-client.ts
|
|
1247
|
-
var
|
|
1366
|
+
var import_shared3 = require("@copilotkit/shared");
|
|
1248
1367
|
|
|
1249
1368
|
// src/lib/runtime/remote-actions.ts
|
|
1369
|
+
var import_shared = require("@copilotkit/shared");
|
|
1250
1370
|
var EndpointType;
|
|
1251
1371
|
(function(EndpointType2) {
|
|
1252
1372
|
EndpointType2["CopilotKit"] = "copilotKit";
|
|
@@ -1257,7 +1377,7 @@ var EndpointType;
|
|
|
1257
1377
|
var import_node_crypto = require("crypto");
|
|
1258
1378
|
|
|
1259
1379
|
// src/lib/runtime/copilot-runtime.ts
|
|
1260
|
-
var
|
|
1380
|
+
var import_shared2 = require("@copilotkit/shared");
|
|
1261
1381
|
|
|
1262
1382
|
// src/graphql/types/converted/index.ts
|
|
1263
1383
|
var Message = class extends BaseMessageInput {
|
|
@@ -1375,6 +1495,7 @@ __name(AgentStateMessage, "AgentStateMessage");
|
|
|
1375
1495
|
|
|
1376
1496
|
// src/lib/runtime/copilot-runtime.ts
|
|
1377
1497
|
var import_rxjs = require("rxjs");
|
|
1498
|
+
var import_langgraph_sdk = require("@langchain/langgraph-sdk");
|
|
1378
1499
|
function resolveEndpointType(endpoint) {
|
|
1379
1500
|
if (!endpoint.type) {
|
|
1380
1501
|
if ("langsmithApiKey" in endpoint && "deploymentUrl" in endpoint && "agents" in endpoint) {
|
|
@@ -1389,7 +1510,7 @@ __name(resolveEndpointType, "resolveEndpointType");
|
|
|
1389
1510
|
|
|
1390
1511
|
// src/lib/telemetry-client.ts
|
|
1391
1512
|
var packageJson = require_package();
|
|
1392
|
-
var telemetryClient = new
|
|
1513
|
+
var telemetryClient = new import_shared3.TelemetryClient({
|
|
1393
1514
|
packageName: packageJson.name,
|
|
1394
1515
|
packageVersion: packageJson.version
|
|
1395
1516
|
});
|
|
@@ -1486,11 +1607,11 @@ var UnknownErrorResponse = class extends FailedResponseStatus {
|
|
|
1486
1607
|
__name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
1487
1608
|
|
|
1488
1609
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1489
|
-
var
|
|
1610
|
+
var import_shared5 = require("@copilotkit/shared");
|
|
1490
1611
|
|
|
1491
1612
|
// src/graphql/types/agents-response.type.ts
|
|
1492
|
-
var
|
|
1493
|
-
function
|
|
1613
|
+
var import_type_graphql17 = require("type-graphql");
|
|
1614
|
+
function _ts_decorate16(decorators, target, key, desc) {
|
|
1494
1615
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1495
1616
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1496
1617
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1500,49 +1621,49 @@ function _ts_decorate14(decorators, target, key, desc) {
|
|
|
1500
1621
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1501
1622
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1502
1623
|
}
|
|
1503
|
-
__name(
|
|
1504
|
-
function
|
|
1624
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
1625
|
+
function _ts_metadata16(k, v) {
|
|
1505
1626
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1506
1627
|
return Reflect.metadata(k, v);
|
|
1507
1628
|
}
|
|
1508
|
-
__name(
|
|
1629
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
1509
1630
|
var Agent = class {
|
|
1510
1631
|
id;
|
|
1511
1632
|
name;
|
|
1512
1633
|
description;
|
|
1513
1634
|
};
|
|
1514
1635
|
__name(Agent, "Agent");
|
|
1515
|
-
|
|
1516
|
-
(0,
|
|
1517
|
-
|
|
1636
|
+
_ts_decorate16([
|
|
1637
|
+
(0, import_type_graphql17.Field)(() => String),
|
|
1638
|
+
_ts_metadata16("design:type", String)
|
|
1518
1639
|
], Agent.prototype, "id", void 0);
|
|
1519
|
-
|
|
1520
|
-
(0,
|
|
1521
|
-
|
|
1640
|
+
_ts_decorate16([
|
|
1641
|
+
(0, import_type_graphql17.Field)(() => String),
|
|
1642
|
+
_ts_metadata16("design:type", String)
|
|
1522
1643
|
], Agent.prototype, "name", void 0);
|
|
1523
|
-
|
|
1524
|
-
(0,
|
|
1525
|
-
|
|
1644
|
+
_ts_decorate16([
|
|
1645
|
+
(0, import_type_graphql17.Field)(() => String),
|
|
1646
|
+
_ts_metadata16("design:type", String)
|
|
1526
1647
|
], Agent.prototype, "description", void 0);
|
|
1527
|
-
Agent =
|
|
1528
|
-
(0,
|
|
1648
|
+
Agent = _ts_decorate16([
|
|
1649
|
+
(0, import_type_graphql17.ObjectType)()
|
|
1529
1650
|
], Agent);
|
|
1530
1651
|
var AgentsResponse = class {
|
|
1531
1652
|
agents;
|
|
1532
1653
|
};
|
|
1533
1654
|
__name(AgentsResponse, "AgentsResponse");
|
|
1534
|
-
|
|
1535
|
-
(0,
|
|
1655
|
+
_ts_decorate16([
|
|
1656
|
+
(0, import_type_graphql17.Field)(() => [
|
|
1536
1657
|
Agent
|
|
1537
1658
|
]),
|
|
1538
|
-
|
|
1659
|
+
_ts_metadata16("design:type", Array)
|
|
1539
1660
|
], AgentsResponse.prototype, "agents", void 0);
|
|
1540
|
-
AgentsResponse =
|
|
1541
|
-
(0,
|
|
1661
|
+
AgentsResponse = _ts_decorate16([
|
|
1662
|
+
(0, import_type_graphql17.ObjectType)()
|
|
1542
1663
|
], AgentsResponse);
|
|
1543
1664
|
|
|
1544
1665
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1545
|
-
function
|
|
1666
|
+
function _ts_decorate17(decorators, target, key, desc) {
|
|
1546
1667
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1547
1668
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
1548
1669
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1552,12 +1673,12 @@ function _ts_decorate15(decorators, target, key, desc) {
|
|
|
1552
1673
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1553
1674
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1554
1675
|
}
|
|
1555
|
-
__name(
|
|
1556
|
-
function
|
|
1676
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
1677
|
+
function _ts_metadata17(k, v) {
|
|
1557
1678
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
1558
1679
|
return Reflect.metadata(k, v);
|
|
1559
1680
|
}
|
|
1560
|
-
__name(
|
|
1681
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
1561
1682
|
function _ts_param(paramIndex, decorator) {
|
|
1562
1683
|
return function(target, key) {
|
|
1563
1684
|
decorator(target, key, paramIndex);
|
|
@@ -1604,10 +1725,10 @@ var CopilotResolver = class {
|
|
|
1604
1725
|
component: "CopilotResolver.availableAgents"
|
|
1605
1726
|
});
|
|
1606
1727
|
logger2.debug("Processing");
|
|
1607
|
-
const
|
|
1728
|
+
const agentsWithEndpoints = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
1608
1729
|
logger2.debug("Event source created, creating response");
|
|
1609
1730
|
return {
|
|
1610
|
-
agents
|
|
1731
|
+
agents: agentsWithEndpoints.map(({ endpoint, ...agentWithoutEndpoint }) => agentWithoutEndpoint)
|
|
1611
1732
|
};
|
|
1612
1733
|
}
|
|
1613
1734
|
async generateCopilotResponse(ctx, data, properties) {
|
|
@@ -1669,7 +1790,7 @@ var CopilotResolver = class {
|
|
|
1669
1790
|
rejectOutputMessagesPromise = reject;
|
|
1670
1791
|
});
|
|
1671
1792
|
logger2.debug("Processing");
|
|
1672
|
-
const { eventSource, threadId = (0,
|
|
1793
|
+
const { eventSource, threadId = (0, import_shared5.randomId)(), runId, serverSideActions, actionInputsWithoutAgents, extensions } = await copilotRuntime.processRuntimeRequest({
|
|
1673
1794
|
serviceAdapter,
|
|
1674
1795
|
messages: data.messages,
|
|
1675
1796
|
actions: data.frontend.actions.filter((action) => action.available !== ActionInputAvailability.disabled),
|
|
@@ -1681,13 +1802,15 @@ var CopilotResolver = class {
|
|
|
1681
1802
|
forwardedParameters: data.forwardedParameters,
|
|
1682
1803
|
agentSession: data.agentSession,
|
|
1683
1804
|
agentStates: data.agentStates,
|
|
1684
|
-
url: data.frontend.url
|
|
1805
|
+
url: data.frontend.url,
|
|
1806
|
+
extensions: data.extensions
|
|
1685
1807
|
});
|
|
1686
1808
|
logger2.debug("Event source created, creating response");
|
|
1687
1809
|
const response = {
|
|
1688
1810
|
threadId,
|
|
1689
1811
|
runId,
|
|
1690
1812
|
status: (0, import_rxjs3.firstValueFrom)(responseStatus$),
|
|
1813
|
+
extensions,
|
|
1691
1814
|
messages: new import_graphql_yoga.Repeater(async (pushMessage, stopStreamingMessages) => {
|
|
1692
1815
|
var _a2, _b2;
|
|
1693
1816
|
logger2.debug("Messages repeater created");
|
|
@@ -1714,7 +1837,7 @@ var CopilotResolver = class {
|
|
|
1714
1837
|
});
|
|
1715
1838
|
outputMessages = [
|
|
1716
1839
|
(0, import_class_transformer2.plainToInstance)(TextMessage, {
|
|
1717
|
-
id: (0,
|
|
1840
|
+
id: (0, import_shared5.randomId)(),
|
|
1718
1841
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1719
1842
|
content: result.reason,
|
|
1720
1843
|
role: MessageRole.assistant
|
|
@@ -1744,7 +1867,8 @@ var CopilotResolver = class {
|
|
|
1744
1867
|
actionInputsWithoutAgents: actionInputsWithoutAgents.filter(
|
|
1745
1868
|
// TODO-AGENTS: do not exclude ALL server side actions
|
|
1746
1869
|
(action) => !serverSideActions.find((serverSideAction) => serverSideAction.name == action.name)
|
|
1747
|
-
)
|
|
1870
|
+
),
|
|
1871
|
+
threadId
|
|
1748
1872
|
}).pipe(
|
|
1749
1873
|
// shareReplay() ensures that later subscribers will see the whole stream instead of
|
|
1750
1874
|
// just the events that were emitted after the subscriber was added.
|
|
@@ -1905,7 +2029,7 @@ var CopilotResolver = class {
|
|
|
1905
2029
|
event
|
|
1906
2030
|
}, "Agent message event received");
|
|
1907
2031
|
pushMessage({
|
|
1908
|
-
id: (0,
|
|
2032
|
+
id: (0, import_shared5.randomId)(),
|
|
1909
2033
|
status: new SuccessMessageStatus(),
|
|
1910
2034
|
threadId: event.threadId,
|
|
1911
2035
|
agentName: event.agentName,
|
|
@@ -1918,7 +2042,7 @@ var CopilotResolver = class {
|
|
|
1918
2042
|
createdAt: /* @__PURE__ */ new Date()
|
|
1919
2043
|
});
|
|
1920
2044
|
outputMessages.push((0, import_class_transformer2.plainToInstance)(AgentStateMessage, {
|
|
1921
|
-
id: (0,
|
|
2045
|
+
id: (0, import_shared5.randomId)(),
|
|
1922
2046
|
threadId: event.threadId,
|
|
1923
2047
|
agentName: event.agentName,
|
|
1924
2048
|
nodeName: event.nodeName,
|
|
@@ -1962,38 +2086,38 @@ var CopilotResolver = class {
|
|
|
1962
2086
|
}
|
|
1963
2087
|
};
|
|
1964
2088
|
__name(CopilotResolver, "CopilotResolver");
|
|
1965
|
-
|
|
1966
|
-
(0,
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
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)
|
|
1970
2094
|
], CopilotResolver.prototype, "hello", null);
|
|
1971
|
-
|
|
1972
|
-
(0,
|
|
1973
|
-
_ts_param(0, (0,
|
|
1974
|
-
|
|
1975
|
-
|
|
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", [
|
|
1976
2100
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
1977
2101
|
]),
|
|
1978
|
-
|
|
2102
|
+
_ts_metadata17("design:returntype", Promise)
|
|
1979
2103
|
], CopilotResolver.prototype, "availableAgents", null);
|
|
1980
|
-
|
|
1981
|
-
(0,
|
|
1982
|
-
_ts_param(0, (0,
|
|
1983
|
-
_ts_param(1, (0,
|
|
1984
|
-
_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, {
|
|
1985
2109
|
nullable: true
|
|
1986
2110
|
})),
|
|
1987
|
-
|
|
1988
|
-
|
|
2111
|
+
_ts_metadata17("design:type", Function),
|
|
2112
|
+
_ts_metadata17("design:paramtypes", [
|
|
1989
2113
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
1990
2114
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
1991
2115
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
1992
2116
|
]),
|
|
1993
|
-
|
|
2117
|
+
_ts_metadata17("design:returntype", Promise)
|
|
1994
2118
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
1995
|
-
CopilotResolver =
|
|
1996
|
-
(0,
|
|
2119
|
+
CopilotResolver = _ts_decorate17([
|
|
2120
|
+
(0, import_type_graphql18.Resolver)(() => CopilotResponse)
|
|
1997
2121
|
], CopilotResolver);
|
|
1998
2122
|
|
|
1999
2123
|
// src/lib/integrations/shared.ts
|
|
@@ -2027,6 +2151,141 @@ function createLogger(options) {
|
|
|
2027
2151
|
}
|
|
2028
2152
|
__name(createLogger, "createLogger");
|
|
2029
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
|
+
|
|
2030
2289
|
// src/lib/integrations/shared.ts
|
|
2031
2290
|
var logger = createLogger();
|
|
2032
2291
|
async function createContext(initialContext, copilotKitContext, contextLogger, properties = {}) {
|
|
@@ -2048,9 +2307,10 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
2048
2307
|
__name(createContext, "createContext");
|
|
2049
2308
|
function buildSchema(options = {}) {
|
|
2050
2309
|
logger.debug("Building GraphQL schema...");
|
|
2051
|
-
const schema = (0,
|
|
2310
|
+
const schema = (0, import_type_graphql24.buildSchemaSync)({
|
|
2052
2311
|
resolvers: [
|
|
2053
|
-
CopilotResolver
|
|
2312
|
+
CopilotResolver,
|
|
2313
|
+
StateResolver
|
|
2054
2314
|
],
|
|
2055
2315
|
emitSchemaFile: options.emitSchemaFile
|
|
2056
2316
|
});
|