(transcript: TranscriptMessage[])
| 1760 | } |
| 1761 | |
| 1762 | function extractFirstPrompt(transcript: TranscriptMessage[]): string { |
| 1763 | const textContent = getFirstMeaningfulUserMessageTextContent(transcript) |
| 1764 | if (textContent) { |
| 1765 | let result = textContent.replace(/\n/g, ' ').trim() |
| 1766 | |
| 1767 | // Store a reasonably long version for display-time truncation |
| 1768 | // The actual truncation will be applied at display time based on terminal width |
| 1769 | if (result.length > 200) { |
| 1770 | result = result.slice(0, 200).trim() + '…' |
| 1771 | } |
| 1772 | |
| 1773 | return result |
| 1774 | } |
| 1775 | |
| 1776 | return 'No prompt' |
| 1777 | } |
| 1778 | |
| 1779 | /** |
| 1780 | * Gets the last user message that was processed (i.e., before any non-user message appears). |
no test coverage detected