Skip to main content

Module parser

Module parser 

Source
Expand description

bob’s stream-json parser — bob’s wire format → the neutral crate::RunEvent vocabulary.

The normalized event types and the generic normalize_process_event skeleton live in crate::events; this module is bob’s adapter-side decoder on top of them. bob emits one JSON object per line with a snake_case type discriminator — see parse_bob_line for the grounded schema. Reasoning is streamed inline as <thinking>…</thinking> and routed by the stateful BobStreamParser.

Structs§

BobStreamParser
Stateful wrapper over parse_bob_line for a single bob run. bob streams its reasoning inline as <thinking>…</thinking> within the assistant message content (grounded in a real run — the tags arrive as their own deltas), so routing that reasoning to the Thinking stream requires tracking the open/closed state across lines. The per-line dispatch (text / tool events / answer) stays in parse_bob_line; this only re-routes assistant text through the thinking-tag state machine. One instance per run (see BobHarness).

Functions§

normalize_bob_event
bob’s adapter-side normalization: parse bob’s --output-format stream-json stdout via parse_bob_line.
parse_bob_line
Parse one line of bob’s --output-format stream-json into the shared ParsedLine. Grounded in bob’s empirical event schema (the bob-agents reference + “bob shell usage” findings), not guessed: bob emits one JSON object per line with a snake_case type discriminator — init / message{role,content,delta} / tool_use{tool_id,tool_name, parameters} / tool_result{tool_id,status,output} / result{stats}.