@copilotkit/runtime 1.8.7-next.0 → 1.8.8-next.0
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 +15 -0
- package/dist/{chunk-RU5CS42E.mjs → chunk-5TUGSSSM.mjs} +2 -2
- package/dist/{chunk-CWPYW7XE.mjs → chunk-62XKONGF.mjs} +2 -2
- package/dist/{chunk-JSV26III.mjs → chunk-XXKM3PJL.mjs} +22 -14
- package/dist/chunk-XXKM3PJL.mjs.map +1 -0
- package/dist/{chunk-BXJZ5GEO.mjs → chunk-YM7JEVJF.mjs} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +21 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +21 -13
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.d.ts +2 -2
- package/dist/lib/integrations/index.js +1 -1
- 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 +1 -1
- package/dist/lib/integrations/nest/index.js +1 -1
- 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 +1 -1
- package/dist/lib/integrations/node-express/index.js +1 -1
- 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 +1 -1
- package/dist/lib/integrations/node-http/index.js +1 -1
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/dist/{shared-350db43f.d.ts → shared-e61e0ebb.d.ts} +4 -4
- package/package.json +2 -2
- package/src/lib/runtime/copilot-runtime.ts +34 -24
- package/dist/chunk-JSV26III.mjs.map +0 -1
- /package/dist/{chunk-RU5CS42E.mjs.map → chunk-5TUGSSSM.mjs.map} +0 -0
- /package/dist/{chunk-CWPYW7XE.mjs.map → chunk-62XKONGF.mjs.map} +0 -0
- /package/dist/{chunk-BXJZ5GEO.mjs.map → chunk-YM7JEVJF.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @copilotkit/runtime
|
|
2
2
|
|
|
3
|
+
## 1.8.8-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dfb67c3: - refactor: rename mcpEndpoints to mcpServers for naming consistency
|
|
8
|
+
- doc changes
|
|
9
|
+
- @copilotkit/shared@1.8.8-next.0
|
|
10
|
+
|
|
11
|
+
## 1.8.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 8b8474f: - feat: add image input support with multi-model compatibility, pasting, and UX improvements
|
|
16
|
+
- @copilotkit/shared@1.8.7
|
|
17
|
+
|
|
3
18
|
## 1.8.7-next.0
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getCommonConfig,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XXKM3PJL.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
config,
|
|
78
78
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-5TUGSSSM.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XXKM3PJL.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNodeExpressEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-62XKONGF.mjs.map
|
|
@@ -40,7 +40,7 @@ var require_package = __commonJS({
|
|
|
40
40
|
publishConfig: {
|
|
41
41
|
access: "public"
|
|
42
42
|
},
|
|
43
|
-
version: "1.8.
|
|
43
|
+
version: "1.8.8-next.0",
|
|
44
44
|
sideEffects: false,
|
|
45
45
|
main: "./dist/index.js",
|
|
46
46
|
module: "./dist/index.mjs",
|
|
@@ -3023,7 +3023,7 @@ var CopilotRuntime = class {
|
|
|
3023
3023
|
observability;
|
|
3024
3024
|
availableAgents;
|
|
3025
3025
|
// +++ MCP Properties +++
|
|
3026
|
-
|
|
3026
|
+
mcpServersConfig;
|
|
3027
3027
|
mcpActionCache = /* @__PURE__ */ new Map();
|
|
3028
3028
|
// --- MCP Properties ---
|
|
3029
3029
|
// +++ MCP Client Factory +++
|
|
@@ -3046,14 +3046,14 @@ var CopilotRuntime = class {
|
|
|
3046
3046
|
this.delegateAgentProcessingToServiceAdapter = (params == null ? void 0 : params.delegateAgentProcessingToServiceAdapter) || false;
|
|
3047
3047
|
this.observability = params == null ? void 0 : params.observability_c;
|
|
3048
3048
|
this.agents = (params == null ? void 0 : params.agents) ?? {};
|
|
3049
|
-
this.
|
|
3049
|
+
this.mcpServersConfig = params == null ? void 0 : params.mcpServers;
|
|
3050
3050
|
this.createMCPClientImpl = params == null ? void 0 : params.createMCPClient;
|
|
3051
|
-
if (this.
|
|
3051
|
+
if (this.mcpServersConfig && this.mcpServersConfig.length > 0 && !this.createMCPClientImpl) {
|
|
3052
3052
|
throw new CopilotKitMisuseError2({
|
|
3053
|
-
message: "MCP Integration Error: `
|
|
3053
|
+
message: "MCP Integration Error: `mcpServers` were provided, but the `createMCPClient` function was not passed to the CopilotRuntime constructor. Please provide an implementation for `createMCPClient`."
|
|
3054
3054
|
});
|
|
3055
3055
|
}
|
|
3056
|
-
if ((params == null ? void 0 : params.actions) && (((_c = params == null ? void 0 : params.remoteEndpoints) == null ? void 0 : _c.some((e) => e.type === EndpointType.LangGraphPlatform)) || ((_d = this.
|
|
3056
|
+
if ((params == null ? void 0 : params.actions) && (((_c = params == null ? void 0 : params.remoteEndpoints) == null ? void 0 : _c.some((e) => e.type === EndpointType.LangGraphPlatform)) || ((_d = this.mcpServersConfig) == null ? void 0 : _d.length))) {
|
|
3057
3057
|
console.warn("Local 'actions' defined in CopilotRuntime might not be available to remote agents (LangGraph, MCP). Consider defining actions closer to the agent implementation if needed.");
|
|
3058
3058
|
}
|
|
3059
3059
|
}
|
|
@@ -3063,7 +3063,11 @@ var CopilotRuntime = class {
|
|
|
3063
3063
|
if (!mcpActionsForRequest || mcpActionsForRequest.length === 0) {
|
|
3064
3064
|
return messages;
|
|
3065
3065
|
}
|
|
3066
|
-
const
|
|
3066
|
+
const uniqueMcpTools = /* @__PURE__ */ new Map();
|
|
3067
|
+
mcpActionsForRequest.forEach((action) => {
|
|
3068
|
+
uniqueMcpTools.set(action.name, action);
|
|
3069
|
+
});
|
|
3070
|
+
const mcpToolInstructions = Array.from(uniqueMcpTools.values()).map((action) => {
|
|
3067
3071
|
const paramsString = action.parameters && action.parameters.length > 0 ? ` Parameters: ${action.parameters.map((p) => `${p.name}${p.required ? "*" : ""}(${p.type})`).join(", ")}` : "";
|
|
3068
3072
|
return `- ${action.name}:${paramsString} ${action.description || ""}`;
|
|
3069
3073
|
}).join("\n");
|
|
@@ -3646,7 +3650,7 @@ please use an LLM adapter instead.`
|
|
|
3646
3650
|
}
|
|
3647
3651
|
}
|
|
3648
3652
|
async getServerSideActions(request) {
|
|
3649
|
-
var _a;
|
|
3653
|
+
var _a, _b;
|
|
3650
3654
|
const { graphqlContext, messages: rawMessages, agentStates, url } = request;
|
|
3651
3655
|
const inputMessages = convertGqlInputToMessages(rawMessages);
|
|
3652
3656
|
const langserveFunctions = [];
|
|
@@ -3676,11 +3680,17 @@ please use an LLM adapter instead.`
|
|
|
3676
3680
|
}) : this.actions;
|
|
3677
3681
|
const requestSpecificMCPActions = [];
|
|
3678
3682
|
if (this.createMCPClientImpl) {
|
|
3679
|
-
const baseEndpoints = this.
|
|
3680
|
-
const requestEndpoints = ((_a = graphqlContext.properties) == null ? void 0 : _a.mcpEndpoints) || [];
|
|
3683
|
+
const baseEndpoints = this.mcpServersConfig || [];
|
|
3684
|
+
const requestEndpoints = ((_a = graphqlContext.properties) == null ? void 0 : _a.mcpServers) || ((_b = graphqlContext.properties) == null ? void 0 : _b.mcpEndpoints) || [];
|
|
3681
3685
|
const effectiveEndpointsMap = /* @__PURE__ */ new Map();
|
|
3682
3686
|
[
|
|
3683
|
-
...baseEndpoints
|
|
3687
|
+
...baseEndpoints
|
|
3688
|
+
].forEach((ep) => {
|
|
3689
|
+
if (ep && ep.endpoint) {
|
|
3690
|
+
effectiveEndpointsMap.set(ep.endpoint, ep);
|
|
3691
|
+
}
|
|
3692
|
+
});
|
|
3693
|
+
[
|
|
3684
3694
|
...requestEndpoints
|
|
3685
3695
|
].forEach((ep) => {
|
|
3686
3696
|
if (ep && ep.endpoint) {
|
|
@@ -3694,12 +3704,10 @@ please use an LLM adapter instead.`
|
|
|
3694
3704
|
if (!actionsForEndpoint) {
|
|
3695
3705
|
let client = null;
|
|
3696
3706
|
try {
|
|
3697
|
-
console.log(`MCP: Cache miss. Fetching tools for endpoint: ${endpointUrl}`);
|
|
3698
3707
|
client = await this.createMCPClientImpl(config);
|
|
3699
3708
|
const tools = await client.tools();
|
|
3700
3709
|
actionsForEndpoint = convertMCPToolsToActions(tools, endpointUrl);
|
|
3701
3710
|
this.mcpActionCache.set(endpointUrl, actionsForEndpoint);
|
|
3702
|
-
console.log(`MCP: Fetched and cached ${actionsForEndpoint.length} tools for ${endpointUrl}`);
|
|
3703
3711
|
} catch (error) {
|
|
3704
3712
|
console.error(`MCP: Failed to fetch tools from endpoint ${endpointUrl}. Skipping. Error:`, error);
|
|
3705
3713
|
actionsForEndpoint = [];
|
|
@@ -4987,4 +4995,4 @@ export {
|
|
|
4987
4995
|
getCommonConfig,
|
|
4988
4996
|
copilotRuntimeNodeHttpEndpoint
|
|
4989
4997
|
};
|
|
4990
|
-
//# sourceMappingURL=chunk-
|
|
4998
|
+
//# sourceMappingURL=chunk-XXKM3PJL.mjs.map
|