| 3552 | static void agent_tool_viz_restore_param_color(agent_stream_renderer *sr) { |
| 3553 | agent_tool_visualizer *v = &sr->viz; |
| 3554 | if (!v->active || !v->param_active || v->read_style) return; |
| 3555 | renderer_color(sr->renderer, agent_tool_param_color(v->param_kind)); |
| 3556 | } |
| 3557 | |
| 3558 | /* Stream one DSML parameter byte into the visualizer. The visualizer must not |
| 3559 | * wait for the whole parameter: large write/edit contents should show progress |
| 3560 | * as the model emits them, while still detecting the closing parameter tag. */ |
| 3561 | static void agent_tool_viz_param_value_byte(agent_stream_renderer *sr, char c) { |
| 3562 | agent_tool_visualizer *v = &sr->viz; |
| 3563 | |
| 3564 | if (v->param_end_len || c == '<') { |
| 3565 | if (v->param_end_len == sizeof(v->param_end_tail)) { |
| 3566 | size_t keep = v->param_end_len; |
| 3567 | v->param_end_len = 0; |
| 3568 | for (size_t i = 0; i < keep; i++) |
| 3569 | agent_tool_viz_param_raw_byte(sr, v->param_end_tail[i]); |
| 3570 | if (c != '<') { |
| 3571 | agent_tool_viz_param_raw_byte(sr, c); |
| 3572 | return; |
| 3573 | } |
| 3574 | } |
no test coverage detected