(entry, auditEntries = [])
| 720 | |
| 721 | function extractBlockedCommand(detail) { |
| 722 | const text = String(detail || ''); |
| 723 | const match = text.match(/^[^:]+:\s+(.+)$/); |
| 724 | return (match ? match[1] : text).trim(); |
| 725 | } |
| 726 | |
| 727 | function normalizeCommandForMatch(command) { |
| 728 | return String(command || '') |
| 729 | .replace(/\s+/g, ' ') |
| 730 | .replace(/^git push -u /, 'git push ') |
| 731 | .trim(); |
| 732 | } |
| 733 | |
| 734 | function hasLaterMatchingToolCall(entry, auditEntries = []) { |
| 735 | const detail = entry.detail || entry.reason || entry.message || entry.error || ''; |
| 736 | const command = normalizeCommandForMatch(extractBlockedCommand(detail)); |
| 737 | if (!command) return false; |
| 738 |
no test coverage detected