(task: Task, block: ToolUse<"list_files">)
| 69 | } |
| 70 | |
| 71 | override async handlePartial(task: Task, block: ToolUse<"list_files">): Promise<void> { |
| 72 | const relDirPath: string | undefined = block.params.path |
| 73 | const recursiveRaw: string | undefined = block.params.recursive |
| 74 | const recursive = recursiveRaw?.toLowerCase() === "true" |
| 75 | |
| 76 | const absolutePath = relDirPath ? path.resolve(task.cwd, relDirPath) : task.cwd |
| 77 | const isOutsideWorkspace = isPathOutsideWorkspace(absolutePath) |
| 78 | |
| 79 | const sharedMessageProps: ClineSayTool = { |
| 80 | tool: !recursive ? "listFilesTopLevel" : "listFilesRecursive", |
| 81 | path: getReadablePath(task.cwd, relDirPath ?? ""), |
| 82 | isOutsideWorkspace, |
| 83 | } |
| 84 | |
| 85 | const partialMessage = JSON.stringify({ ...sharedMessageProps, content: "" } satisfies ClineSayTool) |
| 86 | await task.ask("tool", partialMessage, block.partial).catch(() => {}) |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | export const listFilesTool = new ListFilesTool() |
nothing calls this directly
no test coverage detected