Add background styling to finish and reporting tool renderers

- Wrap finish_scan and create_vulnerability_report tool output in Padding with dark grey background (#141414)
- Refactor TUI rendering to support heterogeneous renderables (Text, Padding, Group) instead of just Text
- Update _render_streaming_content and _render_tool_content_simple to return Any renderable type
- Handle interrupted messages by composing with Group instead of appending to Text
This commit is contained in:
0xallam
2026-01-08 15:02:47 -08:00
committed by Ahmed Allam
parent cdf3cca3b7
commit e8662fbda9
4 changed files with 74 additions and 52 deletions

View File

@@ -1,5 +1,6 @@
from typing import Any, ClassVar
from rich.padding import Padding
from rich.text import Text
from textual.widgets import Static
@@ -8,6 +9,7 @@ from .registry import register_tool_renderer
FIELD_STYLE = "bold #4ade80"
BG_COLOR = "#141414"
@register_tool_renderer
@@ -56,5 +58,7 @@ class FinishScanRenderer(BaseToolRenderer):
text.append("\n ")
text.append("Generating final report...", style="dim")
padded = Padding(text, 2, style=f"on {BG_COLOR}")
css_classes = cls.get_css_classes("completed")
return Static(text, classes=css_classes)
return Static(padded, classes=css_classes)