MCPcopy Create free account
hub / github.com/Noumena-Network/code / readPromptBand

Function readPromptBand

src/testing/replScreenContractHarness.ts:43–58  ·  view source on GitHub ↗
(
  screenText: string,
  options?: {
    readonly rowsBelow?: number
  },
)

Source from the content-addressed store, hash-verified

41}
42
43export function readPromptBand(
44 screenText: string,
45 options?: {
46 readonly rowsBelow?: number
47 },
48): string {
49 const rows = screenText.split('\n')
50 const promptRow = findPromptRow(screenText)
51 if (promptRow === -1) {
52 return screenText
53 }
54
55 const rowsBelow = options?.rowsBelow ?? 1
56 const endRow = Math.min(rows.length, promptRow + rowsBelow + 1)
57 return rows.slice(promptRow, endRow).join('\n')
58}
59
60export function readTranscriptBandAbovePrompt(screenText: string): string {
61 const rows = screenText.split('\n')

Callers 3

waitForPromptRowsFunction · 0.85
expectPromptInputBlockFunction · 0.85

Calls 1

findPromptRowFunction · 0.85

Tested by 1

waitForPromptRowsFunction · 0.68