@copilotkit/runtime 1.10.5-next.0 → 1.10.5-next.10
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 +68 -0
- package/__snapshots__/schema/schema.graphql +6 -0
- package/dist/{chunk-2JRX6LGW.mjs → chunk-COGFQ4V4.mjs} +2 -2
- package/dist/{chunk-WGOBL6DV.mjs → chunk-M65Z27MR.mjs} +2 -2
- package/dist/{chunk-HZWVUP7K.mjs → chunk-NFB4H6NT.mjs} +211 -144
- package/dist/chunk-NFB4H6NT.mjs.map +1 -0
- package/dist/{chunk-4GRKJVD6.mjs → chunk-NNBTOZO3.mjs} +2 -2
- package/dist/{chunk-TPMK44TE.mjs → chunk-Y5BKTUH2.mjs} +20 -6
- package/dist/chunk-Y5BKTUH2.mjs.map +1 -0
- package/dist/graphql/types/converted/index.d.ts +1 -1
- package/dist/{groq-adapter-4ba7b2f0.d.ts → groq-adapter-c8aec5c5.d.ts} +1 -1
- package/dist/{index-d4614f9b.d.ts → index-96b330da.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +247 -166
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/{langserve-3f99bf2e.d.ts → langserve-0c6100e3.d.ts} +1 -1
- package/dist/lib/index.d.ts +12 -6
- package/dist/lib/index.js +247 -166
- 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 +196 -151
- 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 +196 -151
- 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 +196 -151
- 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 +196 -151
- 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 +5 -5
- package/dist/{shared-26958730.d.ts → shared-0a7346ce.d.ts} +19 -2
- package/package.json +11 -11
- package/src/graphql/inputs/copilot-context.input.ts +10 -0
- package/src/graphql/inputs/generate-copilot-response.input.ts +4 -0
- package/src/graphql/resolvers/copilot.resolver.ts +1 -0
- package/src/lib/runtime/agui-action.ts +11 -0
- package/src/lib/runtime/copilot-runtime.ts +30 -0
- package/src/lib/runtime/langgraph/langgraph-agent.ts +28 -7
- package/src/lib/runtime/remote-actions.ts +4 -0
- package/dist/chunk-HZWVUP7K.mjs.map +0 -1
- package/dist/chunk-TPMK44TE.mjs.map +0 -1
- /package/dist/{chunk-2JRX6LGW.mjs.map → chunk-COGFQ4V4.mjs.map} +0 -0
- /package/dist/{chunk-WGOBL6DV.mjs.map → chunk-M65Z27MR.mjs.map} +0 -0
- /package/dist/{chunk-4GRKJVD6.mjs.map → chunk-NNBTOZO3.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.10.5-next.
|
|
47
|
+
version: "1.10.5-next.10",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -82,11 +82,11 @@ var require_package = __commonJS({
|
|
|
82
82
|
"zod-to-json-schema": "^3.23.5"
|
|
83
83
|
},
|
|
84
84
|
dependencies: {
|
|
85
|
-
"@ag-ui/client": "^0.0.
|
|
86
|
-
"@ag-ui/core": "^0.0.
|
|
87
|
-
"@ag-ui/encoder": "^0.0.
|
|
88
|
-
"@ag-ui/langgraph": "^0.0.
|
|
89
|
-
"@ag-ui/proto": "^0.0.
|
|
85
|
+
"@ag-ui/client": "^0.0.39",
|
|
86
|
+
"@ag-ui/core": "^0.0.39",
|
|
87
|
+
"@ag-ui/encoder": "^0.0.39",
|
|
88
|
+
"@ag-ui/langgraph": "^0.0.17",
|
|
89
|
+
"@ag-ui/proto": "^0.0.39",
|
|
90
90
|
"@anthropic-ai/sdk": "^0.57.0",
|
|
91
91
|
"@copilotkit/shared": "workspace:*",
|
|
92
92
|
"@graphql-yoga/plugin-defer-stream": "^3.3.1",
|
|
@@ -115,10 +115,10 @@ var require_package = __commonJS({
|
|
|
115
115
|
zod: "^3.23.3"
|
|
116
116
|
},
|
|
117
117
|
peerDependencies: {
|
|
118
|
-
"@ag-ui/client": ">=0.0.
|
|
119
|
-
"@ag-ui/core": ">=0.0.
|
|
120
|
-
"@ag-ui/encoder": ">=0.0.
|
|
121
|
-
"@ag-ui/proto": ">=0.0.
|
|
118
|
+
"@ag-ui/client": ">=0.0.39",
|
|
119
|
+
"@ag-ui/core": ">=0.0.39",
|
|
120
|
+
"@ag-ui/encoder": ">=0.0.39",
|
|
121
|
+
"@ag-ui/proto": ">=0.0.39"
|
|
122
122
|
},
|
|
123
123
|
keywords: [
|
|
124
124
|
"copilotkit",
|
|
@@ -1309,14 +1309,14 @@ var GroqAdapter = class {
|
|
|
1309
1309
|
__name(GroqAdapter, "GroqAdapter");
|
|
1310
1310
|
|
|
1311
1311
|
// src/lib/integrations/shared.ts
|
|
1312
|
-
var
|
|
1312
|
+
var import_type_graphql27 = require("type-graphql");
|
|
1313
1313
|
|
|
1314
1314
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1315
|
-
var
|
|
1315
|
+
var import_type_graphql21 = require("type-graphql");
|
|
1316
1316
|
var import_rxjs5 = require("rxjs");
|
|
1317
1317
|
|
|
1318
1318
|
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
1319
|
-
var
|
|
1319
|
+
var import_type_graphql19 = require("type-graphql");
|
|
1320
1320
|
|
|
1321
1321
|
// src/graphql/inputs/message.input.ts
|
|
1322
1322
|
var import_type_graphql3 = require("type-graphql");
|
|
@@ -2674,7 +2674,8 @@ MetaEventInput = _ts_decorate16([
|
|
|
2674
2674
|
(0, import_type_graphql17.InputType)()
|
|
2675
2675
|
], MetaEventInput);
|
|
2676
2676
|
|
|
2677
|
-
// src/graphql/inputs/
|
|
2677
|
+
// src/graphql/inputs/copilot-context.input.ts
|
|
2678
|
+
var import_type_graphql18 = require("type-graphql");
|
|
2678
2679
|
function _ts_decorate17(decorators, target, key, desc) {
|
|
2679
2680
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2680
2681
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -2691,18 +2692,52 @@ function _ts_metadata17(k, v) {
|
|
|
2691
2692
|
return Reflect.metadata(k, v);
|
|
2692
2693
|
}
|
|
2693
2694
|
__name(_ts_metadata17, "_ts_metadata");
|
|
2695
|
+
var CopilotContextInput = class {
|
|
2696
|
+
description;
|
|
2697
|
+
value;
|
|
2698
|
+
};
|
|
2699
|
+
__name(CopilotContextInput, "CopilotContextInput");
|
|
2700
|
+
_ts_decorate17([
|
|
2701
|
+
(0, import_type_graphql18.Field)(() => String),
|
|
2702
|
+
_ts_metadata17("design:type", String)
|
|
2703
|
+
], CopilotContextInput.prototype, "description", void 0);
|
|
2704
|
+
_ts_decorate17([
|
|
2705
|
+
(0, import_type_graphql18.Field)(() => String),
|
|
2706
|
+
_ts_metadata17("design:type", String)
|
|
2707
|
+
], CopilotContextInput.prototype, "value", void 0);
|
|
2708
|
+
CopilotContextInput = _ts_decorate17([
|
|
2709
|
+
(0, import_type_graphql18.InputType)()
|
|
2710
|
+
], CopilotContextInput);
|
|
2711
|
+
|
|
2712
|
+
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
2713
|
+
function _ts_decorate18(decorators, target, key, desc) {
|
|
2714
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2715
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2716
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2717
|
+
else
|
|
2718
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2719
|
+
if (d = decorators[i])
|
|
2720
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2721
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2722
|
+
}
|
|
2723
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
2724
|
+
function _ts_metadata18(k, v) {
|
|
2725
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
2726
|
+
return Reflect.metadata(k, v);
|
|
2727
|
+
}
|
|
2728
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
2694
2729
|
var GenerateCopilotResponseMetadataInput = class {
|
|
2695
2730
|
requestType;
|
|
2696
2731
|
};
|
|
2697
2732
|
__name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
|
|
2698
|
-
|
|
2699
|
-
(0,
|
|
2733
|
+
_ts_decorate18([
|
|
2734
|
+
(0, import_type_graphql19.Field)(() => CopilotRequestType, {
|
|
2700
2735
|
nullable: true
|
|
2701
2736
|
}),
|
|
2702
|
-
|
|
2737
|
+
_ts_metadata18("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
|
|
2703
2738
|
], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
|
|
2704
|
-
GenerateCopilotResponseMetadataInput =
|
|
2705
|
-
(0,
|
|
2739
|
+
GenerateCopilotResponseMetadataInput = _ts_decorate18([
|
|
2740
|
+
(0, import_type_graphql19.InputType)()
|
|
2706
2741
|
], GenerateCopilotResponseMetadataInput);
|
|
2707
2742
|
var GenerateCopilotResponseInput = class {
|
|
2708
2743
|
metadata;
|
|
@@ -2717,84 +2752,93 @@ var GenerateCopilotResponseInput = class {
|
|
|
2717
2752
|
agentStates;
|
|
2718
2753
|
extensions;
|
|
2719
2754
|
metaEvents;
|
|
2755
|
+
context;
|
|
2720
2756
|
};
|
|
2721
2757
|
__name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
|
|
2722
|
-
|
|
2723
|
-
(0,
|
|
2758
|
+
_ts_decorate18([
|
|
2759
|
+
(0, import_type_graphql19.Field)(() => GenerateCopilotResponseMetadataInput, {
|
|
2724
2760
|
nullable: false
|
|
2725
2761
|
}),
|
|
2726
|
-
|
|
2762
|
+
_ts_metadata18("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
|
|
2727
2763
|
], GenerateCopilotResponseInput.prototype, "metadata", void 0);
|
|
2728
|
-
|
|
2729
|
-
(0,
|
|
2764
|
+
_ts_decorate18([
|
|
2765
|
+
(0, import_type_graphql19.Field)(() => String, {
|
|
2730
2766
|
nullable: true
|
|
2731
2767
|
}),
|
|
2732
|
-
|
|
2768
|
+
_ts_metadata18("design:type", String)
|
|
2733
2769
|
], GenerateCopilotResponseInput.prototype, "threadId", void 0);
|
|
2734
|
-
|
|
2735
|
-
(0,
|
|
2770
|
+
_ts_decorate18([
|
|
2771
|
+
(0, import_type_graphql19.Field)(() => String, {
|
|
2736
2772
|
nullable: true
|
|
2737
2773
|
}),
|
|
2738
|
-
|
|
2774
|
+
_ts_metadata18("design:type", String)
|
|
2739
2775
|
], GenerateCopilotResponseInput.prototype, "runId", void 0);
|
|
2740
|
-
|
|
2741
|
-
(0,
|
|
2776
|
+
_ts_decorate18([
|
|
2777
|
+
(0, import_type_graphql19.Field)(() => [
|
|
2742
2778
|
MessageInput
|
|
2743
2779
|
]),
|
|
2744
|
-
|
|
2780
|
+
_ts_metadata18("design:type", Array)
|
|
2745
2781
|
], GenerateCopilotResponseInput.prototype, "messages", void 0);
|
|
2746
|
-
|
|
2747
|
-
(0,
|
|
2748
|
-
|
|
2782
|
+
_ts_decorate18([
|
|
2783
|
+
(0, import_type_graphql19.Field)(() => FrontendInput),
|
|
2784
|
+
_ts_metadata18("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
|
|
2749
2785
|
], GenerateCopilotResponseInput.prototype, "frontend", void 0);
|
|
2750
|
-
|
|
2751
|
-
(0,
|
|
2786
|
+
_ts_decorate18([
|
|
2787
|
+
(0, import_type_graphql19.Field)(() => CloudInput, {
|
|
2752
2788
|
nullable: true
|
|
2753
2789
|
}),
|
|
2754
|
-
|
|
2790
|
+
_ts_metadata18("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
|
|
2755
2791
|
], GenerateCopilotResponseInput.prototype, "cloud", void 0);
|
|
2756
|
-
|
|
2757
|
-
(0,
|
|
2792
|
+
_ts_decorate18([
|
|
2793
|
+
(0, import_type_graphql19.Field)(() => ForwardedParametersInput, {
|
|
2758
2794
|
nullable: true
|
|
2759
2795
|
}),
|
|
2760
|
-
|
|
2796
|
+
_ts_metadata18("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
|
|
2761
2797
|
], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
|
|
2762
|
-
|
|
2763
|
-
(0,
|
|
2798
|
+
_ts_decorate18([
|
|
2799
|
+
(0, import_type_graphql19.Field)(() => AgentSessionInput, {
|
|
2764
2800
|
nullable: true
|
|
2765
2801
|
}),
|
|
2766
|
-
|
|
2802
|
+
_ts_metadata18("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
|
|
2767
2803
|
], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
|
|
2768
|
-
|
|
2769
|
-
(0,
|
|
2804
|
+
_ts_decorate18([
|
|
2805
|
+
(0, import_type_graphql19.Field)(() => AgentStateInput, {
|
|
2770
2806
|
nullable: true
|
|
2771
2807
|
}),
|
|
2772
|
-
|
|
2808
|
+
_ts_metadata18("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
|
|
2773
2809
|
], GenerateCopilotResponseInput.prototype, "agentState", void 0);
|
|
2774
|
-
|
|
2775
|
-
(0,
|
|
2810
|
+
_ts_decorate18([
|
|
2811
|
+
(0, import_type_graphql19.Field)(() => [
|
|
2776
2812
|
AgentStateInput
|
|
2777
2813
|
], {
|
|
2778
2814
|
nullable: true
|
|
2779
2815
|
}),
|
|
2780
|
-
|
|
2816
|
+
_ts_metadata18("design:type", Array)
|
|
2781
2817
|
], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
|
|
2782
|
-
|
|
2783
|
-
(0,
|
|
2818
|
+
_ts_decorate18([
|
|
2819
|
+
(0, import_type_graphql19.Field)(() => ExtensionsInput, {
|
|
2784
2820
|
nullable: true
|
|
2785
2821
|
}),
|
|
2786
|
-
|
|
2822
|
+
_ts_metadata18("design:type", typeof ExtensionsInput === "undefined" ? Object : ExtensionsInput)
|
|
2787
2823
|
], GenerateCopilotResponseInput.prototype, "extensions", void 0);
|
|
2788
|
-
|
|
2789
|
-
(0,
|
|
2824
|
+
_ts_decorate18([
|
|
2825
|
+
(0, import_type_graphql19.Field)(() => [
|
|
2790
2826
|
MetaEventInput
|
|
2791
2827
|
], {
|
|
2792
2828
|
nullable: true
|
|
2793
2829
|
}),
|
|
2794
|
-
|
|
2830
|
+
_ts_metadata18("design:type", Array)
|
|
2795
2831
|
], GenerateCopilotResponseInput.prototype, "metaEvents", void 0);
|
|
2796
|
-
|
|
2797
|
-
(0,
|
|
2832
|
+
_ts_decorate18([
|
|
2833
|
+
(0, import_type_graphql19.Field)(() => [
|
|
2834
|
+
CopilotContextInput
|
|
2835
|
+
], {
|
|
2836
|
+
nullable: true
|
|
2837
|
+
}),
|
|
2838
|
+
_ts_metadata18("design:type", Array)
|
|
2839
|
+
], GenerateCopilotResponseInput.prototype, "context", void 0);
|
|
2840
|
+
GenerateCopilotResponseInput = _ts_decorate18([
|
|
2841
|
+
(0, import_type_graphql19.InputType)()
|
|
2798
2842
|
], GenerateCopilotResponseInput);
|
|
2799
2843
|
|
|
2800
2844
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
@@ -4809,6 +4853,7 @@ var CopilotRuntime = class {
|
|
|
4809
4853
|
langserve = [];
|
|
4810
4854
|
onBeforeRequest;
|
|
4811
4855
|
onAfterRequest;
|
|
4856
|
+
onStopGeneration;
|
|
4812
4857
|
delegateAgentProcessingToServiceAdapter;
|
|
4813
4858
|
observability;
|
|
4814
4859
|
availableAgents;
|
|
@@ -4836,6 +4881,7 @@ var CopilotRuntime = class {
|
|
|
4836
4881
|
this.remoteEndpointDefinitions = (params == null ? void 0 : params.remoteEndpoints) ?? (params == null ? void 0 : params.remoteActions) ?? [];
|
|
4837
4882
|
this.onBeforeRequest = (_a = params == null ? void 0 : params.middleware) == null ? void 0 : _a.onBeforeRequest;
|
|
4838
4883
|
this.onAfterRequest = (_b = params == null ? void 0 : params.middleware) == null ? void 0 : _b.onAfterRequest;
|
|
4884
|
+
this.onStopGeneration = params == null ? void 0 : params.onStopGeneration;
|
|
4839
4885
|
this.delegateAgentProcessingToServiceAdapter = (params == null ? void 0 : params.delegateAgentProcessingToServiceAdapter) || false;
|
|
4840
4886
|
this.observability = params == null ? void 0 : params.observability_c;
|
|
4841
4887
|
this.agents = (params == null ? void 0 : params.agents) ?? {};
|
|
@@ -4914,10 +4960,22 @@ var CopilotRuntime = class {
|
|
|
4914
4960
|
}
|
|
4915
4961
|
async processRuntimeRequest(request) {
|
|
4916
4962
|
var _a, _b, _c, _d, _e;
|
|
4917
|
-
const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey } = request;
|
|
4963
|
+
const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey, context } = request;
|
|
4964
|
+
graphqlContext.request.signal.addEventListener("abort", () => {
|
|
4965
|
+
var _a2;
|
|
4966
|
+
return (_a2 = this.onStopGeneration) == null ? void 0 : _a2.call(this, {
|
|
4967
|
+
threadId,
|
|
4968
|
+
runId,
|
|
4969
|
+
url,
|
|
4970
|
+
agentName: agentSession == null ? void 0 : agentSession.agentName,
|
|
4971
|
+
lastMessage: rawMessages[rawMessages.length - 1]
|
|
4972
|
+
});
|
|
4973
|
+
}, {
|
|
4974
|
+
once: true
|
|
4975
|
+
});
|
|
4918
4976
|
const eventSource = new RuntimeEventSource({
|
|
4919
|
-
errorHandler: async (error,
|
|
4920
|
-
await this.error("error",
|
|
4977
|
+
errorHandler: async (error, context2) => {
|
|
4978
|
+
await this.error("error", context2, error, publicApiKey);
|
|
4921
4979
|
},
|
|
4922
4980
|
errorContext: {
|
|
4923
4981
|
threadId,
|
|
@@ -5363,7 +5421,7 @@ please use an LLM adapter instead.`
|
|
|
5363
5421
|
}
|
|
5364
5422
|
async processAgentRequest(request) {
|
|
5365
5423
|
var _a, _b, _c, _d, _e;
|
|
5366
|
-
const { messages: rawMessages, outputMessagesPromise, graphqlContext, agentSession, threadId: threadIdFromRequest, metaEvents, publicApiKey, forwardedParameters } = request;
|
|
5424
|
+
const { messages: rawMessages, outputMessagesPromise, graphqlContext, agentSession, threadId: threadIdFromRequest, metaEvents, publicApiKey, forwardedParameters, context } = request;
|
|
5367
5425
|
const { agentName, nodeName } = agentSession;
|
|
5368
5426
|
const requestStartTime = Date.now();
|
|
5369
5427
|
const streamedChunks = [];
|
|
@@ -5437,8 +5495,8 @@ please use an LLM adapter instead.`
|
|
|
5437
5495
|
}));
|
|
5438
5496
|
try {
|
|
5439
5497
|
const eventSource = new RuntimeEventSource({
|
|
5440
|
-
errorHandler: async (error,
|
|
5441
|
-
await this.error("error",
|
|
5498
|
+
errorHandler: async (error, context2) => {
|
|
5499
|
+
await this.error("error", context2, error, publicApiKey);
|
|
5442
5500
|
},
|
|
5443
5501
|
errorContext: {
|
|
5444
5502
|
threadId,
|
|
@@ -5663,7 +5721,8 @@ please use an LLM adapter instead.`
|
|
|
5663
5721
|
frontendUrl: url,
|
|
5664
5722
|
agents: this.agents,
|
|
5665
5723
|
metaEvents: request.metaEvents,
|
|
5666
|
-
nodeName: (_a = request.agentSession) == null ? void 0 : _a.nodeName
|
|
5724
|
+
nodeName: (_a = request.agentSession) == null ? void 0 : _a.nodeName,
|
|
5725
|
+
context: request.context
|
|
5667
5726
|
});
|
|
5668
5727
|
const configuredActions = typeof this.actions === "function" ? this.actions({
|
|
5669
5728
|
properties: graphqlContext.properties,
|
|
@@ -6407,7 +6466,7 @@ var import_shared26 = require("@copilotkit/shared");
|
|
|
6407
6466
|
// src/lib/runtime/agui-action.ts
|
|
6408
6467
|
var import_rxjs3 = require("rxjs");
|
|
6409
6468
|
var import_shared24 = require("@copilotkit/shared");
|
|
6410
|
-
function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, graphqlContext }) {
|
|
6469
|
+
function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, context, graphqlContext }) {
|
|
6411
6470
|
const action = {
|
|
6412
6471
|
name: agent.agentId,
|
|
6413
6472
|
description: agent.description,
|
|
@@ -6416,6 +6475,11 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
|
|
|
6416
6475
|
},
|
|
6417
6476
|
remoteAgentHandler: async ({ actionInputsWithoutAgents, threadId }) => {
|
|
6418
6477
|
var _a;
|
|
6478
|
+
graphqlContext.request.signal.addEventListener("abort", () => {
|
|
6479
|
+
agent.abortRun();
|
|
6480
|
+
}, {
|
|
6481
|
+
once: true
|
|
6482
|
+
});
|
|
6419
6483
|
logger2.debug({
|
|
6420
6484
|
actionName: agent.agentId
|
|
6421
6485
|
}, "Executing remote agent");
|
|
@@ -6466,7 +6530,8 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
|
|
|
6466
6530
|
};
|
|
6467
6531
|
return agent.legacy_to_be_removed_runAgentBridged({
|
|
6468
6532
|
tools,
|
|
6469
|
-
forwardedProps
|
|
6533
|
+
forwardedProps,
|
|
6534
|
+
context
|
|
6470
6535
|
}).pipe((0, import_rxjs3.mergeMap)((event) => {
|
|
6471
6536
|
if (event.type === RuntimeEventTypes.RunError) {
|
|
6472
6537
|
const { message } = event;
|
|
@@ -6591,7 +6656,7 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
|
|
|
6591
6656
|
}
|
|
6592
6657
|
}
|
|
6593
6658
|
__name(fetchRemoteInfo, "fetchRemoteInfo");
|
|
6594
|
-
async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents, nodeName }) {
|
|
6659
|
+
async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents, nodeName, context }) {
|
|
6595
6660
|
var _a;
|
|
6596
6661
|
const logger2 = graphqlContext.logger.child({
|
|
6597
6662
|
component: "remote-actions.fetchRemoteActions"
|
|
@@ -6659,7 +6724,8 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
|
|
|
6659
6724
|
metaEvents,
|
|
6660
6725
|
threadMetadata,
|
|
6661
6726
|
nodeName,
|
|
6662
|
-
graphqlContext
|
|
6727
|
+
graphqlContext,
|
|
6728
|
+
context
|
|
6663
6729
|
}));
|
|
6664
6730
|
}
|
|
6665
6731
|
return result.flat();
|
|
@@ -7042,8 +7108,8 @@ __name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
|
7042
7108
|
var import_shared28 = require("@copilotkit/shared");
|
|
7043
7109
|
|
|
7044
7110
|
// src/graphql/types/agents-response.type.ts
|
|
7045
|
-
var
|
|
7046
|
-
function
|
|
7111
|
+
var import_type_graphql20 = require("type-graphql");
|
|
7112
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
7047
7113
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7048
7114
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7049
7115
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7053,50 +7119,50 @@ function _ts_decorate18(decorators, target, key, desc) {
|
|
|
7053
7119
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7054
7120
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7055
7121
|
}
|
|
7056
|
-
__name(
|
|
7057
|
-
function
|
|
7122
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
7123
|
+
function _ts_metadata19(k, v) {
|
|
7058
7124
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7059
7125
|
return Reflect.metadata(k, v);
|
|
7060
7126
|
}
|
|
7061
|
-
__name(
|
|
7127
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
7062
7128
|
var Agent = class {
|
|
7063
7129
|
id;
|
|
7064
7130
|
name;
|
|
7065
7131
|
description;
|
|
7066
7132
|
};
|
|
7067
7133
|
__name(Agent, "Agent");
|
|
7068
|
-
|
|
7069
|
-
(0,
|
|
7070
|
-
|
|
7134
|
+
_ts_decorate19([
|
|
7135
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
7136
|
+
_ts_metadata19("design:type", String)
|
|
7071
7137
|
], Agent.prototype, "id", void 0);
|
|
7072
|
-
|
|
7073
|
-
(0,
|
|
7074
|
-
|
|
7138
|
+
_ts_decorate19([
|
|
7139
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
7140
|
+
_ts_metadata19("design:type", String)
|
|
7075
7141
|
], Agent.prototype, "name", void 0);
|
|
7076
|
-
|
|
7077
|
-
(0,
|
|
7078
|
-
|
|
7142
|
+
_ts_decorate19([
|
|
7143
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
7144
|
+
_ts_metadata19("design:type", String)
|
|
7079
7145
|
], Agent.prototype, "description", void 0);
|
|
7080
|
-
Agent =
|
|
7081
|
-
(0,
|
|
7146
|
+
Agent = _ts_decorate19([
|
|
7147
|
+
(0, import_type_graphql20.ObjectType)()
|
|
7082
7148
|
], Agent);
|
|
7083
7149
|
var AgentsResponse = class {
|
|
7084
7150
|
agents;
|
|
7085
7151
|
};
|
|
7086
7152
|
__name(AgentsResponse, "AgentsResponse");
|
|
7087
|
-
|
|
7088
|
-
(0,
|
|
7153
|
+
_ts_decorate19([
|
|
7154
|
+
(0, import_type_graphql20.Field)(() => [
|
|
7089
7155
|
Agent
|
|
7090
7156
|
]),
|
|
7091
|
-
|
|
7157
|
+
_ts_metadata19("design:type", Array)
|
|
7092
7158
|
], AgentsResponse.prototype, "agents", void 0);
|
|
7093
|
-
AgentsResponse =
|
|
7094
|
-
(0,
|
|
7159
|
+
AgentsResponse = _ts_decorate19([
|
|
7160
|
+
(0, import_type_graphql20.ObjectType)()
|
|
7095
7161
|
], AgentsResponse);
|
|
7096
7162
|
|
|
7097
7163
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
7098
7164
|
var import_shared29 = require("@copilotkit/shared");
|
|
7099
|
-
function
|
|
7165
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
7100
7166
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7101
7167
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7102
7168
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7106,12 +7172,12 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
7106
7172
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7107
7173
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7108
7174
|
}
|
|
7109
|
-
__name(
|
|
7110
|
-
function
|
|
7175
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
7176
|
+
function _ts_metadata20(k, v) {
|
|
7111
7177
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7112
7178
|
return Reflect.metadata(k, v);
|
|
7113
7179
|
}
|
|
7114
|
-
__name(
|
|
7180
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
7115
7181
|
function _ts_param(paramIndex, decorator) {
|
|
7116
7182
|
return function(target, key) {
|
|
7117
7183
|
decorator(target, key, paramIndex);
|
|
@@ -7260,7 +7326,8 @@ var CopilotResolver = class {
|
|
|
7260
7326
|
agentStates: data.agentStates,
|
|
7261
7327
|
url: data.frontend.url,
|
|
7262
7328
|
extensions: data.extensions,
|
|
7263
|
-
metaEvents: data.metaEvents
|
|
7329
|
+
metaEvents: data.metaEvents,
|
|
7330
|
+
context: data.context
|
|
7264
7331
|
});
|
|
7265
7332
|
} catch (error) {
|
|
7266
7333
|
if ((0, import_shared29.isStructuredCopilotKitError)(error) || ((_e = error == null ? void 0 : error.extensions) == null ? void 0 : _e.visibility)) {
|
|
@@ -7657,38 +7724,38 @@ var CopilotResolver = class {
|
|
|
7657
7724
|
}
|
|
7658
7725
|
};
|
|
7659
7726
|
__name(CopilotResolver, "CopilotResolver");
|
|
7660
|
-
|
|
7661
|
-
(0,
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7727
|
+
_ts_decorate20([
|
|
7728
|
+
(0, import_type_graphql21.Query)(() => String),
|
|
7729
|
+
_ts_metadata20("design:type", Function),
|
|
7730
|
+
_ts_metadata20("design:paramtypes", []),
|
|
7731
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7665
7732
|
], CopilotResolver.prototype, "hello", null);
|
|
7666
|
-
|
|
7667
|
-
(0,
|
|
7668
|
-
_ts_param(0, (0,
|
|
7669
|
-
|
|
7670
|
-
|
|
7733
|
+
_ts_decorate20([
|
|
7734
|
+
(0, import_type_graphql21.Query)(() => AgentsResponse),
|
|
7735
|
+
_ts_param(0, (0, import_type_graphql21.Ctx)()),
|
|
7736
|
+
_ts_metadata20("design:type", Function),
|
|
7737
|
+
_ts_metadata20("design:paramtypes", [
|
|
7671
7738
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
7672
7739
|
]),
|
|
7673
|
-
|
|
7740
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7674
7741
|
], CopilotResolver.prototype, "availableAgents", null);
|
|
7675
|
-
|
|
7676
|
-
(0,
|
|
7677
|
-
_ts_param(0, (0,
|
|
7678
|
-
_ts_param(1, (0,
|
|
7679
|
-
_ts_param(2, (0,
|
|
7742
|
+
_ts_decorate20([
|
|
7743
|
+
(0, import_type_graphql21.Mutation)(() => CopilotResponse),
|
|
7744
|
+
_ts_param(0, (0, import_type_graphql21.Ctx)()),
|
|
7745
|
+
_ts_param(1, (0, import_type_graphql21.Arg)("data")),
|
|
7746
|
+
_ts_param(2, (0, import_type_graphql21.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
7680
7747
|
nullable: true
|
|
7681
7748
|
})),
|
|
7682
|
-
|
|
7683
|
-
|
|
7749
|
+
_ts_metadata20("design:type", Function),
|
|
7750
|
+
_ts_metadata20("design:paramtypes", [
|
|
7684
7751
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
7685
7752
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
7686
7753
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
7687
7754
|
]),
|
|
7688
|
-
|
|
7755
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7689
7756
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
7690
|
-
CopilotResolver =
|
|
7691
|
-
(0,
|
|
7757
|
+
CopilotResolver = _ts_decorate20([
|
|
7758
|
+
(0, import_type_graphql21.Resolver)(() => CopilotResponse)
|
|
7692
7759
|
], CopilotResolver);
|
|
7693
7760
|
|
|
7694
7761
|
// src/lib/integrations/shared.ts
|
|
@@ -7723,13 +7790,13 @@ function createLogger(options) {
|
|
|
7723
7790
|
__name(createLogger, "createLogger");
|
|
7724
7791
|
|
|
7725
7792
|
// src/graphql/resolvers/state.resolver.ts
|
|
7726
|
-
var import_type_graphql23 = require("type-graphql");
|
|
7727
7793
|
var import_type_graphql24 = require("type-graphql");
|
|
7728
7794
|
var import_type_graphql25 = require("type-graphql");
|
|
7795
|
+
var import_type_graphql26 = require("type-graphql");
|
|
7729
7796
|
|
|
7730
7797
|
// src/graphql/types/load-agent-state-response.type.ts
|
|
7731
|
-
var
|
|
7732
|
-
function
|
|
7798
|
+
var import_type_graphql22 = require("type-graphql");
|
|
7799
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
7733
7800
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7734
7801
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7735
7802
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7739,12 +7806,12 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
7739
7806
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7740
7807
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7741
7808
|
}
|
|
7742
|
-
__name(
|
|
7743
|
-
function
|
|
7809
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
7810
|
+
function _ts_metadata21(k, v) {
|
|
7744
7811
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7745
7812
|
return Reflect.metadata(k, v);
|
|
7746
7813
|
}
|
|
7747
|
-
__name(
|
|
7814
|
+
__name(_ts_metadata21, "_ts_metadata");
|
|
7748
7815
|
var LoadAgentStateResponse = class {
|
|
7749
7816
|
threadId;
|
|
7750
7817
|
threadExists;
|
|
@@ -7752,29 +7819,29 @@ var LoadAgentStateResponse = class {
|
|
|
7752
7819
|
messages;
|
|
7753
7820
|
};
|
|
7754
7821
|
__name(LoadAgentStateResponse, "LoadAgentStateResponse");
|
|
7755
|
-
|
|
7756
|
-
(0,
|
|
7757
|
-
|
|
7822
|
+
_ts_decorate21([
|
|
7823
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7824
|
+
_ts_metadata21("design:type", String)
|
|
7758
7825
|
], LoadAgentStateResponse.prototype, "threadId", void 0);
|
|
7759
|
-
|
|
7760
|
-
(0,
|
|
7761
|
-
|
|
7826
|
+
_ts_decorate21([
|
|
7827
|
+
(0, import_type_graphql22.Field)(() => Boolean),
|
|
7828
|
+
_ts_metadata21("design:type", Boolean)
|
|
7762
7829
|
], LoadAgentStateResponse.prototype, "threadExists", void 0);
|
|
7763
|
-
|
|
7764
|
-
(0,
|
|
7765
|
-
|
|
7830
|
+
_ts_decorate21([
|
|
7831
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7832
|
+
_ts_metadata21("design:type", String)
|
|
7766
7833
|
], LoadAgentStateResponse.prototype, "state", void 0);
|
|
7767
|
-
|
|
7768
|
-
(0,
|
|
7769
|
-
|
|
7834
|
+
_ts_decorate21([
|
|
7835
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7836
|
+
_ts_metadata21("design:type", String)
|
|
7770
7837
|
], LoadAgentStateResponse.prototype, "messages", void 0);
|
|
7771
|
-
LoadAgentStateResponse =
|
|
7772
|
-
(0,
|
|
7838
|
+
LoadAgentStateResponse = _ts_decorate21([
|
|
7839
|
+
(0, import_type_graphql22.ObjectType)()
|
|
7773
7840
|
], LoadAgentStateResponse);
|
|
7774
7841
|
|
|
7775
7842
|
// src/graphql/inputs/load-agent-state.input.ts
|
|
7776
|
-
var
|
|
7777
|
-
function
|
|
7843
|
+
var import_type_graphql23 = require("type-graphql");
|
|
7844
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
7778
7845
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7779
7846
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7780
7847
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7784,32 +7851,32 @@ function _ts_decorate21(decorators, target, key, desc) {
|
|
|
7784
7851
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7785
7852
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7786
7853
|
}
|
|
7787
|
-
__name(
|
|
7788
|
-
function
|
|
7854
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
7855
|
+
function _ts_metadata22(k, v) {
|
|
7789
7856
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7790
7857
|
return Reflect.metadata(k, v);
|
|
7791
7858
|
}
|
|
7792
|
-
__name(
|
|
7859
|
+
__name(_ts_metadata22, "_ts_metadata");
|
|
7793
7860
|
var LoadAgentStateInput = class {
|
|
7794
7861
|
threadId;
|
|
7795
7862
|
agentName;
|
|
7796
7863
|
};
|
|
7797
7864
|
__name(LoadAgentStateInput, "LoadAgentStateInput");
|
|
7798
|
-
|
|
7799
|
-
(0,
|
|
7800
|
-
|
|
7865
|
+
_ts_decorate22([
|
|
7866
|
+
(0, import_type_graphql23.Field)(() => String),
|
|
7867
|
+
_ts_metadata22("design:type", String)
|
|
7801
7868
|
], LoadAgentStateInput.prototype, "threadId", void 0);
|
|
7802
|
-
|
|
7803
|
-
(0,
|
|
7804
|
-
|
|
7869
|
+
_ts_decorate22([
|
|
7870
|
+
(0, import_type_graphql23.Field)(() => String),
|
|
7871
|
+
_ts_metadata22("design:type", String)
|
|
7805
7872
|
], LoadAgentStateInput.prototype, "agentName", void 0);
|
|
7806
|
-
LoadAgentStateInput =
|
|
7807
|
-
(0,
|
|
7873
|
+
LoadAgentStateInput = _ts_decorate22([
|
|
7874
|
+
(0, import_type_graphql23.InputType)()
|
|
7808
7875
|
], LoadAgentStateInput);
|
|
7809
7876
|
|
|
7810
7877
|
// src/graphql/resolvers/state.resolver.ts
|
|
7811
7878
|
var import_shared30 = require("@copilotkit/shared");
|
|
7812
|
-
function
|
|
7879
|
+
function _ts_decorate23(decorators, target, key, desc) {
|
|
7813
7880
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7814
7881
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7815
7882
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7819,12 +7886,12 @@ function _ts_decorate22(decorators, target, key, desc) {
|
|
|
7819
7886
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7820
7887
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7821
7888
|
}
|
|
7822
|
-
__name(
|
|
7823
|
-
function
|
|
7889
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
7890
|
+
function _ts_metadata23(k, v) {
|
|
7824
7891
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7825
7892
|
return Reflect.metadata(k, v);
|
|
7826
7893
|
}
|
|
7827
|
-
__name(
|
|
7894
|
+
__name(_ts_metadata23, "_ts_metadata");
|
|
7828
7895
|
function _ts_param2(paramIndex, decorator) {
|
|
7829
7896
|
return function(target, key) {
|
|
7830
7897
|
decorator(target, key, paramIndex);
|
|
@@ -7849,19 +7916,19 @@ var StateResolver = class {
|
|
|
7849
7916
|
}
|
|
7850
7917
|
};
|
|
7851
7918
|
__name(StateResolver, "StateResolver");
|
|
7852
|
-
|
|
7853
|
-
(0,
|
|
7854
|
-
_ts_param2(0, (0,
|
|
7855
|
-
_ts_param2(1, (0,
|
|
7856
|
-
|
|
7857
|
-
|
|
7919
|
+
_ts_decorate23([
|
|
7920
|
+
(0, import_type_graphql26.Query)(() => LoadAgentStateResponse),
|
|
7921
|
+
_ts_param2(0, (0, import_type_graphql25.Ctx)()),
|
|
7922
|
+
_ts_param2(1, (0, import_type_graphql24.Arg)("data")),
|
|
7923
|
+
_ts_metadata23("design:type", Function),
|
|
7924
|
+
_ts_metadata23("design:paramtypes", [
|
|
7858
7925
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
7859
7926
|
typeof LoadAgentStateInput === "undefined" ? Object : LoadAgentStateInput
|
|
7860
7927
|
]),
|
|
7861
|
-
|
|
7928
|
+
_ts_metadata23("design:returntype", Promise)
|
|
7862
7929
|
], StateResolver.prototype, "loadAgentState", null);
|
|
7863
|
-
StateResolver =
|
|
7864
|
-
(0,
|
|
7930
|
+
StateResolver = _ts_decorate23([
|
|
7931
|
+
(0, import_type_graphql24.Resolver)(() => LoadAgentStateResponse)
|
|
7865
7932
|
], StateResolver);
|
|
7866
7933
|
|
|
7867
7934
|
// src/lib/integrations/shared.ts
|
|
@@ -7892,7 +7959,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
7892
7959
|
__name(createContext, "createContext");
|
|
7893
7960
|
function buildSchema(options = {}) {
|
|
7894
7961
|
logger.debug("Building GraphQL schema...");
|
|
7895
|
-
const schema = (0,
|
|
7962
|
+
const schema = (0, import_type_graphql27.buildSchemaSync)({
|
|
7896
7963
|
resolvers: [
|
|
7897
7964
|
CopilotResolver,
|
|
7898
7965
|
StateResolver
|
|
@@ -8205,12 +8272,22 @@ var LangGraphAgent = class extends import_langgraph.LangGraphAgent {
|
|
|
8205
8272
|
return processedEvent;
|
|
8206
8273
|
}));
|
|
8207
8274
|
}
|
|
8208
|
-
langGraphDefaultMergeState(state, messages,
|
|
8209
|
-
const
|
|
8275
|
+
langGraphDefaultMergeState(state, messages, input) {
|
|
8276
|
+
const aguiMergedState = super.langGraphDefaultMergeState(state, messages, input);
|
|
8277
|
+
const { tools: returnedTools, "ag-ui": agui } = aguiMergedState;
|
|
8278
|
+
const rawCombinedTools = [
|
|
8279
|
+
...returnedTools ?? [],
|
|
8280
|
+
...(agui == null ? void 0 : agui.tools) ?? []
|
|
8281
|
+
];
|
|
8282
|
+
const combinedTools = Array.from(new Map(rawCombinedTools.map((t) => [
|
|
8283
|
+
(t == null ? void 0 : t.id) ?? (t == null ? void 0 : t.name) ?? (t == null ? void 0 : t.key) ?? JSON.stringify(t),
|
|
8284
|
+
t
|
|
8285
|
+
])).values());
|
|
8210
8286
|
return {
|
|
8211
|
-
...
|
|
8287
|
+
...aguiMergedState,
|
|
8212
8288
|
copilotkit: {
|
|
8213
|
-
actions:
|
|
8289
|
+
actions: combinedTools,
|
|
8290
|
+
context: (agui == null ? void 0 : agui.context) ?? []
|
|
8214
8291
|
}
|
|
8215
8292
|
};
|
|
8216
8293
|
}
|
|
@@ -8228,6 +8305,10 @@ var LangGraphAgent = class extends import_langgraph.LangGraphAgent {
|
|
|
8228
8305
|
output: schemaKeys.output ? [
|
|
8229
8306
|
...schemaKeys.output,
|
|
8230
8307
|
...CONSTANT_KEYS
|
|
8308
|
+
] : null,
|
|
8309
|
+
context: schemaKeys.context ? [
|
|
8310
|
+
...schemaKeys.context,
|
|
8311
|
+
...CONSTANT_KEYS
|
|
8231
8312
|
] : null
|
|
8232
8313
|
};
|
|
8233
8314
|
}
|