(text: string, max = 500)
| 626 | * - Append "…" if truncated |
| 627 | */ |
| 628 | export function excerptForReview(text: string, max = 500): string { |
| 629 | if (!text) return ''; |
| 630 | const cleaned = text |
| 631 | .replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '') |
| 632 | .replace(/\s+/g, ' ') |
| 633 | .trim(); |
| 634 | if (cleaned.length <= max) return cleaned; |
| 635 | return cleaned.slice(0, max) + '…'; |
| 636 | } |
| 637 | |
| 638 | // ─── Status reporting (for shield icon via /health) ────────── |
| 639 |
no outgoing calls
no test coverage detected