@copilotkit/runtime 1.10.4 → 1.10.5-next.1
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 +13 -0
- package/__snapshots__/schema/schema.graphql +6 -0
- package/dist/{chunk-HV5H6LOK.mjs → chunk-C56AVUZI.mjs} +2 -2
- package/dist/{chunk-HHMKB5P4.mjs → chunk-CX4GADTM.mjs} +2 -2
- package/dist/{chunk-XAA5PFCY.mjs → chunk-FOXQPOXW.mjs} +184 -136
- package/dist/chunk-FOXQPOXW.mjs.map +1 -0
- package/dist/{chunk-XGVZS3FD.mjs → chunk-H6QUY5ZQ.mjs} +16 -6
- package/dist/chunk-H6QUY5ZQ.mjs.map +1 -0
- package/dist/{chunk-CNG7I5M5.mjs → chunk-T4NLPBCY.mjs} +2 -2
- 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 +216 -158
- 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 +216 -158
- 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 +188 -143
- 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 +188 -143
- 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 +188 -143
- 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 +188 -143
- 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-35015e40.d.ts} +9 -2
- package/package.json +3 -3
- 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 +4 -0
- package/src/lib/runtime/copilot-runtime.ts +5 -0
- package/src/lib/runtime/langgraph/langgraph-agent.ts +27 -7
- package/src/lib/runtime/remote-actions.ts +4 -0
- package/dist/chunk-XAA5PFCY.mjs.map +0 -1
- package/dist/chunk-XGVZS3FD.mjs.map +0 -1
- /package/dist/{chunk-HV5H6LOK.mjs.map → chunk-C56AVUZI.mjs.map} +0 -0
- /package/dist/{chunk-HHMKB5P4.mjs.map → chunk-CX4GADTM.mjs.map} +0 -0
- /package/dist/{chunk-CNG7I5M5.mjs.map → chunk-T4NLPBCY.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.
|
|
47
|
+
version: "1.10.5-next.1",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -85,7 +85,7 @@ var require_package = __commonJS({
|
|
|
85
85
|
"@ag-ui/client": "^0.0.37",
|
|
86
86
|
"@ag-ui/core": "^0.0.37",
|
|
87
87
|
"@ag-ui/encoder": "^0.0.37",
|
|
88
|
-
"@ag-ui/langgraph": "^0.0.
|
|
88
|
+
"@ag-ui/langgraph": "^0.0.13",
|
|
89
89
|
"@ag-ui/proto": "^0.0.37",
|
|
90
90
|
"@anthropic-ai/sdk": "^0.57.0",
|
|
91
91
|
"@copilotkit/shared": "workspace:*",
|
|
@@ -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
|
|
@@ -4400,10 +4444,10 @@ var CopilotRuntime = class {
|
|
|
4400
4444
|
}
|
|
4401
4445
|
async processRuntimeRequest(request) {
|
|
4402
4446
|
var _a, _b, _c, _d, _e;
|
|
4403
|
-
const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey } = request;
|
|
4447
|
+
const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey, context } = request;
|
|
4404
4448
|
const eventSource = new RuntimeEventSource({
|
|
4405
|
-
errorHandler: async (error,
|
|
4406
|
-
await this.error("error",
|
|
4449
|
+
errorHandler: async (error, context2) => {
|
|
4450
|
+
await this.error("error", context2, error, publicApiKey);
|
|
4407
4451
|
},
|
|
4408
4452
|
errorContext: {
|
|
4409
4453
|
threadId,
|
|
@@ -4849,7 +4893,7 @@ please use an LLM adapter instead.`
|
|
|
4849
4893
|
}
|
|
4850
4894
|
async processAgentRequest(request) {
|
|
4851
4895
|
var _a, _b, _c, _d, _e;
|
|
4852
|
-
const { messages: rawMessages, outputMessagesPromise, graphqlContext, agentSession, threadId: threadIdFromRequest, metaEvents, publicApiKey, forwardedParameters } = request;
|
|
4896
|
+
const { messages: rawMessages, outputMessagesPromise, graphqlContext, agentSession, threadId: threadIdFromRequest, metaEvents, publicApiKey, forwardedParameters, context } = request;
|
|
4853
4897
|
const { agentName, nodeName } = agentSession;
|
|
4854
4898
|
const requestStartTime = Date.now();
|
|
4855
4899
|
const streamedChunks = [];
|
|
@@ -4923,8 +4967,8 @@ please use an LLM adapter instead.`
|
|
|
4923
4967
|
}));
|
|
4924
4968
|
try {
|
|
4925
4969
|
const eventSource = new RuntimeEventSource({
|
|
4926
|
-
errorHandler: async (error,
|
|
4927
|
-
await this.error("error",
|
|
4970
|
+
errorHandler: async (error, context2) => {
|
|
4971
|
+
await this.error("error", context2, error, publicApiKey);
|
|
4928
4972
|
},
|
|
4929
4973
|
errorContext: {
|
|
4930
4974
|
threadId,
|
|
@@ -5149,7 +5193,8 @@ please use an LLM adapter instead.`
|
|
|
5149
5193
|
frontendUrl: url,
|
|
5150
5194
|
agents: this.agents,
|
|
5151
5195
|
metaEvents: request.metaEvents,
|
|
5152
|
-
nodeName: (_a = request.agentSession) == null ? void 0 : _a.nodeName
|
|
5196
|
+
nodeName: (_a = request.agentSession) == null ? void 0 : _a.nodeName,
|
|
5197
|
+
context: request.context
|
|
5153
5198
|
});
|
|
5154
5199
|
const configuredActions = typeof this.actions === "function" ? this.actions({
|
|
5155
5200
|
properties: graphqlContext.properties,
|
|
@@ -5893,7 +5938,7 @@ var import_shared23 = require("@copilotkit/shared");
|
|
|
5893
5938
|
// src/lib/runtime/agui-action.ts
|
|
5894
5939
|
var import_rxjs3 = require("rxjs");
|
|
5895
5940
|
var import_shared21 = require("@copilotkit/shared");
|
|
5896
|
-
function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, graphqlContext }) {
|
|
5941
|
+
function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, context, graphqlContext }) {
|
|
5897
5942
|
const action = {
|
|
5898
5943
|
name: agent.agentId,
|
|
5899
5944
|
description: agent.description,
|
|
@@ -5952,7 +5997,8 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
|
|
|
5952
5997
|
};
|
|
5953
5998
|
return agent.legacy_to_be_removed_runAgentBridged({
|
|
5954
5999
|
tools,
|
|
5955
|
-
forwardedProps
|
|
6000
|
+
forwardedProps,
|
|
6001
|
+
context
|
|
5956
6002
|
}).pipe((0, import_rxjs3.mergeMap)((event) => {
|
|
5957
6003
|
if (event.type === RuntimeEventTypes.RunError) {
|
|
5958
6004
|
const { message } = event;
|
|
@@ -6077,7 +6123,7 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
|
|
|
6077
6123
|
}
|
|
6078
6124
|
}
|
|
6079
6125
|
__name(fetchRemoteInfo, "fetchRemoteInfo");
|
|
6080
|
-
async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents, nodeName }) {
|
|
6126
|
+
async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents, nodeName, context }) {
|
|
6081
6127
|
var _a;
|
|
6082
6128
|
const logger2 = graphqlContext.logger.child({
|
|
6083
6129
|
component: "remote-actions.fetchRemoteActions"
|
|
@@ -6145,7 +6191,8 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
|
|
|
6145
6191
|
metaEvents,
|
|
6146
6192
|
threadMetadata,
|
|
6147
6193
|
nodeName,
|
|
6148
|
-
graphqlContext
|
|
6194
|
+
graphqlContext,
|
|
6195
|
+
context
|
|
6149
6196
|
}));
|
|
6150
6197
|
}
|
|
6151
6198
|
return result.flat();
|
|
@@ -6528,8 +6575,8 @@ __name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
|
6528
6575
|
var import_shared25 = require("@copilotkit/shared");
|
|
6529
6576
|
|
|
6530
6577
|
// src/graphql/types/agents-response.type.ts
|
|
6531
|
-
var
|
|
6532
|
-
function
|
|
6578
|
+
var import_type_graphql20 = require("type-graphql");
|
|
6579
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
6533
6580
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6534
6581
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
6535
6582
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -6539,50 +6586,50 @@ function _ts_decorate18(decorators, target, key, desc) {
|
|
|
6539
6586
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6540
6587
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6541
6588
|
}
|
|
6542
|
-
__name(
|
|
6543
|
-
function
|
|
6589
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
6590
|
+
function _ts_metadata19(k, v) {
|
|
6544
6591
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
6545
6592
|
return Reflect.metadata(k, v);
|
|
6546
6593
|
}
|
|
6547
|
-
__name(
|
|
6594
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
6548
6595
|
var Agent = class {
|
|
6549
6596
|
id;
|
|
6550
6597
|
name;
|
|
6551
6598
|
description;
|
|
6552
6599
|
};
|
|
6553
6600
|
__name(Agent, "Agent");
|
|
6554
|
-
|
|
6555
|
-
(0,
|
|
6556
|
-
|
|
6601
|
+
_ts_decorate19([
|
|
6602
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
6603
|
+
_ts_metadata19("design:type", String)
|
|
6557
6604
|
], Agent.prototype, "id", void 0);
|
|
6558
|
-
|
|
6559
|
-
(0,
|
|
6560
|
-
|
|
6605
|
+
_ts_decorate19([
|
|
6606
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
6607
|
+
_ts_metadata19("design:type", String)
|
|
6561
6608
|
], Agent.prototype, "name", void 0);
|
|
6562
|
-
|
|
6563
|
-
(0,
|
|
6564
|
-
|
|
6609
|
+
_ts_decorate19([
|
|
6610
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
6611
|
+
_ts_metadata19("design:type", String)
|
|
6565
6612
|
], Agent.prototype, "description", void 0);
|
|
6566
|
-
Agent =
|
|
6567
|
-
(0,
|
|
6613
|
+
Agent = _ts_decorate19([
|
|
6614
|
+
(0, import_type_graphql20.ObjectType)()
|
|
6568
6615
|
], Agent);
|
|
6569
6616
|
var AgentsResponse = class {
|
|
6570
6617
|
agents;
|
|
6571
6618
|
};
|
|
6572
6619
|
__name(AgentsResponse, "AgentsResponse");
|
|
6573
|
-
|
|
6574
|
-
(0,
|
|
6620
|
+
_ts_decorate19([
|
|
6621
|
+
(0, import_type_graphql20.Field)(() => [
|
|
6575
6622
|
Agent
|
|
6576
6623
|
]),
|
|
6577
|
-
|
|
6624
|
+
_ts_metadata19("design:type", Array)
|
|
6578
6625
|
], AgentsResponse.prototype, "agents", void 0);
|
|
6579
|
-
AgentsResponse =
|
|
6580
|
-
(0,
|
|
6626
|
+
AgentsResponse = _ts_decorate19([
|
|
6627
|
+
(0, import_type_graphql20.ObjectType)()
|
|
6581
6628
|
], AgentsResponse);
|
|
6582
6629
|
|
|
6583
6630
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
6584
6631
|
var import_shared26 = require("@copilotkit/shared");
|
|
6585
|
-
function
|
|
6632
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
6586
6633
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6587
6634
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
6588
6635
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -6592,12 +6639,12 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
6592
6639
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6593
6640
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6594
6641
|
}
|
|
6595
|
-
__name(
|
|
6596
|
-
function
|
|
6642
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
6643
|
+
function _ts_metadata20(k, v) {
|
|
6597
6644
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
6598
6645
|
return Reflect.metadata(k, v);
|
|
6599
6646
|
}
|
|
6600
|
-
__name(
|
|
6647
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
6601
6648
|
function _ts_param(paramIndex, decorator) {
|
|
6602
6649
|
return function(target, key) {
|
|
6603
6650
|
decorator(target, key, paramIndex);
|
|
@@ -6746,7 +6793,8 @@ var CopilotResolver = class {
|
|
|
6746
6793
|
agentStates: data.agentStates,
|
|
6747
6794
|
url: data.frontend.url,
|
|
6748
6795
|
extensions: data.extensions,
|
|
6749
|
-
metaEvents: data.metaEvents
|
|
6796
|
+
metaEvents: data.metaEvents,
|
|
6797
|
+
context: data.context
|
|
6750
6798
|
});
|
|
6751
6799
|
} catch (error) {
|
|
6752
6800
|
if ((0, import_shared26.isStructuredCopilotKitError)(error) || ((_e = error == null ? void 0 : error.extensions) == null ? void 0 : _e.visibility)) {
|
|
@@ -7143,38 +7191,38 @@ var CopilotResolver = class {
|
|
|
7143
7191
|
}
|
|
7144
7192
|
};
|
|
7145
7193
|
__name(CopilotResolver, "CopilotResolver");
|
|
7146
|
-
|
|
7147
|
-
(0,
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7194
|
+
_ts_decorate20([
|
|
7195
|
+
(0, import_type_graphql21.Query)(() => String),
|
|
7196
|
+
_ts_metadata20("design:type", Function),
|
|
7197
|
+
_ts_metadata20("design:paramtypes", []),
|
|
7198
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7151
7199
|
], CopilotResolver.prototype, "hello", null);
|
|
7152
|
-
|
|
7153
|
-
(0,
|
|
7154
|
-
_ts_param(0, (0,
|
|
7155
|
-
|
|
7156
|
-
|
|
7200
|
+
_ts_decorate20([
|
|
7201
|
+
(0, import_type_graphql21.Query)(() => AgentsResponse),
|
|
7202
|
+
_ts_param(0, (0, import_type_graphql21.Ctx)()),
|
|
7203
|
+
_ts_metadata20("design:type", Function),
|
|
7204
|
+
_ts_metadata20("design:paramtypes", [
|
|
7157
7205
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
7158
7206
|
]),
|
|
7159
|
-
|
|
7207
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7160
7208
|
], CopilotResolver.prototype, "availableAgents", null);
|
|
7161
|
-
|
|
7162
|
-
(0,
|
|
7163
|
-
_ts_param(0, (0,
|
|
7164
|
-
_ts_param(1, (0,
|
|
7165
|
-
_ts_param(2, (0,
|
|
7209
|
+
_ts_decorate20([
|
|
7210
|
+
(0, import_type_graphql21.Mutation)(() => CopilotResponse),
|
|
7211
|
+
_ts_param(0, (0, import_type_graphql21.Ctx)()),
|
|
7212
|
+
_ts_param(1, (0, import_type_graphql21.Arg)("data")),
|
|
7213
|
+
_ts_param(2, (0, import_type_graphql21.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
7166
7214
|
nullable: true
|
|
7167
7215
|
})),
|
|
7168
|
-
|
|
7169
|
-
|
|
7216
|
+
_ts_metadata20("design:type", Function),
|
|
7217
|
+
_ts_metadata20("design:paramtypes", [
|
|
7170
7218
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
7171
7219
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
7172
7220
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
7173
7221
|
]),
|
|
7174
|
-
|
|
7222
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7175
7223
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
7176
|
-
CopilotResolver =
|
|
7177
|
-
(0,
|
|
7224
|
+
CopilotResolver = _ts_decorate20([
|
|
7225
|
+
(0, import_type_graphql21.Resolver)(() => CopilotResponse)
|
|
7178
7226
|
], CopilotResolver);
|
|
7179
7227
|
|
|
7180
7228
|
// src/lib/integrations/shared.ts
|
|
@@ -7209,13 +7257,13 @@ function createLogger(options) {
|
|
|
7209
7257
|
__name(createLogger, "createLogger");
|
|
7210
7258
|
|
|
7211
7259
|
// src/graphql/resolvers/state.resolver.ts
|
|
7212
|
-
var import_type_graphql23 = require("type-graphql");
|
|
7213
7260
|
var import_type_graphql24 = require("type-graphql");
|
|
7214
7261
|
var import_type_graphql25 = require("type-graphql");
|
|
7262
|
+
var import_type_graphql26 = require("type-graphql");
|
|
7215
7263
|
|
|
7216
7264
|
// src/graphql/types/load-agent-state-response.type.ts
|
|
7217
|
-
var
|
|
7218
|
-
function
|
|
7265
|
+
var import_type_graphql22 = require("type-graphql");
|
|
7266
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
7219
7267
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7220
7268
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7221
7269
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7225,12 +7273,12 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
7225
7273
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7226
7274
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7227
7275
|
}
|
|
7228
|
-
__name(
|
|
7229
|
-
function
|
|
7276
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
7277
|
+
function _ts_metadata21(k, v) {
|
|
7230
7278
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7231
7279
|
return Reflect.metadata(k, v);
|
|
7232
7280
|
}
|
|
7233
|
-
__name(
|
|
7281
|
+
__name(_ts_metadata21, "_ts_metadata");
|
|
7234
7282
|
var LoadAgentStateResponse = class {
|
|
7235
7283
|
threadId;
|
|
7236
7284
|
threadExists;
|
|
@@ -7238,29 +7286,29 @@ var LoadAgentStateResponse = class {
|
|
|
7238
7286
|
messages;
|
|
7239
7287
|
};
|
|
7240
7288
|
__name(LoadAgentStateResponse, "LoadAgentStateResponse");
|
|
7241
|
-
|
|
7242
|
-
(0,
|
|
7243
|
-
|
|
7289
|
+
_ts_decorate21([
|
|
7290
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7291
|
+
_ts_metadata21("design:type", String)
|
|
7244
7292
|
], LoadAgentStateResponse.prototype, "threadId", void 0);
|
|
7245
|
-
|
|
7246
|
-
(0,
|
|
7247
|
-
|
|
7293
|
+
_ts_decorate21([
|
|
7294
|
+
(0, import_type_graphql22.Field)(() => Boolean),
|
|
7295
|
+
_ts_metadata21("design:type", Boolean)
|
|
7248
7296
|
], LoadAgentStateResponse.prototype, "threadExists", void 0);
|
|
7249
|
-
|
|
7250
|
-
(0,
|
|
7251
|
-
|
|
7297
|
+
_ts_decorate21([
|
|
7298
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7299
|
+
_ts_metadata21("design:type", String)
|
|
7252
7300
|
], LoadAgentStateResponse.prototype, "state", void 0);
|
|
7253
|
-
|
|
7254
|
-
(0,
|
|
7255
|
-
|
|
7301
|
+
_ts_decorate21([
|
|
7302
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7303
|
+
_ts_metadata21("design:type", String)
|
|
7256
7304
|
], LoadAgentStateResponse.prototype, "messages", void 0);
|
|
7257
|
-
LoadAgentStateResponse =
|
|
7258
|
-
(0,
|
|
7305
|
+
LoadAgentStateResponse = _ts_decorate21([
|
|
7306
|
+
(0, import_type_graphql22.ObjectType)()
|
|
7259
7307
|
], LoadAgentStateResponse);
|
|
7260
7308
|
|
|
7261
7309
|
// src/graphql/inputs/load-agent-state.input.ts
|
|
7262
|
-
var
|
|
7263
|
-
function
|
|
7310
|
+
var import_type_graphql23 = require("type-graphql");
|
|
7311
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
7264
7312
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7265
7313
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7266
7314
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7270,32 +7318,32 @@ function _ts_decorate21(decorators, target, key, desc) {
|
|
|
7270
7318
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7271
7319
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7272
7320
|
}
|
|
7273
|
-
__name(
|
|
7274
|
-
function
|
|
7321
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
7322
|
+
function _ts_metadata22(k, v) {
|
|
7275
7323
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7276
7324
|
return Reflect.metadata(k, v);
|
|
7277
7325
|
}
|
|
7278
|
-
__name(
|
|
7326
|
+
__name(_ts_metadata22, "_ts_metadata");
|
|
7279
7327
|
var LoadAgentStateInput = class {
|
|
7280
7328
|
threadId;
|
|
7281
7329
|
agentName;
|
|
7282
7330
|
};
|
|
7283
7331
|
__name(LoadAgentStateInput, "LoadAgentStateInput");
|
|
7284
|
-
|
|
7285
|
-
(0,
|
|
7286
|
-
|
|
7332
|
+
_ts_decorate22([
|
|
7333
|
+
(0, import_type_graphql23.Field)(() => String),
|
|
7334
|
+
_ts_metadata22("design:type", String)
|
|
7287
7335
|
], LoadAgentStateInput.prototype, "threadId", void 0);
|
|
7288
|
-
|
|
7289
|
-
(0,
|
|
7290
|
-
|
|
7336
|
+
_ts_decorate22([
|
|
7337
|
+
(0, import_type_graphql23.Field)(() => String),
|
|
7338
|
+
_ts_metadata22("design:type", String)
|
|
7291
7339
|
], LoadAgentStateInput.prototype, "agentName", void 0);
|
|
7292
|
-
LoadAgentStateInput =
|
|
7293
|
-
(0,
|
|
7340
|
+
LoadAgentStateInput = _ts_decorate22([
|
|
7341
|
+
(0, import_type_graphql23.InputType)()
|
|
7294
7342
|
], LoadAgentStateInput);
|
|
7295
7343
|
|
|
7296
7344
|
// src/graphql/resolvers/state.resolver.ts
|
|
7297
7345
|
var import_shared27 = require("@copilotkit/shared");
|
|
7298
|
-
function
|
|
7346
|
+
function _ts_decorate23(decorators, target, key, desc) {
|
|
7299
7347
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7300
7348
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7301
7349
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7305,12 +7353,12 @@ function _ts_decorate22(decorators, target, key, desc) {
|
|
|
7305
7353
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7306
7354
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7307
7355
|
}
|
|
7308
|
-
__name(
|
|
7309
|
-
function
|
|
7356
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
7357
|
+
function _ts_metadata23(k, v) {
|
|
7310
7358
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7311
7359
|
return Reflect.metadata(k, v);
|
|
7312
7360
|
}
|
|
7313
|
-
__name(
|
|
7361
|
+
__name(_ts_metadata23, "_ts_metadata");
|
|
7314
7362
|
function _ts_param2(paramIndex, decorator) {
|
|
7315
7363
|
return function(target, key) {
|
|
7316
7364
|
decorator(target, key, paramIndex);
|
|
@@ -7335,19 +7383,19 @@ var StateResolver = class {
|
|
|
7335
7383
|
}
|
|
7336
7384
|
};
|
|
7337
7385
|
__name(StateResolver, "StateResolver");
|
|
7338
|
-
|
|
7339
|
-
(0,
|
|
7340
|
-
_ts_param2(0, (0,
|
|
7341
|
-
_ts_param2(1, (0,
|
|
7342
|
-
|
|
7343
|
-
|
|
7386
|
+
_ts_decorate23([
|
|
7387
|
+
(0, import_type_graphql26.Query)(() => LoadAgentStateResponse),
|
|
7388
|
+
_ts_param2(0, (0, import_type_graphql25.Ctx)()),
|
|
7389
|
+
_ts_param2(1, (0, import_type_graphql24.Arg)("data")),
|
|
7390
|
+
_ts_metadata23("design:type", Function),
|
|
7391
|
+
_ts_metadata23("design:paramtypes", [
|
|
7344
7392
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
7345
7393
|
typeof LoadAgentStateInput === "undefined" ? Object : LoadAgentStateInput
|
|
7346
7394
|
]),
|
|
7347
|
-
|
|
7395
|
+
_ts_metadata23("design:returntype", Promise)
|
|
7348
7396
|
], StateResolver.prototype, "loadAgentState", null);
|
|
7349
|
-
StateResolver =
|
|
7350
|
-
(0,
|
|
7397
|
+
StateResolver = _ts_decorate23([
|
|
7398
|
+
(0, import_type_graphql24.Resolver)(() => LoadAgentStateResponse)
|
|
7351
7399
|
], StateResolver);
|
|
7352
7400
|
|
|
7353
7401
|
// src/lib/integrations/shared.ts
|
|
@@ -7378,7 +7426,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
7378
7426
|
__name(createContext, "createContext");
|
|
7379
7427
|
function buildSchema(options = {}) {
|
|
7380
7428
|
logger.debug("Building GraphQL schema...");
|
|
7381
|
-
const schema = (0,
|
|
7429
|
+
const schema = (0, import_type_graphql27.buildSchemaSync)({
|
|
7382
7430
|
resolvers: [
|
|
7383
7431
|
CopilotResolver,
|
|
7384
7432
|
StateResolver
|
|
@@ -7691,12 +7739,22 @@ var LangGraphAgent = class extends import_langgraph.LangGraphAgent {
|
|
|
7691
7739
|
return processedEvent;
|
|
7692
7740
|
}));
|
|
7693
7741
|
}
|
|
7694
|
-
langGraphDefaultMergeState(state, messages,
|
|
7695
|
-
const
|
|
7742
|
+
langGraphDefaultMergeState(state, messages, input) {
|
|
7743
|
+
const aguiMergedState = super.langGraphDefaultMergeState(state, messages, input);
|
|
7744
|
+
const { tools: returnedTools, "ag-ui": agui } = aguiMergedState;
|
|
7745
|
+
const rawCombinedTools = [
|
|
7746
|
+
...returnedTools ?? [],
|
|
7747
|
+
...(agui == null ? void 0 : agui.tools) ?? []
|
|
7748
|
+
];
|
|
7749
|
+
const combinedTools = Array.from(new Map(rawCombinedTools.map((t) => [
|
|
7750
|
+
(t == null ? void 0 : t.id) ?? (t == null ? void 0 : t.name) ?? (t == null ? void 0 : t.key) ?? JSON.stringify(t),
|
|
7751
|
+
t
|
|
7752
|
+
])).values());
|
|
7696
7753
|
return {
|
|
7697
|
-
...
|
|
7754
|
+
...aguiMergedState,
|
|
7698
7755
|
copilotkit: {
|
|
7699
|
-
actions:
|
|
7756
|
+
actions: combinedTools,
|
|
7757
|
+
context: (agui == null ? void 0 : agui.context) ?? []
|
|
7700
7758
|
}
|
|
7701
7759
|
};
|
|
7702
7760
|
}
|