22 lines
743 B
Python
Raw Normal View History

2025-11-04 05:17:27 +01:00
import json
from typing import Dict, Any
from pr.ui.colors import Colors
def display_tool_call(tool_name, arguments, status="running", result=None):
2025-11-04 05:57:23 +01:00
if status == "running":
return
2025-11-04 05:17:27 +01:00
2025-11-04 05:57:23 +01:00
args_str = ", ".join([f"{k}={str(v)[:20]}" for k, v in list(arguments.items())[:2]])
line = f"{tool_name}({args_str})"
2025-11-04 05:17:27 +01:00
2025-11-04 05:57:23 +01:00
if len(line) > 80:
line = line[:77] + "..."
2025-11-04 05:17:27 +01:00
2025-11-04 05:57:23 +01:00
print(f"{Colors.GRAY}{line}{Colors.RESET}")
2025-11-04 05:17:27 +01:00
def print_autonomous_header(task):
print(f"{Colors.BOLD}Task:{Colors.RESET} {task}")
print(f"{Colors.GRAY}r will work continuously until the task is complete.{Colors.RESET}")
print(f"{Colors.GRAY}Press Ctrl+C twice to interrupt.{Colors.RESET}\n")
print(f"{Colors.BOLD}{'' * 80}{Colors.RESET}\n")