* Extract the primary file/directory path from a tool_use input. * Handles both `file_path` (Read/Write/Edit) and `path` (Grep/Glob).
(toolInput: unknown)
| 69 | * Handles both `file_path` (Read/Write/Edit) and `path` (Grep/Glob). |
| 70 | */ |
| 71 | function getFilePathFromToolInput(toolInput: unknown): string | undefined { |
| 72 | const input = toolInput as |
| 73 | | { file_path?: string; path?: string; pattern?: string; glob?: string } |
| 74 | | undefined |
| 75 | return input?.file_path ?? input?.path |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Check if a search tool use targets memory files by examining its path, pattern, and glob. |
no outgoing calls
no test coverage detected