feat(tui): welcome art with light-blue thick border, new C_WELCOME color pair

This commit is contained in:
Dita Aji Pratama 2026-05-26 15:18:16 +07:00
parent 02f5ce345b
commit d833774809
3 changed files with 20 additions and 0 deletions

View File

@ -3,6 +3,18 @@ import threading
from datetime import datetime
from scripts import ntro
WELCOME_ART = """\
\n\
/\\_/\\ H E N D R I K
( o.o ) AI Agent
> ^ < siap membantu!
( )
(___)
"""
def log(app, role, text):
app.log.append({

View File

@ -2,6 +2,7 @@ import curses
import threading
from .render import init_colors, draw
from .input import handle_key
from .agent import log, WELCOME_ART
class HendrikTUI:
@ -41,6 +42,7 @@ class HendrikTUI:
self.messages = [{"role": "system",
"content": self.build_system_prompt(self.tools_def)}]
log(self, "welcome", WELCOME_ART)
while self.running:
self.h, self.w = stdscr.getmaxyx()

View File

@ -20,6 +20,7 @@ C_ERROR = 8 # error message: merah
C_INPUT_BORDER = 9 # border input box: biru
C_STATUS_INFO = 12 # status info (workspace/hints): putih
C_HINT_DISABLED = 13 # hint disabled (abu-abu)
C_WELCOME = 14 # welcome art: light blue
def init_colors():
@ -38,6 +39,7 @@ def init_colors():
curses.init_pair(C_ERROR, curses.COLOR_RED, -1)
curses.init_pair(C_INPUT_BORDER, curses.COLOR_BLUE, -1)
curses.init_pair(C_HINT_DISABLED, 8, -1) # abu-abu di atas bg default
curses.init_pair(C_WELCOME, curses.COLOR_BLUE + 8, -1) # light blue
def draw(app, stdscr):
@ -123,6 +125,10 @@ def draw_chat(app, stdscr):
rendered.append((C_SYSTEM, lines[0]))
for line in lines[1:]:
rendered.append((C_SYSTEM, " " + line))
elif role == "welcome":
lines = text.split("\n")
for line in lines:
rendered.append((C_WELCOME, " " + line))
elif role == "error":
label = " \u2717 "
lines = text.split("\n")