Parser for the --output-format stream-json NDJSON protocol shared by Claude
Code and Cursor's cursor-agent.
Each stdout line is a standalone JSON object tagged with a type:
system(init/config) -- ignored.assistant-- a model message; itscontentblocks become:text,:reasoning(thinking), or:tool_callevents.user-- tool results echoed back; ignored (the MCP server owns execution).result-- the terminal event;successyields{:done, ...}with the final text + usage, an error subtype yields{:error, ...}.
Non-JSON lines (banners, warnings) parse to [] so stray output never breaks a
run. Returns Raxol.Agent.NativeHarness event tuples.
Summary
Functions
Parse one NDJSON line into normalized harness events.
Functions
@spec parse_line(String.t()) :: [Raxol.Agent.NativeHarness.event()]
Parse one NDJSON line into normalized harness events.