logging refactoring
This commit is contained in:
@@ -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}` }],
|
||||
};
|
||||
}
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user