From d83377480934806c61cc4730d3f394555329b38b Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Tue, 26 May 2026 15:18:16 +0700 Subject: [PATCH] feat(tui): welcome art with light-blue thick border, new C_WELCOME color pair --- tui/agent.py | 12 ++++++++++++ tui/app.py | 2 ++ tui/render.py | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/tui/agent.py b/tui/agent.py index 3e4c606..35add09 100644 --- a/tui/agent.py +++ b/tui/agent.py @@ -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({ diff --git a/tui/app.py b/tui/app.py index 4e69ca7..6936db1 100644 --- a/tui/app.py +++ b/tui/app.py @@ -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() diff --git a/tui/render.py b/tui/render.py index 98f5505..0c63923 100644 --- a/tui/render.py +++ b/tui/render.py @@ -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")