feat(interface): Introduce non-interactive CLI mode and restructure UI layer

This commit is contained in:
Ahmed Allam
2025-10-29 06:14:08 +03:00
committed by Ahmed Allam
parent 85209bfc20
commit 86dd6f5330
29 changed files with 254 additions and 46 deletions

View File

@@ -0,0 +1,29 @@
from typing import Any, ClassVar
from textual.widgets import Static
from .base_renderer import BaseToolRenderer
from .registry import register_tool_renderer
@register_tool_renderer
class ThinkRenderer(BaseToolRenderer):
tool_name: ClassVar[str] = "think"
css_classes: ClassVar[list[str]] = ["tool-call", "thinking-tool"]
@classmethod
def render(cls, tool_data: dict[str, Any]) -> Static:
args = tool_data.get("args", {})
thought = args.get("thought", "")
header = "🧠 [bold #a855f7]Thinking[/]"
if thought:
thought_display = thought[:600] + "..." if len(thought) > 600 else thought
content = f"{header}\n [italic dim]{cls.escape_markup(thought_display)}[/]"
else:
content = f"{header}\n [italic dim]Thinking...[/]"
css_classes = cls.get_css_classes("completed")
return Static(content, classes=css_classes)