import json import time from typing import Dict, Any from pr.ui.colors import Colors def display_tool_call(tool_name, arguments, status="running", result=None): if status == "running": return args_str = ", ".join([f"{k}={str(v)[:20]}" for k, v in list(arguments.items())[:2]]) line = f"{tool_name}({args_str})" if len(line) > 80: line = line[:77] + "..." print(f"{Colors.GRAY}{line}{Colors.RESET}") 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")