( content: string, maxSize: number = MAX_CONTENT_SIZE, )
| 101 | * Truncate content to fit within Honeycomb limits. |
| 102 | */ |
| 103 | export function truncateContent( |
| 104 | content: string, |
| 105 | maxSize: number = MAX_CONTENT_SIZE, |
| 106 | ): { content: string; truncated: boolean } { |
| 107 | if (content.length <= maxSize) { |
| 108 | return { content, truncated: false } |
| 109 | } |
| 110 | |
| 111 | return { |
| 112 | content: |
| 113 | content.slice(0, maxSize) + |
| 114 | '\n\n[TRUNCATED - Content exceeds 60KB limit]', |
| 115 | truncated: true, |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Generate a short hash (first 12 hex chars of SHA-256). |
no outgoing calls
no test coverage detected