* Extract the primary file/directory path from a tool_use input. * Handles both `file_path` (Read/Write/Edit) and `path` (Grep/Glob).
(toolInput: unknown)
| 91 | * Handles both `file_path` (Read/Write/Edit) and `path` (Grep/Glob). |
| 92 | */ |
| 93 | function getFilePathFromToolInput(toolInput: unknown): string | undefined { |
| 94 | const input = toolInput as |
| 95 | | { file_path?: string; path?: string; pattern?: string; glob?: string } |
| 96 | | undefined |
| 97 | return input?.file_path ?? input?.path |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Check if a search tool use targets memory files by examining its path, pattern, and glob. |
no outgoing calls
no test coverage detected