| 7607 | ANTH_BLOCK_THINKING, |
| 7608 | ANTH_BLOCK_TEXT, |
| 7609 | ANTH_BLOCK_TOOL, |
| 7610 | } anthropic_block_type; |
| 7611 | |
| 7612 | typedef struct { |
| 7613 | dsml_tool_stream_state state; |
| 7614 | const dsml_syntax *syn; |
| 7615 | size_t parse_pos; |
| 7616 | int index; |
| 7617 | bool active; |
| 7618 | bool emitted_any; |
| 7619 | bool args_open; |
| 7620 | bool first_param; |
| 7621 | bool param_is_string; |
| 7622 | char **ids; |
| 7623 | int ids_cap; |
| 7624 | } anthropic_tool_stream; |
| 7625 | |
| 7626 | /* Anthropic streaming uses the same sampled DSML bytes that will later be |
| 7627 | * parsed and remembered for exact continuation. This state is only a wire |
| 7628 | * projection: it turns an in-progress DSML block into content_block/tool_use |
| 7629 | * SSE events, and never rewrites the model-visible transcript or cache key. */ |
| 7630 | typedef struct { |
| 7631 | anthropic_stream_mode mode; |
| 7632 | anthropic_block_type open_block; |
| 7633 | int next_index; |
| 7634 | size_t emit_pos; |
| 7635 | bool active; |
| 7636 | bool checked_think_prefix; |
| 7637 | bool guard_second_reasoning; |
no test coverage detected