MCPcopy Create free account
hub / github.com/HELPMEEADICE/doge-code / extractFirstPrompt

Function extractFirstPrompt

src/utils/sessionStorage.ts:1771–1786  ·  view source on GitHub ↗
(transcript: TranscriptMessage[])

Source from the content-addressed store, hash-verified

1769}
1770
1771function 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).

Callers 3

convertToLogOptionFunction · 0.70
loadFullLogFunction · 0.70

Tested by

no test coverage detected