IterEval
What ReplHost.execute hands back for a cross-tick snippet: the iterator to drive one step per tick. Both output channels — println, and the => type = value each yield renders — land in the per-eval out sink EvalTask owns and passed down, so the two arrive interleaved in the order they happened.
errorFlag is set by the masking-side iterator guard if a step throws — surfaced as errored, so the lane can return the partial output and still mark the eval's Outcome as an error.
scope is the builder behind iterator when it is ours — what an early end unwinds (McpScope.unwind). Null for the stdlib's (a fully-qualified kotlin.sequences.iterator, or what chunked/windowed build): its suspended body is private, and hasNext() would run a step rather than end it, so that body is dropped as before. Safe to hold across the masking seam: repl.scope is parent-first from both sides, so there is one McpScope class.