mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-18 04:41:56 +00:00
feat(tui): find bundled entry.js from wheel before falling back to npm build
Add _find_bundled_tui() that checks for hermes_cli/tui_dist/entry.js (present in wheel installs) and wire it into _make_tui_argv() between the HERMES_TUI_DIR prebuilt path and the npm install fallback.
This commit is contained in:
parent
d69eab1efd
commit
b2bf658442
2 changed files with 35 additions and 0 deletions
21
tests/hermes_cli/test_tui_bundled.py
Normal file
21
tests/hermes_cli/test_tui_bundled.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
from pathlib import Path
|
||||
|
||||
|
||||
def test_tui_finds_bundled_entry_js(tmp_path):
|
||||
"""_find_bundled_tui finds entry.js bundled in the package."""
|
||||
tui_dist = tmp_path / "hermes_cli" / "tui_dist"
|
||||
tui_dist.mkdir(parents=True)
|
||||
entry = tui_dist / "entry.js"
|
||||
entry.write_text("// bundled TUI", encoding="utf-8")
|
||||
|
||||
from hermes_cli.main import _find_bundled_tui
|
||||
result = _find_bundled_tui(hermes_cli_dir=tmp_path / "hermes_cli")
|
||||
assert result is not None
|
||||
assert result.name == "entry.js"
|
||||
|
||||
|
||||
def test_tui_returns_none_when_no_bundle(tmp_path):
|
||||
"""_find_bundled_tui returns None when no bundle exists."""
|
||||
from hermes_cli.main import _find_bundled_tui
|
||||
result = _find_bundled_tui(hermes_cli_dir=tmp_path / "hermes_cli")
|
||||
assert result is None
|
||||
Loading…
Add table
Add a link
Reference in a new issue