(hunks: StructuredPatchHunk[])
| 53 | } |
| 54 | |
| 55 | function countHunkLines(hunks: StructuredPatchHunk[]): { |
| 56 | added: number |
| 57 | removed: number |
| 58 | } { |
| 59 | let added = 0 |
| 60 | let removed = 0 |
| 61 | for (const hunk of hunks) { |
| 62 | for (const line of hunk.lines) { |
| 63 | if (line.startsWith('+')) added++ |
| 64 | else if (line.startsWith('-')) removed++ |
| 65 | } |
| 66 | } |
| 67 | return { added, removed } |
| 68 | } |
| 69 | |
| 70 | function getUserPromptPreview(message: Message): string { |
| 71 | if (message.type !== 'user') return '' |