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