@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/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:*",
|
|
@@ -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
|
|
@@ -4914,10 +4958,10 @@ var CopilotRuntime = class {
|
|
|
4914
4958
|
}
|
|
4915
4959
|
async processRuntimeRequest(request) {
|
|
4916
4960
|
var _a, _b, _c, _d, _e;
|
|
4917
|
-
const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey } = request;
|
|
4961
|
+
const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey, context } = request;
|
|
4918
4962
|
const eventSource = new RuntimeEventSource({
|
|
4919
|
-
errorHandler: async (error,
|
|
4920
|
-
await this.error("error",
|
|
4963
|
+
errorHandler: async (error, context2) => {
|
|
4964
|
+
await this.error("error", context2, error, publicApiKey);
|
|
4921
4965
|
},
|
|
4922
4966
|
errorContext: {
|
|
4923
4967
|
threadId,
|
|
@@ -5363,7 +5407,7 @@ please use an LLM adapter instead.`
|
|
|
5363
5407
|
}
|
|
5364
5408
|
async processAgentRequest(request) {
|
|
5365
5409
|
var _a, _b, _c, _d, _e;
|
|
5366
|
-
const { messages: rawMessages, outputMessagesPromise, graphqlContext, agentSession, threadId: threadIdFromRequest, metaEvents, publicApiKey, forwardedParameters } = request;
|
|
5410
|
+
const { messages: rawMessages, outputMessagesPromise, graphqlContext, agentSession, threadId: threadIdFromRequest, metaEvents, publicApiKey, forwardedParameters, context } = request;
|
|
5367
5411
|
const { agentName, nodeName } = agentSession;
|
|
5368
5412
|
const requestStartTime = Date.now();
|
|
5369
5413
|
const streamedChunks = [];
|
|
@@ -5437,8 +5481,8 @@ please use an LLM adapter instead.`
|
|
|
5437
5481
|
}));
|
|
5438
5482
|
try {
|
|
5439
5483
|
const eventSource = new RuntimeEventSource({
|
|
5440
|
-
errorHandler: async (error,
|
|
5441
|
-
await this.error("error",
|
|
5484
|
+
errorHandler: async (error, context2) => {
|
|
5485
|
+
await this.error("error", context2, error, publicApiKey);
|
|
5442
5486
|
},
|
|
5443
5487
|
errorContext: {
|
|
5444
5488
|
threadId,
|
|
@@ -5663,7 +5707,8 @@ please use an LLM adapter instead.`
|
|
|
5663
5707
|
frontendUrl: url,
|
|
5664
5708
|
agents: this.agents,
|
|
5665
5709
|
metaEvents: request.metaEvents,
|
|
5666
|
-
nodeName: (_a = request.agentSession) == null ? void 0 : _a.nodeName
|
|
5710
|
+
nodeName: (_a = request.agentSession) == null ? void 0 : _a.nodeName,
|
|
5711
|
+
context: request.context
|
|
5667
5712
|
});
|
|
5668
5713
|
const configuredActions = typeof this.actions === "function" ? this.actions({
|
|
5669
5714
|
properties: graphqlContext.properties,
|
|
@@ -6407,7 +6452,7 @@ var import_shared26 = require("@copilotkit/shared");
|
|
|
6407
6452
|
// src/lib/runtime/agui-action.ts
|
|
6408
6453
|
var import_rxjs3 = require("rxjs");
|
|
6409
6454
|
var import_shared24 = require("@copilotkit/shared");
|
|
6410
|
-
function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, graphqlContext }) {
|
|
6455
|
+
function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, agent, metaEvents, threadMetadata, nodeName, context, graphqlContext }) {
|
|
6411
6456
|
const action = {
|
|
6412
6457
|
name: agent.agentId,
|
|
6413
6458
|
description: agent.description,
|
|
@@ -6466,7 +6511,8 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
|
|
|
6466
6511
|
};
|
|
6467
6512
|
return agent.legacy_to_be_removed_runAgentBridged({
|
|
6468
6513
|
tools,
|
|
6469
|
-
forwardedProps
|
|
6514
|
+
forwardedProps,
|
|
6515
|
+
context
|
|
6470
6516
|
}).pipe((0, import_rxjs3.mergeMap)((event) => {
|
|
6471
6517
|
if (event.type === RuntimeEventTypes.RunError) {
|
|
6472
6518
|
const { message } = event;
|
|
@@ -6591,7 +6637,7 @@ async function fetchRemoteInfo({ url, onBeforeRequest, graphqlContext, logger: l
|
|
|
6591
6637
|
}
|
|
6592
6638
|
}
|
|
6593
6639
|
__name(fetchRemoteInfo, "fetchRemoteInfo");
|
|
6594
|
-
async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents, nodeName }) {
|
|
6640
|
+
async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, messages, agentStates, frontendUrl, agents, metaEvents, nodeName, context }) {
|
|
6595
6641
|
var _a;
|
|
6596
6642
|
const logger2 = graphqlContext.logger.child({
|
|
6597
6643
|
component: "remote-actions.fetchRemoteActions"
|
|
@@ -6659,7 +6705,8 @@ async function setupRemoteActions({ remoteEndpointDefinitions, graphqlContext, m
|
|
|
6659
6705
|
metaEvents,
|
|
6660
6706
|
threadMetadata,
|
|
6661
6707
|
nodeName,
|
|
6662
|
-
graphqlContext
|
|
6708
|
+
graphqlContext,
|
|
6709
|
+
context
|
|
6663
6710
|
}));
|
|
6664
6711
|
}
|
|
6665
6712
|
return result.flat();
|
|
@@ -7042,8 +7089,8 @@ __name(UnknownErrorResponse, "UnknownErrorResponse");
|
|
|
7042
7089
|
var import_shared28 = require("@copilotkit/shared");
|
|
7043
7090
|
|
|
7044
7091
|
// src/graphql/types/agents-response.type.ts
|
|
7045
|
-
var
|
|
7046
|
-
function
|
|
7092
|
+
var import_type_graphql20 = require("type-graphql");
|
|
7093
|
+
function _ts_decorate19(decorators, target, key, desc) {
|
|
7047
7094
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7048
7095
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7049
7096
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7053,50 +7100,50 @@ function _ts_decorate18(decorators, target, key, desc) {
|
|
|
7053
7100
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7054
7101
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7055
7102
|
}
|
|
7056
|
-
__name(
|
|
7057
|
-
function
|
|
7103
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
7104
|
+
function _ts_metadata19(k, v) {
|
|
7058
7105
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7059
7106
|
return Reflect.metadata(k, v);
|
|
7060
7107
|
}
|
|
7061
|
-
__name(
|
|
7108
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
7062
7109
|
var Agent = class {
|
|
7063
7110
|
id;
|
|
7064
7111
|
name;
|
|
7065
7112
|
description;
|
|
7066
7113
|
};
|
|
7067
7114
|
__name(Agent, "Agent");
|
|
7068
|
-
|
|
7069
|
-
(0,
|
|
7070
|
-
|
|
7115
|
+
_ts_decorate19([
|
|
7116
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
7117
|
+
_ts_metadata19("design:type", String)
|
|
7071
7118
|
], Agent.prototype, "id", void 0);
|
|
7072
|
-
|
|
7073
|
-
(0,
|
|
7074
|
-
|
|
7119
|
+
_ts_decorate19([
|
|
7120
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
7121
|
+
_ts_metadata19("design:type", String)
|
|
7075
7122
|
], Agent.prototype, "name", void 0);
|
|
7076
|
-
|
|
7077
|
-
(0,
|
|
7078
|
-
|
|
7123
|
+
_ts_decorate19([
|
|
7124
|
+
(0, import_type_graphql20.Field)(() => String),
|
|
7125
|
+
_ts_metadata19("design:type", String)
|
|
7079
7126
|
], Agent.prototype, "description", void 0);
|
|
7080
|
-
Agent =
|
|
7081
|
-
(0,
|
|
7127
|
+
Agent = _ts_decorate19([
|
|
7128
|
+
(0, import_type_graphql20.ObjectType)()
|
|
7082
7129
|
], Agent);
|
|
7083
7130
|
var AgentsResponse = class {
|
|
7084
7131
|
agents;
|
|
7085
7132
|
};
|
|
7086
7133
|
__name(AgentsResponse, "AgentsResponse");
|
|
7087
|
-
|
|
7088
|
-
(0,
|
|
7134
|
+
_ts_decorate19([
|
|
7135
|
+
(0, import_type_graphql20.Field)(() => [
|
|
7089
7136
|
Agent
|
|
7090
7137
|
]),
|
|
7091
|
-
|
|
7138
|
+
_ts_metadata19("design:type", Array)
|
|
7092
7139
|
], AgentsResponse.prototype, "agents", void 0);
|
|
7093
|
-
AgentsResponse =
|
|
7094
|
-
(0,
|
|
7140
|
+
AgentsResponse = _ts_decorate19([
|
|
7141
|
+
(0, import_type_graphql20.ObjectType)()
|
|
7095
7142
|
], AgentsResponse);
|
|
7096
7143
|
|
|
7097
7144
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
7098
7145
|
var import_shared29 = require("@copilotkit/shared");
|
|
7099
|
-
function
|
|
7146
|
+
function _ts_decorate20(decorators, target, key, desc) {
|
|
7100
7147
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7101
7148
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7102
7149
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7106,12 +7153,12 @@ function _ts_decorate19(decorators, target, key, desc) {
|
|
|
7106
7153
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7107
7154
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7108
7155
|
}
|
|
7109
|
-
__name(
|
|
7110
|
-
function
|
|
7156
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
7157
|
+
function _ts_metadata20(k, v) {
|
|
7111
7158
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7112
7159
|
return Reflect.metadata(k, v);
|
|
7113
7160
|
}
|
|
7114
|
-
__name(
|
|
7161
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
7115
7162
|
function _ts_param(paramIndex, decorator) {
|
|
7116
7163
|
return function(target, key) {
|
|
7117
7164
|
decorator(target, key, paramIndex);
|
|
@@ -7260,7 +7307,8 @@ var CopilotResolver = class {
|
|
|
7260
7307
|
agentStates: data.agentStates,
|
|
7261
7308
|
url: data.frontend.url,
|
|
7262
7309
|
extensions: data.extensions,
|
|
7263
|
-
metaEvents: data.metaEvents
|
|
7310
|
+
metaEvents: data.metaEvents,
|
|
7311
|
+
context: data.context
|
|
7264
7312
|
});
|
|
7265
7313
|
} catch (error) {
|
|
7266
7314
|
if ((0, import_shared29.isStructuredCopilotKitError)(error) || ((_e = error == null ? void 0 : error.extensions) == null ? void 0 : _e.visibility)) {
|
|
@@ -7657,38 +7705,38 @@ var CopilotResolver = class {
|
|
|
7657
7705
|
}
|
|
7658
7706
|
};
|
|
7659
7707
|
__name(CopilotResolver, "CopilotResolver");
|
|
7660
|
-
|
|
7661
|
-
(0,
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7708
|
+
_ts_decorate20([
|
|
7709
|
+
(0, import_type_graphql21.Query)(() => String),
|
|
7710
|
+
_ts_metadata20("design:type", Function),
|
|
7711
|
+
_ts_metadata20("design:paramtypes", []),
|
|
7712
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7665
7713
|
], CopilotResolver.prototype, "hello", null);
|
|
7666
|
-
|
|
7667
|
-
(0,
|
|
7668
|
-
_ts_param(0, (0,
|
|
7669
|
-
|
|
7670
|
-
|
|
7714
|
+
_ts_decorate20([
|
|
7715
|
+
(0, import_type_graphql21.Query)(() => AgentsResponse),
|
|
7716
|
+
_ts_param(0, (0, import_type_graphql21.Ctx)()),
|
|
7717
|
+
_ts_metadata20("design:type", Function),
|
|
7718
|
+
_ts_metadata20("design:paramtypes", [
|
|
7671
7719
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext
|
|
7672
7720
|
]),
|
|
7673
|
-
|
|
7721
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7674
7722
|
], CopilotResolver.prototype, "availableAgents", null);
|
|
7675
|
-
|
|
7676
|
-
(0,
|
|
7677
|
-
_ts_param(0, (0,
|
|
7678
|
-
_ts_param(1, (0,
|
|
7679
|
-
_ts_param(2, (0,
|
|
7723
|
+
_ts_decorate20([
|
|
7724
|
+
(0, import_type_graphql21.Mutation)(() => CopilotResponse),
|
|
7725
|
+
_ts_param(0, (0, import_type_graphql21.Ctx)()),
|
|
7726
|
+
_ts_param(1, (0, import_type_graphql21.Arg)("data")),
|
|
7727
|
+
_ts_param(2, (0, import_type_graphql21.Arg)("properties", () => import_graphql_scalars2.GraphQLJSONObject, {
|
|
7680
7728
|
nullable: true
|
|
7681
7729
|
})),
|
|
7682
|
-
|
|
7683
|
-
|
|
7730
|
+
_ts_metadata20("design:type", Function),
|
|
7731
|
+
_ts_metadata20("design:paramtypes", [
|
|
7684
7732
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
7685
7733
|
typeof GenerateCopilotResponseInput === "undefined" ? Object : GenerateCopilotResponseInput,
|
|
7686
7734
|
typeof CopilotRequestContextProperties === "undefined" ? Object : CopilotRequestContextProperties
|
|
7687
7735
|
]),
|
|
7688
|
-
|
|
7736
|
+
_ts_metadata20("design:returntype", Promise)
|
|
7689
7737
|
], CopilotResolver.prototype, "generateCopilotResponse", null);
|
|
7690
|
-
CopilotResolver =
|
|
7691
|
-
(0,
|
|
7738
|
+
CopilotResolver = _ts_decorate20([
|
|
7739
|
+
(0, import_type_graphql21.Resolver)(() => CopilotResponse)
|
|
7692
7740
|
], CopilotResolver);
|
|
7693
7741
|
|
|
7694
7742
|
// src/lib/integrations/shared.ts
|
|
@@ -7723,13 +7771,13 @@ function createLogger(options) {
|
|
|
7723
7771
|
__name(createLogger, "createLogger");
|
|
7724
7772
|
|
|
7725
7773
|
// src/graphql/resolvers/state.resolver.ts
|
|
7726
|
-
var import_type_graphql23 = require("type-graphql");
|
|
7727
7774
|
var import_type_graphql24 = require("type-graphql");
|
|
7728
7775
|
var import_type_graphql25 = require("type-graphql");
|
|
7776
|
+
var import_type_graphql26 = require("type-graphql");
|
|
7729
7777
|
|
|
7730
7778
|
// src/graphql/types/load-agent-state-response.type.ts
|
|
7731
|
-
var
|
|
7732
|
-
function
|
|
7779
|
+
var import_type_graphql22 = require("type-graphql");
|
|
7780
|
+
function _ts_decorate21(decorators, target, key, desc) {
|
|
7733
7781
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7734
7782
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7735
7783
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7739,12 +7787,12 @@ function _ts_decorate20(decorators, target, key, desc) {
|
|
|
7739
7787
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7740
7788
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7741
7789
|
}
|
|
7742
|
-
__name(
|
|
7743
|
-
function
|
|
7790
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
7791
|
+
function _ts_metadata21(k, v) {
|
|
7744
7792
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7745
7793
|
return Reflect.metadata(k, v);
|
|
7746
7794
|
}
|
|
7747
|
-
__name(
|
|
7795
|
+
__name(_ts_metadata21, "_ts_metadata");
|
|
7748
7796
|
var LoadAgentStateResponse = class {
|
|
7749
7797
|
threadId;
|
|
7750
7798
|
threadExists;
|
|
@@ -7752,29 +7800,29 @@ var LoadAgentStateResponse = class {
|
|
|
7752
7800
|
messages;
|
|
7753
7801
|
};
|
|
7754
7802
|
__name(LoadAgentStateResponse, "LoadAgentStateResponse");
|
|
7755
|
-
|
|
7756
|
-
(0,
|
|
7757
|
-
|
|
7803
|
+
_ts_decorate21([
|
|
7804
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7805
|
+
_ts_metadata21("design:type", String)
|
|
7758
7806
|
], LoadAgentStateResponse.prototype, "threadId", void 0);
|
|
7759
|
-
|
|
7760
|
-
(0,
|
|
7761
|
-
|
|
7807
|
+
_ts_decorate21([
|
|
7808
|
+
(0, import_type_graphql22.Field)(() => Boolean),
|
|
7809
|
+
_ts_metadata21("design:type", Boolean)
|
|
7762
7810
|
], LoadAgentStateResponse.prototype, "threadExists", void 0);
|
|
7763
|
-
|
|
7764
|
-
(0,
|
|
7765
|
-
|
|
7811
|
+
_ts_decorate21([
|
|
7812
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7813
|
+
_ts_metadata21("design:type", String)
|
|
7766
7814
|
], LoadAgentStateResponse.prototype, "state", void 0);
|
|
7767
|
-
|
|
7768
|
-
(0,
|
|
7769
|
-
|
|
7815
|
+
_ts_decorate21([
|
|
7816
|
+
(0, import_type_graphql22.Field)(() => String),
|
|
7817
|
+
_ts_metadata21("design:type", String)
|
|
7770
7818
|
], LoadAgentStateResponse.prototype, "messages", void 0);
|
|
7771
|
-
LoadAgentStateResponse =
|
|
7772
|
-
(0,
|
|
7819
|
+
LoadAgentStateResponse = _ts_decorate21([
|
|
7820
|
+
(0, import_type_graphql22.ObjectType)()
|
|
7773
7821
|
], LoadAgentStateResponse);
|
|
7774
7822
|
|
|
7775
7823
|
// src/graphql/inputs/load-agent-state.input.ts
|
|
7776
|
-
var
|
|
7777
|
-
function
|
|
7824
|
+
var import_type_graphql23 = require("type-graphql");
|
|
7825
|
+
function _ts_decorate22(decorators, target, key, desc) {
|
|
7778
7826
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7779
7827
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7780
7828
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7784,32 +7832,32 @@ function _ts_decorate21(decorators, target, key, desc) {
|
|
|
7784
7832
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7785
7833
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7786
7834
|
}
|
|
7787
|
-
__name(
|
|
7788
|
-
function
|
|
7835
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
7836
|
+
function _ts_metadata22(k, v) {
|
|
7789
7837
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7790
7838
|
return Reflect.metadata(k, v);
|
|
7791
7839
|
}
|
|
7792
|
-
__name(
|
|
7840
|
+
__name(_ts_metadata22, "_ts_metadata");
|
|
7793
7841
|
var LoadAgentStateInput = class {
|
|
7794
7842
|
threadId;
|
|
7795
7843
|
agentName;
|
|
7796
7844
|
};
|
|
7797
7845
|
__name(LoadAgentStateInput, "LoadAgentStateInput");
|
|
7798
|
-
|
|
7799
|
-
(0,
|
|
7800
|
-
|
|
7846
|
+
_ts_decorate22([
|
|
7847
|
+
(0, import_type_graphql23.Field)(() => String),
|
|
7848
|
+
_ts_metadata22("design:type", String)
|
|
7801
7849
|
], LoadAgentStateInput.prototype, "threadId", void 0);
|
|
7802
|
-
|
|
7803
|
-
(0,
|
|
7804
|
-
|
|
7850
|
+
_ts_decorate22([
|
|
7851
|
+
(0, import_type_graphql23.Field)(() => String),
|
|
7852
|
+
_ts_metadata22("design:type", String)
|
|
7805
7853
|
], LoadAgentStateInput.prototype, "agentName", void 0);
|
|
7806
|
-
LoadAgentStateInput =
|
|
7807
|
-
(0,
|
|
7854
|
+
LoadAgentStateInput = _ts_decorate22([
|
|
7855
|
+
(0, import_type_graphql23.InputType)()
|
|
7808
7856
|
], LoadAgentStateInput);
|
|
7809
7857
|
|
|
7810
7858
|
// src/graphql/resolvers/state.resolver.ts
|
|
7811
7859
|
var import_shared30 = require("@copilotkit/shared");
|
|
7812
|
-
function
|
|
7860
|
+
function _ts_decorate23(decorators, target, key, desc) {
|
|
7813
7861
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7814
7862
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
7815
7863
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7819,12 +7867,12 @@ function _ts_decorate22(decorators, target, key, desc) {
|
|
|
7819
7867
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7820
7868
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7821
7869
|
}
|
|
7822
|
-
__name(
|
|
7823
|
-
function
|
|
7870
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
7871
|
+
function _ts_metadata23(k, v) {
|
|
7824
7872
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
7825
7873
|
return Reflect.metadata(k, v);
|
|
7826
7874
|
}
|
|
7827
|
-
__name(
|
|
7875
|
+
__name(_ts_metadata23, "_ts_metadata");
|
|
7828
7876
|
function _ts_param2(paramIndex, decorator) {
|
|
7829
7877
|
return function(target, key) {
|
|
7830
7878
|
decorator(target, key, paramIndex);
|
|
@@ -7849,19 +7897,19 @@ var StateResolver = class {
|
|
|
7849
7897
|
}
|
|
7850
7898
|
};
|
|
7851
7899
|
__name(StateResolver, "StateResolver");
|
|
7852
|
-
|
|
7853
|
-
(0,
|
|
7854
|
-
_ts_param2(0, (0,
|
|
7855
|
-
_ts_param2(1, (0,
|
|
7856
|
-
|
|
7857
|
-
|
|
7900
|
+
_ts_decorate23([
|
|
7901
|
+
(0, import_type_graphql26.Query)(() => LoadAgentStateResponse),
|
|
7902
|
+
_ts_param2(0, (0, import_type_graphql25.Ctx)()),
|
|
7903
|
+
_ts_param2(1, (0, import_type_graphql24.Arg)("data")),
|
|
7904
|
+
_ts_metadata23("design:type", Function),
|
|
7905
|
+
_ts_metadata23("design:paramtypes", [
|
|
7858
7906
|
typeof GraphQLContext === "undefined" ? Object : GraphQLContext,
|
|
7859
7907
|
typeof LoadAgentStateInput === "undefined" ? Object : LoadAgentStateInput
|
|
7860
7908
|
]),
|
|
7861
|
-
|
|
7909
|
+
_ts_metadata23("design:returntype", Promise)
|
|
7862
7910
|
], StateResolver.prototype, "loadAgentState", null);
|
|
7863
|
-
StateResolver =
|
|
7864
|
-
(0,
|
|
7911
|
+
StateResolver = _ts_decorate23([
|
|
7912
|
+
(0, import_type_graphql24.Resolver)(() => LoadAgentStateResponse)
|
|
7865
7913
|
], StateResolver);
|
|
7866
7914
|
|
|
7867
7915
|
// src/lib/integrations/shared.ts
|
|
@@ -7892,7 +7940,7 @@ async function createContext(initialContext, copilotKitContext, contextLogger, p
|
|
|
7892
7940
|
__name(createContext, "createContext");
|
|
7893
7941
|
function buildSchema(options = {}) {
|
|
7894
7942
|
logger.debug("Building GraphQL schema...");
|
|
7895
|
-
const schema = (0,
|
|
7943
|
+
const schema = (0, import_type_graphql27.buildSchemaSync)({
|
|
7896
7944
|
resolvers: [
|
|
7897
7945
|
CopilotResolver,
|
|
7898
7946
|
StateResolver
|
|
@@ -8205,12 +8253,22 @@ var LangGraphAgent = class extends import_langgraph.LangGraphAgent {
|
|
|
8205
8253
|
return processedEvent;
|
|
8206
8254
|
}));
|
|
8207
8255
|
}
|
|
8208
|
-
langGraphDefaultMergeState(state, messages,
|
|
8209
|
-
const
|
|
8256
|
+
langGraphDefaultMergeState(state, messages, input) {
|
|
8257
|
+
const aguiMergedState = super.langGraphDefaultMergeState(state, messages, input);
|
|
8258
|
+
const { tools: returnedTools, "ag-ui": agui } = aguiMergedState;
|
|
8259
|
+
const rawCombinedTools = [
|
|
8260
|
+
...returnedTools ?? [],
|
|
8261
|
+
...(agui == null ? void 0 : agui.tools) ?? []
|
|
8262
|
+
];
|
|
8263
|
+
const combinedTools = Array.from(new Map(rawCombinedTools.map((t) => [
|
|
8264
|
+
(t == null ? void 0 : t.id) ?? (t == null ? void 0 : t.name) ?? (t == null ? void 0 : t.key) ?? JSON.stringify(t),
|
|
8265
|
+
t
|
|
8266
|
+
])).values());
|
|
8210
8267
|
return {
|
|
8211
|
-
...
|
|
8268
|
+
...aguiMergedState,
|
|
8212
8269
|
copilotkit: {
|
|
8213
|
-
actions:
|
|
8270
|
+
actions: combinedTools,
|
|
8271
|
+
context: (agui == null ? void 0 : agui.context) ?? []
|
|
8214
8272
|
}
|
|
8215
8273
|
};
|
|
8216
8274
|
}
|