TerminalOutputParser
interface TerminalOutputParser
Byte-stream parser contract for terminal host output.
Implementations accept raw bytes from PTY/network/process output, preserve parser state across arbitrary chunk boundaries, and emit semantic terminal operations to a TerminalCommandSink.
Factory-created parsers require serialized, non-reentrant calls, including reset and end-of-input. Sink and custom OSC callbacks run synchronously on the calling thread. Supplied byte ranges are consumed before returning and may then be reused. Callback exceptions propagate to the caller; stop processing that stream after a failed callback rather than assuming parser and sink state remain aligned.