@copilotkit/runtime 1.5.15-next.7 → 1.5.15
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 +25 -0
- package/__snapshots__/schema/schema.graphql +14 -1
- package/dist/{chunk-F4WILQ32.mjs → chunk-2ITUMI4O.mjs} +2 -2
- package/dist/{chunk-BUEAVIXA.mjs → chunk-GRU4U3VO.mjs} +2 -2
- package/dist/{chunk-OMS5GY45.mjs → chunk-HOTR3KYO.mjs} +538 -416
- package/dist/chunk-HOTR3KYO.mjs.map +1 -0
- package/dist/{chunk-65VBDTR4.mjs → chunk-USNCP24V.mjs} +2 -2
- package/dist/{copilot-runtime-a113045f.d.ts → copilot-runtime-3e7f1c7b.d.ts} +5 -4
- package/dist/graphql/types/converted/index.d.ts +1 -1
- package/dist/{groq-adapter-248058e8.d.ts → groq-adapter-3b894689.d.ts} +1 -1
- package/dist/{index-a7f37670.d.ts → index-f6d1f30b.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1283 -1161
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{langserve-9580bd66.d.ts → langserve-3a591089.d.ts} +11 -3
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +1283 -1161
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.d.ts +4 -4
- package/dist/lib/integrations/index.js +493 -400
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.d.ts +3 -3
- package/dist/lib/integrations/nest/index.js +493 -400
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +2 -2
- package/dist/lib/integrations/node-express/index.d.ts +3 -3
- package/dist/lib/integrations/node-express/index.js +493 -400
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +2 -2
- package/dist/lib/integrations/node-http/index.d.ts +3 -3
- package/dist/lib/integrations/node-http/index.js +493 -400
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/dist/service-adapters/index.d.ts +4 -4
- package/package.json +2 -2
- package/src/agents/langgraph/event-source.ts +7 -0
- package/src/agents/langgraph/events.ts +11 -1
- package/src/graphql/inputs/meta-event.input.ts +4 -3
- package/src/graphql/resolvers/copilot.resolver.ts +44 -1
- package/src/graphql/types/copilot-response.type.ts +1 -3
- package/src/graphql/types/meta-events.type.ts +41 -1
- package/src/lib/runtime/remote-lg-action.ts +44 -19
- package/src/service-adapters/events.ts +8 -2
- package/dist/chunk-OMS5GY45.mjs.map +0 -1
- /package/dist/{chunk-F4WILQ32.mjs.map → chunk-2ITUMI4O.mjs.map} +0 -0
- /package/dist/{chunk-BUEAVIXA.mjs.map → chunk-GRU4U3VO.mjs.map} +0 -0
- /package/dist/{chunk-65VBDTR4.mjs.map → chunk-USNCP24V.mjs.map} +0 -0
|
@@ -38,7 +38,7 @@ var require_package = __commonJS({
|
|
|
38
38
|
publishConfig: {
|
|
39
39
|
access: "public"
|
|
40
40
|
},
|
|
41
|
-
version: "1.5.15
|
|
41
|
+
version: "1.5.15",
|
|
42
42
|
sideEffects: false,
|
|
43
43
|
main: "./dist/index.js",
|
|
44
44
|
module: "./dist/index.mjs",
|
|
@@ -126,7 +126,7 @@ import { Arg, Ctx, Mutation, Query, Resolver } from "type-graphql";
|
|
|
126
126
|
import { ReplaySubject as ReplaySubject3, Subject, filter, finalize, firstValueFrom as firstValueFrom2, shareReplay, skipWhile, take, takeWhile, tap } from "rxjs";
|
|
127
127
|
|
|
128
128
|
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
129
|
-
import { Field as
|
|
129
|
+
import { Field as Field15, InputType as InputType11 } from "type-graphql";
|
|
130
130
|
|
|
131
131
|
// src/graphql/inputs/message.input.ts
|
|
132
132
|
import { Field, InputType } from "type-graphql";
|
|
@@ -733,10 +733,16 @@ OpenAIApiAssistantAPIInput = _ts_decorate9([
|
|
|
733
733
|
], OpenAIApiAssistantAPIInput);
|
|
734
734
|
|
|
735
735
|
// src/graphql/inputs/meta-event.input.ts
|
|
736
|
-
import { Field as
|
|
736
|
+
import { Field as Field14, InputType as InputType10 } from "type-graphql";
|
|
737
737
|
|
|
738
738
|
// src/graphql/types/meta-events.type.ts
|
|
739
|
-
import { Field as
|
|
739
|
+
import { Field as Field13, InterfaceType as InterfaceType2, ObjectType as ObjectType4, registerEnumType as registerEnumType3 } from "type-graphql";
|
|
740
|
+
|
|
741
|
+
// src/graphql/types/copilot-response.type.ts
|
|
742
|
+
import { Field as Field12, InterfaceType, ObjectType as ObjectType3 } from "type-graphql";
|
|
743
|
+
|
|
744
|
+
// src/graphql/types/message-status.type.ts
|
|
745
|
+
import { Field as Field10, ObjectType, createUnionType, registerEnumType as registerEnumType2 } from "type-graphql";
|
|
740
746
|
function _ts_decorate10(decorators, target, key, desc) {
|
|
741
747
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
742
748
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -753,57 +759,62 @@ function _ts_metadata10(k, v) {
|
|
|
753
759
|
return Reflect.metadata(k, v);
|
|
754
760
|
}
|
|
755
761
|
__name(_ts_metadata10, "_ts_metadata");
|
|
756
|
-
var
|
|
757
|
-
(function(
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
762
|
+
var MessageStatusCode;
|
|
763
|
+
(function(MessageStatusCode2) {
|
|
764
|
+
MessageStatusCode2["Pending"] = "pending";
|
|
765
|
+
MessageStatusCode2["Success"] = "success";
|
|
766
|
+
MessageStatusCode2["Failed"] = "failed";
|
|
767
|
+
})(MessageStatusCode || (MessageStatusCode = {}));
|
|
768
|
+
registerEnumType2(MessageStatusCode, {
|
|
769
|
+
name: "MessageStatusCode"
|
|
763
770
|
});
|
|
764
|
-
var
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
};
|
|
768
|
-
__name(BaseMetaEvent, "BaseMetaEvent");
|
|
769
|
-
_ts_decorate10([
|
|
770
|
-
Field10(() => String),
|
|
771
|
-
_ts_metadata10("design:type", String)
|
|
772
|
-
], BaseMetaEvent.prototype, "type", void 0);
|
|
771
|
+
var BaseMessageStatus = /* @__PURE__ */ __name(class BaseMessageStatus2 {
|
|
772
|
+
code;
|
|
773
|
+
}, "BaseMessageStatus");
|
|
773
774
|
_ts_decorate10([
|
|
774
|
-
Field10(() =>
|
|
775
|
+
Field10(() => MessageStatusCode),
|
|
775
776
|
_ts_metadata10("design:type", String)
|
|
776
|
-
],
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
],
|
|
780
|
-
var
|
|
781
|
-
|
|
782
|
-
value;
|
|
783
|
-
response;
|
|
777
|
+
], BaseMessageStatus.prototype, "code", void 0);
|
|
778
|
+
BaseMessageStatus = _ts_decorate10([
|
|
779
|
+
ObjectType()
|
|
780
|
+
], BaseMessageStatus);
|
|
781
|
+
var PendingMessageStatus = class extends BaseMessageStatus {
|
|
782
|
+
code = "pending";
|
|
784
783
|
};
|
|
785
|
-
__name(
|
|
786
|
-
_ts_decorate10([
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
784
|
+
__name(PendingMessageStatus, "PendingMessageStatus");
|
|
785
|
+
PendingMessageStatus = _ts_decorate10([
|
|
786
|
+
ObjectType()
|
|
787
|
+
], PendingMessageStatus);
|
|
788
|
+
var SuccessMessageStatus = class extends BaseMessageStatus {
|
|
789
|
+
code = "success";
|
|
790
|
+
};
|
|
791
|
+
__name(SuccessMessageStatus, "SuccessMessageStatus");
|
|
792
|
+
SuccessMessageStatus = _ts_decorate10([
|
|
793
|
+
ObjectType()
|
|
794
|
+
], SuccessMessageStatus);
|
|
795
|
+
var FailedMessageStatus = class extends BaseMessageStatus {
|
|
796
|
+
code = "failed";
|
|
797
|
+
reason;
|
|
798
|
+
};
|
|
799
|
+
__name(FailedMessageStatus, "FailedMessageStatus");
|
|
790
800
|
_ts_decorate10([
|
|
791
801
|
Field10(() => String),
|
|
792
802
|
_ts_metadata10("design:type", String)
|
|
793
|
-
],
|
|
794
|
-
_ts_decorate10([
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
803
|
+
], FailedMessageStatus.prototype, "reason", void 0);
|
|
804
|
+
FailedMessageStatus = _ts_decorate10([
|
|
805
|
+
ObjectType()
|
|
806
|
+
], FailedMessageStatus);
|
|
807
|
+
var MessageStatusUnion = createUnionType({
|
|
808
|
+
name: "MessageStatus",
|
|
809
|
+
types: () => [
|
|
810
|
+
PendingMessageStatus,
|
|
811
|
+
SuccessMessageStatus,
|
|
812
|
+
FailedMessageStatus
|
|
813
|
+
]
|
|
814
|
+
});
|
|
805
815
|
|
|
806
|
-
// src/graphql/
|
|
816
|
+
// src/graphql/types/extensions-response.type.ts
|
|
817
|
+
import { Field as Field11, ObjectType as ObjectType2 } from "type-graphql";
|
|
807
818
|
function _ts_decorate11(decorators, target, key, desc) {
|
|
808
819
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
809
820
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -820,36 +831,41 @@ function _ts_metadata11(k, v) {
|
|
|
820
831
|
return Reflect.metadata(k, v);
|
|
821
832
|
}
|
|
822
833
|
__name(_ts_metadata11, "_ts_metadata");
|
|
823
|
-
var
|
|
824
|
-
|
|
825
|
-
name;
|
|
826
|
-
value;
|
|
827
|
-
response;
|
|
834
|
+
var ExtensionsResponse = class {
|
|
835
|
+
openaiAssistantAPI;
|
|
828
836
|
};
|
|
829
|
-
__name(
|
|
830
|
-
_ts_decorate11([
|
|
831
|
-
Field11(() => String),
|
|
832
|
-
_ts_metadata11("design:type", String)
|
|
833
|
-
], MetaEventInput.prototype, "type", void 0);
|
|
837
|
+
__name(ExtensionsResponse, "ExtensionsResponse");
|
|
834
838
|
_ts_decorate11([
|
|
835
|
-
Field11(() =>
|
|
836
|
-
|
|
837
|
-
|
|
839
|
+
Field11(() => OpenAIApiAssistantAPIResponse, {
|
|
840
|
+
nullable: true
|
|
841
|
+
}),
|
|
842
|
+
_ts_metadata11("design:type", typeof OpenAIApiAssistantAPIResponse === "undefined" ? Object : OpenAIApiAssistantAPIResponse)
|
|
843
|
+
], ExtensionsResponse.prototype, "openaiAssistantAPI", void 0);
|
|
844
|
+
ExtensionsResponse = _ts_decorate11([
|
|
845
|
+
ObjectType2()
|
|
846
|
+
], ExtensionsResponse);
|
|
847
|
+
var OpenAIApiAssistantAPIResponse = class {
|
|
848
|
+
runId;
|
|
849
|
+
threadId;
|
|
850
|
+
};
|
|
851
|
+
__name(OpenAIApiAssistantAPIResponse, "OpenAIApiAssistantAPIResponse");
|
|
838
852
|
_ts_decorate11([
|
|
839
|
-
Field11(() => String
|
|
853
|
+
Field11(() => String, {
|
|
854
|
+
nullable: true
|
|
855
|
+
}),
|
|
840
856
|
_ts_metadata11("design:type", String)
|
|
841
|
-
],
|
|
857
|
+
], OpenAIApiAssistantAPIResponse.prototype, "runId", void 0);
|
|
842
858
|
_ts_decorate11([
|
|
843
859
|
Field11(() => String, {
|
|
844
860
|
nullable: true
|
|
845
861
|
}),
|
|
846
862
|
_ts_metadata11("design:type", String)
|
|
847
|
-
],
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
],
|
|
863
|
+
], OpenAIApiAssistantAPIResponse.prototype, "threadId", void 0);
|
|
864
|
+
OpenAIApiAssistantAPIResponse = _ts_decorate11([
|
|
865
|
+
ObjectType2()
|
|
866
|
+
], OpenAIApiAssistantAPIResponse);
|
|
851
867
|
|
|
852
|
-
// src/graphql/
|
|
868
|
+
// src/graphql/types/copilot-response.type.ts
|
|
853
869
|
function _ts_decorate12(decorators, target, key, desc) {
|
|
854
870
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
855
871
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -866,117 +882,221 @@ function _ts_metadata12(k, v) {
|
|
|
866
882
|
return Reflect.metadata(k, v);
|
|
867
883
|
}
|
|
868
884
|
__name(_ts_metadata12, "_ts_metadata");
|
|
869
|
-
var
|
|
870
|
-
|
|
885
|
+
var BaseMessageOutput = class {
|
|
886
|
+
id;
|
|
887
|
+
createdAt;
|
|
888
|
+
status;
|
|
871
889
|
};
|
|
872
|
-
__name(
|
|
890
|
+
__name(BaseMessageOutput, "BaseMessageOutput");
|
|
873
891
|
_ts_decorate12([
|
|
874
|
-
Field12(() =>
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
892
|
+
Field12(() => String),
|
|
893
|
+
_ts_metadata12("design:type", String)
|
|
894
|
+
], BaseMessageOutput.prototype, "id", void 0);
|
|
895
|
+
_ts_decorate12([
|
|
896
|
+
Field12(() => Date),
|
|
897
|
+
_ts_metadata12("design:type", typeof Date === "undefined" ? Object : Date)
|
|
898
|
+
], BaseMessageOutput.prototype, "createdAt", void 0);
|
|
899
|
+
_ts_decorate12([
|
|
900
|
+
Field12(() => MessageStatusUnion),
|
|
901
|
+
_ts_metadata12("design:type", Object)
|
|
902
|
+
], BaseMessageOutput.prototype, "status", void 0);
|
|
903
|
+
BaseMessageOutput = _ts_decorate12([
|
|
904
|
+
InterfaceType({
|
|
905
|
+
resolveType(value) {
|
|
906
|
+
if (value.hasOwnProperty("content")) {
|
|
907
|
+
return TextMessageOutput;
|
|
908
|
+
} else if (value.hasOwnProperty("name")) {
|
|
909
|
+
return ActionExecutionMessageOutput;
|
|
910
|
+
} else if (value.hasOwnProperty("result")) {
|
|
911
|
+
return ResultMessageOutput;
|
|
912
|
+
} else if (value.hasOwnProperty("state")) {
|
|
913
|
+
return AgentStateMessageOutput;
|
|
914
|
+
}
|
|
915
|
+
return void 0;
|
|
916
|
+
}
|
|
917
|
+
})
|
|
918
|
+
], BaseMessageOutput);
|
|
919
|
+
var TextMessageOutput = class {
|
|
920
|
+
role;
|
|
921
|
+
content;
|
|
922
|
+
parentMessageId;
|
|
895
923
|
};
|
|
896
|
-
__name(
|
|
924
|
+
__name(TextMessageOutput, "TextMessageOutput");
|
|
897
925
|
_ts_decorate12([
|
|
898
|
-
Field12(() =>
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
926
|
+
Field12(() => MessageRole),
|
|
927
|
+
_ts_metadata12("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
928
|
+
], TextMessageOutput.prototype, "role", void 0);
|
|
929
|
+
_ts_decorate12([
|
|
930
|
+
Field12(() => [
|
|
931
|
+
String
|
|
932
|
+
]),
|
|
933
|
+
_ts_metadata12("design:type", Array)
|
|
934
|
+
], TextMessageOutput.prototype, "content", void 0);
|
|
903
935
|
_ts_decorate12([
|
|
904
936
|
Field12(() => String, {
|
|
905
937
|
nullable: true
|
|
906
938
|
}),
|
|
907
939
|
_ts_metadata12("design:type", String)
|
|
908
|
-
],
|
|
940
|
+
], TextMessageOutput.prototype, "parentMessageId", void 0);
|
|
941
|
+
TextMessageOutput = _ts_decorate12([
|
|
942
|
+
ObjectType3({
|
|
943
|
+
implements: BaseMessageOutput
|
|
944
|
+
})
|
|
945
|
+
], TextMessageOutput);
|
|
946
|
+
var ActionExecutionMessageOutput = class {
|
|
947
|
+
name;
|
|
948
|
+
scope;
|
|
949
|
+
arguments;
|
|
950
|
+
parentMessageId;
|
|
951
|
+
};
|
|
952
|
+
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
953
|
+
_ts_decorate12([
|
|
954
|
+
Field12(() => String),
|
|
955
|
+
_ts_metadata12("design:type", String)
|
|
956
|
+
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
909
957
|
_ts_decorate12([
|
|
910
958
|
Field12(() => String, {
|
|
911
|
-
nullable: true
|
|
959
|
+
nullable: true,
|
|
960
|
+
deprecationReason: "This field will be removed in a future version"
|
|
912
961
|
}),
|
|
913
962
|
_ts_metadata12("design:type", String)
|
|
914
|
-
],
|
|
963
|
+
], ActionExecutionMessageOutput.prototype, "scope", void 0);
|
|
915
964
|
_ts_decorate12([
|
|
916
965
|
Field12(() => [
|
|
917
|
-
|
|
966
|
+
String
|
|
918
967
|
]),
|
|
919
968
|
_ts_metadata12("design:type", Array)
|
|
920
|
-
],
|
|
921
|
-
_ts_decorate12([
|
|
922
|
-
Field12(() => FrontendInput),
|
|
923
|
-
_ts_metadata12("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
|
|
924
|
-
], GenerateCopilotResponseInput.prototype, "frontend", void 0);
|
|
969
|
+
], ActionExecutionMessageOutput.prototype, "arguments", void 0);
|
|
925
970
|
_ts_decorate12([
|
|
926
|
-
Field12(() =>
|
|
971
|
+
Field12(() => String, {
|
|
927
972
|
nullable: true
|
|
928
973
|
}),
|
|
929
|
-
_ts_metadata12("design:type",
|
|
930
|
-
],
|
|
974
|
+
_ts_metadata12("design:type", String)
|
|
975
|
+
], ActionExecutionMessageOutput.prototype, "parentMessageId", void 0);
|
|
976
|
+
ActionExecutionMessageOutput = _ts_decorate12([
|
|
977
|
+
ObjectType3({
|
|
978
|
+
implements: BaseMessageOutput
|
|
979
|
+
})
|
|
980
|
+
], ActionExecutionMessageOutput);
|
|
981
|
+
var ResultMessageOutput = class {
|
|
982
|
+
actionExecutionId;
|
|
983
|
+
actionName;
|
|
984
|
+
result;
|
|
985
|
+
};
|
|
986
|
+
__name(ResultMessageOutput, "ResultMessageOutput");
|
|
931
987
|
_ts_decorate12([
|
|
932
|
-
Field12(() =>
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
_ts_metadata12("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
|
|
936
|
-
], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
|
|
988
|
+
Field12(() => String),
|
|
989
|
+
_ts_metadata12("design:type", String)
|
|
990
|
+
], ResultMessageOutput.prototype, "actionExecutionId", void 0);
|
|
937
991
|
_ts_decorate12([
|
|
938
|
-
Field12(() =>
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
992
|
+
Field12(() => String),
|
|
993
|
+
_ts_metadata12("design:type", String)
|
|
994
|
+
], ResultMessageOutput.prototype, "actionName", void 0);
|
|
995
|
+
_ts_decorate12([
|
|
996
|
+
Field12(() => String),
|
|
997
|
+
_ts_metadata12("design:type", String)
|
|
998
|
+
], ResultMessageOutput.prototype, "result", void 0);
|
|
999
|
+
ResultMessageOutput = _ts_decorate12([
|
|
1000
|
+
ObjectType3({
|
|
1001
|
+
implements: BaseMessageOutput
|
|
1002
|
+
})
|
|
1003
|
+
], ResultMessageOutput);
|
|
1004
|
+
var AgentStateMessageOutput = class {
|
|
1005
|
+
threadId;
|
|
1006
|
+
agentName;
|
|
1007
|
+
nodeName;
|
|
1008
|
+
runId;
|
|
1009
|
+
active;
|
|
1010
|
+
role;
|
|
1011
|
+
state;
|
|
1012
|
+
running;
|
|
1013
|
+
};
|
|
1014
|
+
__name(AgentStateMessageOutput, "AgentStateMessageOutput");
|
|
1015
|
+
_ts_decorate12([
|
|
1016
|
+
Field12(() => String),
|
|
1017
|
+
_ts_metadata12("design:type", String)
|
|
1018
|
+
], AgentStateMessageOutput.prototype, "threadId", void 0);
|
|
1019
|
+
_ts_decorate12([
|
|
1020
|
+
Field12(() => String),
|
|
1021
|
+
_ts_metadata12("design:type", String)
|
|
1022
|
+
], AgentStateMessageOutput.prototype, "agentName", void 0);
|
|
1023
|
+
_ts_decorate12([
|
|
1024
|
+
Field12(() => String),
|
|
1025
|
+
_ts_metadata12("design:type", String)
|
|
1026
|
+
], AgentStateMessageOutput.prototype, "nodeName", void 0);
|
|
1027
|
+
_ts_decorate12([
|
|
1028
|
+
Field12(() => String),
|
|
1029
|
+
_ts_metadata12("design:type", String)
|
|
1030
|
+
], AgentStateMessageOutput.prototype, "runId", void 0);
|
|
1031
|
+
_ts_decorate12([
|
|
1032
|
+
Field12(() => Boolean),
|
|
1033
|
+
_ts_metadata12("design:type", Boolean)
|
|
1034
|
+
], AgentStateMessageOutput.prototype, "active", void 0);
|
|
1035
|
+
_ts_decorate12([
|
|
1036
|
+
Field12(() => MessageRole),
|
|
1037
|
+
_ts_metadata12("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
1038
|
+
], AgentStateMessageOutput.prototype, "role", void 0);
|
|
1039
|
+
_ts_decorate12([
|
|
1040
|
+
Field12(() => String),
|
|
1041
|
+
_ts_metadata12("design:type", String)
|
|
1042
|
+
], AgentStateMessageOutput.prototype, "state", void 0);
|
|
1043
|
+
_ts_decorate12([
|
|
1044
|
+
Field12(() => Boolean),
|
|
1045
|
+
_ts_metadata12("design:type", Boolean)
|
|
1046
|
+
], AgentStateMessageOutput.prototype, "running", void 0);
|
|
1047
|
+
AgentStateMessageOutput = _ts_decorate12([
|
|
1048
|
+
ObjectType3({
|
|
1049
|
+
implements: BaseMessageOutput
|
|
1050
|
+
})
|
|
1051
|
+
], AgentStateMessageOutput);
|
|
1052
|
+
var CopilotResponse = class {
|
|
1053
|
+
threadId;
|
|
1054
|
+
status;
|
|
1055
|
+
runId;
|
|
1056
|
+
messages;
|
|
1057
|
+
extensions;
|
|
1058
|
+
metaEvents;
|
|
1059
|
+
};
|
|
1060
|
+
__name(CopilotResponse, "CopilotResponse");
|
|
943
1061
|
_ts_decorate12([
|
|
944
|
-
Field12(() =>
|
|
1062
|
+
Field12(() => String),
|
|
1063
|
+
_ts_metadata12("design:type", String)
|
|
1064
|
+
], CopilotResponse.prototype, "threadId", void 0);
|
|
1065
|
+
_ts_decorate12([
|
|
1066
|
+
Field12(() => ResponseStatusUnion),
|
|
1067
|
+
_ts_metadata12("design:type", Object)
|
|
1068
|
+
], CopilotResponse.prototype, "status", void 0);
|
|
1069
|
+
_ts_decorate12([
|
|
1070
|
+
Field12({
|
|
945
1071
|
nullable: true
|
|
946
1072
|
}),
|
|
947
|
-
_ts_metadata12("design:type",
|
|
948
|
-
],
|
|
1073
|
+
_ts_metadata12("design:type", String)
|
|
1074
|
+
], CopilotResponse.prototype, "runId", void 0);
|
|
949
1075
|
_ts_decorate12([
|
|
950
1076
|
Field12(() => [
|
|
951
|
-
|
|
952
|
-
],
|
|
953
|
-
nullable: true
|
|
954
|
-
}),
|
|
1077
|
+
BaseMessageOutput
|
|
1078
|
+
]),
|
|
955
1079
|
_ts_metadata12("design:type", Array)
|
|
956
|
-
],
|
|
1080
|
+
], CopilotResponse.prototype, "messages", void 0);
|
|
957
1081
|
_ts_decorate12([
|
|
958
|
-
Field12(() =>
|
|
1082
|
+
Field12(() => ExtensionsResponse, {
|
|
959
1083
|
nullable: true
|
|
960
1084
|
}),
|
|
961
|
-
_ts_metadata12("design:type", typeof
|
|
962
|
-
],
|
|
1085
|
+
_ts_metadata12("design:type", typeof ExtensionsResponse === "undefined" ? Object : ExtensionsResponse)
|
|
1086
|
+
], CopilotResponse.prototype, "extensions", void 0);
|
|
963
1087
|
_ts_decorate12([
|
|
964
1088
|
Field12(() => [
|
|
965
|
-
|
|
1089
|
+
BaseMetaEvent
|
|
966
1090
|
], {
|
|
967
1091
|
nullable: true
|
|
968
1092
|
}),
|
|
969
1093
|
_ts_metadata12("design:type", Array)
|
|
970
|
-
],
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
],
|
|
974
|
-
|
|
975
|
-
// src/graphql/types/copilot-response.type.ts
|
|
976
|
-
import { Field as Field15, InterfaceType as InterfaceType2, ObjectType as ObjectType4 } from "type-graphql";
|
|
1094
|
+
], CopilotResponse.prototype, "metaEvents", void 0);
|
|
1095
|
+
CopilotResponse = _ts_decorate12([
|
|
1096
|
+
ObjectType3()
|
|
1097
|
+
], CopilotResponse);
|
|
977
1098
|
|
|
978
|
-
// src/graphql/types/
|
|
979
|
-
import { Field as Field13, ObjectType as ObjectType2, createUnionType, registerEnumType as registerEnumType3 } from "type-graphql";
|
|
1099
|
+
// src/graphql/types/meta-events.type.ts
|
|
980
1100
|
function _ts_decorate13(decorators, target, key, desc) {
|
|
981
1101
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
982
1102
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -993,62 +1113,111 @@ function _ts_metadata13(k, v) {
|
|
|
993
1113
|
return Reflect.metadata(k, v);
|
|
994
1114
|
}
|
|
995
1115
|
__name(_ts_metadata13, "_ts_metadata");
|
|
996
|
-
var
|
|
997
|
-
(function(
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1116
|
+
var MetaEventName;
|
|
1117
|
+
(function(MetaEventName2) {
|
|
1118
|
+
MetaEventName2["LangGraphInterruptEvent"] = "LangGraphInterruptEvent";
|
|
1119
|
+
MetaEventName2["CopilotKitLangGraphInterruptEvent"] = "CopilotKitLangGraphInterruptEvent";
|
|
1120
|
+
})(MetaEventName || (MetaEventName = {}));
|
|
1121
|
+
registerEnumType3(MetaEventName, {
|
|
1122
|
+
name: "MetaEventName",
|
|
1123
|
+
description: "Meta event types"
|
|
1004
1124
|
});
|
|
1005
|
-
var
|
|
1006
|
-
|
|
1007
|
-
|
|
1125
|
+
var BaseMetaEvent = class {
|
|
1126
|
+
type = "MetaEvent";
|
|
1127
|
+
name;
|
|
1128
|
+
};
|
|
1129
|
+
__name(BaseMetaEvent, "BaseMetaEvent");
|
|
1008
1130
|
_ts_decorate13([
|
|
1009
|
-
Field13(() =>
|
|
1131
|
+
Field13(() => String),
|
|
1010
1132
|
_ts_metadata13("design:type", String)
|
|
1011
|
-
],
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1133
|
+
], BaseMetaEvent.prototype, "type", void 0);
|
|
1134
|
+
_ts_decorate13([
|
|
1135
|
+
Field13(() => MetaEventName),
|
|
1136
|
+
_ts_metadata13("design:type", String)
|
|
1137
|
+
], BaseMetaEvent.prototype, "name", void 0);
|
|
1138
|
+
BaseMetaEvent = _ts_decorate13([
|
|
1139
|
+
InterfaceType2({
|
|
1140
|
+
resolveType(value) {
|
|
1141
|
+
if (value.name === "LangGraphInterruptEvent") {
|
|
1142
|
+
return LangGraphInterruptEvent;
|
|
1143
|
+
} else if (value.name === "CopilotKitLangGraphInterruptEvent") {
|
|
1144
|
+
return CopilotKitLangGraphInterruptEvent;
|
|
1145
|
+
}
|
|
1146
|
+
return void 0;
|
|
1147
|
+
}
|
|
1148
|
+
}),
|
|
1149
|
+
InterfaceType2()
|
|
1150
|
+
], BaseMetaEvent);
|
|
1151
|
+
var CopilotKitLangGraphInterruptEventData = class {
|
|
1152
|
+
value;
|
|
1153
|
+
messages;
|
|
1024
1154
|
};
|
|
1025
|
-
__name(
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1155
|
+
__name(CopilotKitLangGraphInterruptEventData, "CopilotKitLangGraphInterruptEventData");
|
|
1156
|
+
_ts_decorate13([
|
|
1157
|
+
Field13(() => String),
|
|
1158
|
+
_ts_metadata13("design:type", String)
|
|
1159
|
+
], CopilotKitLangGraphInterruptEventData.prototype, "value", void 0);
|
|
1160
|
+
_ts_decorate13([
|
|
1161
|
+
Field13(() => [
|
|
1162
|
+
BaseMessageOutput
|
|
1163
|
+
]),
|
|
1164
|
+
_ts_metadata13("design:type", Array)
|
|
1165
|
+
], CopilotKitLangGraphInterruptEventData.prototype, "messages", void 0);
|
|
1166
|
+
CopilotKitLangGraphInterruptEventData = _ts_decorate13([
|
|
1167
|
+
ObjectType4()
|
|
1168
|
+
], CopilotKitLangGraphInterruptEventData);
|
|
1169
|
+
var LangGraphInterruptEvent = class {
|
|
1170
|
+
name = "LangGraphInterruptEvent";
|
|
1171
|
+
value;
|
|
1172
|
+
response;
|
|
1032
1173
|
};
|
|
1033
|
-
__name(
|
|
1174
|
+
__name(LangGraphInterruptEvent, "LangGraphInterruptEvent");
|
|
1175
|
+
_ts_decorate13([
|
|
1176
|
+
Field13(() => MetaEventName),
|
|
1177
|
+
_ts_metadata13("design:type", typeof MetaEventName === "undefined" || false ? Object : "LangGraphInterruptEvent")
|
|
1178
|
+
], LangGraphInterruptEvent.prototype, "name", void 0);
|
|
1034
1179
|
_ts_decorate13([
|
|
1035
1180
|
Field13(() => String),
|
|
1036
1181
|
_ts_metadata13("design:type", String)
|
|
1037
|
-
],
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1182
|
+
], LangGraphInterruptEvent.prototype, "value", void 0);
|
|
1183
|
+
_ts_decorate13([
|
|
1184
|
+
Field13(() => String, {
|
|
1185
|
+
nullable: true
|
|
1186
|
+
}),
|
|
1187
|
+
_ts_metadata13("design:type", String)
|
|
1188
|
+
], LangGraphInterruptEvent.prototype, "response", void 0);
|
|
1189
|
+
LangGraphInterruptEvent = _ts_decorate13([
|
|
1190
|
+
ObjectType4({
|
|
1191
|
+
implements: BaseMetaEvent
|
|
1192
|
+
})
|
|
1193
|
+
], LangGraphInterruptEvent);
|
|
1194
|
+
var CopilotKitLangGraphInterruptEvent = class {
|
|
1195
|
+
name = "CopilotKitLangGraphInterruptEvent";
|
|
1196
|
+
data;
|
|
1197
|
+
response;
|
|
1198
|
+
};
|
|
1199
|
+
__name(CopilotKitLangGraphInterruptEvent, "CopilotKitLangGraphInterruptEvent");
|
|
1200
|
+
_ts_decorate13([
|
|
1201
|
+
Field13(() => MetaEventName),
|
|
1202
|
+
_ts_metadata13("design:type", typeof MetaEventName === "undefined" || false ? Object : "CopilotKitLangGraphInterruptEvent")
|
|
1203
|
+
], CopilotKitLangGraphInterruptEvent.prototype, "name", void 0);
|
|
1204
|
+
_ts_decorate13([
|
|
1205
|
+
Field13(() => CopilotKitLangGraphInterruptEventData),
|
|
1206
|
+
_ts_metadata13("design:type", typeof CopilotKitLangGraphInterruptEventData === "undefined" ? Object : CopilotKitLangGraphInterruptEventData)
|
|
1207
|
+
], CopilotKitLangGraphInterruptEvent.prototype, "data", void 0);
|
|
1208
|
+
_ts_decorate13([
|
|
1209
|
+
Field13(() => String, {
|
|
1210
|
+
nullable: true
|
|
1211
|
+
}),
|
|
1212
|
+
_ts_metadata13("design:type", String)
|
|
1213
|
+
], CopilotKitLangGraphInterruptEvent.prototype, "response", void 0);
|
|
1214
|
+
CopilotKitLangGraphInterruptEvent = _ts_decorate13([
|
|
1215
|
+
ObjectType4({
|
|
1216
|
+
implements: BaseMetaEvent
|
|
1217
|
+
})
|
|
1218
|
+
], CopilotKitLangGraphInterruptEvent);
|
|
1049
1219
|
|
|
1050
|
-
// src/graphql/
|
|
1051
|
-
import { Field as Field14, ObjectType as ObjectType3 } from "type-graphql";
|
|
1220
|
+
// src/graphql/inputs/meta-event.input.ts
|
|
1052
1221
|
function _ts_decorate14(decorators, target, key, desc) {
|
|
1053
1222
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1054
1223
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -1065,41 +1234,40 @@ function _ts_metadata14(k, v) {
|
|
|
1065
1234
|
return Reflect.metadata(k, v);
|
|
1066
1235
|
}
|
|
1067
1236
|
__name(_ts_metadata14, "_ts_metadata");
|
|
1068
|
-
var
|
|
1069
|
-
|
|
1237
|
+
var MetaEventInput = class {
|
|
1238
|
+
name;
|
|
1239
|
+
value;
|
|
1240
|
+
response;
|
|
1241
|
+
messages;
|
|
1070
1242
|
};
|
|
1071
|
-
__name(
|
|
1243
|
+
__name(MetaEventInput, "MetaEventInput");
|
|
1072
1244
|
_ts_decorate14([
|
|
1073
|
-
Field14(() =>
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
], ExtensionsResponse);
|
|
1081
|
-
var OpenAIApiAssistantAPIResponse = class {
|
|
1082
|
-
runId;
|
|
1083
|
-
threadId;
|
|
1084
|
-
};
|
|
1085
|
-
__name(OpenAIApiAssistantAPIResponse, "OpenAIApiAssistantAPIResponse");
|
|
1245
|
+
Field14(() => MetaEventName),
|
|
1246
|
+
_ts_metadata14("design:type", typeof MetaEventName === "undefined" ? Object : MetaEventName)
|
|
1247
|
+
], MetaEventInput.prototype, "name", void 0);
|
|
1248
|
+
_ts_decorate14([
|
|
1249
|
+
Field14(() => String),
|
|
1250
|
+
_ts_metadata14("design:type", String)
|
|
1251
|
+
], MetaEventInput.prototype, "value", void 0);
|
|
1086
1252
|
_ts_decorate14([
|
|
1087
1253
|
Field14(() => String, {
|
|
1088
1254
|
nullable: true
|
|
1089
1255
|
}),
|
|
1090
1256
|
_ts_metadata14("design:type", String)
|
|
1091
|
-
],
|
|
1257
|
+
], MetaEventInput.prototype, "response", void 0);
|
|
1092
1258
|
_ts_decorate14([
|
|
1093
|
-
Field14(() =>
|
|
1259
|
+
Field14(() => [
|
|
1260
|
+
MessageInput
|
|
1261
|
+
], {
|
|
1094
1262
|
nullable: true
|
|
1095
1263
|
}),
|
|
1096
|
-
_ts_metadata14("design:type",
|
|
1097
|
-
],
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
],
|
|
1264
|
+
_ts_metadata14("design:type", Array)
|
|
1265
|
+
], MetaEventInput.prototype, "messages", void 0);
|
|
1266
|
+
MetaEventInput = _ts_decorate14([
|
|
1267
|
+
InputType10()
|
|
1268
|
+
], MetaEventInput);
|
|
1101
1269
|
|
|
1102
|
-
// src/graphql/
|
|
1270
|
+
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
1103
1271
|
function _ts_decorate15(decorators, target, key, desc) {
|
|
1104
1272
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1105
1273
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -1116,221 +1284,111 @@ function _ts_metadata15(k, v) {
|
|
|
1116
1284
|
return Reflect.metadata(k, v);
|
|
1117
1285
|
}
|
|
1118
1286
|
__name(_ts_metadata15, "_ts_metadata");
|
|
1119
|
-
var
|
|
1120
|
-
|
|
1121
|
-
createdAt;
|
|
1122
|
-
status;
|
|
1287
|
+
var GenerateCopilotResponseMetadataInput = class {
|
|
1288
|
+
requestType;
|
|
1123
1289
|
};
|
|
1124
|
-
__name(
|
|
1125
|
-
_ts_decorate15([
|
|
1126
|
-
Field15(() => String),
|
|
1127
|
-
_ts_metadata15("design:type", String)
|
|
1128
|
-
], BaseMessageOutput.prototype, "id", void 0);
|
|
1129
|
-
_ts_decorate15([
|
|
1130
|
-
Field15(() => Date),
|
|
1131
|
-
_ts_metadata15("design:type", typeof Date === "undefined" ? Object : Date)
|
|
1132
|
-
], BaseMessageOutput.prototype, "createdAt", void 0);
|
|
1290
|
+
__name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
|
|
1133
1291
|
_ts_decorate15([
|
|
1134
|
-
Field15(() =>
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
var TextMessageOutput = class {
|
|
1156
|
-
role;
|
|
1157
|
-
content;
|
|
1158
|
-
parentMessageId;
|
|
1292
|
+
Field15(() => CopilotRequestType, {
|
|
1293
|
+
nullable: true
|
|
1294
|
+
}),
|
|
1295
|
+
_ts_metadata15("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
|
|
1296
|
+
], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
|
|
1297
|
+
GenerateCopilotResponseMetadataInput = _ts_decorate15([
|
|
1298
|
+
InputType11()
|
|
1299
|
+
], GenerateCopilotResponseMetadataInput);
|
|
1300
|
+
var GenerateCopilotResponseInput = class {
|
|
1301
|
+
metadata;
|
|
1302
|
+
threadId;
|
|
1303
|
+
runId;
|
|
1304
|
+
messages;
|
|
1305
|
+
frontend;
|
|
1306
|
+
cloud;
|
|
1307
|
+
forwardedParameters;
|
|
1308
|
+
agentSession;
|
|
1309
|
+
agentState;
|
|
1310
|
+
agentStates;
|
|
1311
|
+
extensions;
|
|
1312
|
+
metaEvents;
|
|
1159
1313
|
};
|
|
1160
|
-
__name(
|
|
1161
|
-
_ts_decorate15([
|
|
1162
|
-
Field15(() => MessageRole),
|
|
1163
|
-
_ts_metadata15("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
1164
|
-
], TextMessageOutput.prototype, "role", void 0);
|
|
1314
|
+
__name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
|
|
1165
1315
|
_ts_decorate15([
|
|
1166
|
-
Field15(() =>
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
_ts_metadata15("design:type",
|
|
1170
|
-
],
|
|
1316
|
+
Field15(() => GenerateCopilotResponseMetadataInput, {
|
|
1317
|
+
nullable: false
|
|
1318
|
+
}),
|
|
1319
|
+
_ts_metadata15("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
|
|
1320
|
+
], GenerateCopilotResponseInput.prototype, "metadata", void 0);
|
|
1171
1321
|
_ts_decorate15([
|
|
1172
1322
|
Field15(() => String, {
|
|
1173
1323
|
nullable: true
|
|
1174
1324
|
}),
|
|
1175
1325
|
_ts_metadata15("design:type", String)
|
|
1176
|
-
],
|
|
1177
|
-
TextMessageOutput = _ts_decorate15([
|
|
1178
|
-
ObjectType4({
|
|
1179
|
-
implements: BaseMessageOutput
|
|
1180
|
-
})
|
|
1181
|
-
], TextMessageOutput);
|
|
1182
|
-
var ActionExecutionMessageOutput = class {
|
|
1183
|
-
name;
|
|
1184
|
-
scope;
|
|
1185
|
-
arguments;
|
|
1186
|
-
parentMessageId;
|
|
1187
|
-
};
|
|
1188
|
-
__name(ActionExecutionMessageOutput, "ActionExecutionMessageOutput");
|
|
1189
|
-
_ts_decorate15([
|
|
1190
|
-
Field15(() => String),
|
|
1191
|
-
_ts_metadata15("design:type", String)
|
|
1192
|
-
], ActionExecutionMessageOutput.prototype, "name", void 0);
|
|
1326
|
+
], GenerateCopilotResponseInput.prototype, "threadId", void 0);
|
|
1193
1327
|
_ts_decorate15([
|
|
1194
1328
|
Field15(() => String, {
|
|
1195
|
-
nullable: true
|
|
1196
|
-
deprecationReason: "This field will be removed in a future version"
|
|
1329
|
+
nullable: true
|
|
1197
1330
|
}),
|
|
1198
1331
|
_ts_metadata15("design:type", String)
|
|
1199
|
-
],
|
|
1332
|
+
], GenerateCopilotResponseInput.prototype, "runId", void 0);
|
|
1200
1333
|
_ts_decorate15([
|
|
1201
1334
|
Field15(() => [
|
|
1202
|
-
|
|
1335
|
+
MessageInput
|
|
1203
1336
|
]),
|
|
1204
1337
|
_ts_metadata15("design:type", Array)
|
|
1205
|
-
],
|
|
1338
|
+
], GenerateCopilotResponseInput.prototype, "messages", void 0);
|
|
1206
1339
|
_ts_decorate15([
|
|
1207
|
-
Field15(() =>
|
|
1340
|
+
Field15(() => FrontendInput),
|
|
1341
|
+
_ts_metadata15("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
|
|
1342
|
+
], GenerateCopilotResponseInput.prototype, "frontend", void 0);
|
|
1343
|
+
_ts_decorate15([
|
|
1344
|
+
Field15(() => CloudInput, {
|
|
1208
1345
|
nullable: true
|
|
1209
1346
|
}),
|
|
1210
|
-
_ts_metadata15("design:type",
|
|
1211
|
-
],
|
|
1212
|
-
ActionExecutionMessageOutput = _ts_decorate15([
|
|
1213
|
-
ObjectType4({
|
|
1214
|
-
implements: BaseMessageOutput
|
|
1215
|
-
})
|
|
1216
|
-
], ActionExecutionMessageOutput);
|
|
1217
|
-
var ResultMessageOutput = class {
|
|
1218
|
-
actionExecutionId;
|
|
1219
|
-
actionName;
|
|
1220
|
-
result;
|
|
1221
|
-
};
|
|
1222
|
-
__name(ResultMessageOutput, "ResultMessageOutput");
|
|
1223
|
-
_ts_decorate15([
|
|
1224
|
-
Field15(() => String),
|
|
1225
|
-
_ts_metadata15("design:type", String)
|
|
1226
|
-
], ResultMessageOutput.prototype, "actionExecutionId", void 0);
|
|
1227
|
-
_ts_decorate15([
|
|
1228
|
-
Field15(() => String),
|
|
1229
|
-
_ts_metadata15("design:type", String)
|
|
1230
|
-
], ResultMessageOutput.prototype, "actionName", void 0);
|
|
1231
|
-
_ts_decorate15([
|
|
1232
|
-
Field15(() => String),
|
|
1233
|
-
_ts_metadata15("design:type", String)
|
|
1234
|
-
], ResultMessageOutput.prototype, "result", void 0);
|
|
1235
|
-
ResultMessageOutput = _ts_decorate15([
|
|
1236
|
-
ObjectType4({
|
|
1237
|
-
implements: BaseMessageOutput
|
|
1238
|
-
})
|
|
1239
|
-
], ResultMessageOutput);
|
|
1240
|
-
var AgentStateMessageOutput = class {
|
|
1241
|
-
threadId;
|
|
1242
|
-
agentName;
|
|
1243
|
-
nodeName;
|
|
1244
|
-
runId;
|
|
1245
|
-
active;
|
|
1246
|
-
role;
|
|
1247
|
-
state;
|
|
1248
|
-
running;
|
|
1249
|
-
};
|
|
1250
|
-
__name(AgentStateMessageOutput, "AgentStateMessageOutput");
|
|
1251
|
-
_ts_decorate15([
|
|
1252
|
-
Field15(() => String),
|
|
1253
|
-
_ts_metadata15("design:type", String)
|
|
1254
|
-
], AgentStateMessageOutput.prototype, "threadId", void 0);
|
|
1255
|
-
_ts_decorate15([
|
|
1256
|
-
Field15(() => String),
|
|
1257
|
-
_ts_metadata15("design:type", String)
|
|
1258
|
-
], AgentStateMessageOutput.prototype, "agentName", void 0);
|
|
1259
|
-
_ts_decorate15([
|
|
1260
|
-
Field15(() => String),
|
|
1261
|
-
_ts_metadata15("design:type", String)
|
|
1262
|
-
], AgentStateMessageOutput.prototype, "nodeName", void 0);
|
|
1263
|
-
_ts_decorate15([
|
|
1264
|
-
Field15(() => String),
|
|
1265
|
-
_ts_metadata15("design:type", String)
|
|
1266
|
-
], AgentStateMessageOutput.prototype, "runId", void 0);
|
|
1267
|
-
_ts_decorate15([
|
|
1268
|
-
Field15(() => Boolean),
|
|
1269
|
-
_ts_metadata15("design:type", Boolean)
|
|
1270
|
-
], AgentStateMessageOutput.prototype, "active", void 0);
|
|
1271
|
-
_ts_decorate15([
|
|
1272
|
-
Field15(() => MessageRole),
|
|
1273
|
-
_ts_metadata15("design:type", typeof MessageRole === "undefined" ? Object : MessageRole)
|
|
1274
|
-
], AgentStateMessageOutput.prototype, "role", void 0);
|
|
1275
|
-
_ts_decorate15([
|
|
1276
|
-
Field15(() => String),
|
|
1277
|
-
_ts_metadata15("design:type", String)
|
|
1278
|
-
], AgentStateMessageOutput.prototype, "state", void 0);
|
|
1279
|
-
_ts_decorate15([
|
|
1280
|
-
Field15(() => Boolean),
|
|
1281
|
-
_ts_metadata15("design:type", Boolean)
|
|
1282
|
-
], AgentStateMessageOutput.prototype, "running", void 0);
|
|
1283
|
-
AgentStateMessageOutput = _ts_decorate15([
|
|
1284
|
-
ObjectType4({
|
|
1285
|
-
implements: BaseMessageOutput
|
|
1286
|
-
})
|
|
1287
|
-
], AgentStateMessageOutput);
|
|
1288
|
-
var CopilotResponse = class {
|
|
1289
|
-
threadId;
|
|
1290
|
-
status;
|
|
1291
|
-
runId;
|
|
1292
|
-
messages;
|
|
1293
|
-
extensions;
|
|
1294
|
-
metaEvents;
|
|
1295
|
-
};
|
|
1296
|
-
__name(CopilotResponse, "CopilotResponse");
|
|
1347
|
+
_ts_metadata15("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
|
|
1348
|
+
], GenerateCopilotResponseInput.prototype, "cloud", void 0);
|
|
1297
1349
|
_ts_decorate15([
|
|
1298
|
-
Field15(() =>
|
|
1299
|
-
|
|
1300
|
-
|
|
1350
|
+
Field15(() => ForwardedParametersInput, {
|
|
1351
|
+
nullable: true
|
|
1352
|
+
}),
|
|
1353
|
+
_ts_metadata15("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
|
|
1354
|
+
], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
|
|
1301
1355
|
_ts_decorate15([
|
|
1302
|
-
Field15(() =>
|
|
1303
|
-
|
|
1304
|
-
|
|
1356
|
+
Field15(() => AgentSessionInput, {
|
|
1357
|
+
nullable: true
|
|
1358
|
+
}),
|
|
1359
|
+
_ts_metadata15("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
|
|
1360
|
+
], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
|
|
1305
1361
|
_ts_decorate15([
|
|
1306
|
-
Field15({
|
|
1362
|
+
Field15(() => AgentStateInput, {
|
|
1307
1363
|
nullable: true
|
|
1308
1364
|
}),
|
|
1309
|
-
_ts_metadata15("design:type",
|
|
1310
|
-
],
|
|
1365
|
+
_ts_metadata15("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
|
|
1366
|
+
], GenerateCopilotResponseInput.prototype, "agentState", void 0);
|
|
1311
1367
|
_ts_decorate15([
|
|
1312
1368
|
Field15(() => [
|
|
1313
|
-
|
|
1314
|
-
]
|
|
1369
|
+
AgentStateInput
|
|
1370
|
+
], {
|
|
1371
|
+
nullable: true
|
|
1372
|
+
}),
|
|
1315
1373
|
_ts_metadata15("design:type", Array)
|
|
1316
|
-
],
|
|
1374
|
+
], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
|
|
1317
1375
|
_ts_decorate15([
|
|
1318
|
-
Field15(() =>
|
|
1376
|
+
Field15(() => ExtensionsInput, {
|
|
1319
1377
|
nullable: true
|
|
1320
1378
|
}),
|
|
1321
|
-
_ts_metadata15("design:type", typeof
|
|
1322
|
-
],
|
|
1379
|
+
_ts_metadata15("design:type", typeof ExtensionsInput === "undefined" ? Object : ExtensionsInput)
|
|
1380
|
+
], GenerateCopilotResponseInput.prototype, "extensions", void 0);
|
|
1323
1381
|
_ts_decorate15([
|
|
1324
1382
|
Field15(() => [
|
|
1325
|
-
|
|
1383
|
+
MetaEventInput
|
|
1326
1384
|
], {
|
|
1327
1385
|
nullable: true
|
|
1328
1386
|
}),
|
|
1329
1387
|
_ts_metadata15("design:type", Array)
|
|
1330
|
-
],
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
],
|
|
1388
|
+
], GenerateCopilotResponseInput.prototype, "metaEvents", void 0);
|
|
1389
|
+
GenerateCopilotResponseInput = _ts_decorate15([
|
|
1390
|
+
InputType11()
|
|
1391
|
+
], GenerateCopilotResponseInput);
|
|
1334
1392
|
|
|
1335
1393
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1336
1394
|
import { Repeater } from "graphql-yoga";
|
|
@@ -1364,10 +1422,12 @@ var LangGraphEventTypes;
|
|
|
1364
1422
|
LangGraphEventTypes2["OnCopilotKitEmitToolCall"] = "on_copilotkit_emit_tool_call";
|
|
1365
1423
|
LangGraphEventTypes2["OnCustomEvent"] = "on_custom_event";
|
|
1366
1424
|
LangGraphEventTypes2["OnInterrupt"] = "on_interrupt";
|
|
1425
|
+
LangGraphEventTypes2["OnCopilotKitInterrupt"] = "on_copilotkit_interrupt";
|
|
1367
1426
|
})(LangGraphEventTypes || (LangGraphEventTypes = {}));
|
|
1368
1427
|
var MetaEventNames;
|
|
1369
1428
|
(function(MetaEventNames2) {
|
|
1370
1429
|
MetaEventNames2["LangGraphInterruptEvent"] = "LangGraphInterruptEvent";
|
|
1430
|
+
MetaEventNames2["CopilotKitLangGraphInterruptEvent"] = "CopilotKitLangGraphInterruptEvent";
|
|
1371
1431
|
})(MetaEventNames || (MetaEventNames = {}));
|
|
1372
1432
|
var CustomEventNames;
|
|
1373
1433
|
(function(CustomEventNames2) {
|
|
@@ -1472,6 +1532,13 @@ var RemoteLangGraphEventSource = class {
|
|
|
1472
1532
|
value: acc.event.value
|
|
1473
1533
|
});
|
|
1474
1534
|
}
|
|
1535
|
+
if (acc.event.event === LangGraphEventTypes.OnCopilotKitInterrupt) {
|
|
1536
|
+
events.push({
|
|
1537
|
+
type: RuntimeEventTypes.MetaEvent,
|
|
1538
|
+
name: RuntimeMetaEventName.CopilotKitLangGraphInterruptEvent,
|
|
1539
|
+
data: acc.event.data
|
|
1540
|
+
});
|
|
1541
|
+
}
|
|
1475
1542
|
const responseMetadata = this.getResponseMetadata(acc.event);
|
|
1476
1543
|
if ((responseMetadata == null ? void 0 : responseMetadata.finish_reason) === "tool_calls" && this.shouldEmitToolCall(shouldEmitToolCalls, acc.lastToolCallName)) {
|
|
1477
1544
|
events.push({
|
|
@@ -1602,6 +1669,7 @@ import { Client as LangGraphClient } from "@langchain/langgraph-sdk";
|
|
|
1602
1669
|
import { createHash } from "crypto";
|
|
1603
1670
|
import { isValidUUID, randomUUID } from "@copilotkit/shared";
|
|
1604
1671
|
import { parse as parsePartialJson } from "partial-json";
|
|
1672
|
+
var activeInterruptEvent = false;
|
|
1605
1673
|
async function execute(args) {
|
|
1606
1674
|
return new ReadableStream({
|
|
1607
1675
|
async start(controller) {
|
|
@@ -1615,7 +1683,7 @@ async function execute(args) {
|
|
|
1615
1683
|
}
|
|
1616
1684
|
__name(execute, "execute");
|
|
1617
1685
|
async function streamEvents(controller, args) {
|
|
1618
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1686
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1619
1687
|
const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, messages, actions, logger: logger2, properties, metaEvents } = args;
|
|
1620
1688
|
let nodeName = initialNodeName;
|
|
1621
1689
|
let state = initialState;
|
|
@@ -1662,8 +1730,28 @@ async function streamEvents(controller, args) {
|
|
|
1662
1730
|
logger2.error(e, `Error event thrown: ${e.message}`);
|
|
1663
1731
|
}
|
|
1664
1732
|
state = langGraphDefaultMergeState(state, formattedMessages, actions, name);
|
|
1665
|
-
const
|
|
1666
|
-
|
|
1733
|
+
const streamInput = mode === "start" ? state : null;
|
|
1734
|
+
const payload = {
|
|
1735
|
+
input: streamInput,
|
|
1736
|
+
streamMode: [
|
|
1737
|
+
"events",
|
|
1738
|
+
"values",
|
|
1739
|
+
"updates"
|
|
1740
|
+
],
|
|
1741
|
+
command: void 0
|
|
1742
|
+
};
|
|
1743
|
+
const lgInterruptMetaEvent = metaEvents == null ? void 0 : metaEvents.find((ev) => ev.name === MetaEventName.LangGraphInterruptEvent);
|
|
1744
|
+
if (activeInterruptEvent && !lgInterruptMetaEvent) {
|
|
1745
|
+
payload.command = {
|
|
1746
|
+
resume: formattedMessages[formattedMessages.length - 1]
|
|
1747
|
+
};
|
|
1748
|
+
}
|
|
1749
|
+
if (lgInterruptMetaEvent == null ? void 0 : lgInterruptMetaEvent.response) {
|
|
1750
|
+
payload.command = {
|
|
1751
|
+
resume: lgInterruptMetaEvent.response
|
|
1752
|
+
};
|
|
1753
|
+
}
|
|
1754
|
+
if (mode === "continue" && !activeInterruptEvent) {
|
|
1667
1755
|
await client.threads.updateState(threadId, {
|
|
1668
1756
|
values: state,
|
|
1669
1757
|
asNode: nodeName
|
|
@@ -1690,31 +1778,17 @@ async function streamEvents(controller, args) {
|
|
|
1690
1778
|
}
|
|
1691
1779
|
const assistantId = retrievedAssistant.assistant_id;
|
|
1692
1780
|
const graphInfo = await client.assistants.getGraph(assistantId);
|
|
1693
|
-
const streamInput = mode === "start" ? state : null;
|
|
1694
1781
|
let streamingStateExtractor = new StreamingStateExtractor([]);
|
|
1695
1782
|
let prevNodeName = null;
|
|
1696
1783
|
let emitIntermediateStateUntilEnd = null;
|
|
1697
1784
|
let shouldExit = false;
|
|
1698
1785
|
let externalRunId = null;
|
|
1699
|
-
const payload = {
|
|
1700
|
-
input: streamInput,
|
|
1701
|
-
streamMode: [
|
|
1702
|
-
"events",
|
|
1703
|
-
"values",
|
|
1704
|
-
"updates"
|
|
1705
|
-
],
|
|
1706
|
-
command: void 0
|
|
1707
|
-
};
|
|
1708
|
-
if (lgInterruptEvent == null ? void 0 : lgInterruptEvent.response) {
|
|
1709
|
-
payload.command = {
|
|
1710
|
-
resume: lgInterruptEvent.response
|
|
1711
|
-
};
|
|
1712
|
-
}
|
|
1713
1786
|
const streamResponse2 = client.runs.stream(threadId, assistantId, payload);
|
|
1714
1787
|
const emit = /* @__PURE__ */ __name((message) => controller.enqueue(new TextEncoder().encode(message)), "emit");
|
|
1715
1788
|
let latestStateValues = {};
|
|
1716
1789
|
let updatedState = state;
|
|
1717
1790
|
let manuallyEmittedState = null;
|
|
1791
|
+
activeInterruptEvent = false;
|
|
1718
1792
|
try {
|
|
1719
1793
|
telemetry_client_default.capture("oss.runtime.agent_execution_stream_started", {
|
|
1720
1794
|
hashedLgcKey: streamInfo.hashedLgcKey
|
|
@@ -1730,11 +1804,24 @@ async function streamEvents(controller, args) {
|
|
|
1730
1804
|
if (chunk.event === "error") {
|
|
1731
1805
|
throw new Error(`Error event thrown: ${chunk.data.message}`);
|
|
1732
1806
|
}
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1807
|
+
const interruptEvents = (_a = chunk.data) == null ? void 0 : _a.__interrupt__;
|
|
1808
|
+
if (interruptEvents == null ? void 0 : interruptEvents.length) {
|
|
1809
|
+
activeInterruptEvent = true;
|
|
1810
|
+
const interruptValue = interruptEvents == null ? void 0 : interruptEvents[0].value;
|
|
1811
|
+
if (typeof interruptValue != "string" && "__copilotkit_interrupt_value__" in interruptValue) {
|
|
1812
|
+
emit(JSON.stringify({
|
|
1813
|
+
event: LangGraphEventTypes.OnCopilotKitInterrupt,
|
|
1814
|
+
data: {
|
|
1815
|
+
value: interruptValue.__copilotkit_interrupt_value__,
|
|
1816
|
+
messages: langchainMessagesToCopilotKit(interruptValue.__copilotkit_messages__)
|
|
1817
|
+
}
|
|
1818
|
+
}) + "\n");
|
|
1819
|
+
} else {
|
|
1820
|
+
emit(JSON.stringify({
|
|
1821
|
+
event: LangGraphEventTypes.OnInterrupt,
|
|
1822
|
+
value: interruptValue
|
|
1823
|
+
}) + "\n");
|
|
1824
|
+
}
|
|
1738
1825
|
continue;
|
|
1739
1826
|
}
|
|
1740
1827
|
if (chunk.event === "updates")
|
|
@@ -1749,8 +1836,8 @@ async function streamEvents(controller, args) {
|
|
|
1749
1836
|
const runId = event.metadata.run_id;
|
|
1750
1837
|
externalRunId = runId;
|
|
1751
1838
|
const metadata = event.metadata;
|
|
1752
|
-
if (((
|
|
1753
|
-
streamInfo.provider = (
|
|
1839
|
+
if (((_c = (_b = event.data) == null ? void 0 : _b.output) == null ? void 0 : _c.model) != null && ((_e = (_d = event.data) == null ? void 0 : _d.output) == null ? void 0 : _e.model) != "") {
|
|
1840
|
+
streamInfo.provider = (_g = (_f = event.data) == null ? void 0 : _f.output) == null ? void 0 : _g.model;
|
|
1754
1841
|
}
|
|
1755
1842
|
if (metadata.langgraph_host != null && metadata.langgraph_host != "") {
|
|
1756
1843
|
streamInfo.langGraphHost = metadata.langgraph_host;
|
|
@@ -1819,7 +1906,7 @@ async function streamEvents(controller, args) {
|
|
|
1819
1906
|
emit(JSON.stringify(event) + "\n");
|
|
1820
1907
|
}
|
|
1821
1908
|
state = await client.threads.getState(threadId);
|
|
1822
|
-
const interrupts = (
|
|
1909
|
+
const interrupts = (_i = (_h = state.tasks) == null ? void 0 : _h[0]) == null ? void 0 : _i.interrupts;
|
|
1823
1910
|
nodeName = interrupts ? nodeName : Object.keys(state.metadata.writes)[0];
|
|
1824
1911
|
const isEndNode = state.next.length === 0 && !interrupts;
|
|
1825
1912
|
telemetry_client_default.capture("oss.runtime.agent_execution_stream_ended", streamInfo);
|
|
@@ -2956,6 +3043,7 @@ var RuntimeMetaEventName;
|
|
|
2956
3043
|
(function(RuntimeMetaEventName2) {
|
|
2957
3044
|
RuntimeMetaEventName2["LangGraphInterruptEvent"] = "LangGraphInterruptEvent";
|
|
2958
3045
|
RuntimeMetaEventName2["LangGraphInterruptResumeEvent"] = "LangGraphInterruptResumeEvent";
|
|
3046
|
+
RuntimeMetaEventName2["CopilotKitLangGraphInterruptEvent"] = "CopilotKitLangGraphInterruptEvent";
|
|
2959
3047
|
})(RuntimeMetaEventName || (RuntimeMetaEventName = {}));
|
|
2960
3048
|
var RuntimeEventSubject = class extends ReplaySubject2 {
|
|
2961
3049
|
constructor() {
|
|
@@ -3461,6 +3549,40 @@ var CopilotResolver = class {
|
|
|
3461
3549
|
value: event.value
|
|
3462
3550
|
}));
|
|
3463
3551
|
break;
|
|
3552
|
+
case RuntimeMetaEventName.CopilotKitLangGraphInterruptEvent:
|
|
3553
|
+
push(plainToInstance3(CopilotKitLangGraphInterruptEvent, {
|
|
3554
|
+
type: event.type,
|
|
3555
|
+
name: event.name,
|
|
3556
|
+
data: {
|
|
3557
|
+
value: typeof event.data.value === "string" ? event.data.value : JSON.stringify(event.data.value),
|
|
3558
|
+
messages: event.data.messages.map((message) => {
|
|
3559
|
+
if (message.type === "TextMessage" || "content" in message && "role" in message) {
|
|
3560
|
+
return plainToInstance3(TextMessage, {
|
|
3561
|
+
id: message.id,
|
|
3562
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
3563
|
+
content: [
|
|
3564
|
+
message.content
|
|
3565
|
+
],
|
|
3566
|
+
role: message.role,
|
|
3567
|
+
status: new SuccessMessageStatus()
|
|
3568
|
+
});
|
|
3569
|
+
}
|
|
3570
|
+
if ("arguments" in message) {
|
|
3571
|
+
return plainToInstance3(ActionExecutionMessage, {
|
|
3572
|
+
name: message.name,
|
|
3573
|
+
id: message.id,
|
|
3574
|
+
arguments: [
|
|
3575
|
+
JSON.stringify(message.arguments)
|
|
3576
|
+
],
|
|
3577
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
3578
|
+
status: new SuccessMessageStatus()
|
|
3579
|
+
});
|
|
3580
|
+
}
|
|
3581
|
+
throw new Error("Unknown message in metaEvents copilot resolver");
|
|
3582
|
+
})
|
|
3583
|
+
}
|
|
3584
|
+
}));
|
|
3585
|
+
break;
|
|
3464
3586
|
}
|
|
3465
3587
|
},
|
|
3466
3588
|
error: (err) => {
|
|
@@ -4054,4 +4176,4 @@ export {
|
|
|
4054
4176
|
getCommonConfig,
|
|
4055
4177
|
copilotRuntimeNodeHttpEndpoint
|
|
4056
4178
|
};
|
|
4057
|
-
//# sourceMappingURL=chunk-
|
|
4179
|
+
//# sourceMappingURL=chunk-HOTR3KYO.mjs.map
|