Improving CLI tool components
This commit is contained in:
@@ -556,7 +556,9 @@ class StrixCLIApp(App): # type: ignore[misc]
|
||||
current_verb = self._get_agent_verb(self.selected_agent_id)
|
||||
animated_text = self._get_animated_verb_text(self.selected_agent_id, current_verb)
|
||||
self._safe_widget_operation(status_text.update, animated_text)
|
||||
self._safe_widget_operation(keymap_indicator.update, "[dim]ESC to stop agent[/dim]")
|
||||
self._safe_widget_operation(
|
||||
keymap_indicator.update, "[dim]ESC to stop | CTRL-C to quit and save[/dim]"
|
||||
)
|
||||
self._safe_widget_operation(status_display.remove_class, "hidden")
|
||||
self._start_dot_animation()
|
||||
else:
|
||||
|
||||
@@ -577,10 +577,8 @@ def pull_docker_image() -> None:
|
||||
return
|
||||
|
||||
console.print()
|
||||
console.print(f"[bold cyan]🐳 Pulling Docker image:[/bold cyan] {STRIX_IMAGE}")
|
||||
console.print(
|
||||
"[dim yellow]This only happens on first run and may take a few minutes...[/dim yellow]"
|
||||
)
|
||||
console.print(f"[bold cyan]🐳 Pulling Docker image:[/] {STRIX_IMAGE}")
|
||||
console.print("[dim yellow]This only happens on first run and may take a few minutes...[/]")
|
||||
console.print()
|
||||
|
||||
with console.status("[bold cyan]Downloading image layers...", spinner="dots") as status:
|
||||
|
||||
@@ -21,7 +21,7 @@ class PythonRenderer(BaseToolRenderer):
|
||||
header = "</> [bold #3b82f6]Python[/]"
|
||||
|
||||
if code and action in ["new_session", "execute"]:
|
||||
code_display = code[:250] + "..." if len(code) > 250 else code
|
||||
code_display = code[:600] + "..." if len(code) > 600 else code
|
||||
content_text = f"{header}\n [italic white]{cls.escape_markup(code_display)}[/]"
|
||||
elif action == "close":
|
||||
content_text = f"{header}\n [dim]Closing session...[/]"
|
||||
|
||||
@@ -28,11 +28,11 @@ class ScanStartInfoRenderer(BaseToolRenderer):
|
||||
@classmethod
|
||||
def _build_target_display(cls, target: dict[str, Any]) -> str:
|
||||
if target_url := target.get("target_url"):
|
||||
return f"[bold #22c55e]{target_url}[/bold #22c55e]"
|
||||
return f"[bold #22c55e]{target_url}[/]"
|
||||
if target_repo := target.get("target_repo"):
|
||||
return f"[bold #22c55e]{target_repo}[/bold #22c55e]"
|
||||
return f"[bold #22c55e]{target_repo}[/]"
|
||||
if target_path := target.get("target_path"):
|
||||
return f"[bold #22c55e]{target_path}[/bold #22c55e]"
|
||||
return f"[bold #22c55e]{target_path}[/]"
|
||||
return "[dim]unknown target[/dim]"
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class SubagentStartInfoRenderer(BaseToolRenderer):
|
||||
name = args.get("name", "Unknown Agent")
|
||||
task = args.get("task", "")
|
||||
|
||||
content = f"🤖 Spawned subagent [bold #22c55e]{name}[/bold #22c55e]"
|
||||
content = f"🤖 Spawned subagent [bold #22c55e]{name}[/]"
|
||||
if task:
|
||||
content += f"\n Task: [dim]{task}[/dim]"
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ class TerminalRenderer(BaseToolRenderer):
|
||||
if not command:
|
||||
return ""
|
||||
|
||||
if len(command) > 200:
|
||||
command = command[:197] + "..."
|
||||
if len(command) > 400:
|
||||
command = command[:397] + "..."
|
||||
|
||||
return cls.escape_markup(command)
|
||||
|
||||
@@ -20,7 +20,7 @@ class ThinkRenderer(BaseToolRenderer):
|
||||
header = "🧠 [bold #a855f7]Thinking[/]"
|
||||
|
||||
if thought:
|
||||
thought_display = thought[:200] + "..." if len(thought) > 200 else 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...[/]"
|
||||
|
||||
Reference in New Issue
Block a user