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§
- BobStream
Parser - Stateful wrapper over
parse_bob_linefor a single bob run. bob streams its reasoning inline as<thinking>…</thinking>within the assistantmessagecontent (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 inparse_bob_line; this only re-routes assistant text through the thinking-tag state machine. One instance per run (seeBobHarness).
Functions§
- normalize_
bob_ event - bob’s adapter-side normalization: parse bob’s
--output-format stream-jsonstdout viaparse_bob_line. - parse_
bob_ line - Parse one line of bob’s
--output-format stream-jsoninto the sharedParsedLine. Grounded in bob’s empirical event schema (thebob-agentsreference + “bob shell usage” findings), not guessed: bob emits one JSON object per line with a snake_casetypediscriminator —init/message{role,content,delta}/tool_use{tool_id,tool_name, parameters}/tool_result{tool_id,status,output}/result{stats}.