mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(cli): add ChatConsole.status for /skills search
This commit is contained in:
parent
32519066dc
commit
fc417ed049
2 changed files with 30 additions and 0 deletions
13
cli.py
13
cli.py
|
|
@ -1355,6 +1355,19 @@ class ChatConsole:
|
|||
for line in output.rstrip("\n").split("\n"):
|
||||
_cprint(line)
|
||||
|
||||
@contextmanager
|
||||
def status(self, *_args, **_kwargs):
|
||||
"""Provide a no-op Rich-compatible status context.
|
||||
|
||||
Some slash command helpers use ``console.status(...)`` when running in
|
||||
the standalone CLI. Interactive chat routes those helpers through
|
||||
``ChatConsole()``, which historically only implemented ``print()``.
|
||||
Returning a silent context manager keeps slash commands compatible
|
||||
without duplicating the higher-level busy indicator already shown by
|
||||
``HermesCLI._busy_command()``.
|
||||
"""
|
||||
yield self
|
||||
|
||||
# ASCII Art - HERMES-AGENT logo (full width, single line - requires ~95 char terminal)
|
||||
HERMES_AGENT_LOGO = """[bold #FFD700]██╗ ██╗███████╗██████╗ ███╗ ███╗███████╗███████╗ █████╗ ██████╗ ███████╗███╗ ██╗████████╗[/]
|
||||
[bold #FFD700]██║ ██║██╔════╝██╔══██╗████╗ ████║██╔════╝██╔════╝ ██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝[/]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
from io import StringIO
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from rich.console import Console
|
||||
|
||||
from cli import ChatConsole
|
||||
from hermes_cli.skills_hub import do_check, do_install, do_list, do_update, handle_skills_slash
|
||||
|
||||
|
||||
|
|
@ -179,6 +181,21 @@ def test_do_update_reinstalls_outdated_skills(monkeypatch):
|
|||
assert "Updated 1 skill" in output
|
||||
|
||||
|
||||
def test_handle_skills_slash_search_accepts_chatconsole_without_status_errors():
|
||||
results = [type("R", (), {
|
||||
"name": "kubernetes",
|
||||
"description": "Cluster orchestration",
|
||||
"source": "skills.sh",
|
||||
"trust_level": "community",
|
||||
"identifier": "skills-sh/example/kubernetes",
|
||||
})()]
|
||||
|
||||
with patch("tools.skills_hub.unified_search", return_value=results), \
|
||||
patch("tools.skills_hub.create_source_router", return_value={}), \
|
||||
patch("tools.skills_hub.GitHubAuth"):
|
||||
handle_skills_slash("/skills search kubernetes", console=ChatConsole())
|
||||
|
||||
|
||||
def test_do_install_scans_with_resolved_identifier(monkeypatch, tmp_path, hub_env):
|
||||
import tools.skills_guard as guard
|
||||
import tools.skills_hub as hub
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue