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