mirror of
https://github.com/usestrix/strix.git
synced 2026-08-21 18:52:47 +02:00
feat(tui): add vulnerability detail dialog with markdown copy support
- Add VulnerabilityDetailScreen modal with full vulnerability details - Add Copy button that exports report as markdown to clipboard - Add VulnerabilitiesPanel in sidebar showing found vulnerabilities - Add clickable VulnerabilityItem widgets with severity-colored dots - ESC key closes modal dialogs - Remove emojis from TUI stats panel for cleaner display - Add build_tui_stats_text() for minimal TUI-specific stats
This commit is contained in:
@@ -361,6 +361,33 @@ def build_live_stats_text(tracer: Any, agent_config: dict[str, Any] | None = Non
|
||||
return stats_text
|
||||
|
||||
|
||||
def build_tui_stats_text(tracer: Any, agent_config: dict[str, Any] | None = None) -> Text:
|
||||
stats_text = Text()
|
||||
if not tracer:
|
||||
return stats_text
|
||||
|
||||
if agent_config:
|
||||
llm_config = agent_config["llm_config"]
|
||||
model = getattr(llm_config, "model_name", "Unknown")
|
||||
stats_text.append("Model: ", style="bold white")
|
||||
stats_text.append(model, style="dim white")
|
||||
|
||||
llm_stats = tracer.get_total_llm_stats()
|
||||
total_stats = llm_stats["total"]
|
||||
|
||||
total_tokens = total_stats["input_tokens"] + total_stats["output_tokens"]
|
||||
|
||||
stats_text.append("\n")
|
||||
stats_text.append("Tokens: ", style="bold white")
|
||||
stats_text.append(format_token_count(total_tokens), style="dim white")
|
||||
|
||||
stats_text.append(" • ", style="dim white")
|
||||
stats_text.append("Cost: ", style="bold white")
|
||||
stats_text.append(f"${total_stats['cost']:.4f}", style="dim white")
|
||||
|
||||
return stats_text
|
||||
|
||||
|
||||
# Name generation utilities
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user