@blaxel/core 0.2.11-dev.88 → 0.2.11-dev.89
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/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +2 -2
- package/dist/tools/mcpTool.d.ts +1 -1
- package/dist/tools/mcpTool.js +2 -4
- package/package.json +1 -1
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Function } from "../client/client.js";
|
|
2
2
|
import { Tool } from "./types.js";
|
|
3
|
-
export declare const getTool: (name: string) => Promise<Tool[]>;
|
|
3
|
+
export declare const getTool: (name: string, ms?: number) => Promise<Tool[]>;
|
|
4
4
|
export declare class BLTools {
|
|
5
5
|
toolNames: string[];
|
|
6
6
|
constructor(toolNames: string[]);
|
package/dist/tools/index.js
CHANGED
|
@@ -5,8 +5,8 @@ const index_js_1 = require("../cache/index.js");
|
|
|
5
5
|
const client_js_1 = require("../client/client.js");
|
|
6
6
|
const env_js_1 = require("../common/env.js");
|
|
7
7
|
const mcpTool_js_1 = require("./mcpTool.js");
|
|
8
|
-
const getTool = async (name) => {
|
|
9
|
-
return await (0, mcpTool_js_1.getMcpTool)(name);
|
|
8
|
+
const getTool = async (name, ms) => {
|
|
9
|
+
return await (0, mcpTool_js_1.getMcpTool)(name, ms);
|
|
10
10
|
};
|
|
11
11
|
exports.getTool = getTool;
|
|
12
12
|
class BLTools {
|
package/dist/tools/mcpTool.d.ts
CHANGED
|
@@ -20,4 +20,4 @@ export declare class McpTool {
|
|
|
20
20
|
listTools(): Promise<Tool[]>;
|
|
21
21
|
call(toolName: string, args: Record<string, unknown> | undefined): Promise<unknown>;
|
|
22
22
|
}
|
|
23
|
-
export declare const getMcpTool: (name: string) => Promise<Tool[]>;
|
|
23
|
+
export declare const getMcpTool: (name: string, ms?: number) => Promise<Tool[]>;
|
package/dist/tools/mcpTool.js
CHANGED
|
@@ -78,7 +78,6 @@ class McpTool {
|
|
|
78
78
|
await (0, index_js_2.authenticate)();
|
|
79
79
|
try {
|
|
80
80
|
logger_js_1.logger.debug(`MCP:${this.name}:Connecting::${this.url.toString()}`);
|
|
81
|
-
console.log("MCP: Connecting to");
|
|
82
81
|
this.transport = new client_js_1.BlaxelMcpClientTransport(this.url.toString(), settings_js_1.settings.headers);
|
|
83
82
|
await this.client.connect(this.transport);
|
|
84
83
|
logger_js_1.logger.debug(`MCP:${this.name}:Connected`);
|
|
@@ -131,7 +130,6 @@ class McpTool {
|
|
|
131
130
|
logger_js_1.logger.debug(`MCP:${this.name}:Listing tools`);
|
|
132
131
|
await this.start();
|
|
133
132
|
const { tools } = (await this.client.listTools());
|
|
134
|
-
logger_js_1.logger.debug(`MCP:${this.name}:Listed tools result`, tools);
|
|
135
133
|
await this.close();
|
|
136
134
|
const result = tools.map((tool) => {
|
|
137
135
|
return {
|
|
@@ -191,11 +189,11 @@ class McpTool {
|
|
|
191
189
|
}
|
|
192
190
|
}
|
|
193
191
|
exports.McpTool = McpTool;
|
|
194
|
-
const getMcpTool = async (name) => {
|
|
192
|
+
const getMcpTool = async (name, ms) => {
|
|
195
193
|
let tool = McpToolCache.get(name);
|
|
196
194
|
if (!tool) {
|
|
197
195
|
logger_js_1.logger.debug(`MCP:${name}:Creating new tool`);
|
|
198
|
-
tool = new McpTool(name);
|
|
196
|
+
tool = new McpTool(name, ms);
|
|
199
197
|
McpToolCache.set(name, tool);
|
|
200
198
|
}
|
|
201
199
|
return await tool.listTools();
|