pub fn find_opencode_result(ndjson: &str) -> Option<AgentResult>Expand description
Extract a structured AgentResult from OpenCode NDJSON output.
Concatenates text from type:text events (both part.text and direct
text field formats), extracts tokens from the last step_finish event,
and checks for error / step_finish.reason=error events.
Returns None only if no parseable NDJSON events are found.