@toolplex/client 0.1.30 → 0.1.31
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/server-manager/serverManager.js +30 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
|
@@ -6,6 +6,22 @@ import * as path from "path";
|
|
|
6
6
|
import { FileLogger } from "../shared/fileLogger.js";
|
|
7
7
|
import envPaths from "env-paths";
|
|
8
8
|
import { getEnhancedPath } from "../shared/enhancedPath.js";
|
|
9
|
+
import { version } from "../version.js";
|
|
10
|
+
/**
|
|
11
|
+
* A permissive JSON Schema validator that doesn't fail on unresolved $ref.
|
|
12
|
+
* This is needed because MCP SDK 1.22.0 uses AJV which throws errors when
|
|
13
|
+
* output schemas have $ref references to $defs that aren't in the schema
|
|
14
|
+
* (e.g., "#/$defs/TextContent" from Pydantic/FastMCP-generated schemas).
|
|
15
|
+
*/
|
|
16
|
+
class PermissiveJsonSchemaValidator {
|
|
17
|
+
getValidator(_schema) {
|
|
18
|
+
return (input) => ({
|
|
19
|
+
valid: true,
|
|
20
|
+
data: input,
|
|
21
|
+
errorMessage: undefined,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
9
25
|
const logger = FileLogger;
|
|
10
26
|
export class ServerManager {
|
|
11
27
|
constructor() {
|
|
@@ -247,7 +263,17 @@ export class ServerManager {
|
|
|
247
263
|
// like "npx", "uvx", "git" will resolve to bundled versions first.
|
|
248
264
|
// We use process.env.PATH directly instead of rebuilding with getEnhancedPath()
|
|
249
265
|
// to preserve the bundled directories that were set up by Electron.
|
|
250
|
-
|
|
266
|
+
let inheritedPath = process.env.PATH || getEnhancedPath();
|
|
267
|
+
// When npx downloads and runs packages, it spawns child processes
|
|
268
|
+
// that need to find 'node' in PATH. The bundled node directory MUST be explicitly
|
|
269
|
+
// prepended to PATH to ensure child processes can find the node executable.
|
|
270
|
+
if (process.env.TOOLPLEX_NODE_PATH) {
|
|
271
|
+
const nodeDir = path.dirname(process.env.TOOLPLEX_NODE_PATH);
|
|
272
|
+
const pathDelimiter = process.platform === "win32" ? ";" : ":";
|
|
273
|
+
if (nodeDir && !inheritedPath.startsWith(nodeDir)) {
|
|
274
|
+
inheritedPath = nodeDir + pathDelimiter + inheritedPath;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
251
277
|
// For the command itself, resolve it properly handling the case where
|
|
252
278
|
// bundled npm/npx on Unix are .js scripts that need to be invoked via node.
|
|
253
279
|
let resolvedCommand = config.command;
|
|
@@ -280,7 +306,9 @@ export class ServerManager {
|
|
|
280
306
|
else {
|
|
281
307
|
throw new Error(`Invalid transport type: ${config.transport}`);
|
|
282
308
|
}
|
|
283
|
-
const client = new Client({ name: serverId, version
|
|
309
|
+
const client = new Client({ name: serverId, version }, {
|
|
310
|
+
jsonSchemaValidator: new PermissiveJsonSchemaValidator(),
|
|
311
|
+
});
|
|
284
312
|
try {
|
|
285
313
|
const toolsResponse = await this.connectWithHandshakeTimeout(client, transport, 60000, stderrBuffer, serverId);
|
|
286
314
|
const tools = toolsResponse.tools || [];
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.1.
|
|
1
|
+
export declare const version = "0.1.31";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.1.
|
|
1
|
+
export const version = '0.1.31';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolplex/client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"author": "ToolPlex LLC",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"description": "The official ToolPlex client for AI agent tool discovery and execution",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"ai-integration"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
47
|
+
"@modelcontextprotocol/sdk": "^1.22.0",
|
|
48
48
|
"@types/node": "^22.13.11",
|
|
49
49
|
"@types/node-fetch": "^2.6.12",
|
|
50
50
|
"@types/which": "^3.0.4",
|