d3ab3f836b
exec_command, write_stdin, apply_patch, view_image, load_skill, list_sitemap, and view_sitemap_entry were falling through to the generic dict-dumper. They now render in the same visual language as the rest of the toolset: the terminal pair uses the >_ icon with pygments bash highlighting; apply_patch and view_image use the file- edit diamond with colored +/- diff lines and per-language syntax highlighting; sitemap and load_skill mirror the proxy and skill patterns already established. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
from typing import Any, ClassVar
|
|
|
|
from rich.text import Text
|
|
from textual.widgets import Static
|
|
|
|
from .base_renderer import BaseToolRenderer
|
|
from .registry import register_tool_renderer
|
|
|
|
|
|
@register_tool_renderer
|
|
class LoadSkillRenderer(BaseToolRenderer):
|
|
tool_name: ClassVar[str] = "load_skill"
|
|
css_classes: ClassVar[list[str]] = ["tool-call", "load-skill-tool"]
|
|
|
|
@classmethod
|
|
def render(cls, tool_data: dict[str, Any]) -> Static:
|
|
args = tool_data.get("args", {})
|
|
status = tool_data.get("status", "completed")
|
|
|
|
raw_skills = args.get("skills", "")
|
|
if isinstance(raw_skills, list):
|
|
requested = ", ".join(str(s) for s in raw_skills)
|
|
else:
|
|
requested = str(raw_skills)
|
|
|
|
text = Text()
|
|
text.append("◇ ", style="#10b981")
|
|
text.append("loading skill", style="dim")
|
|
|
|
if requested:
|
|
text.append(" ")
|
|
text.append(requested, style="#10b981")
|
|
elif not tool_data.get("result"):
|
|
text.append("\n ")
|
|
text.append("Loading...", style="dim")
|
|
|
|
return Static(text, classes=cls.get_css_classes(status))
|