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.
This commit is contained in:
+1
-1
@@ -187,7 +187,7 @@ export async function setupIPC(): Promise<void> {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user