From 15b48953512d2e69f0e39e2b80671d4be23e27e8 Mon Sep 17 00:00:00 2001 From: thzxx Date: Fri, 24 Apr 2026 13:56:30 +0800 Subject: [PATCH] fix: replace 'as any' with proper type assertion for git tool args The git tool handler in ipc.ts was using 'args as any' to bypass type checking. Replaced with the explicit typed params interface matching handleGit's signature to maintain type safety. --- src/main/ipc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/ipc.ts b/src/main/ipc.ts index c40091c..3214c21 100644 --- a/src/main/ipc.ts +++ b/src/main/ipc.ts @@ -187,7 +187,7 @@ export async function setupIPC(): Promise { case 'diff_files': result = await handleDiffFiles(args as { file1: string; file2: string; context_lines?: number }); break; case 'replace_in_files': result = await handleReplaceInFiles(args as { path: string; glob: string; old_text: string; new_text: string }); break; case 'read_multiple_files':result = await handleReadMultipleFiles(args as { paths: string[]; max_chars_per_file?: number }); break; - case 'git': result = await handleGit(args as any); break; + case 'git': result = await handleGit(args as { action: string; path?: string; files?: string[]; message?: string; branch?: string; remote?: string; remote_url?: string; count?: number; all?: boolean; staged?: boolean; new_branch?: boolean; delete_branch?: boolean; force?: boolean; url?: string }); break; case 'compress': result = await handleCompress(args as { action: string; path: string; destination?: string; format?: string }); break; // v5.0 Browser 控制 case 'browser_open': result = await browserOpen(args.url as string); break;