refactor: correct type definitions for ToolInputSchema and error handling in searchFiles function

This commit is contained in:
Marco Beretta 2025-05-31 20:53:12 +02:00
parent a06e999dd6
commit 1386c38b14
No known key found for this signature in database
GPG key ID: D918033D8E74CC11

View file

@ -162,8 +162,8 @@ const GetFileInfoArgsSchema = z.object({
path: z.string(), path: z.string(),
}); });
const ToolInputSchema = ToolSchema.shape.inputSchema; type ToolInputSchema = typeof ToolSchema.shape.inputSchema;
type ToolInput = z.infer<typeof ToolInputSchema>; type ToolInput = z.infer<ToolInputSchema>;
interface FileInfo { interface FileInfo {
size: number; size: number;
@ -237,7 +237,7 @@ async function searchFiles(
if (entry.isDirectory()) { if (entry.isDirectory()) {
await search(fullPath); await search(fullPath);
} }
} catch (error) { } catch {
// Skip invalid paths during search // Skip invalid paths during search
continue; continue;
} }