@toolplex/client 0.1.2 → 0.1.3
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.
|
@@ -3,6 +3,14 @@ import { CallToolResultSchema } from "../../shared/serverManagerTypes.js";
|
|
|
3
3
|
import { FileLogger } from "../../shared/fileLogger.js";
|
|
4
4
|
import Registry from "../registry.js";
|
|
5
5
|
const logger = FileLogger;
|
|
6
|
+
function safeLength(obj) {
|
|
7
|
+
try {
|
|
8
|
+
return JSON.stringify(obj).length;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return -1;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
6
14
|
export async function handleCallTool(params) {
|
|
7
15
|
await logger.debug(`Handling call tool request with params: ${JSON.stringify(params)}`);
|
|
8
16
|
const serverManagerClients = Registry.getServerManagerClients();
|
|
@@ -42,6 +50,8 @@ export async function handleCallTool(params) {
|
|
|
42
50
|
log_context: {
|
|
43
51
|
server_id: params.server_id,
|
|
44
52
|
tool_name: params.tool_name,
|
|
53
|
+
input_length: safeLength(params),
|
|
54
|
+
response_length: safeLength(content),
|
|
45
55
|
},
|
|
46
56
|
latency_ms: Date.now() - startTime,
|
|
47
57
|
});
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.1.
|
|
1
|
+
export declare const version = "0.1.2";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.1.
|
|
1
|
+
export const version = '0.1.2';
|