1010from datetime import datetime
1111from typing import Dict , Any , List
1212from rich .console import Group
13+ from rich .box import HORIZONTALS , SQUARE
1314from rich .markdown import Markdown
1415from rich .text import Text
1516from rich .panel import Panel
2223 RICH_STYLE_GRAY ,
2324 RICH_STYLE_YELLOW_BOLD ,
2425 RICH_STYLE_GREEN_BOLD ,
26+ RICH_STYLE_BLUE_BOLD ,
2527 RICH_STYLE_FILE_ACCENT_BOLD ,
2628 RICH_STYLE_WHITE ,
2729 CODE_THEME ,
@@ -75,11 +77,12 @@ def display_message(self, message: Text):
7577 def display_user_message (self , message : str ):
7678 header = Text (
7779 "👤 YOU:" ,
78- style = RICH_STYLE_GREEN_BOLD ,
80+ style = RICH_STYLE_BLUE_BOLD ,
7981 )
8082 user_panel = Panel (
8183 Text (message ),
8284 title = header ,
85+ box = HORIZONTALS ,
8386 title_align = "left" ,
8487 border_style = RICH_STYLE_BLUE ,
8588 )
@@ -93,6 +96,7 @@ def display_assistant_message(self, agent_name: str, message: str):
9396 assistant_panel = Panel (
9497 Markdown (message , code_theme = CODE_THEME ),
9598 title = header ,
99+ box = HORIZONTALS ,
96100 title_align = "left" ,
97101 border_style = RICH_STYLE_GREEN ,
98102 )
@@ -102,6 +106,14 @@ def display_divider(self):
102106 """Display a divider line."""
103107 pass
104108
109+ def print_divider (self , title = "" ):
110+ """Display a divider line."""
111+ title_length = len (title ) + 1 if title else 0
112+ self .console .print (
113+ " ─" + title + ("─" * (self .console .width - title_length - 3 )) + " " ,
114+ style = RICH_STYLE_BLUE ,
115+ )
116+
105117 def display_debug_info (self , debug_info ):
106118 """Display debug information."""
107119 self .console .print (Text ("Current messages:" , style = RICH_STYLE_YELLOW ))
@@ -248,7 +260,7 @@ def display_token_usage(
248260 f"Total: { input_tokens + output_tokens :,} | Cost: ${ total_cost :.4f} | Total: { session_cost :.4f} " ,
249261 style = RICH_STYLE_YELLOW ,
250262 )
251- self .console .print (Panel (token_info ))
263+ self .console .print (Panel (token_info , box = HORIZONTALS ))
252264 self .display_divider ()
253265
254266 def display_added_files (self ):
@@ -263,10 +275,6 @@ def display_added_files(self):
263275 def print_welcome_message (self , version : str ):
264276 """Print the welcome message for the chat."""
265277 welcome_messages = Group (
266- Text (
267- "🎮 Welcome to AgentCrew v" + version + " interactive chat!" ,
268- style = RICH_STYLE_YELLOW_BOLD ,
269- ),
270278 Text ("Press Ctrl+C twice to exit." , style = RICH_STYLE_GRAY ),
271279 Text ("Type '/exit' or '/quit' to end the session." , style = RICH_STYLE_GRAY ),
272280 Text (
@@ -353,7 +361,16 @@ def print_welcome_message(self, version: str):
353361 ),
354362 )
355363
356- self .console .print (Panel (welcome_messages ))
364+ self .console .print (
365+ Panel (
366+ welcome_messages ,
367+ box = SQUARE ,
368+ title = Text (
369+ "🎮 Welcome to AgentCrew v" + version + " interactive chat!" ,
370+ style = RICH_STYLE_YELLOW_BOLD ,
371+ ),
372+ )
373+ )
357374 self .display_divider ()
358375
359376 def print_prompt_prefix (
0 commit comments