(task: Task, block: ToolUse<"read_file">)
| 636 | } |
| 637 | |
| 638 | override async handlePartial(task: Task, block: ToolUse<"read_file">): Promise<void> { |
| 639 | // Handle both legacy and new format for partial display |
| 640 | let filePath = "" |
| 641 | if (block.nativeArgs) { |
| 642 | if (isLegacyReadFileParams(block.nativeArgs)) { |
| 643 | // Legacy format - show first file |
| 644 | filePath = block.nativeArgs.files[0]?.path ?? "" |
| 645 | } else { |
| 646 | filePath = block.nativeArgs.path ?? "" |
| 647 | } |
| 648 | } |
| 649 | |
| 650 | const fullPath = filePath ? path.resolve(task.cwd, filePath) : "" |
| 651 | const sharedMessageProps: ClineSayTool = { |
| 652 | tool: "readFile", |
| 653 | path: getReadablePath(task.cwd, filePath), |
| 654 | isOutsideWorkspace: filePath ? isPathOutsideWorkspace(fullPath) : false, |
| 655 | } |
| 656 | const partialMessage = JSON.stringify({ |
| 657 | ...sharedMessageProps, |
| 658 | content: undefined, |
| 659 | } satisfies ClineSayTool) |
| 660 | await task.ask("tool", partialMessage, block.partial).catch(() => {}) |
| 661 | } |
| 662 | |
| 663 | /** |
| 664 | * Execute legacy multi-file format for backward compatibility. |
nothing calls this directly
no test coverage detected