@toolplex/client 0.1.27 → 0.1.28

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.
@@ -68,7 +68,7 @@ function sanitizeServerConfig(config) {
68
68
  env_count: config.env ? Object.keys(config.env).length : 0,
69
69
  };
70
70
  }
71
- async function installServer(serverId, serverName, description, serverManagerClient, serverConfig) {
71
+ async function installServer(serverId, serverName, description, serverManagerClient, serverConfig, timeoutMs) {
72
72
  await logger.info(`Starting installation of tool ${serverId}: ${serverName}`);
73
73
  await logger.debug(`Server config: ${JSON.stringify(serverConfig)}, Server ID: ${serverId}`);
74
74
  const response = await serverManagerClient.sendRequest("install", {
@@ -76,7 +76,7 @@ async function installServer(serverId, serverName, description, serverManagerCli
76
76
  server_name: serverName,
77
77
  description: description,
78
78
  config: serverConfig,
79
- });
79
+ }, timeoutMs);
80
80
  if ("error" in response) {
81
81
  const error = `Server installation failed: ${response.error.message}`;
82
82
  await logger.error(error);
@@ -147,7 +147,7 @@ export async function handleInstallServer(params) {
147
147
  throw new Error(`Unsupported runtime: ${runtime}`);
148
148
  }
149
149
  // Install server
150
- const installResult = await installServer(server_id, server_name, description, client, config);
150
+ const installResult = await installServer(server_id, server_name, description, client, config, params.timeout_ms);
151
151
  // After successful install, refresh the servers cache
152
152
  await serversCache.refreshCache(serverManagerClients);
153
153
  // List tools on the newly installed server
@@ -180,6 +180,7 @@ export declare const InstallParamsSchema: z.ZodObject<{
180
180
  env?: Record<string, string> | undefined;
181
181
  url?: string | undefined;
182
182
  }>;
183
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
183
184
  }, "strip", z.ZodTypeAny, {
184
185
  server_name: string;
185
186
  description: string;
@@ -194,6 +195,7 @@ export declare const InstallParamsSchema: z.ZodObject<{
194
195
  env?: Record<string, string> | undefined;
195
196
  url?: string | undefined;
196
197
  };
198
+ timeout_ms?: number | undefined;
197
199
  }, {
198
200
  server_name: string;
199
201
  description: string;
@@ -208,6 +210,7 @@ export declare const InstallParamsSchema: z.ZodObject<{
208
210
  env?: Record<string, string> | undefined;
209
211
  url?: string | undefined;
210
212
  };
213
+ timeout_ms?: number | undefined;
211
214
  }>;
212
215
  export type InstallParams = z.infer<typeof InstallParamsSchema>;
213
216
  export declare const ListToolsParamsSchema: z.ZodObject<{
@@ -60,6 +60,7 @@ export const InstallParamsSchema = z.object({
60
60
  server_name: z.string(),
61
61
  description: z.string(),
62
62
  config: ServerConfigSchema,
63
+ timeout_ms: z.number().int().min(10000).max(300000).optional(),
63
64
  });
64
65
  // --------------------
65
66
  // ListToolsParams
@@ -7,6 +7,6 @@ export declare class StdioServerManagerClient {
7
7
  private env;
8
8
  constructor(command: string, args: string[], env?: NodeJS.ProcessEnv);
9
9
  start(): Promise<void>;
10
- sendRequest(method: string, params: any): Promise<any>;
10
+ sendRequest(method: string, params: any, timeoutMs?: number): Promise<any>;
11
11
  stop(): Promise<void>;
12
12
  }
@@ -55,8 +55,9 @@ export class StdioServerManagerClient {
55
55
  this.messageBuffer = "";
56
56
  });
57
57
  }
58
+ async sendRequest(method,
58
59
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
- async sendRequest(method, params) {
60
+ params, timeoutMs = 60000) {
60
61
  return new Promise((resolve, reject) => {
61
62
  const id = Date.now();
62
63
  if (!this.serverProcess?.stdin) {
@@ -84,7 +85,7 @@ export class StdioServerManagerClient {
84
85
  this.messageHandlers.delete(id);
85
86
  reject(new Error(`Request timed out: ${method}`));
86
87
  }
87
- }, 60000);
88
+ }, timeoutMs);
88
89
  });
89
90
  }
90
91
  async stop() {
@@ -60,6 +60,7 @@ export const InstallParamsSchema = z.object({
60
60
  server_name: z.string(),
61
61
  description: z.string(),
62
62
  config: ServerConfigSchema,
63
+ timeout_ms: z.number().int().min(10000).max(300000).optional(),
63
64
  });
64
65
  // --------------------
65
66
  // ListToolsParams
@@ -55,8 +55,9 @@ export class StdioServerManagerClient {
55
55
  this.messageBuffer = "";
56
56
  });
57
57
  }
58
+ async sendRequest(method,
58
59
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
- async sendRequest(method, params) {
60
+ params, timeoutMs = 60000) {
60
61
  return new Promise((resolve, reject) => {
61
62
  const id = Date.now();
62
63
  if (!this.serverProcess?.stdin) {
@@ -84,7 +85,7 @@ export class StdioServerManagerClient {
84
85
  this.messageHandlers.delete(id);
85
86
  reject(new Error(`Request timed out: ${method}`));
86
87
  }
87
- }, 60000);
88
+ }, timeoutMs);
88
89
  });
89
90
  }
90
91
  async stop() {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.1.27";
1
+ export declare const version = "0.1.28";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '0.1.27';
1
+ export const version = '0.1.28';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolplex/client",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
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",