(toolBlock: ToolContentBlock)
| 517 | * Determine file change type based on tool and context. |
| 518 | */ |
| 519 | export function getFileChangeType(toolBlock: ToolContentBlock): FileChangeType { |
| 520 | const baseToolName = getBaseToolName(toolBlock.toolName) |
| 521 | // write_file creating new file = Added |
| 522 | if (baseToolName === 'write_file') { |
| 523 | const isCreate = isCreateFile(toolBlock) |
| 524 | return isCreate ? 'A' : 'M' |
| 525 | } |
| 526 | |
| 527 | // str_replace is always a modification |
| 528 | if (baseToolName === 'str_replace') { |
| 529 | return 'M' |
| 530 | } |
| 531 | |
| 532 | // Default to modified |
| 533 | return 'M' |
| 534 | } |
| 535 | |
| 536 | /** |
| 537 | * Get aggregated file stats from all edit blocks. |
no test coverage detected