The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(cli): glyph transcript, status line under the composer, two-line header
Tekniume2bb757eba44
diff --git a/agent/display.py b/agent/display.pyindex 83e8d9a49e1..c116f282198 100644--- a/agent/display.py+++ b/agent/display.py@@ -1079,9 +1079,45 @@ def _cute_path(p) -> str:return "." * limit if limit <= 3 else "..." + p[-(limit - 3):]+class _CuteRow(str):+ """A rendered completion row that also keeps its verb and detail, so the CLI's glyph layout+ can rebuild the row without re-parsing the padded ``┊ emoji verb`` string."""++ verb: str+ detail: str++ def __new__(cls, text: str, verb: str, detail: str):+ row = super().__new__(cls, text)+ row.verb, row.detail = verb, detail+ return row++ def __reduce__(self): # copy/pickle as a plain str; the custom __new__ can't be re-called bare+ return (str, (str(self),))++def _cute_row(emoji: str, verb: str, detail: str = "") -> str:"""``┊ {emoji} {verb:9} {detail}`` -- verb column from ``display.cute.verb.<verb>`` (9 cells wide)."""- return f"┊ {emoji} {t(f'display.cute.verb.{verb}'):9} {detail}"+ label = t(f'display.cute.verb.{verb}')+ return _CuteRow(f"┊ {emoji} {label:9} {detail}", label, detail)+++def get_tool_row_parts(tool_name: str, args: dict | None, result: str | None = None):+ """``([(verb, detail), ...], is_failure, failure_suffix)`` for one completed call: the same+ labels the ``┊`` completion line uses, without its emoji and column padding."""+ try:+ args = redact_tool_args_for_display(tool_name, args) or args or {}+ is_failure, suffix = _detect_tool_failure(tool_name, result)+ labels = bridge_tool_labels(tool_name, args)+ if labels:+ return [(_cute_trunc(lb.text), _cute_trunc(lb.preview) if lb.preview else "") for lb in labels], is_failure, suffix+ render = _CUTE_LINES.get(tool_name)+ row = render(args, result) if render else None+ if isinstance(row, _CuteRow):+ return [(row.verb, row.detail)], is_failure, suffix+ return [(tool_name, _cute_trunc(build_tool_preview(tool_name, args) or ""))], is_failure, suffix+ except Exception:+ logger.debug("Tool row parts failed for %s", tool_name, exc_info=True)+ return [(str(tool_name), "")], False, ""def _cute_web_extract(a: dict, _r) -> str:diff --git a/hermes_cli/cli_chat_turn_mixin.py b/hermes_cli/cli_chat_turn_mixin.pyindex da41cb7dca9..7ca1f7bed98 100644--- a/hermes_cli/cli_chat_turn_mixin.py+++ b/hermes_cli/cli_chat_turn_mixin.py@@ -92,8 +92,9 @@ class CLIChatTurnMixin:if isinstance(message, TimelineNotification):message = str(message) # UI metadata is on the staged row, never in model content.- ChatConsole().print(f"[{_accent_hex()}]{'─' * 40}[/]")- _cprint("")+ if not getattr(self, "_modern_layout", False):+ ChatConsole().print(f"[{_accent_hex()}]{'─' * 40}[/]")+ _cprint("")from agent.notification_presentation import notification_config_snapshot, notification_policy_snapshotwith notification_policy_snapshot(agent, "cli", notification_config_snapshot()):@@ -246,6 +247,10 @@ class CLIChatTurnMixin:# display_callback only when token streaming is off: with streaming on,# _stream_delta already renders the text and this would print it twice.def display_callback(sentence: str):+ if not turn.box_opened and getattr(self, "_modern_layout", False):+ from hermes_cli.cli_modern_layout import answer_label+ turn.box_opened = True+ _cprint(answer_label())if not turn.box_opened:turn.box_opened = Truelabel = " ☤ Hermes "@@ -624,7 +629,12 @@ class CLIChatTurnMixin:# intermediate turn boundaries (tool loops) and re-rendered the box after the answer.if self.show_reasoning and turn.result and not self._reasoning_shown_this_turn:reasoning = turn.result.get("last_reasoning")- if reasoning:+ if reasoning and getattr(self, "_modern_layout", False):+ from hermes_cli.cli_modern_layout import thought_body, thought_line+ _cprint("\n" + thought_line(None, reasoning))+ for line in thought_body(reasoning) if self.reasoning_full else []:+ _cprint(line)+ elif reasoning:w = self._scrollback_box_width()r_label = f" {t('cli.chat.reasoning_label')} "r_top = f"{_DIM}┌─{r_label}{'─' * max(w - 3 - len(r_label), 0)}┐{_RST}"@@ -667,15 +677,22 @@ class CLIChatTurnMixin:already_streamed = ((self._stream_started and self._stream_box_opened) or _interrupted_streamed) and not is_error_response+ modern = getattr(self, "_modern_layout", False)if turn.use_streaming_tts and turn.box_opened and not is_error_response:# Text already printed sentence-by-sentence; just close the box.- _cprint(f"\n{_ACCENT}╰{'─' * (self._scrollback_box_width() - 2)}╯{_RST}")+ if not modern:+ _cprint(f"\n{_ACCENT}╰{'─' * (self._scrollback_box_width() - 2)}╯{_RST}")elif already_streamed:# _flush_stream() already closed the streamed box; a post-stream transform# hook shows a suffix for append-only changes, else the full replacement._post_stream_text = _post_stream_transform_output(response, turn.result)if _post_stream_text.strip():_cprint(_post_stream_text)+ elif modern:+ from hermes_cli.cli_modern_layout import answer_label+ _cprint(answer_label())+ ChatConsole().print(_render_final_assistant_content(response, mode=self.final_response_markdown),+ style=_resp_text, width=self._scrollback_box_width())else:ChatConsole().print(Panel(_render_final_assistant_content(response, mode=self.final_response_markdown),diff --git a/hermes_cli/cli_config_load.py b/hermes_cli/cli_config_load.pyindex c382cc3d002..bff6bc05359 100644--- a/hermes_cli/cli_config_load.py+++ b/hermes_cli/cli_config_load.py@@ -208,7 +208,8 @@ def _cli_config_defaults():# /resume recap tuning and show_reasoning: keep in sync with hermes_cli/config.py DEFAULT_CONFIG"resume_display": "full", "resume_exchanges": 10, "resume_max_user_chars": 300,"resume_max_assistant_chars": 200, "resume_max_assistant_lines": 3, "resume_skip_tool_only": True,- "show_reasoning": True, "reasoning_full": False, "streaming": True, "busy_input_mode": "interrupt",+ "show_reasoning": True, "reasoning_full": False, "streaming": True, "busy_input_mode": None, # None: per display.cli_layout (steer / interrupt)+ "cli_layout": "modern","persistent_output": True, "persistent_output_max_lines": 200,# Also clear scrollback on redraw/resize recovery; off because users prefer history."cli_rebuild_scrollback_on_redraw": False,diff --git a/hermes_cli/cli_init_mixin.py b/hermes_cli/cli_init_mixin.pyindex 6119553d1db..d4b070ab0a8 100644--- a/hermes_cli/cli_init_mixin.py+++ b/hermes_cli/cli_init_mixin.py@@ -121,8 +121,12 @@ class CLIInitMixin:enabled=display.get("persistent_output", True),max_lines=display.get("persistent_output_max_lines", 200),)+ from hermes_cli.cli_modern_layout import layout_from_config, set_active+ self._modern_layout = layout_from_config(display) # display.cli_layout: modern | classic+ set_active(self._modern_layout)# busy_input_mode: "interrupt" (redirect the run) | "queue" (next turn) | "steer" (inject mid-run).- _bim = str(display.get("busy_input_mode", "interrupt")).strip().lower()+ # Unset: the glyph layout steers (Tab queues), the classic layout interrupts.+ _bim = str(display.get("busy_input_mode") or ("steer" if self._modern_layout else "interrupt")).strip().lower()self.busy_input_mode = _bim if _bim in ("queue", "steer") else "interrupt"# verbose ONLY controls global DEBUG logging; tool_progress="verbose" is independentdiff --git a/hermes_cli/cli_loops_mixin.py b/hermes_cli/cli_loops_mixin.pyindex 8e8c7e0418a..6af0829de06 100644--- a/hermes_cli/cli_loops_mixin.py+++ b/hermes_cli/cli_loops_mixin.py@@ -125,7 +125,10 @@ class CLILoopsMixin:out.cursor_goto(0, 0)out.flush()cc = ChatConsole()- if self.compact or shutil.get_terminal_size().columns < 80:+ if getattr(self, "_modern_layout", False):+ from hermes_cli.cli_modern_layout import header_markup+ cc.print(header_markup(self))+ elif self.compact or shutil.get_terminal_size().columns < 80:cc.print(_build_compact_banner())else:tools = get_tool_definitions(enabled_toolsets=self.enabled_toolsets,diff --git a/hermes_cli/cli_modern_layout.py b/hermes_cli/cli_modern_layout.pynew file mode 100644index 00000000000..b480448a0b6--- /dev/null+++ b/hermes_cli/cli_modern_layout.py@@ -0,0 +1,386 @@+"""Glyph-grammar transcript and bottom-anchored chrome for the classic CLI (``display.cli_layout``).++Every row this module prints into scrollback is width-independent (a column-0 glyph, no boxes, no+full-width rules), so resizing the terminal cannot re-wrap and garble what is already printed.+Width-dependent chrome (the composer's top rule and the footer) lives only in prompt_toolkit's live+region, which is redrawn on every resize. ``display.cli_layout: classic`` restores the boxed look.+"""++from __future__ import annotations++import logging+import os+import re+import shutil+import time+from datetime import datetime++from agent.i18n import t++logger = logging.getLogger(__name__)++_SPIN = "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"+_RST, _BOLD, _DIM = "\x1b[0m", "\x1b[1m", "\x1b[2m"+_RED = "\x1b[38;2;239;83;80m"+_TITLE_MAX = 72+++def is_modern(cli) -> bool:+ return bool(getattr(cli, "_modern_layout", False))+++def layout_from_config(display: dict) -> bool:+ """True for the glyph layout (default); ``classic`` keeps the boxed transcript."""+ return str((display or {}).get("cli_layout", "modern") or "modern").strip().lower() != "classic"+++def _skin_hex(key: str, fallback: str) -> str:+ from hermes_cli.skin_engine import get_active_skin+ return get_active_skin().get_color(key, fallback) or fallback+++def _fg(hex_color: str, bold: bool = False) -> str:+ try:+ r, g, b = (int(hex_color.lstrip("#")[i:i + 2], 16) for i in (0, 2, 4))+ return f"\x1b[{'1;' if bold else ''}38;2;{r};{g};{b}m"+ except (ValueError, IndexError):+ return _BOLD if bold else ""+++def _brand_glyph() -> tuple[str, str]:+ """(glyph, name) from the skin's response label, e.g. ``" ☤ Hermes "`` → ("☤", "Hermes")."""+ from hermes_cli.skin_engine import get_active_skin+ label = get_active_skin().get_branding("response_label", " ☤ Hermes ")+ parts = label.split(None, 1)+ return (parts[0], parts[1].strip()) if len(parts) == 2 else ("☤", label.strip() or "Hermes")+++def prompt_glyph() -> str:+ from hermes_cli.skin_engine import get_active_skin+ return get_active_skin().get_branding("prompt_symbol", "❯").strip() or "❯"+++# ── transcript rows (printed into scrollback) ───────────────────────────────────────────────++def user_echo_markup(text: str, accent_hex: str, ts_suffix: str = "") -> str:+ """Rich markup for a submitted single-line user message: ``❯ text``, no surrounding rules."""+ from rich.markup import escape+ return f"\n[bold {accent_hex}]{escape(prompt_glyph())}[/] [bold]{escape(text)}[/]{ts_suffix}"+++def answer_label(timestamp: str = "") -> str:+ """The line that opens an answer: the skin's brand glyph + name, replacing the framed header."""+ glyph, name = _brand_glyph()+ stamp = f" {_DIM}{timestamp}{_RST}" if timestamp else ""+ return f"\n{_fg(_skin_hex('ui_accent', '#FFBF00'), bold=True)}{glyph} {name}{_RST}{stamp}"+++def thought_title(text: str) -> str:+ """Short title for a reasoning block: its first ``**bold**`` heading, else its first sentence."""+ text = (text or "").strip()+ match = re.search(r"\*\*(.+?)\*\*", text)+ title = match.group(1) if match else re.split(r"(?<=[.!?])\s|\n", text, maxsplit=1)[0]+ title = " ".join(title.split()).strip("*# ")+ return title if len(title) <= _TITLE_MAX else title[:_TITLE_MAX - 1].rstrip() + "…"+++def thought_line(seconds: float | None, text: str) -> str:+ """``∴ Thought for 3s · Planning the change`` (dim italic), the collapsed reasoning row."""+ title = thought_title(text)+ took = t("cli.modern.thought_for", seconds=f"{max(seconds or 0.0, 0.0):.0f}") if seconds else t("cli.modern.thought")+ body = f"{took} · {title}" if title else took+ return f"\x1b[2;3m∴ {body}{_RST}"+++def thought_body(text: str) -> list[str]:+ """Full reasoning under a ``│`` gutter, for ``/reasoning full``."""+ return [f"\x1b[2;3m│ {line}{_RST}" if line.strip() else "\x1b[2;3m│\x1b[0m" for line in text.strip().splitlines()]+++def completed_tool_line(cli, function_name: str, args: dict | None, duration: float, result=None,+ is_error: bool = False) -> str:+ """The scrollback line for a finished tool call in the active layout."""+ if is_modern(cli):+ return tool_row(function_name, args, duration, result, is_error)+ from agent.display import get_cute_tool_message+ return f" {get_cute_tool_message(function_name, args, duration, result=result)}"+++def tool_row(function_name: str, args: dict | None, duration: float, result=None, is_error: bool = False) -> str:+ """``● Read calc.py 0.2s`` / ``✗ Ran $ pytest -q 0.4s [exit 1]`` — one row per completed call."""+ from agent.display import get_tool_row_parts+ rows, failed, suffix = get_tool_row_parts(function_name, args or {}, result)+ failed = failed or bool(is_error)+ glyph = f"{_RED}✗{_RST}" if failed else "●"+ out = []+ for index, (verb, detail) in enumerate(rows):+ verb = (verb or function_name).strip()+ line = f"{glyph} {_BOLD}{verb[:1].upper()}{verb[1:]}{_RST}"+ if detail:+ line += f" {detail}"+ if index == len(rows) - 1 and duration >= 0.1:+ line += f" {_DIM}{duration:.1f}s{_RST}"+ if failed and suffix:+ line += f"{_RED}{suffix}{_RST}"+ out.append(line)+ return "\n".join(out)+++_ACTIVE = False # one CLI per process; read by printers that get no CLI handle (gateway inline diffs)+_ANSI_RE = re.compile(r"\x1b\[[0-9;]*m")+_DIFF_FILE_RE = re.compile(r"^a/(.+?) → b/(.+)$")+++def set_active(enabled: bool) -> None:+ global _ACTIVE+ _ACTIVE = bool(enabled)+++def _display_path(path: str) -> str:+ path = path[1:] if path.startswith("//") else path+ cwd = os.getenv("TERMINAL_CWD") or os.getcwd()+ try:+ rel = os.path.relpath(path, cwd) if os.path.isabs(path) else path+ except ValueError:+ return path+ return path if rel.startswith("..") else rel+++def gutter_print(print_fn):+ """Wrap a line printer so a diff hangs under its tool row behind a dim ``│``: the ``review+ diff`` header is dropped and ``a/<abs> → b/<abs>`` collapses to one cwd-relative path."""+ header = _ANSI_RE.sub("", t("display.diff.review_header")).strip()++ def _print(text):+ for line in str(text).split("\n"):+ plain = _ANSI_RE.sub("", line).strip()+ if plain == header:+ continue+ match = _DIFF_FILE_RE.match(plain)+ if match:+ old, new = _display_path(match.group(1)), _display_path(match.group(2))+ line = f"{_BOLD}{new if old == new else f'{old} → {new}'}{_RST}"+ print_fn(f"{_DIM}│{_RST} {line}" if plain else f"{_DIM}│{_RST}")+ return _print+++def diff_printer(print_fn):+ """``print_fn`` with the gutter when the glyph layout is active in this process."""+ return gutter_print(print_fn) if _ACTIVE else print_fn+++def turn_footer(summary: str) -> str:+ """``─ 12.4s · read 3 files · edited 1 file +4 -0 · 7:02 AM`` closing each turn."""+ body = summary.lstrip("⋯ ").strip()+ clock = datetime.now().strftime("%-I:%M %p") if os.name != "nt" else datetime.now().strftime("%I:%M %p")+ return f"{_DIM}─ {body} · {clock}{_RST}" if body else f"{_DIM}─ {clock}{_RST}"+++def _short_version() -> str:+ from hermes_cli.version_info import get_version_info+ return get_version_info().derived_version.split("+", 1)[0]+++def header_markup(cli, width: int = 0) -> str:+ """Two-line launch header that replaces the full banner: identity + model, then where + help."""+ from rich.markup import escape+ accent, label = _skin_hex("ui_accent", "#FFBF00"), _skin_hex("ui_label", "#DAA520")+ glyph, name = _brand_glyph()+ model = str(getattr(cli, "model", "") or "")+ model = model.split("/")[-1] if "/" in model else model+ provider = str(getattr(cli, "provider", "") or "")+ via = f" [dim]via {escape(provider)}[/]" if provider and provider != "auto" else ""+ version = _short_version()+ version = f" [dim]v{escape(version)} ·[/]" if version else " [dim]·[/]"+ line1 = f"[bold {accent}]{glyph}[/] [bold {label}]{escape(name)} Agent[/]{version} {escape(model)}{via}"+ hint, cwd = t("cli.modern.header_hint"), _cwd_label()+ width = width or shutil.get_terminal_size((100, 24)).columns+ room = max(12, width - 2 - 3 - len(hint))+ cwd = cwd if len(cwd) <= room else "…" + cwd[-(room - 1):]+ return f"\n{line1}\n [dim]{escape(cwd)} · {escape(hint)}[/]"+++def print_short_banner(cli) -> bool:+ """Launch header short of the full banner: the two-line header in this layout, the compact+ banner for ``display.compact`` or a terminal under 80 columns. False → print the full banner."""+ if is_modern(cli):+ cli._console_print(header_markup(cli))+ return True+ if cli.compact or shutil.get_terminal_size().columns < 80: # the full banner wraps below ~80 cols+ from cli import _build_compact_banner+ cli._console_print(_build_compact_banner())+ cli._show_status()+ return True+ return False+++# ── live region (prompt_toolkit fragments, redrawn every frame) ─────────────────────────────++def _cwd_label() -> str:+ cwd = os.getenv("TERMINAL_CWD") or os.getcwd()+ home = os.path.expanduser("~")+ short = "~" + cwd[len(home):] if cwd == home or cwd.startswith(home + os.sep) else cwd+ from hermes_cli.status_bar_git import current_git_branch+ branch = current_git_branch(cwd)+ return f"{short} ({branch})" if branch else short+++def activity_text(cli) -> str:+ """What the agent is doing, without the kaomoji face or per-tool emoji."""+ if getattr(cli, "_command_running", False):+ return str(getattr(cli, "_command_status", "") or "")+ text = str(getattr(cli, "_spinner_text", "") or "").strip()+ if not text:+ return t("cli.modern.working") if getattr(cli, "_agent_running", False) else ""+ if text.endswith("...") and " " in text: # "(⊙_⊙) pondering..." → "Pondering…"+ verb = text.rsplit(" ", 1)[-1].rstrip(".")+ return f"{verb[:1].upper()}{verb[1:]}…"+ head, _, rest = text.partition(" ")+ if rest and head and not any(ch.isalnum() for ch in head): # drop the emoji token+ return rest+ return text+++def _turn_elapsed(cli) -> str:+ started = getattr(cli, "_prompt_start_time", None)+ if started is None:+ return ""+ from cli import format_duration_compact+ return format_duration_compact(max(0.0, time.time() - float(started)))+++def rule_style() -> str:+ """Composer rules are quiet chrome: the skin's session border, not the accent."""+ return f"fg:{_skin_hex('session_border', '#8B8682')}"+++def _no_bg(frags: list) -> list:+ """The footer sits on the terminal background, not the classic status bar's fill."""+ return [(f"{style} bg:default".strip(), text) for style, text in frags]+++def _fit(cli, frags: list, width: int) -> list:+ used = sum(cli._status_bar_display_width(text) for _, text in frags)+ if used <= width:+ return frags+ plain = "".join(text for _, text in frags)+ return [(rule_style(), cli._trim_status_bar_text(plain, width))]+++def top_rule_fragments(cli) -> list:+ """``── ⠹ Running tests · 14s ─────────── calc helpers ─``: live status left, session title right."""+ width = max(10, cli._get_tui_terminal_width())+ rule, accent = rule_style(), f"fg:{_skin_hex('ui_accent', '#FFBF00')} bold"+ busy = getattr(cli, "_agent_running", False) or getattr(cli, "_command_running", False)+ left: list = []+ if busy:+ frame = _SPIN[int(time.monotonic() * 10) % len(_SPIN)]+ left = [(rule, "── "), (accent, frame + " "), ("", activity_text(cli))]+ elapsed = _turn_elapsed(cli)+ if elapsed:+ left.append(("class:status-bar-dim bg:default", f" · {elapsed}"))+ left.append((rule, " "))+ title = cli._get_status_bar_session_title()+ right = [(rule, " "), (f"fg:{_skin_hex('ui_label', '#DAA520')}", title), (rule, " ─")] if title else []+ used = sum(cli._status_bar_display_width(text) for _, text in left + right)+ if used >= width:+ right, used = [], sum(cli._status_bar_display_width(text) for _, text in left)+ return _fit(cli, left + [(rule, "─" * max(0, width - used))] + right, width)+++def hint_pairs(cli) -> list[tuple[str, str]]:+ """Keys that do something right now, for the footer's right half."""+ if any(getattr(cli, attr, None) for attr in (+ "_approval_state", "_clarify_state", "_sudo_state", "_secret_state", "_connection_state",+ "_slash_confirm_state", "_model_picker_state", "_command_palette_state")):+ return []+ if getattr(cli, "_agent_running", False):+ enter = {"steer": "steer", "queue": "queue"}.get(getattr(cli, "busy_input_mode", ""), "interrupt")+ pairs = [("enter", t(f"cli.modern.hint_{enter}"))]+ if enter != "queue":+ pairs.append(("tab", t("cli.modern.hint_queue")))+ return pairs + [("ctrl+c", t("cli.modern.hint_stop"))]+ return [("/", t("cli.modern.hint_commands")), ("@", t("cli.modern.hint_files")), ("!", t("cli.modern.hint_shell"))]+++def status_line_fragments(cli) -> list:+ """Footer under the composer: model · context gauge · cwd (branch) left, live key hints right.+ An explicit ``display.status_bar.fields`` list keeps the user's chosen segments on the left."""+ return _render_safely(_status_line_fragments, cli)+++def _render_safely(render, cli) -> list:+ """Boundary for prompt_toolkit render callbacks: a bad frame degrades to a bare line."""+ try:+ return render(cli)+ except Exception: # health: allow BLE001 -- a render callback must never take down the app frame+ logger.debug("%s failed", render.__name__, exc_info=True)+ return [("", f" {getattr(cli, 'model', '') or 'Hermes'}")]+++# Live-state badges the classic bar shows, minus its throughput/clock fields: what changes per turn.+_DEFAULT_FIELDS = frozenset({"model", "context_pct", "compressions", "bg_tasks", "bg_processes", "bg_subagents",+ "goal", "focus", "yolo", "stash"})+++def _status_line_fragments(cli) -> list:+ width = max(10, cli._get_tui_terminal_width())+ dim, strong = "class:status-bar-dim", "class:status-bar-strong"+ snapshot = cli._get_status_bar_snapshot()+ field_set = cli._get_status_bar_field_set()+ fields = _DEFAULT_FIELDS if field_set is None else field_set+ left: list = []+ for seg in cli._status_bar_segments(snapshot, width, fields, cli._is_session_yolo_active(), styled=True):+ if left:+ left.append((dim, " · "))+ left.extend(seg)+ stash = cli._prompt_stash.indicator() if "stash" in fields and hasattr(cli, "_prompt_stash") else ""+ if stash: # a parked draft is never silently forgotten+ left += [(dim, " · "), (strong, stash)]+ right: list = []+ for key, text in hint_pairs(cli) if width >= 76 else []:+ if right:+ right.append((dim, " · "))+ right += [(strong, key), (dim, f" {text}")]+ used_left = sum(cli._status_bar_display_width(text) for _, text in left)+ used_right = sum(cli._status_bar_display_width(text) for _, text in right)+ room = width - used_left - used_right - 6+ if field_set is None and room >= 12: # cwd takes whatever the hints leave, trimmed from the left+ cwd = _cwd_label()+ cwd = cwd if len(cwd) <= room else "…" + cwd[-(room - 1):]+ left += [(dim, " · "), (dim, cwd)]+ used_left += 3 + cli._status_bar_display_width(cwd)+ if right and used_left + used_right + 2 > width:+ right, used_right = [], 0+ pad = [("", " " * max(1, width - used_left - used_right - 1))] if right else []+ return _no_bg(_fit(cli, left + pad + right + ([("", " ")] if right else []), width))+++def modern_input_rules(cli, kb):+ """The composer's rules for this layout (the top one carries live status), plus Tab-to-queue."""+ from prompt_toolkit.filters import Condition+ from prompt_toolkit.layout import FormattedTextControl, Window++ top = Window(FormattedTextControl(lambda: _render_safely(top_rule_fragments, cli)),+ height=lambda: cli._tui_input_rule_height("top"), wrap_lines=False)+ bottom = Window(char="─", height=lambda: cli._tui_input_rule_height("bottom"), style=rule_style)++ def _can_queue() -> bool:+ from prompt_toolkit.application import get_app+ from cli import _looks_like_slash_command+ from hermes_cli.cli_subagent_monitor import modal_prompt_active+ buf = get_app().current_buffer+ text = buf.text.strip()+ return bool(getattr(cli, "_agent_running", False) and text and buf.complete_state is None+ and not _looks_like_slash_command(text) and not text.startswith("!")+ and not modal_prompt_active(cli))++ @kb.add("tab", filter=Condition(_can_queue), eager=True)+ def _queue_while_busy(event):+ cli._busy_mode_override = "queue"+ try:+ cli._tui_handle_enter(event)+ finally:+ cli._busy_mode_override = None++ return top, bottomdiff --git a/hermes_cli/cli_render.py b/hermes_cli/cli_render.pyindex 49a0d68a0f3..f52ab7c2949 100644--- a/hermes_cli/cli_render.py+++ b/hermes_cli/cli_render.py@@ -958,9 +958,11 @@ def _panel_box_width(title: str, content_lines: list[str], min_width: int = 46,def _wrap_panel_text(text: str, width: int, subsequent_indent: str = "", *, keep_ws: bool = False) -> list[str]:- """Wrap panel text; ``keep_ws`` preserves whitespace (command/detail previews)."""+ """Wrap panel text; ``keep_ws`` preserves whitespace (command/detail previews). Each source+ line wraps on its own: a newline inside a row would break the panel's right border."""kw = dict(replace_whitespace=False, drop_whitespace=False) if keep_ws else dict(break_long_words=False, break_on_hyphens=False)- wrapped = textwrap.wrap(text, width=max(8, width), subsequent_indent=subsequent_indent, **kw)+ wrapped = [row for part in (text.expandtabs(4).splitlines() if keep_ws else [text])+ for row in (textwrap.wrap(part, width=max(8, width), subsequent_indent=subsequent_indent, **kw) or [""])]return wrapped or [""]diff --git a/hermes_cli/cli_status_bar_mixin.py b/hermes_cli/cli_status_bar_mixin.pyindex 80be27e52d3..14dbe602930 100644--- a/hermes_cli/cli_status_bar_mixin.py+++ b/hermes_cli/cli_status_bar_mixin.py@@ -539,14 +539,14 @@ class CLIStatusBarMixin:def _agent_spacer_height(self, width: Optional[int] = None) -> int:"""Spacer height above the status bar while the agent runs."""- if not getattr(self, "_agent_running", False):+ if not getattr(self, "_agent_running", False) or getattr(self, "_modern_layout", False):return 0return 0 if self._use_minimal_tui_chrome(width=width) else 1def _spinner_widget_height(self, width: Optional[int] = None) -> int:"""Visible height of the spinner/status line above the status bar."""spinner_line = self._render_spinner_text()- if not spinner_line or self._use_minimal_tui_chrome(width=width):+ if not spinner_line or self._use_minimal_tui_chrome(width=width) or getattr(self, "_modern_layout", False):return 0width = width or self._get_tui_terminal_width()if width and width > 10:@@ -597,7 +597,9 @@ class CLIStatusBarMixin:if getattr(self, "tool_progress_mode", "all") == "off":return Falseagent = getattr(self, "agent", None)- if agent is not None and getattr(agent, "quiet_mode", False):+ # The interactive agent itself runs quiet unless --verbose, so in the classic layout this+ # line only shows under --verbose; the glyph layout closes every interactive turn with it.+ if agent is not None and getattr(agent, "quiet_mode", False) and not getattr(self, "_modern_layout", False):return Falsereturn bool(getattr(self, "_interactive_turn", False))@@ -638,7 +640,10 @@ class CLIStatusBarMixin:try:started = getattr(self, "_turn_summary_start", 0.0) or 0.0line = collector.render(max(0.0, time.monotonic() - started) if started else 0.0)- if line:+ if line and getattr(self, "_modern_layout", False):+ from hermes_cli.cli_modern_layout import turn_footer+ _cprint(turn_footer(line))+ elif line:_cprint(f" {_D}{line}{_RST}")except Exception:logger.debug("Turn summary render failed", exc_info=True)@@ -1131,6 +1136,9 @@ class CLIStatusBarMixin:or getattr(self, "_model_picker_state", None)or getattr(self, "_command_palette_state", None)):return []+ if getattr(self, "_modern_layout", False):+ from hermes_cli.cli_modern_layout import status_line_fragments+ return status_line_fragments(self)try:snapshot = self._get_status_bar_snapshot()# prompt_toolkit's own width: shutil's can be stale (esp. over SSH) and an overflowdiff --git a/hermes_cli/cli_stream_mixin.py b/hermes_cli/cli_stream_mixin.pyindex cb8efde8925..563ba7fdd92 100644--- a/hermes_cli/cli_stream_mixin.py+++ b/hermes_cli/cli_stream_mixin.py@@ -185,8 +185,10 @@ class CLIStreamMixin:f" [dim]{datetime.now().strftime(getattr(self, 'timestamp_format', '%H:%M'))}[/]"if getattr(self, "show_timestamps", False) else "")lines = user_input.split("\n")+ from hermes_cli.cli_modern_layout import is_modern, prompt_glyph+ mark = _escape(prompt_glyph()) if is_modern(self) else "●"if len(lines) <= 1:- return f"[bold {_accent_hex()}]●[/] [bold]{_escape(user_input)}[/]{ts_suffix}"+ return f"[bold {_accent_hex()}]{mark}[/] [bold]{_escape(user_input)}[/]{ts_suffix}"first_lines = max(1, int(getattr(self, "user_message_preview_first_lines", 2)))last_lines = max(0, int(getattr(self, "user_message_preview_last_lines", 2)))@@ -198,7 +200,7 @@ class CLIStreamMixin:hidden_middle_count = 0tail = []- preview_lines = [f"[bold {_accent_hex()}]●[/] [bold]{_escape(head[0])}[/]{ts_suffix}"]+ preview_lines = [f"[bold {_accent_hex()}]{mark}[/] [bold]{_escape(head[0])}[/]{ts_suffix}"]preview_lines.extend(f"[bold]{_escape(line)}[/]" for line in head[1:])if hidden_middle_count > 0:key = "cli.stream.preview_more_lines_one" if hidden_middle_count == 1 else "cli.stream.preview_more_lines_other"@@ -235,10 +237,15 @@ class CLIStreamMixin:render_notification(lambda: ChatConsole().print(f"[dim]◈ {_escape(user_input.display_text)}[/dim]"),platform="cli", diagnostic=user_input.notification_category == "diagnostic")return- ChatConsole().print(f"[{_accent_hex()}]{'─' * 40}[/]")+ modern = getattr(self, "_modern_layout", False)+ if not modern:+ ChatConsole().print(f"[{_accent_hex()}]{'─' * 40}[/]")text = str(user_input or "")if "\n" in text:- ChatConsole().print(self._format_submitted_user_message_preview(text))+ ChatConsole().print(("\n" if modern else "") + self._format_submitted_user_message_preview(text))+ elif modern:+ from hermes_cli.cli_modern_layout import user_echo_markup+ ChatConsole().print(user_echo_markup(text, _accent_hex()))else:ChatConsole().print(f"[bold {_accent_hex()}]●[/] [bold]{_escape(text)}[/]")@@ -255,6 +262,11 @@ class CLIStreamMixin:self._reasoning_shown_this_turn = Trueif getattr(self, "_stream_box_opened", False):return+ if getattr(self, "_modern_layout", False):+ if not getattr(self, "_reasoning_box_opened", False):+ self._reasoning_box_opened, self._reasoning_started_at, self._reasoning_buf = True, time.monotonic(), ""+ self._reasoning_buf = getattr(self, "_reasoning_buf", "") + text+ returnif not getattr(self, "_reasoning_box_opened", False):self._reasoning_box_opened = Truew = self._scrollback_box_width()@@ -296,6 +308,17 @@ class CLIStreamMixin:from cli import _DIM, _RST, _cprintif not getattr(self, "_reasoning_box_opened", False):return+ if getattr(self, "_modern_layout", False):+ from hermes_cli.cli_modern_layout import thought_body, thought_line+ text = getattr(self, "_reasoning_buf", "")+ started = getattr(self, "_reasoning_started_at", 0.0)+ _cprint(thought_line(time.monotonic() - started if started else None, text))+ for line in thought_body(text) if self.reasoning_full else []:+ _cprint(line)+ self._reasoning_buf, self._reasoning_box_opened = "", False+ if not getattr(self, "_stream_box_live", False):+ self._release_held_status_lines()+ returnbuf = getattr(self, "_reasoning_buf", "")if buf:_cprint(f"{_DIM}{buf}{_RST}")@@ -451,9 +474,14 @@ class CLIStreamMixin:self._stream_text_ansi = ""if self.show_timestamps:label = f"{label} {datetime.now().strftime(getattr(self, 'timestamp_format', '%H:%M'))}"- w = self._scrollback_box_width()- fill = w - 2 - HermesCLI._status_bar_display_width(label)- _cprint(f"\n{_ACCENT}╭─{label}{'─' * max(fill - 1, 0)}╮{_RST}")+ if getattr(self, "_modern_layout", False):+ from hermes_cli.cli_modern_layout import answer_label+ _cprint(answer_label(datetime.now().strftime(getattr(self, 'timestamp_format', '%H:%M'))+ if self.show_timestamps else ""))+ else:+ w = self._scrollback_box_width()+ fill = w - 2 - HermesCLI._status_bar_display_width(label)+ _cprint(f"\n{_ACCENT}╭─{label}{'─' * max(fill - 1, 0)}╮{_RST}")# Turn-level record of what actually reached the screen; survives _reset_stream_state at# tool-call boundaries so an interrupted reply isn't re-rendered as a Panel (#65666).@@ -519,7 +547,7 @@ class CLIStreamMixin:line = _strip_markdown_syntax(self._stream_buf) if self.final_response_markdown == "strip" else self._stream_bufself._emit_stream_line(line)self._stream_buf = ""- if self._stream_box_opened and getattr(self, "_stream_box_live", False):+ if self._stream_box_opened and getattr(self, "_stream_box_live", False) and not getattr(self, "_modern_layout", False):w = self._scrollback_box_width()_cprint(f"{_ACCENT}╰{'─' * (w - 2)}╯{_RST}")self._stream_box_live = False@@ -661,6 +689,10 @@ class CLIStreamMixin:announced.add(tool_name)from agent.display import bridge_generating_phrase, get_tool_emojiwhat = bridge_generating_phrase(tool_name) or tool_name+ if getattr(self, "_modern_layout", False): # the composer rule shows it; scrollback stays quiet+ self._spinner_text = t("cli.modern.preparing", what=what)+ self._invalidate()+ return_cprint(f" ┊ {t('cli.stream.tool_preparing', emoji=get_tool_emoji(tool_name, default='⚡'), what=what)}")def _on_tool_progress(self, event_type: str, function_name: str | None = None, preview: str | None = None, function_args: dict | None = None, **kwargs):@@ -731,9 +763,9 @@ class CLIStreamMixin:returnself._last_scrollback_tool = function_nametry:- from agent.display import get_cute_tool_message- line = get_cute_tool_message(function_name, stored_args, duration, result=kwargs.get("result"))- _cprint(f" {line}")+ from hermes_cli.cli_modern_layout import completed_tool_line+ _cprint(completed_tool_line(self, function_name, stored_args, duration, kwargs.get("result"),+ kwargs.get("is_error", False)))except Exception:pass# One-time /verbose hint on the first long tool in the noisiest mode; latched@@ -800,8 +832,9 @@ class CLIStreamMixin:snapshot = self._pending_edit_snapshots.pop(tool_call_id, None)try:from agent.display import render_edit_diff_with_delta+ from hermes_cli.cli_modern_layout import diff_printerrender_edit_diff_with_delta(function_name, function_result, function_args=function_args, snapshot=snapshot,- print_fn=_cprint)+ print_fn=diff_printer(_cprint))except Exception:logger.debug("Edit diff preview failed for %s", function_name, exc_info=True)diff --git a/hermes_cli/cli_tui_mixin.py b/hermes_cli/cli_tui_mixin.pyindex a456e92ac6b..c4c593616e8 100644--- a/hermes_cli/cli_tui_mixin.py+++ b/hermes_cli/cli_tui_mixin.py@@ -438,6 +438,8 @@ class CLITuiMixin:input_rule_bot,voice_status_bar,completions_menu]+ if getattr(self, "_modern_layout", False): # footer under the composer and its completions+ ordered.append(ordered.pop(ordered.index(status_bar)))return [item for item in ordered if item is not None]def _tui_spinner_loop(self):@@ -819,6 +821,8 @@ class CLITuiMixin:if self._command_running:return f"{self._command_spinner_frame()} {self._command_status or t('cli.tui.placeholder_processing_command')}"if self._agent_running:+ if getattr(self, "_modern_layout", False):+ return t(f"cli.modern.placeholder_busy_{self.busy_input_mode}")return t("cli.tui.placeholder_busy")if self._voice_mode:return t("cli.tui.placeholder_voice_idle", shortcut=self._voice_record_key_label())@@ -1510,7 +1514,7 @@ class CLITuiMixin:multimodal follow-ups, or a turn that finished in the race). queue → next turn."""from cli import CLI_CONFIG, _ACCENT, _DIM, _RST, _cprint, _hermes_home- _effective_mode = self.busy_input_mode+ _effective_mode = getattr(self, "_busy_mode_override", None) or self.busy_input_moderedirected = Falseif _effective_mode == "steer":if images or not text:@@ -2159,6 +2163,9 @@ class CLITuiMixin:input_rule_bot = Window(char='─', height=lambda: cli_ref._tui_input_rule_height("bottom"), style='class:input-rule',)+ if getattr(self, "_modern_layout", False):+ from hermes_cli.cli_modern_layout import modern_input_rules+ input_rule_top, input_rule_bot = modern_input_rules(self, kb)image_bar = Window(content=FormattedTextControl(self._tui_image_bar_fragments),height=Condition(lambda: bool(cli_ref._attached_images)))diff --git a/hermes_cli/cli_tui_runtime_mixin.py b/hermes_cli/cli_tui_runtime_mixin.pyindex 75d9af97534..9f7f9625361 100644--- a/hermes_cli/cli_tui_runtime_mixin.py+++ b/hermes_cli/cli_tui_runtime_mixin.py@@ -314,7 +314,8 @@ class CLITuiRuntimeMixin:_welcome_color = _welcome_skin.get_color("banner_text", _welcome_color)except Exception:pass- self._console_print(f"[{_welcome_color}]{_welcome_text}[/]")+ if not getattr(self, "_modern_layout", False): # the glyph layout's header already greets+ self._console_print(f"[{_welcome_color}]{_welcome_text}[/]")self._tui_startup_prewarm_and_warnings(_welcome_skin)self._print_random_tip()diff --git a/hermes_cli/config_defaults.py b/hermes_cli/config_defaults.pyindex 68074c0d493..0cd83db0046 100644--- a/hermes_cli/config_defaults.py+++ b/hermes_cli/config_defaults.py@@ -850,9 +850,9 @@ DEFAULT_CONFIG = {# continues, Shift+Enter reported distinctly. False restores the c-j submit fallback for# POSIX PTYs whose plain Enter arrives as LF."cli_multiline_shortcuts": True,- # Interface bare `hermes`/`hermes chat` launches: "cli" (prompt_toolkit REPL) | "tui" (Ink).- # Flags win: `--cli` forces the REPL, `--tui` / HERMES_TUI=1 forces the TUI.- "interface": "cli",+ # `hermes`/`hermes chat` launches "cli" (prompt_toolkit REPL) | "tui" (Ink); --cli, --tui, HERMES_TUI=1 win.+ # cli_layout = the REPL's look: "modern" (glyph rows, status under the composer) | "classic" (boxed panels).+ "interface": "cli", "cli_layout": "modern",# Native TUI uses the terminal's primary buffer and scrollback instead of the custom# alternate-screen viewport. Flags win: `--native` / `--tui-native` and `--cli`."tui_native": False,diff --git a/hermes_cli/gateway_agent.py b/hermes_cli/gateway_agent.pyindex 1565322a535..0e92f1d99bb 100644--- a/hermes_cli/gateway_agent.py+++ b/hermes_cli/gateway_agent.py@@ -927,8 +927,10 @@ class GatewayAgent:diff = payload.get("inline_diff")if isinstance(diff, str) and diff:from cli import _cprint+ from hermes_cli.cli_modern_layout import diff_printer+ emit = diff_printer(_cprint)for line in diff.rstrip("\n").splitlines():- _cprint(line)+ emit(line)if name == "delegate_task" and self.tool_complete_callback is not None:self.tool_complete_callback(call_id, name, args, result)elif self.tool_complete_callback is not None:diff --git a/locales/af.yaml b/locales/af.yamlindex 12f7e9f2d15..382cef39c56 100644--- a/locales/af.yaml+++ b/locales/af.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "Verlaat die CLI (gebruik --delete om ook sessiegeskiedenis te verwyder)"cli:+ modern:+ thought_for: "Het {seconds}s gedink"+ thought: "Het gedink"+ working: "Besig…"+ preparing: "Berei {what} voor…"+ header_hint: "/help vir opdragte · /tools en /skills wys wat gelaai is"+ hint_steer: "stuur"+ hint_queue: "in tou"+ hint_interrupt: "onderbreek"+ hint_stop: "stop"+ hint_commands: "opdragte"+ hint_files: "lêers"+ hint_shell: "dop"+ placeholder_busy_steer: "tik om hierdie beurt te stuur · Tab plaas dit in die tou vir daarna"+ placeholder_busy_interrupt: "tik om hierdie beurt te herlei · Tab plaas dit in die tou vir daarna"+ placeholder_busy_queue: "tik om 'n boodskap vir ná hierdie beurt in die tou te plaas"billing:load_failed: "{label}: {error}"load_failed_label: "Kon nie faktureringsinligting laai nie"diff --git a/locales/ar.yaml b/locales/ar.yamlindex 252ac98aa2f..fde90591be7 100644--- a/locales/ar.yaml+++ b/locales/ar.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "الخروج من واجهة سطر الأوامر (استخدم --delete لحذف سجل الجلسة أيضًا)"cli:+ modern:+ thought_for: "فكّر لمدة {seconds} ث"+ thought: "فكّر"+ working: "يعمل…"+ preparing: "جارٍ تحضير {what}…"+ header_hint: "/help للأوامر · /tools و/skills تعرض ما تم تحميله"+ hint_steer: "توجيه"+ hint_queue: "إضافة للطابور"+ hint_interrupt: "مقاطعة"+ hint_stop: "إيقاف"+ hint_commands: "الأوامر"+ hint_files: "الملفات"+ hint_shell: "الطرفية"+ placeholder_busy_steer: "اكتب لتوجيه هذه الجولة · Tab يضيفها للطابور لما بعد"+ placeholder_busy_interrupt: "اكتب لإعادة توجيه هذه الجولة · Tab يضيفها للطابور لما بعد"+ placeholder_busy_queue: "اكتب لإضافة رسالة إلى الطابور بعد هذه الجولة"billing:load_failed: "{label}: {error}"load_failed_label: "تعذّر تحميل الفوترة"diff --git a/locales/de.yaml b/locales/de.yamlindex b7e520d02b7..e71b24ceda5 100644--- a/locales/de.yaml+++ b/locales/de.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "CLI beenden (--delete entfernt zusätzlich den Sitzungsverlauf)"cli:+ modern:+ thought_for: "Nachgedacht für {seconds}s"+ thought: "Nachgedacht"+ working: "Arbeitet…"+ preparing: "Bereite {what} vor…"+ header_hint: "/help für Befehle · /tools und /skills zeigen, was geladen ist"+ hint_steer: "lenken"+ hint_queue: "einreihen"+ hint_interrupt: "unterbrechen"+ hint_stop: "stoppen"+ hint_commands: "Befehle"+ hint_files: "Dateien"+ hint_shell: "Shell"+ placeholder_busy_steer: "tippen, um diesen Zug zu lenken · Tab reiht für danach ein"+ placeholder_busy_interrupt: "tippen, um diesen Zug umzulenken · Tab reiht für danach ein"+ placeholder_busy_queue: "tippen, um eine Nachricht für nach diesem Zug einzureihen"billing:load_failed: "{label}: {error}"load_failed_label: "Abrechnung konnte nicht geladen werden"diff --git a/locales/en.yaml b/locales/en.yamlindex b1ed6a7e01a..49ff858323e 100644--- a/locales/en.yaml+++ b/locales/en.yaml@@ -1760,6 +1760,22 @@ slash:quit:description: "Exit the CLI (use --delete to also remove session history)"cli:+ modern:+ thought_for: "Thought for {seconds}s"+ thought: "Thought"+ working: "Working…"+ preparing: "Preparing {what}…"+ header_hint: "/help for commands · /tools and /skills list what is loaded"+ hint_steer: "steer"+ hint_queue: "queue"+ hint_interrupt: "interrupt"+ hint_stop: "stop"+ hint_commands: "commands"+ hint_files: "files"+ hint_shell: "shell"+ placeholder_busy_steer: "type to steer this turn · Tab queues it for after"+ placeholder_busy_interrupt: "type to redirect this turn · Tab queues it for after"+ placeholder_busy_queue: "type to queue a message for after this turn"billing:# shared helpers (/topup + /subscription)load_failed: "{label}: {error}"diff --git a/locales/es.yaml b/locales/es.yamlindex 2d959af6961..a0a4a20ecd9 100644--- a/locales/es.yaml+++ b/locales/es.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "Salir de la CLI (usa --delete para eliminar también el historial de la sesión)"cli:+ modern:+ thought_for: "Pensó durante {seconds}s"+ thought: "Pensó"+ working: "Trabajando…"+ preparing: "Preparando {what}…"+ header_hint: "/help para comandos · /tools y /skills muestran lo cargado"+ hint_steer: "guiar"+ hint_queue: "encolar"+ hint_interrupt: "interrumpir"+ hint_stop: "detener"+ hint_commands: "comandos"+ hint_files: "archivos"+ hint_shell: "shell"+ placeholder_busy_steer: "escribe para guiar este turno · Tab lo encola para después"+ placeholder_busy_interrupt: "escribe para redirigir este turno · Tab lo encola para después"+ placeholder_busy_queue: "escribe para encolar un mensaje para después de este turno"billing:load_failed: "{label}: {error}"load_failed_label: "No se pudo cargar la facturación"diff --git a/locales/fr.yaml b/locales/fr.yamlindex c390af1d2f8..e08b0ed6e6d 100644--- a/locales/fr.yaml+++ b/locales/fr.yaml@@ -1941,6 +1941,22 @@ slash:quit:description: "Quitter la CLI (--delete supprime aussi l'historique de session)"cli:+ modern:+ thought_for: "Réflexion pendant {seconds}s"+ thought: "Réflexion"+ working: "En cours…"+ preparing: "Préparation de {what}…"+ header_hint: "/help pour les commandes · /tools et /skills listent ce qui est chargé"+ hint_steer: "orienter"+ hint_queue: "mettre en file"+ hint_interrupt: "interrompre"+ hint_stop: "arrêter"+ hint_commands: "commandes"+ hint_files: "fichiers"+ hint_shell: "shell"+ placeholder_busy_steer: "tapez pour orienter ce tour · Tab le met en file pour après"+ placeholder_busy_interrupt: "tapez pour rediriger ce tour · Tab le met en file pour après"+ placeholder_busy_queue: "tapez pour mettre un message en file après ce tour"billing:load_failed: "{label} : {error}"load_failed_label: "Facturation indisponible"diff --git a/locales/ga.yaml b/locales/ga.yamlindex 0dffd22baac..493011af2e0 100644--- a/locales/ga.yaml+++ b/locales/ga.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "Scoir den CLI (úsáid --delete chun stair an tseisiúin a bhaint freisin)"cli:+ modern:+ thought_for: "Smaoinigh ar feadh {seconds}s"+ thought: "Smaoinigh"+ working: "Ag obair…"+ preparing: "{what} á ullmhú…"+ header_hint: "/help le haghaidh orduithe · liostaíonn /tools agus /skills a bhfuil luchtaithe"+ hint_steer: "stiúir"+ hint_queue: "cuir sa scuaine"+ hint_interrupt: "cuir isteach air"+ hint_stop: "stop"+ hint_commands: "orduithe"+ hint_files: "comhaid"+ hint_shell: "blaosc"+ placeholder_busy_steer: "clóscríobh chun an seal seo a stiúradh · cuireann Tab sa scuaine é"+ placeholder_busy_interrupt: "clóscríobh chun an seal seo a atreorú · cuireann Tab sa scuaine é"+ placeholder_busy_queue: "clóscríobh chun teachtaireacht a chur sa scuaine don tréimhse ina dhiaidh"billing:load_failed: "{label}: {error}"load_failed_label: "Níorbh fhéidir an bhilleáil a lódáil"diff --git a/locales/hu.yaml b/locales/hu.yamlindex 7482e4d7a64..f96d6cfa722 100644--- a/locales/hu.yaml+++ b/locales/hu.yaml@@ -1706,6 +1706,22 @@ slash:quit:description: "Kilépés a CLI-ből (a --delete a munkamenet előzményeit is törli)"cli:+ modern:+ thought_for: "{seconds} mp-ig gondolkodott"+ thought: "Gondolkodott"+ working: "Dolgozik…"+ preparing: "{what} előkészítése…"+ header_hint: "/help a parancsokhoz · /tools és /skills mutatja, mi van betöltve"+ hint_steer: "terelés"+ hint_queue: "sorba"+ hint_interrupt: "megszakítás"+ hint_stop: "leállítás"+ hint_commands: "parancsok"+ hint_files: "fájlok"+ hint_shell: "shell"+ placeholder_busy_steer: "írj, hogy tereld ezt a kört · Tab sorba állítja utánra"+ placeholder_busy_interrupt: "írj, hogy átirányítsd ezt a kört · Tab sorba állítja utánra"+ placeholder_busy_queue: "írj, hogy üzenetet állíts sorba e kör utánra"billing:load_failed: "{label}: {error}"load_failed_label: "Nem sikerült betölteni a számlázást"diff --git a/locales/it.yaml b/locales/it.yamlindex 968974b505a..ac035be0699 100644--- a/locales/it.yaml+++ b/locales/it.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "Esci dalla CLI (usa --delete per eliminare anche la cronologia della sessione)"cli:+ modern:+ thought_for: "Ha pensato per {seconds}s"+ thought: "Ha pensato"+ working: "Al lavoro…"+ preparing: "Preparazione di {what}…"+ header_hint: "/help per i comandi · /tools e /skills mostrano cosa è caricato"+ hint_steer: "guida"+ hint_queue: "accoda"+ hint_interrupt: "interrompi"+ hint_stop: "ferma"+ hint_commands: "comandi"+ hint_files: "file"+ hint_shell: "shell"+ placeholder_busy_steer: "scrivi per guidare questo turno · Tab lo accoda per dopo"+ placeholder_busy_interrupt: "scrivi per reindirizzare questo turno · Tab lo accoda per dopo"+ placeholder_busy_queue: "scrivi per accodare un messaggio dopo questo turno"billing:load_failed: "{label}: {error}"load_failed_label: "Impossibile caricare la fatturazione"diff --git a/locales/ja.yaml b/locales/ja.yamlindex 0afa6b067dc..2277d752a86 100644--- a/locales/ja.yaml+++ b/locales/ja.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "CLI を終了(--delete でセッション履歴も削除)"cli:+ modern:+ thought_for: "{seconds}秒考えました"+ thought: "考えました"+ working: "作業中…"+ preparing: "{what} を準備中…"+ header_hint: "/help でコマンド · /tools と /skills で読み込み内容を表示"+ hint_steer: "誘導"+ hint_queue: "キュー"+ hint_interrupt: "中断"+ hint_stop: "停止"+ hint_commands: "コマンド"+ hint_files: "ファイル"+ hint_shell: "シェル"+ placeholder_busy_steer: "入力してこのターンを誘導 · Tab で後にキュー"+ placeholder_busy_interrupt: "入力してこのターンを切り替え · Tab で後にキュー"+ placeholder_busy_queue: "入力してこのターンの後にメッセージをキュー"billing:load_failed: "{label}: {error}"load_failed_label: "請求情報を読み込めませんでした"diff --git a/locales/ko.yaml b/locales/ko.yamlindex 02ca5d75d1d..14d054d6bd1 100644--- a/locales/ko.yaml+++ b/locales/ko.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "CLI 종료 (--delete를 붙이면 세션 기록도 삭제)"cli:+ modern:+ thought_for: "{seconds}초 동안 생각함"+ thought: "생각함"+ working: "작업 중…"+ preparing: "{what} 준비 중…"+ header_hint: "/help 명령어 · /tools, /skills 로 로드된 항목 보기"+ hint_steer: "유도"+ hint_queue: "대기열"+ hint_interrupt: "중단"+ hint_stop: "정지"+ hint_commands: "명령어"+ hint_files: "파일"+ hint_shell: "셸"+ placeholder_busy_steer: "입력해 이번 턴을 유도 · Tab 은 이후로 대기열에 추가"+ placeholder_busy_interrupt: "입력해 이번 턴을 전환 · Tab 은 이후로 대기열에 추가"+ placeholder_busy_queue: "입력해 이번 턴 이후 메시지를 대기열에 추가"billing:load_failed: "{label}: {error}"load_failed_label: "결제 정보를 불러올 수 없어요"diff --git a/locales/pt.yaml b/locales/pt.yamlindex eadf372ae12..00e05a24f4f 100644--- a/locales/pt.yaml+++ b/locales/pt.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "Sair da CLI (use --delete para também remover o histórico da sessão)"cli:+ modern:+ thought_for: "Pensou por {seconds}s"+ thought: "Pensou"+ working: "Trabalhando…"+ preparing: "Preparando {what}…"+ header_hint: "/help para comandos · /tools e /skills mostram o que está carregado"+ hint_steer: "guiar"+ hint_queue: "enfileirar"+ hint_interrupt: "interromper"+ hint_stop: "parar"+ hint_commands: "comandos"+ hint_files: "arquivos"+ hint_shell: "shell"+ placeholder_busy_steer: "digite para guiar este turno · Tab enfileira para depois"+ placeholder_busy_interrupt: "digite para redirecionar este turno · Tab enfileira para depois"+ placeholder_busy_queue: "digite para enfileirar uma mensagem para depois deste turno"billing:load_failed: "{label}: {error}"load_failed_label: "Não foi possível carregar a cobrança"diff --git a/locales/ru.yaml b/locales/ru.yamlindex 15436723521..39db5fc5c32 100644--- a/locales/ru.yaml+++ b/locales/ru.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "Выйти из CLI (с --delete также удаляется история сеанса)"cli:+ modern:+ thought_for: "Размышлял {seconds} с"+ thought: "Размышлял"+ working: "Работаю…"+ preparing: "Готовлю {what}…"+ header_hint: "/help — команды · /tools и /skills показывают загруженное"+ hint_steer: "направить"+ hint_queue: "в очередь"+ hint_interrupt: "прервать"+ hint_stop: "стоп"+ hint_commands: "команды"+ hint_files: "файлы"+ hint_shell: "shell"+ placeholder_busy_steer: "пишите, чтобы направить этот ход · Tab ставит в очередь на потом"+ placeholder_busy_interrupt: "пишите, чтобы перенаправить этот ход · Tab ставит в очередь на потом"+ placeholder_busy_queue: "пишите, чтобы поставить сообщение в очередь после этого хода"billing:load_failed: "{label}: {error}"load_failed_label: "Не удалось загрузить данные биллинга"diff --git a/locales/tr.yaml b/locales/tr.yamlindex f097a7eebd2..8e3bb8e9bed 100644--- a/locales/tr.yaml+++ b/locales/tr.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "CLI'dan çık (oturum geçmişini de silmek için --delete kullanın)"cli:+ modern:+ thought_for: "{seconds} sn düşündü"+ thought: "Düşündü"+ working: "Çalışıyor…"+ preparing: "{what} hazırlanıyor…"+ header_hint: "/help komutlar · /tools ve /skills yüklenenleri listeler"+ hint_steer: "yönlendir"+ hint_queue: "sıraya al"+ hint_interrupt: "kes"+ hint_stop: "durdur"+ hint_commands: "komutlar"+ hint_files: "dosyalar"+ hint_shell: "kabuk"+ placeholder_busy_steer: "bu turu yönlendirmek için yazın · Tab sonrası için sıraya alır"+ placeholder_busy_interrupt: "bu turu değiştirmek için yazın · Tab sonrası için sıraya alır"+ placeholder_busy_queue: "bu turdan sonrası için mesaj sıraya almak üzere yazın"billing:load_failed: "{label}: {error}"load_failed_label: "Faturalandırma yüklenemedi"diff --git a/locales/uk.yaml b/locales/uk.yamlindex 3405cff3964..c54c9feeb49 100644--- a/locales/uk.yaml+++ b/locales/uk.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "Вийти з CLI (--delete також видаляє історію сеансу)"cli:+ modern:+ thought_for: "Міркував {seconds} с"+ thought: "Міркував"+ working: "Працюю…"+ preparing: "Готую {what}…"+ header_hint: "/help — команди · /tools і /skills показують завантажене"+ hint_steer: "спрямувати"+ hint_queue: "у чергу"+ hint_interrupt: "перервати"+ hint_stop: "стоп"+ hint_commands: "команди"+ hint_files: "файли"+ hint_shell: "shell"+ placeholder_busy_steer: "пишіть, щоб спрямувати цей хід · Tab ставить у чергу на потім"+ placeholder_busy_interrupt: "пишіть, щоб перенаправити цей хід · Tab ставить у чергу на потім"+ placeholder_busy_queue: "пишіть, щоб поставити повідомлення в чергу після цього ходу"billing:load_failed: "{label}: {error}"load_failed_label: "Не вдалося завантажити дані оплати"diff --git a/locales/zh-hant.yaml b/locales/zh-hant.yamlindex c7f14ac6a9d..221b6e82eb8 100644--- a/locales/zh-hant.yaml+++ b/locales/zh-hant.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "離開 CLI(加上 --delete 同時移除工作階段歷史)"cli:+ modern:+ thought_for: "思考了 {seconds} 秒"+ thought: "思考"+ working: "工作中…"+ preparing: "正在準備 {what}…"+ header_hint: "/help 查看指令 · /tools 與 /skills 列出已載入內容"+ hint_steer: "引導"+ hint_queue: "排隊"+ hint_interrupt: "中斷"+ hint_stop: "停止"+ hint_commands: "指令"+ hint_files: "檔案"+ hint_shell: "終端"+ placeholder_busy_steer: "輸入以引導本輪 · Tab 排到之後"+ placeholder_busy_interrupt: "輸入以改變本輪方向 · Tab 排到之後"+ placeholder_busy_queue: "輸入以排隊一則本輪結束後的訊息"billing:load_failed: "{label}:{error}"load_failed_label: "無法載入帳務資訊"diff --git a/locales/zh.yaml b/locales/zh.yamlindex c4f8594d883..7a3c07aede3 100644--- a/locales/zh.yaml+++ b/locales/zh.yaml@@ -1689,6 +1689,22 @@ slash:quit:description: "退出 CLI(加 --delete 可同时删除会话历史)"cli:+ modern:+ thought_for: "思考了 {seconds} 秒"+ thought: "思考"+ working: "工作中…"+ preparing: "正在准备 {what}…"+ header_hint: "/help 查看命令 · /tools 和 /skills 列出已加载内容"+ hint_steer: "引导"+ hint_queue: "排队"+ hint_interrupt: "中断"+ hint_stop: "停止"+ hint_commands: "命令"+ hint_files: "文件"+ hint_shell: "终端"+ placeholder_busy_steer: "输入以引导本轮 · Tab 排到之后"+ placeholder_busy_interrupt: "输入以改变本轮方向 · Tab 排到之后"+ placeholder_busy_queue: "输入以排队一条本轮结束后的消息"billing:load_failed: "{label}:{error}"load_failed_label: "无法加载账单信息"diff --git a/tests/hermes_cli/test_cli_modern_layout.py b/tests/hermes_cli/test_cli_modern_layout.pynew file mode 100644index 00000000000..4d77e1c953f--- /dev/null+++ b/tests/hermes_cli/test_cli_modern_layout.py@@ -0,0 +1,67 @@+"""The glyph CLI layout (``display.cli_layout: modern``): scrollback rows never depend on the+terminal width, and the status line renders under the composer instead of above it."""+import re++import pytest+++def _plain(s: str) -> str:+ return re.sub(r"\x1b\[[0-9;]*m", "", s)+++def _run_turn(monkeypatch, width: int, *, modern: bool) -> list[str]:+ from cli import HermesCLI+ import cli as climod++ cli = HermesCLI.__new__(HermesCLI)+ cli._modern_layout = modern+ cli.show_reasoning, cli.reasoning_full = True, False+ cli.final_response_markdown, cli.show_timestamps = "raw", False+ cli._reset_stream_state()+ emitted: list[str] = []+ monkeypatch.setattr(climod, "_cprint", lambda s: emitted.append(_plain(s)))+ monkeypatch.setattr(climod, "_terminal_width_for_streaming", lambda: width)+ monkeypatch.setattr(HermesCLI, "_scrollback_box_width", lambda self: width)+ cli._stream_reasoning_delta("**Planning the change**\nI will read calc.py first.\n")+ cli._stream_delta("Added multiply to calc.py.\n")+ cli._flush_stream()+ return emitted++[email protected]("modern", [True, False])+def test_glyph_layout_scrollback_is_width_independent(monkeypatch, modern):+ narrow, wide = _run_turn(monkeypatch, 60, modern=modern), _run_turn(monkeypatch, 120, modern=modern)+ boxed = any(ch in line for line in wide for ch in "╭╮╰╯┌┐└┘")+ if not modern: # control: the classic layout's frames are sized to the terminal+ assert boxed and narrow != wide+ return+ assert narrow == wide and not boxed, wide+ thought = [line for line in wide if line.startswith("∴")]+ assert len(thought) == 1 and "Planning the change" in thought[0], wide+ assert "I will read calc.py first." not in "\n".join(wide) # collapsed unless /reasoning full+ assert any("Added multiply to calc.py." in line for line in wide)++[email protected]("modern", [True, False])+def test_status_line_sits_under_the_composer_only_in_the_glyph_layout(modern):+ from cli import HermesCLI++ cli = HermesCLI.__new__(HermesCLI)+ cli._modern_layout = modern+ names = ("sudo_widget", "secret_widget", "approval_widget", "clarify_widget", "spacer", "status_bar",+ "input_rule_top", "image_bar", "input_area", "input_rule_bot", "voice_status_bar", "completions_menu")+ order = cli._build_tui_layout_children(**{name: name for name in names})+ if modern:+ assert order.index("status_bar") > order.index("input_rule_bot")+ assert order[-1] == "status_bar"+ else:+ assert order.index("status_bar") < order.index("input_rule_top")+++def test_panel_rows_never_carry_a_newline():+ """A multi-line command (heredoc) in the approval panel wraps line by line, so no row breaks+ the panel's right border."""+ from cli import _wrap_panel_text_keep_ws++ rows = _wrap_panel_text_keep_ws("python3 - <<'PY'\nprint(sum(range(10)))\nPY", 30)+ assert rows == ["python3 - <<'PY'", "print(sum(range(10)))", "PY"]diff --git a/tests/hermes_cli/test_tool_gen_start_dedupe.py b/tests/hermes_cli/test_tool_gen_start_dedupe.pyindex 1f36e01fd14..caab669ca82 100644--- a/tests/hermes_cli/test_tool_gen_start_dedupe.py+++ b/tests/hermes_cli/test_tool_gen_start_dedupe.py@@ -16,6 +16,7 @@ def _announce(cli, names):def test_repeated_tool_in_one_batch_prints_once():cli = _make_cli(tool_progress="off")+ cli._modern_layout = False # the glyph layout shows "preparing" in the composer rule, not scrollbackprinted = _announce(cli, ["terminal", "terminal", "terminal", "read_file"])assert sum("preparing terminal" in p for p in printed) == 1assert sum("preparing read_file" in p for p in printed) == 1diff --git a/website/docs/user-guide/cli.md b/website/docs/user-guide/cli.mdindex 3afc1a35d1f..b7780178f88 100644--- a/website/docs/user-guide/cli.md+++ b/website/docs/user-guide/cli.md@@ -173,11 +173,39 @@ acknowledge it before continuing. Do not resend the queued input.<img className="docs-terminal-figure" src="/docs/img/docs/cli-layout.svg" alt="Stylized preview of the Hermes CLI layout showing the banner, conversation area, and fixed input prompt." /><p className="docs-figure-caption">The Hermes CLI banner, conversation stream, and fixed input prompt rendered as a stable docs figure instead of fragile text art.</p>-The welcome banner shows your model, terminal backend, working directory, available tools, and installed skills at a glance.+### Layout styles++`display.cli_layout` picks how the classic CLI draws. The default, `modern`, prints everything in the scrollback as plain rows that start with one glyph and never depend on the terminal width, so resizing the window can't garble earlier output:++```+❯ add a multiply function and run the tests+∴ Thought for 3s · Planning the change+● Read calc.py+● Patch 0.2s+│ calc.py+│ @@ -1,2 +1,6 @@+│ +def multiply(a, b):+│ + return a * b+✗ $ pytest -q 0.4s [exit 1]+☤ Hermes+Added multiply; pytest isn't installed here, so I ran the tests directly: 2 passed.+─ 15.0s · edited 1 file +4 -0 · read 2 files · 8:27 AM+── ⠹ Running tests · 14s ─────────────────────────── Add multiply to calc.py ─+❯ type to steer this turn · Tab queues it for after+──────────────────────────────────────────────────────────────────────────────+ gpt-5-mini · ctx [░░░░░░░░] 4% · ~/project (main) enter steer · tab queue · ctrl+c stop+```++- `❯` your message, `∴` a reasoning step collapsed to its title and duration (`/reasoning full` prints the text under a `│` gutter), `●` a finished tool call (`✗` in red when it failed, with its exit code), `│` an edit's diff under its row, `☤` the answer, and `─` the turn's summary line.+- The composer's top rule carries the live activity (spinner, what's running, elapsed time) on the left and the session title on the right; no spinner row is printed into the scrollback.+- The status line sits under the composer: model, context gauge, and working directory (with git branch) on the left; the keys that do something right now on the right.+- Launch shows a two-line header instead of the full banner; `/tools` and `/skills` list what is loaded.++Set `display.cli_layout: classic` to keep the boxed reasoning and answer panels, the status bar above the input, and the full welcome banner (which shows your model, terminal backend, working directory, available tools, and installed skills).### Status Bar-A persistent status bar sits above the input area, updating in real time:+In the `classic` layout a persistent status bar sits above the input area, updating in real time (the `modern` layout's status line under the composer reads the same data; an explicit `display.status_bar.fields` list chooses its left side too):```☤ claude-sonnet-4-20250514 │ 12.4K/200K │ [██████░░░░] 6% │ $0.06 │ 15m@@ -235,7 +263,7 @@ On macOS, `F6`/`F7` mean the physical function keys, not the media/system contro| `Ctrl+R` / `F7` | Toggle the live work dock between its multi-row preview and a single summary line without moving composer focus. `Ctrl+R` is the reliable fallback when macOS reserves the function-key row. Besides subagents and background processes, the dock shows a standing `/goal` (active, parked or paused, with turns used) on its top row and the prompts waiting in `/queue` on its bottom rows. || `Ctrl+D` | Exit (on an empty prompt; with text it deletes under the cursor). While the gateway runs a turn, it exits and leaves the turn running: the gateway finishes it, ends the session afterwards, and `hermes --resume` shows the reply. A turn that asks a question (approval or clarify) meanwhile waits for its timeout or for you to resume. Use `Ctrl+C` to stop the turn instead. || `Ctrl+Z` | Suspend Hermes to background (Unix only). Run `fg` in the shell to resume. |-| `Tab` | Accept auto-suggestion (ghost text) or autocomplete slash commands |+| `Tab` | Accept auto-suggestion (ghost text) or autocomplete slash commands. While the agent is working in the `modern` layout, `Tab` on a typed message queues it for the next turn instead of steering || `!<command>` | **Shell mode** — run a shell command yourself without spending a model turn (e.g. `!git status`, `!pytest -x`). See below. |**Multiline paste preview.** When you paste a multi-line block, the CLI echoes a compact single-line preview (`[pasted: 47 lines, 1,842 chars — press Enter to send]`) instead of dumping the whole payload into the scrollback. The full content is still what gets sent; this is just display polish.@@ -430,14 +458,14 @@ The `display.busy_input_mode` config key controls what happens when you press En| Mode | Behavior ||------|----------|-| `"interrupt"` (default) | Your message redirects the active turn. Model generation restarts with displayed reasoning and completed work preserved. A running foreground terminal command is moved to the background (not killed — you get a completion notification) so your message is read immediately; other running tools finish first |-| `"queue"` | Your message is queued as the next turn after the agent finishes. The queue lives on the gateway (crash-durable, visible to every attached client). Classic `hermes chat` always behaves this way: every line typed during a turn queues at the gateway, whatever this key says; `interrupt` and `steer` are TUI and Desktop behaviours |-| `"steer"` | Your message is injected into the current run via `/steer`, arriving at the agent after the next tool call — no interrupt, no new turn |+| `"interrupt"` (default for `display.cli_layout: classic`) | Your message redirects the active turn. Model generation restarts with displayed reasoning and completed work preserved. A running foreground terminal command is moved to the background (not killed — you get a completion notification) so your message is read immediately; other running tools finish first |+| `"queue"` | Your message is queued as the next turn after the agent finishes. The queue lives on the gateway (crash-durable, visible to every attached client). |+| `"steer"` (default for `display.cli_layout: modern`) | Your message is injected into the current run via `/steer`, arriving at the agent after the next tool call — no interrupt, no new turn. `Tab` queues instead |```yaml# ~/.hermes/config.yamldisplay:- busy_input_mode: "steer" # or "queue" or "interrupt" (default)+ busy_input_mode: "steer" # or "queue" or "interrupt"; unset follows display.cli_layout````"queue"` mode prepares a separate follow-up turn. `"steer"` always waits for the next tool-result boundary. The default `"interrupt"` mode responds sooner during model generation while avoiding cancellation of a running tool; a long foreground `terminal` command (a build, a poller) is handed to the background so the agent sees your message right away instead of after the command exits. Use `/stop` when you want to cancel the turn and its foreground work. Unknown values fall back to `"interrupt"`.