@blaxel/core 0.2.35-preview.78 → 0.2.35
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/common/settings.js
CHANGED
|
@@ -8,7 +8,7 @@ function getPackageVersion() {
|
|
|
8
8
|
try {
|
|
9
9
|
// Try to require package.json (Node.js only, gracefully fails in browser)
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
11
|
-
const packageJson = {"version":"0.2.35
|
|
11
|
+
const packageJson = {"version":"0.2.35","commit":"19931c18b6608532016e6c3567f4692edeb9e747"};
|
|
12
12
|
return packageJson.version || "unknown";
|
|
13
13
|
}
|
|
14
14
|
catch {
|
|
@@ -55,7 +55,7 @@ function getCommitHash() {
|
|
|
55
55
|
try {
|
|
56
56
|
// Try to require package.json and look for commit field (set during build)
|
|
57
57
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
58
|
-
const packageJson = {"version":"0.2.35
|
|
58
|
+
const packageJson = {"version":"0.2.35","commit":"19931c18b6608532016e6c3567f4692edeb9e747"};
|
|
59
59
|
// Check for commit in various possible locations
|
|
60
60
|
const commit = packageJson.commit || packageJson.buildInfo?.commit;
|
|
61
61
|
if (commit) {
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Function } from "../client/client.js";
|
|
2
|
+
import { ToolOptions } from "./mcpTool.js";
|
|
2
3
|
import { Tool } from "./types.js";
|
|
3
|
-
export declare const getTool: (name: string,
|
|
4
|
+
export declare const getTool: (name: string, options?: number | ToolOptions) => Promise<Tool[]>;
|
|
4
5
|
export declare class BLTools {
|
|
5
6
|
toolNames: string[];
|
|
6
7
|
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 internal_js_1 = require("../common/internal.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, options) => {
|
|
9
|
+
return await (0, mcpTool_js_1.getMcpTool)(name, options);
|
|
10
10
|
};
|
|
11
11
|
exports.getTool = getTool;
|
|
12
12
|
class BLTools {
|
package/dist/tools/mcpTool.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Tool } from "./types.js";
|
|
2
|
+
export type ToolOptions = {
|
|
3
|
+
ms?: number;
|
|
4
|
+
meta?: Record<string, unknown> | undefined;
|
|
5
|
+
};
|
|
2
6
|
export declare class McpTool {
|
|
3
7
|
private name;
|
|
4
8
|
private type;
|
|
@@ -7,8 +11,9 @@ export declare class McpTool {
|
|
|
7
11
|
private transport?;
|
|
8
12
|
private timer?;
|
|
9
13
|
private ms;
|
|
14
|
+
private meta;
|
|
10
15
|
private startPromise?;
|
|
11
|
-
constructor(name: string,
|
|
16
|
+
constructor(name: string, options?: ToolOptions | number);
|
|
12
17
|
get fallbackUrl(): import("url").URL | null;
|
|
13
18
|
get externalUrl(): import("url").URL;
|
|
14
19
|
get internalUrl(): import("url").URL;
|
|
@@ -20,4 +25,4 @@ export declare class McpTool {
|
|
|
20
25
|
listTools(): Promise<Tool[]>;
|
|
21
26
|
call(toolName: string, args: Record<string, unknown> | undefined): Promise<unknown>;
|
|
22
27
|
}
|
|
23
|
-
export declare const getMcpTool: (name: string,
|
|
28
|
+
export declare const getMcpTool: (name: string, options?: ToolOptions | number) => Promise<Tool[]>;
|
package/dist/tools/mcpTool.js
CHANGED
|
@@ -19,8 +19,9 @@ class McpTool {
|
|
|
19
19
|
transport;
|
|
20
20
|
timer;
|
|
21
21
|
ms;
|
|
22
|
+
meta;
|
|
22
23
|
startPromise;
|
|
23
|
-
constructor(name,
|
|
24
|
+
constructor(name, options = { ms: 5000 }) {
|
|
24
25
|
this.name = name;
|
|
25
26
|
this.type = "function";
|
|
26
27
|
this.pluralType = "functions";
|
|
@@ -33,8 +34,9 @@ class McpTool {
|
|
|
33
34
|
this.ms = 0;
|
|
34
35
|
}
|
|
35
36
|
else {
|
|
36
|
-
this.ms = ms;
|
|
37
|
+
this.ms = typeof options === "number" ? options : options.ms || 5000;
|
|
37
38
|
}
|
|
39
|
+
this.meta = (typeof options === "object" && options.meta) || undefined;
|
|
38
40
|
this.client = new index_js_1.Client({
|
|
39
41
|
name: this.name,
|
|
40
42
|
version: "1.0.0",
|
|
@@ -178,6 +180,7 @@ class McpTool {
|
|
|
178
180
|
const result = await this.client.callTool({
|
|
179
181
|
name: toolName,
|
|
180
182
|
arguments: args,
|
|
183
|
+
_meta: this.meta
|
|
181
184
|
});
|
|
182
185
|
logger_js_1.logger.debug(`MCP:${this.name}:Tool calling:result`);
|
|
183
186
|
await this.close();
|
|
@@ -203,11 +206,11 @@ class McpTool {
|
|
|
203
206
|
}
|
|
204
207
|
}
|
|
205
208
|
exports.McpTool = McpTool;
|
|
206
|
-
const getMcpTool = async (name,
|
|
209
|
+
const getMcpTool = async (name, options) => {
|
|
207
210
|
let tool = McpToolCache.get(name);
|
|
208
211
|
if (!tool) {
|
|
209
212
|
logger_js_1.logger.debug(`MCP:${name}:Creating new tool`);
|
|
210
|
-
tool = new McpTool(name,
|
|
213
|
+
tool = new McpTool(name, options);
|
|
211
214
|
McpToolCache.set(name, tool);
|
|
212
215
|
}
|
|
213
216
|
return await tool.listTools();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaxel/core",
|
|
3
|
-
"version": "0.2.35
|
|
3
|
+
"version": "0.2.35",
|
|
4
4
|
"description": "Blaxel Core SDK for TypeScript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Blaxel, INC (https://blaxel.ai)",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"vite": "^5.2.0",
|
|
77
77
|
"vitest": "^1.5.0"
|
|
78
78
|
},
|
|
79
|
-
"commit": "
|
|
79
|
+
"commit": "19931c18b6608532016e6c3567f4692edeb9e747",
|
|
80
80
|
"scripts": {
|
|
81
81
|
"lint": "eslint src/",
|
|
82
82
|
"dev": "tsc --watch",
|