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

Function onText

src/testing/ptyContractHarness.ts:214–224  ·  view source on GitHub ↗
(chunk: string)

Source from the content-addressed store, hash-verified

212 }
213
214 function onText(chunk: string): void {
215 rawText += chunk
216 visibleText = normalizePtyVisibleText(rawText)
217
218 const cursorQueries = chunk.match(/\x1b\[6n/g)?.length || 0
219 for (let index = 0; index < cursorQueries; index += 1) {
220 proc.stdin.write('\x1b[1;1R')
221 }
222
223 maybeResolveWaiters()
224 }
225
226 const stdoutDone = drainStream(proc.stdout, onText)
227 const stderrDone = drainStream(proc.stderr, onText)

Callers

nothing calls this directly

Calls 3

normalizePtyVisibleTextFunction · 0.85
maybeResolveWaitersFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected