logging refactoring

This commit is contained in:
azykov@mail.ru
2026-07-09 10:32:10 +03:00
parent 812e36d0af
commit bc5b3572df
10 changed files with 152 additions and 70 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import z from "zod";
import { ToolDef } from "../types"
import { isValidHost, logged } from "../utils/logged";
import { isValidHost } from "../utils/logged";
import { exec } from "node:child_process";
import { promisify } from "node:util";
@@ -15,7 +15,7 @@ export const pingTool: ToolDef = {
count: z.number().int().min(1).max(10).default(4).describe("Echo requests to send"),
},
},
handler: logged('ping', async ({ host, count }) => {
handler: async ({ host, count }) => {
if (!isValidHost(host)) {
return {
isError: true,
@@ -40,5 +40,5 @@ export const pingTool: ToolDef = {
content: [{ type: "text", text: `ping failed:\n${message}` }],
};
}
}),
},
};