| 503 | } |
| 504 | |
| 505 | function cleanGitDiff(input) { |
| 506 | return input |
| 507 | .replace(/[│┃╏╎|▌]+/g, '') |
| 508 | .replace(/([^\n])\n(?!\s*(\d+\s*[+-]\s*|[\-*•●⏺▶▪◦]|\d+\.|[A-Z][a-z]|[📌🎯📋📖✨✅❌⭐🔥👉➡️]|^\s*$|$))/g, '$1 ') |
| 509 | .replace(/[ \t]+/g, ' ') |
| 510 | .split('\n') |
| 511 | .map(line => { |
| 512 | const trimmed = line.trim(); |
| 513 | if (trimmed === '') { |
| 514 | return ''; |
| 515 | } |
| 516 | if (/^\d+\s*[+-]/.test(trimmed)) { |
| 517 | return trimmed; |
| 518 | } |
| 519 | return trimmed; |
| 520 | }) |
| 521 | .join('\n') |
| 522 | .replace(/\n{4,}/g, '\n\n\n') |
| 523 | .trim(); |
| 524 | } |
| 525 | |
| 526 | function cleanClaudeDump(input) { |
| 527 | return input |