Files
hermes-agent/hermes_cli/main_dep_hints.py
teknium1 23036e20a6 fix(ux): plain-language, actionable user-facing messages (core)
Squashed integration of the user-facing message audit for this surface set.
Full per-finding receipts: /tmp/ux-audit/lanes/*-receipt.md (campaign artifacts).
2026-09-15 04:12:13 -07:00

23 lines
1.2 KiB
Python

"""Plain-language copy for surfaces that cannot start because an optional dependency group is missing.
``hermes dashboard`` (fastapi + uvicorn) and ``hermes acp`` (agent-client-protocol) are installed by
the ``[all]`` / ``[acp]`` extras. A partial install, a pip-less uv venv or an interrupted update can
leave them out; the built-in repair is ``hermes update``, which reinstalls the extras into the same
interpreter. The manual fallback names the checkout directory and interpreter explicitly because a bare
``pip install -e '.[acp]'`` fails on PEP 668 systems and in venvs without pip.
"""
import sys
def missing_optional_deps_message(surface: str, what: str, extra: str) -> str:
"""``surface`` = "dashboard"/"ACP server"; ``what`` = "its web-server packages"; ``extra`` = "all"/"acp"."""
from hermes_cli.main import PROJECT_ROOT
return (
f"The {surface} can't start: {what} are missing from this install.\n"
"Run `hermes update` to reinstall dependencies. If that fails, run manually:\n"
f" cd {PROJECT_ROOT} && {sys.executable} -m pip install -e '.[{extra}]'\n"
f" (no pip in this venv: uv pip install -e '.[{extra}]')"
)