@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/lib/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",
|
|
@@ -1298,14 +1298,14 @@ var GroqAdapter = class {
|
|
|
1298
1298
|
__name(GroqAdapter, "GroqAdapter");
|
|
1299
1299
|
|
|
1300
1300
|
// src/lib/integrations/shared.ts
|
|
1301
|
-
var
|
|
1301
|
+
var import_type_graphql27 = require("type-graphql");
|
|
1302
1302
|
|
|
1303
1303
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1304
|
-
var
|
|
1304
|
+
var import_type_graphql21 = require("type-graphql");
|
|
1305
1305
|
var import_rxjs5 = require("rxjs");
|
|
1306
1306
|
|
|
1307
1307
|
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
1308
|
-
var
|
|
1308
|
+
var import_type_graphql19 = require("type-graphql");
|
|
1309
1309
|
|
|
1310
1310
|
// src/graphql/inputs/message.input.ts
|
|
1311
1311
|
var import_type_graphql3 = require("type-graphql");
|
|
@@ -2663,7 +2663,8 @@ MetaEventInput = _ts_decorate16([
|
|
|
2663
2663
|
(0, import_type_graphql17.InputType)()
|
|
2664
2664
|
], MetaEventInput);
|
|
2665
2665
|
|
|
2666
|
-
// src/graphql/inputs/
|
|
2666
|
+
// src/graphql/inputs/copilot-context.input.ts
|
|
2667
|
+
var import_type_graphql18 = require("type-graphql");
|
|
2667
2668
|
function _ts_decorate17(decorators, target, key, desc) {
|
|
2668
2669
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2669
2670
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -2680,18 +2681,52 @@ function _ts_metadata17(k, v) {
|
|
|
2680
2681
|
return Reflect.metadata(k, v);
|
|
2681
2682
|
}
|
|
2682
2683
|
__name(_ts_metadata17, "_ts_metadata");
|
|
2684
|
+
var CopilotContextInput = class {
|
|
2685
|
+
description;
|
|
2686
|
+
value;
|
|
2687
|
+
};
|
|
2688
|
+
__name(CopilotContextInput, "CopilotContextInput");
|
|
2689
|
+
_ts_decorate17([
|
|
2690
|
+
(0, import_type_graphql18.Field)(() => String),
|
|
2691
|
+
_ts_metadata17("design:type", String)
|
|
2692
|
+
], CopilotContextInput.prototype, "description", void 0);
|
|
2693
|
+
_ts_decorate17([
|
|
2694
|
+
(0, import_type_graphql18.Field)(() => String),
|
|
2695
|
+
_ts_metadata17("design:type", String)
|
|
2696
|
+
], CopilotContextInput.prototype, "value", void 0);
|
|
2697
|
+
CopilotContextInput = _ts_decorate17([
|
|
2698
|
+
(0, import_type_graphql18.InputType)()
|
|
2699
|
+
], CopilotContextInput);
|
|
2700
|
+
|
|
2701
|
+
// src/graphql/inputs/generate-copilot-response.input.ts
|
|
2702
|
+
function _ts_decorate18(decorators, target, key, desc) {
|
|
2703
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2704
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
2705
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
2706
|
+
else
|
|
2707
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
2708
|
+
if (d = decorators[i])
|
|
2709
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2710
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2711
|
+
}
|
|
2712
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
2713
|
+
function _ts_metadata18(k, v) {
|
|
2714
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
2715
|
+
return Reflect.metadata(k, v);
|
|
2716
|
+
}
|
|
2717
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
2683
2718
|
var GenerateCopilotResponseMetadataInput = class {
|
|
2684
2719
|
requestType;
|
|
2685
2720
|
};
|
|
2686
2721
|
__name(GenerateCopilotResponseMetadataInput, "GenerateCopilotResponseMetadataInput");
|
|
2687
|
-
|
|
2688
|
-
(0,
|
|
2722
|
+
_ts_decorate18([
|
|
2723
|
+
(0, import_type_graphql19.Field)(() => CopilotRequestType, {
|
|
2689
2724
|
nullable: true
|
|
2690
2725
|
}),
|
|
2691
|
-
|
|
2726
|
+
_ts_metadata18("design:type", typeof CopilotRequestType === "undefined" ? Object : CopilotRequestType)
|
|
2692
2727
|
], GenerateCopilotResponseMetadataInput.prototype, "requestType", void 0);
|
|
2693
|
-
GenerateCopilotResponseMetadataInput =
|
|
2694
|
-
(0,
|
|
2728
|
+
GenerateCopilotResponseMetadataInput = _ts_decorate18([
|
|
2729
|
+
(0, import_type_graphql19.InputType)()
|
|
2695
2730
|
], GenerateCopilotResponseMetadataInput);
|
|
2696
2731
|
var GenerateCopilotResponseInput = class {
|
|
2697
2732
|
metadata;
|
|
@@ -2706,84 +2741,93 @@ var GenerateCopilotResponseInput = class {
|
|
|
2706
2741
|
agentStates;
|
|
2707
2742
|
extensions;
|
|
2708
2743
|
metaEvents;
|
|
2744
|
+
context;
|
|
2709
2745
|
};
|
|
2710
2746
|
__name(GenerateCopilotResponseInput, "GenerateCopilotResponseInput");
|
|
2711
|
-
|
|
2712
|
-
(0,
|
|
2747
|
+
_ts_decorate18([
|
|
2748
|
+
(0, import_type_graphql19.Field)(() => GenerateCopilotResponseMetadataInput, {
|
|
2713
2749
|
nullable: false
|
|
2714
2750
|
}),
|
|
2715
|
-
|
|
2751
|
+
_ts_metadata18("design:type", typeof GenerateCopilotResponseMetadataInput === "undefined" ? Object : GenerateCopilotResponseMetadataInput)
|
|
2716
2752
|
], GenerateCopilotResponseInput.prototype, "metadata", void 0);
|
|
2717
|
-
|
|
2718
|
-
(0,
|
|
2753
|
+
_ts_decorate18([
|
|
2754
|
+
(0, import_type_graphql19.Field)(() => String, {
|
|
2719
2755
|
nullable: true
|
|
2720
2756
|
}),
|
|
2721
|
-
|
|
2757
|
+
_ts_metadata18("design:type", String)
|
|
2722
2758
|
], GenerateCopilotResponseInput.prototype, "threadId", void 0);
|
|
2723
|
-
|
|
2724
|
-
(0,
|
|
2759
|
+
_ts_decorate18([
|
|
2760
|
+
(0, import_type_graphql19.Field)(() => String, {
|
|
2725
2761
|
nullable: true
|
|
2726
2762
|
}),
|
|
2727
|
-
|
|
2763
|
+
_ts_metadata18("design:type", String)
|
|
2728
2764
|
], GenerateCopilotResponseInput.prototype, "runId", void 0);
|
|
2729
|
-
|
|
2730
|
-
(0,
|
|
2765
|
+
_ts_decorate18([
|
|
2766
|
+
(0, import_type_graphql19.Field)(() => [
|
|
2731
2767
|
MessageInput
|
|
2732
2768
|
]),
|
|
2733
|
-
|
|
2769
|
+
_ts_metadata18("design:type", Array)
|
|
2734
2770
|
], GenerateCopilotResponseInput.prototype, "messages", void 0);
|
|
2735
|
-
|
|
2736
|
-
(0,
|
|
2737
|
-
|
|
2771
|
+
_ts_decorate18([
|
|
2772
|
+
(0, import_type_graphql19.Field)(() => FrontendInput),
|
|
2773
|
+
_ts_metadata18("design:type", typeof FrontendInput === "undefined" ? Object : FrontendInput)
|
|
2738
2774
|
], GenerateCopilotResponseInput.prototype, "frontend", void 0);
|
|
2739
|
-
|
|
2740
|
-
(0,
|
|
2775
|
+
_ts_decorate18([
|
|
2776
|
+
(0, import_type_graphql19.Field)(() => CloudInput, {
|
|
2741
2777
|
nullable: true
|
|
2742
2778
|
}),
|
|
2743
|
-
|
|
2779
|
+
_ts_metadata18("design:type", typeof CloudInput === "undefined" ? Object : CloudInput)
|
|
2744
2780
|
], GenerateCopilotResponseInput.prototype, "cloud", void 0);
|
|
2745
|
-
|
|
2746
|
-
(0,
|
|
2781
|
+
_ts_decorate18([
|
|
2782
|
+
(0, import_type_graphql19.Field)(() => ForwardedParametersInput, {
|
|
2747
2783
|
nullable: true
|
|
2748
2784
|
}),
|
|
2749
|
-
|
|
2785
|
+
_ts_metadata18("design:type", typeof ForwardedParametersInput === "undefined" ? Object : ForwardedParametersInput)
|
|
2750
2786
|
], GenerateCopilotResponseInput.prototype, "forwardedParameters", void 0);
|
|
2751
|
-
|
|
2752
|
-
(0,
|
|
2787
|
+
_ts_decorate18([
|
|
2788
|
+
(0, import_type_graphql19.Field)(() => AgentSessionInput, {
|
|
2753
2789
|
nullable: true
|
|
2754
2790
|
}),
|
|
2755
|
-
|
|
2791
|
+
_ts_metadata18("design:type", typeof AgentSessionInput === "undefined" ? Object : AgentSessionInput)
|
|
2756
2792
|
], GenerateCopilotResponseInput.prototype, "agentSession", void 0);
|
|
2757
|
-
|
|
2758
|
-
(0,
|
|
2793
|
+
_ts_decorate18([
|
|
2794
|
+
(0, import_type_graphql19.Field)(() => AgentStateInput, {
|
|
2759
2795
|
nullable: true
|
|
2760
2796
|
}),
|
|
2761
|
-
|
|
2797
|
+
_ts_metadata18("design:type", typeof AgentStateInput === "undefined" ? Object : AgentStateInput)
|
|
2762
2798
|
], GenerateCopilotResponseInput.prototype, "agentState", void 0);
|
|
2763
|
-
|
|
2764
|
-
(0,
|
|
2799
|
+
_ts_decorate18([
|
|
2800
|
+
(0, import_type_graphql19.Field)(() => [
|
|
2765
2801
|
AgentStateInput
|
|
2766
2802
|
], {
|
|
2767
2803
|
nullable: true
|
|
2768
2804
|
}),
|
|
2769
|
-
|
|
2805
|
+
_ts_metadata18("design:type", Array)
|
|
2770
2806
|
], GenerateCopilotResponseInput.prototype, "agentStates", void 0);
|
|
2771
|
-
|
|
2772
|
-
(0,
|
|
2807
|
+
_ts_decorate18([
|
|
2808
|
+
(0, import_type_graphql19.Field)(() => ExtensionsInput, {
|
|
2773
2809
|
nullable: true
|
|
2774
2810
|
}),
|
|
2775
|
-
|
|
2811
|
+
_ts_metadata18("design:type", typeof ExtensionsInput === "undefined" ? Object : ExtensionsInput)
|
|
2776
2812
|
], GenerateCopilotResponseInput.prototype, "extensions", void 0);
|
|
2777
|
-
|
|
2778
|
-
(0,
|
|
2813
|
+
_ts_decorate18([
|
|
2814
|
+
(0, import_type_graphql19.Field)(() => [
|
|
2779
2815
|
MetaEventInput
|
|
2780
2816
|
], {
|
|
2781
2817
|
nullable: true
|
|
2782
2818
|
}),
|
|
2783
|
-
|
|
2819
|
+
_ts_metadata18("design:type", Array)
|
|
2784
2820
|
], GenerateCopilotResponseInput.prototype, "metaEvents", void 0);
|
|
2785
|
-
|
|
2786
|
-
(0,
|
|
2821
|
+
_ts_decorate18([
|
|
2822
|
+
(0, import_type_graphql19.Field)(() => [
|
|
2823
|
+
CopilotContextInput
|
|
2824
|
+
], {
|
|
2825
|
+
nullable: true
|
|
2826
|
+
}),
|
|
2827
|
+
_ts_metadata18("design:type", Array)
|
|
2828
|
+
], GenerateCopilotResponseInput.prototype, "context", void 0);
|
|
2829
|
+
GenerateCopilotResponseInput = _ts_decorate18([
|
|
2830
|
+
(0, import_type_graphql19.InputType)()
|
|
2787
2831
|
], GenerateCopilotResponseInput);
|
|
2788
2832
|
|
|
2789
2833
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
@@ -4295,6 +4339,7 @@ var CopilotRuntime = class {
|
|
|
4295
4339
|
langserve = [];
|
|
4296
4340
|
onBeforeRequest;
|
|
4297
4341
|
onAfterRequest;
|
|
4342
|
+
onStopGeneration;
|
|
4298
4343
|
delegateAgentProcessingToServiceAdapter;
|
|
4299
4344
|
observability;
|
|
4300
4345
|
availableAgents;
|
|
@@ -4322,6 +4367,7 @@ var CopilotRuntime = class {
|
|
|
4322
4367
|
this.remoteEndpointDefinitions = (params == null ? void 0 : params.remoteEndpoints) ?? (params == null ? void 0 : params.remoteActions) ?? [];
|
|
4323
4368
|
this.onBeforeRequest = (_a = params == null ? void 0 : params.middleware) == null ? void 0 : _a.onBeforeRequest;
|
|
4324
4369
|
this.onAfterRequest = (_b = params == null ? void 0 : params.middleware) == null ? void 0 : _b.onAfterRequest;
|
|
4370
|
+
this.onStopGeneration = params == null ? void 0 : params.onStopGeneration;
|
|
4325
4371
|
this.delegateAgentProcessingToServiceAdapter = (params == null ? void 0 : params.delegateAgentProcessingToServiceAdapter) || false;
|
|
4326
4372
|
this.observability = params == null ? void 0 : params.observability_c;
|
|
4327
4373
|
this.agents = (params == null ? void 0 : params.agents) ?? {};
|
|
@@ -4400,10 +4446,22 @@ var CopilotRuntime = class {
|
|
|
4400
4446
|
}
|
|
4401
4447
|
async processRuntimeRequest(request) {
|
|
4402
4448
|
var _a, _b, _c, _d, _e;
|
|
4403
|
-
const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey } = request;
|
|
4449
|
+
const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey, context } = request;
|
|
4450
|
+
graphqlContext.request.signal.addEventListener("abort", () => {
|
|
4451
|
+
var _a2;
|
|
4452
|
+
return (_a2 = this.onStopGeneration) == null ? void 0 : _a2.call(this, {
|
|
4453
|
+
threadId,
|
|
4454
|
+
runId,
|
|
4455
|
+
url,
|
|
4456
|
+
agentName: agentSession == null ? void 0 : agentSession.agentName,
|
|
4457
|
+
lastMessage: rawMessages[rawMessages.length - 1]
|
|
4458
|
+
});
|
|
4459
|
+
}, {
|
|
4460
|
+
once: true
|
|
4461
|
+
});
|
|
4404
4462
|
const eventSource = new RuntimeEventSource({
|
|
4405
|
-
errorHandler: async (error,
|
|
4406
|
-
await this.error("error",
|
|
4463
|
+
errorHandler: async (error, context2) => {
|
|
4464
|
+
await this.error("error", context2, error, publicApiKey);
|
|
4407
4465
|
},
|
|
4408
4466
|
errorContext: {
|
|
4409
4467
|
threadId,
|
|
@@ -4849,7 +4907,7 @@ please use an LLM adapter instead.`
|
|
|
4849
4907
|
}
|
|
4850
4908
|
async processAgentRequest(request) {
|
|
4851
4909
|
var _a, _b, _c, _d, _e;
|
|
4852
|
-
const { messages: rawMessages, outputMessagesPromise, graphqlContext, agentSession, threadId: threadIdFromRequest, metaEvents, publicApiKey, forwardedParameters } = request;
|
|
4910
|
+
const { messages: rawMessages, outputMessagesPromise, graphqlContext, agentSession, threadId: threadIdFromRequest, metaEvents, publicApiKey, forwardedParameters, context } = request;
|
|
4853
4911
|
const { agentName, nodeName } = agentSession;
|
|
4854
4912
|
const requestStartTime = Date.now();
|
|
4855
4913
|
const streamedChunks = [];
|
|
@@ -4923,8 +4981,8 @@ please use an LLM adapter instead.`
|
|
|
4923
4981
|
}));
|
|
4924
4982
|
try {
|
|
4925
4983
|
const eventSource = new RuntimeEventSource({
|
|
4926
|
-
errorHandler: async (error,
|
|
4927
|
-
await this.error("error",
|
|
4984
|
+
errorHandler: async (error, context2) => {
|
|
4985
|
+
await this.error("error", context2, error, publicApiKey);
|
|
4928
4986
|
},
|
|
4929
4987
|
errorContext: {
|
|
4930
4988
|
threadId,
|
|
@@ -5149,7 +5207,8 @@ please use an LLM adapter instead.`
|
|
|
5149
5207
|
frontendUrl: url,
|
|
5150
5208
|
agents: this.agents,
|
|
5151
5209
|
metaEvents: request.metaEvents,
|
|
5152
|
-
nodeName: (_a = request.agentSession) == null ? void 0 : _a.nodeName
|
|
5210
|
+
nodeName: (_a = request.agentSession) == null ? void 0 : _a.nodeName,
|
|
5211
|
+
context: request.context
|
|
5153
5212
|
});
|
|
5154
5213
|
const configuredActions = typeof this.actions === "function" ? this.actions({
|
|
5155
5214
|
properties: graphqlContext.properties,
|
|
@@ -5893,7 +5952,7 @@ var import_shared23 = require("@copilotkit/shared");
|
|
|
5893
5952
|
// src/lib/runtime/agui-action.ts
|
|
5894
5953
|
var import_rxjs3 = require("rxjs");
|
|
5895
5954
|
var import_shared21 = require("@copilotkit/shared");
|
|
5896
|
-
function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, graphqlContext }) {
|
|
5955
|
+
function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, context, graphqlContext }) {
|
|
5897
5956
|
const action = {
|
|
5898
5957
|
name: agent.agentId,
|
|
5899
5958
|
description: agent.description,
|
|
@@ -5902,6 +5961,11 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
|
|
|
5902
5961
|
},
|
|
5903
5962
|
remoteAgentHandler: async ({ actionInputsWithoutAgents, threadId }) => {
|
|
5904
5963
|
var _a;
|
|
5964
|
+
graphqlContext.request.signal.addEventListener("abort", () => {
|
|
5965
|
+
agent.abortRun();
|
|
5966
|
+
}, {
|
|
5967
|
+
once: true
|
|
5968
|
+
});
|
|
5905
5969
|
logger2.debug({
|
|
5906
5970
|
actionName: agent.agentId
|
|
5907
5971
|
}, "Executing remote agent");
|
|
@@ -5952,7 +6016,8 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
|
|
|
5952
6016
|
};
|
|
5953
6017
|
return agent.legacy_to_be_removed_runAgentBridged({
|
|
5954
6018
|
tools,
|
|
5955
|
-
forwardedProps
|
|
6019
|
+
forwardedProps,
|
|
6020
|
+
context
|
|
5956
6021
|
}).pipe((0, import_rxjs3.mergeMap)((event) => {
|
|
5957
6022
|
if (event.type === RuntimeEventTypes.RunError) {
|
|
5958
6023
|
const { message } = event;
|
|
@@ -6077,7 +6142,7 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
|
|
|
6077
6142
|
}
|
|
6078
6143
|
}
|
|
6079
6144
|
__name(fetchRemoteInfo, "fetchRemoteInfo");
|
|
6080
|
-
async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents, nodeName }) {
|
|
6145
|
+
async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents, nodeName, context }) {
|
|
6081
6146
|
var _a;
|
|
6082
6147
|
const logger2 = graphqlContext.logger.child({
|
|
6083
6148
|
component: "remote-actions.fetchRemoteActions"
|
|
@@ -6145,7 +6210,8 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
|
|
|
6145
6210
|
metaEvents,
|
|
6146
6211
|
threadMetadata,
|
|
6147
6212
|
nodeName,
|
|
6148
|
-
graphqlContext
|
|
6213
|
+
graphqlContext,
|
|
6214
|
+
context
|
|
6149
6215
|
}));
|
|
6150
6216
|
}
|
|
6151
6217
|
return result.flat();
|
|
@@ -6528,8 +6594,8 @@ __name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
|
6528
6594
|
var import_shared25 = require("@copilotkit/shared");
|
|
6529
6595
|
|
|
6530
6596
|
// src/graphql/types/agents-response.type.ts
|
|
6531
|
-
var
|
|
6532
|
-
function
|
|
6597
|
+
var import_type_graphql20 = require("type-graphql");
|
|
6598
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
6533
6599
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6534
6600
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
6535
6601
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -6539,50 +6605,50 @@ function _ts_decorate18(decorators, target, key, desc) {
|
|
|
6539
6605
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6540
6606
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6541
6607
|
}
|
|
6542
|
-
__name(
|
|
6543
|
-
function
|
|
6608
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
6609
|
+
function _ts_metadata19(k, v) {
|
|
6544
6610
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
6545
6611
|
return Reflect.metadata(k, v);
|
|
6546
6612
|
}
|
|
6547
|
-
__name(
|
|
6613
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
6548
6614
|
var Agent = class {
|
|
6549
6615
|
id;
|
|
6550
6616
|
name;
|
|
6551
6617
|
description;
|
|
6552
6618
|
};
|
|
6553
6619
|
__name(Agent, "Agent");
|
|
6554
|
-
|
|
6555
|
-
(0,
|
|
6556
|
-
|
|
6620
|
+
_ts_decorate19([
|
|
6621
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
6622
|
+
_ts_metadata19("design:type", String)
|
|
6557
6623
|
], Agent.prototype, "id", void 0);
|
|
6558
|
-
|
|
6559
|
-
(0,
|
|
6560
|
-
|
|
6624
|
+
_ts_decorate19([
|
|
6625
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
6626
|
+
_ts_metadata19("design:type", String)
|
|
6561
6627
|
], Agent.prototype, "name", void 0);
|
|
6562
|
-
|
|
6563
|
-
(0,
|
|
6564
|
-
|
|
6628
|
+
_ts_decorate19([
|
|
6629
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
6630
|
+
_ts_metadata19("design:type", String)
|
|
6565
6631
|
], Agent.prototype, "description", void 0);
|
|
6566
|
-
Agent =
|
|
6567
|
-
(0,
|
|
6632
|
+
Agent = _ts_decorate19([
|
|
6633
|
+
(0, import_type_graphql20.ObjectType)()
|
|
6568
6634
|
], Agent);
|
|
6569
6635
|
var AgentsResponse = class {
|
|
6570
6636
|
agents;
|
|
6571
6637
|
};
|
|
6572
6638
|
__name(AgentsResponse, "AgentsResponse");
|
|
6573
|
-
|
|
6574
|
-
(0,
|
|
6639
|
+
_ts_decorate19([
|
|
6640
|
+
(0, import_type_graphql20.Field)(() => [
|
|
6575
6641
|
Agent
|
|
6576
6642
|
]),
|
|
6577
|
-
|
|
6643
|
+
_ts_metadata19("design:type", Array)
|
|
6578
6644
|
], AgentsResponse.prototype, "agents", void 0);
|
|
6579
|
-
AgentsResponse =
|
|
6580
|
-
(0,
|
|
6645
|
+
AgentsResponse = _ts_decorate19([
|
|
6646
|
+
(0, import_type_graphql20.ObjectType)()
|
|
6581
6647
|
], AgentsResponse);
|
|
6582
6648
|
|
|
6583
6649
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
6584
6650
|
var import_shared26 = require("@copilotkit/shared");
|
|
6585
|
-
function
|
|
6651
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
6586
6652
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6587
6653
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
6588
6654
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -6592,12 +6658,12 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
6592
6658
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6593
6659
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6594
6660
|
}
|
|
6595
|
-
__name(
|
|
6596
|
-
function
|
|
6661
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
6662
|
+
function _ts_metadata20(k, v) {
|
|
6597
6663
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
6598
6664
|
return Reflect.metadata(k, v);
|
|
6599
6665
|
}
|
|
6600
|
-
__name(
|
|
6666
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
6601
6667
|
function _ts_param(paramIndex, decorator) {
|
|
6602
6668
|
return function(target, key) {
|
|
6603
6669
|
decorator(target, key, paramIndex);
|
|
@@ -6746,7 +6812,8 @@ var CopilotResolver = class {
|
|
|
6746
6812
|
agentStates: data.agentStates,
|
|
6747
6813
|
url: data.frontend.url,
|
|
6748
6814
|
extensions: data.extensions,
|
|
6749
|
-
metaEvents: data.metaEvents
|
|
6815
|
+
metaEvents: data.metaEvents,
|
|
6816
|
+
context: data.context
|
|
6750
6817
|
});
|
|
6751
6818
|
} catch (error) {
|
|
6752
6819
|
if ((0, import_shared26.isStructuredCopilotKitError)(error) || ((_e = error == null ? void 0 : error.extensions) == null ? void 0 : _e.visibility)) {
|
|
@@ -7143,38 +7210,38 @@ var CopilotResolver = class {
|
|
|
7143
7210
|
}
|
|
7144
7211
|
};
|
|
7145
7212
|
__name(CopilotResolver, "CopilotResolver");
|
|
7146
|
-
|
|
7147
|
-
(0,
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7213
|
+
_ts_decorate20([
|
|
7214
|
+
(0, import_type_graphql21.Query)(() => String),
|
|
7215
|
+
_ts_metadata20("design:type", Function),
|
|
7216
|
+
_ts_metadata20("design:paramtypes", []),
|
|
7217
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7151
7218
|
], CopilotResolver.prototype, "hello", null);
|
|
7152
|
-
|
|
7153
|
-
(0,
|
|
7154
|
-
_ts_param(0, (0,
|
|
7155
|
-
|
|
7156
|
-
|
|
7219
|
+
_ts_decorate20([
|
|
7220
|
+
(0, import_type_graphql21.Query)(() => AgentsResponse),
|
|
7221
|
+
_ts_param(0, (0, import_type_graphql21.Ctx)()),
|
|
7222
|
+
_ts_metadata20("design:type", Function),
|
|
7223
|
+
_ts_metadata20("design:paramtypes", [
|
|
7157
7224
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
7158
7225
|
]),
|
|
7159
|
-
|
|
7226
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7160
7227
|
], CopilotResolver.prototype, "availableAgents", null);
|
|
7161
|
-
|
|
7162
|
-
(0,
|
|
7163
|
-
_ts_param(0, (0,
|
|
7164
|
-
_ts_param(1, (0,
|
|
7165
|
-
_ts_param(2, (0,
|
|
7228
|
+
_ts_decorate20([
|
|
7229
|
+
(0, import_type_graphql21.Mutation)(() => CopilotResponse),
|
|
7230
|
+
_ts_param(0, (0, import_type_graphql21.Ctx)()),
|
|
7231
|
+
_ts_param(1, (0, import_type_graphql21.Arg)("data")),
|
|
7232
|
+
_ts_param(2, (0, import_type_graphql21.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
7166
7233
|
nullable: true
|
|
7167
7234
|
})),
|
|
7168
|
-
|
|
7169
|
-
|
|
7235
|
+
_ts_metadata20("design:type", Function),
|
|
7236
|
+
_ts_metadata20("design:paramtypes", [
|
|
7170
7237
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
7171
7238
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
7172
7239
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
7173
7240
|
]),
|
|
7174
|
-
|
|
7241
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7175
7242
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
7176
|
-
CopilotResolver =
|
|
7177
|
-
(0,
|
|
7243
|
+
CopilotResolver = _ts_decorate20([
|
|
7244
|
+
(0, import_type_graphql21.Resolver)(() => CopilotResponse)
|
|
7178
7245
|
], CopilotResolver);
|
|
7179
7246
|
|
|
7180
7247
|
// src/lib/integrations/shared.ts
|
|
@@ -7209,13 +7276,13 @@ function createLogger(options) {
|
|
|
7209
7276
|
__name(createLogger, "createLogger");
|
|
7210
7277
|
|
|
7211
7278
|
// src/graphql/resolvers/state.resolver.ts
|
|
7212
|
-
var import_type_graphql23 = require("type-graphql");
|
|
7213
7279
|
var import_type_graphql24 = require("type-graphql");
|
|
7214
7280
|
var import_type_graphql25 = require("type-graphql");
|
|
7281
|
+
var import_type_graphql26 = require("type-graphql");
|
|
7215
7282
|
|
|
7216
7283
|
// src/graphql/types/load-agent-state-response.type.ts
|
|
7217
|
-
var
|
|
7218
|
-
function
|
|
7284
|
+
var import_type_graphql22 = require("type-graphql");
|
|
7285
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
7219
7286
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7220
7287
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7221
7288
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7225,12 +7292,12 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
7225
7292
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7226
7293
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7227
7294
|
}
|
|
7228
|
-
__name(
|
|
7229
|
-
function
|
|
7295
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
7296
|
+
function _ts_metadata21(k, v) {
|
|
7230
7297
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7231
7298
|
return Reflect.metadata(k, v);
|
|
7232
7299
|
}
|
|
7233
|
-
__name(
|
|
7300
|
+
__name(_ts_metadata21, "_ts_metadata");
|
|
7234
7301
|
var LoadAgentStateResponse = class {
|
|
7235
7302
|
threadId;
|
|
7236
7303
|
threadExists;
|
|
@@ -7238,29 +7305,29 @@ var LoadAgentStateResponse = class {
|
|
|
7238
7305
|
messages;
|
|
7239
7306
|
};
|
|
7240
7307
|
__name(LoadAgentStateResponse, "LoadAgentStateResponse");
|
|
7241
|
-
|
|
7242
|
-
(0,
|
|
7243
|
-
|
|
7308
|
+
_ts_decorate21([
|
|
7309
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7310
|
+
_ts_metadata21("design:type", String)
|
|
7244
7311
|
], LoadAgentStateResponse.prototype, "threadId", void 0);
|
|
7245
|
-
|
|
7246
|
-
(0,
|
|
7247
|
-
|
|
7312
|
+
_ts_decorate21([
|
|
7313
|
+
(0, import_type_graphql22.Field)(() => Boolean),
|
|
7314
|
+
_ts_metadata21("design:type", Boolean)
|
|
7248
7315
|
], LoadAgentStateResponse.prototype, "threadExists", void 0);
|
|
7249
|
-
|
|
7250
|
-
(0,
|
|
7251
|
-
|
|
7316
|
+
_ts_decorate21([
|
|
7317
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7318
|
+
_ts_metadata21("design:type", String)
|
|
7252
7319
|
], LoadAgentStateResponse.prototype, "state", void 0);
|
|
7253
|
-
|
|
7254
|
-
(0,
|
|
7255
|
-
|
|
7320
|
+
_ts_decorate21([
|
|
7321
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7322
|
+
_ts_metadata21("design:type", String)
|
|
7256
7323
|
], LoadAgentStateResponse.prototype, "messages", void 0);
|
|
7257
|
-
LoadAgentStateResponse =
|
|
7258
|
-
(0,
|
|
7324
|
+
LoadAgentStateResponse = _ts_decorate21([
|
|
7325
|
+
(0, import_type_graphql22.ObjectType)()
|
|
7259
7326
|
], LoadAgentStateResponse);
|
|
7260
7327
|
|
|
7261
7328
|
// src/graphql/inputs/load-agent-state.input.ts
|
|
7262
|
-
var
|
|
7263
|
-
function
|
|
7329
|
+
var import_type_graphql23 = require("type-graphql");
|
|
7330
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
7264
7331
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7265
7332
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7266
7333
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7270,32 +7337,32 @@ function _ts_decorate21(decorators, target, key, desc) {
|
|
|
7270
7337
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7271
7338
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7272
7339
|
}
|
|
7273
|
-
__name(
|
|
7274
|
-
function
|
|
7340
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
7341
|
+
function _ts_metadata22(k, v) {
|
|
7275
7342
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7276
7343
|
return Reflect.metadata(k, v);
|
|
7277
7344
|
}
|
|
7278
|
-
__name(
|
|
7345
|
+
__name(_ts_metadata22, "_ts_metadata");
|
|
7279
7346
|
var LoadAgentStateInput = class {
|
|
7280
7347
|
threadId;
|
|
7281
7348
|
agentName;
|
|
7282
7349
|
};
|
|
7283
7350
|
__name(LoadAgentStateInput, "LoadAgentStateInput");
|
|
7284
|
-
|
|
7285
|
-
(0,
|
|
7286
|
-
|
|
7351
|
+
_ts_decorate22([
|
|
7352
|
+
(0, import_type_graphql23.Field)(() => String),
|
|
7353
|
+
_ts_metadata22("design:type", String)
|
|
7287
7354
|
], LoadAgentStateInput.prototype, "threadId", void 0);
|
|
7288
|
-
|
|
7289
|
-
(0,
|
|
7290
|
-
|
|
7355
|
+
_ts_decorate22([
|
|
7356
|
+
(0, import_type_graphql23.Field)(() => String),
|
|
7357
|
+
_ts_metadata22("design:type", String)
|
|
7291
7358
|
], LoadAgentStateInput.prototype, "agentName", void 0);
|
|
7292
|
-
LoadAgentStateInput =
|
|
7293
|
-
(0,
|
|
7359
|
+
LoadAgentStateInput = _ts_decorate22([
|
|
7360
|
+
(0, import_type_graphql23.InputType)()
|
|
7294
7361
|
], LoadAgentStateInput);
|
|
7295
7362
|
|
|
7296
7363
|
// src/graphql/resolvers/state.resolver.ts
|
|
7297
7364
|
var import_shared27 = require("@copilotkit/shared");
|
|
7298
|
-
function
|
|
7365
|
+
function _ts_decorate23(decorators, target, key, desc) {
|
|
7299
7366
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7300
7367
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7301
7368
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7305,12 +7372,12 @@ function _ts_decorate22(decorators, target, key, desc) {
|
|
|
7305
7372
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7306
7373
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7307
7374
|
}
|
|
7308
|
-
__name(
|
|
7309
|
-
function
|
|
7375
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
7376
|
+
function _ts_metadata23(k, v) {
|
|
7310
7377
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7311
7378
|
return Reflect.metadata(k, v);
|
|
7312
7379
|
}
|
|
7313
|
-
__name(
|
|
7380
|
+
__name(_ts_metadata23, "_ts_metadata");
|
|
7314
7381
|
function _ts_param2(paramIndex, decorator) {
|
|
7315
7382
|
return function(target, key) {
|
|
7316
7383
|
decorator(target, key, paramIndex);
|
|
@@ -7335,19 +7402,19 @@ var StateResolver = class {
|
|
|
7335
7402
|
}
|
|
7336
7403
|
};
|
|
7337
7404
|
__name(StateResolver, "StateResolver");
|
|
7338
|
-
|
|
7339
|
-
(0,
|
|
7340
|
-
_ts_param2(0, (0,
|
|
7341
|
-
_ts_param2(1, (0,
|
|
7342
|
-
|
|
7343
|
-
|
|
7405
|
+
_ts_decorate23([
|
|
7406
|
+
(0, import_type_graphql26.Query)(() => LoadAgentStateResponse),
|
|
7407
|
+
_ts_param2(0, (0, import_type_graphql25.Ctx)()),
|
|
7408
|
+
_ts_param2(1, (0, import_type_graphql24.Arg)("data")),
|
|
7409
|
+
_ts_metadata23("design:type", Function),
|
|
7410
|
+
_ts_metadata23("design:paramtypes", [
|
|
7344
7411
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
7345
7412
|
typeof LoadAgentStateInput === "undefined" ? Object : LoadAgentStateInput
|
|
7346
7413
|
]),
|
|
7347
|
-
|
|
7414
|
+
_ts_metadata23("design:returntype", Promise)
|
|
7348
7415
|
], StateResolver.prototype, "loadAgentState", null);
|
|
7349
|
-
StateResolver =
|
|
7350
|
-
(0,
|
|
7416
|
+
StateResolver = _ts_decorate23([
|
|
7417
|
+
(0, import_type_graphql24.Resolver)(() => LoadAgentStateResponse)
|
|
7351
7418
|
], StateResolver);
|
|
7352
7419
|
|
|
7353
7420
|
// src/lib/integrations/shared.ts
|
|
@@ -7378,7 +7445,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
7378
7445
|
__name(createContext, "createContext");
|
|
7379
7446
|
function buildSchema(options = {}) {
|
|
7380
7447
|
logger.debug("Building GraphQL schema...");
|
|
7381
|
-
const schema = (0,
|
|
7448
|
+
const schema = (0, import_type_graphql27.buildSchemaSync)({
|
|
7382
7449
|
resolvers: [
|
|
7383
7450
|
CopilotResolver,
|
|
7384
7451
|
StateResolver
|
|
@@ -7691,12 +7758,22 @@ var LangGraphAgent = class extends import_langgraph.LangGraphAgent {
|
|
|
7691
7758
|
return processedEvent;
|
|
7692
7759
|
}));
|
|
7693
7760
|
}
|
|
7694
|
-
langGraphDefaultMergeState(state, messages,
|
|
7695
|
-
const
|
|
7761
|
+
langGraphDefaultMergeState(state, messages, input) {
|
|
7762
|
+
const aguiMergedState = super.langGraphDefaultMergeState(state, messages, input);
|
|
7763
|
+
const { tools: returnedTools, "ag-ui": agui } = aguiMergedState;
|
|
7764
|
+
const rawCombinedTools = [
|
|
7765
|
+
...returnedTools ?? [],
|
|
7766
|
+
...(agui == null ? void 0 : agui.tools) ?? []
|
|
7767
|
+
];
|
|
7768
|
+
const combinedTools = Array.from(new Map(rawCombinedTools.map((t) => [
|
|
7769
|
+
(t == null ? void 0 : t.id) ?? (t == null ? void 0 : t.name) ?? (t == null ? void 0 : t.key) ?? JSON.stringify(t),
|
|
7770
|
+
t
|
|
7771
|
+
])).values());
|
|
7696
7772
|
return {
|
|
7697
|
-
...
|
|
7773
|
+
...aguiMergedState,
|
|
7698
7774
|
copilotkit: {
|
|
7699
|
-
actions:
|
|
7775
|
+
actions: combinedTools,
|
|
7776
|
+
context: (agui == null ? void 0 : agui.context) ?? []
|
|
7700
7777
|
}
|
|
7701
7778
|
};
|
|
7702
7779
|
}
|
|
@@ -7714,6 +7791,10 @@ var LangGraphAgent = class extends import_langgraph.LangGraphAgent {
|
|
|
7714
7791
|
output: schemaKeys.output ? [
|
|
7715
7792
|
...schemaKeys.output,
|
|
7716
7793
|
...CONSTANT_KEYS
|
|
7794
|
+
] : null,
|
|
7795
|
+
context: schemaKeys.context ? [
|
|
7796
|
+
...schemaKeys.context,
|
|
7797
|
+
...CONSTANT_KEYS
|
|
7717
7798
|
] : null
|
|
7718
7799
|
};
|
|
7719
7800
|
}
|