What one input produced. output is already rendered — the terminal prints it verbatim — and
the rest is there so a caller can react rather than parse.
const result: ReplResult = { output: '2', failed: false, incomplete: false, tests: [] }; result.incomplete; // false — a true here means "unfinished input", not "no value"
output: string
The text to print, whichever way it went: the rendered value when the input worked, the error and its source-mapped stack when it did not. Empty when there is nothing to print.
Always the thing a terminal writes out. It never says whether the input succeeded — an error message and a value are both just text by the time they get here.
failed: boolean
Whether the input worked. What output never says, and what a caller needs before it can do
anything but print: colour the line red, decline to add it to the replayable history, exit
non-zero on a piped session.
Orthogonal to output rather than derivable from it — output is non-empty in both cases,
and '' means "nothing to print", not "it went fine".
thrown: boolean
The failure was the page throwing, rather than the session refusing the input.
What a terminal reads to decide whether to say Uncaught: an exception from the page belongs
to the page and reads the way a browser console reads it, while "that file will not bundle" is
this REPL answering, and was never thrown anywhere.
incomplete: boolean
The input was unfinished (const a = {), so nothing ran and the terminal should read on.
tests: TestDetails[]
Tests QUnit ran because of this input. Already reported through the session's reporters.
pausedAt: string
Where the input stopped at a debugger statement, or absent when it ran to completion.
The page is still stopped when this comes back. Whatever is typed next runs in that frame, and ReplSession.continue is what lets it carry on.