(transcript: TranscriptMessage[])
| 1723 | } |
| 1724 | |
| 1725 | function extractFirstPrompt(transcript: TranscriptMessage[]): string { |
| 1726 | const textContent = getFirstMeaningfulUserMessageTextContent(transcript) |
| 1727 | if (textContent) { |
| 1728 | let result = textContent.replace(/\n/g, ' ').trim() |
| 1729 | |
| 1730 | // Store a reasonably long version for display-time truncation |
| 1731 | // The actual truncation will be applied at display time based on terminal width |
| 1732 | if (result.length > 200) { |
| 1733 | result = result.slice(0, 200).trim() + '…' |
| 1734 | } |
| 1735 | |
| 1736 | return result |
| 1737 | } |
| 1738 | |
| 1739 | return 'No prompt' |
| 1740 | } |
| 1741 | |
| 1742 | /** |
| 1743 | * Gets the last user message that was processed (i.e., before any non-user message appears). |
no test coverage detected