(task: Task, block: ToolUse<"search_files">)
| 72 | } |
| 73 | |
| 74 | override async handlePartial(task: Task, block: ToolUse<"search_files">): Promise<void> { |
| 75 | const relDirPath = block.params.path |
| 76 | const regex = block.params.regex |
| 77 | const filePattern = block.params.file_pattern |
| 78 | |
| 79 | const absolutePath = relDirPath ? path.resolve(task.cwd, relDirPath) : task.cwd |
| 80 | const isOutsideWorkspace = isPathOutsideWorkspace(absolutePath) |
| 81 | |
| 82 | const sharedMessageProps: ClineSayTool = { |
| 83 | tool: "searchFiles", |
| 84 | path: getReadablePath(task.cwd, relDirPath ?? ""), |
| 85 | regex: regex ?? "", |
| 86 | filePattern: filePattern ?? "", |
| 87 | isOutsideWorkspace, |
| 88 | } |
| 89 | |
| 90 | const partialMessage = JSON.stringify({ ...sharedMessageProps, content: "" } satisfies ClineSayTool) |
| 91 | await task.ask("tool", partialMessage, block.partial).catch(() => {}) |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | export const searchFilesTool = new SearchFilesTool() |
nothing calls this directly
no test coverage detected