Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions hermes_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4788,8 +4788,10 @@ def cmd_dashboard(args):
print("Install them with: pip install hermes-agent[web]")
sys.exit(1)

if not _build_web_ui(PROJECT_ROOT / "web", fatal=True):
sys.exit(1)
# Skip runtime build when pre-built assets are provided (e.g. Nix install)
if "HERMES_WEB_DIST" not in os.environ:
if not _build_web_ui(PROJECT_ROOT / "web", fatal=True):
sys.exit(1)

from hermes_cli.web_server import start_server
start_server(
Expand Down
2 changes: 1 addition & 1 deletion hermes_cli/web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"Run 'hermes web' to auto-install, or: pip install hermes-agent[web]"
)

WEB_DIST = Path(__file__).parent / "web_dist"
WEB_DIST = Path(os.environ["HERMES_WEB_DIST"]) if "HERMES_WEB_DIST" in os.environ else Path(__file__).parent / "web_dist"
_log = logging.getLogger(__name__)

app = FastAPI(title="Hermes Agent", version=__version__)
Expand Down
22 changes: 21 additions & 1 deletion nix/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@
!(pkgs.lib.hasInfix "/index-cache/" path);
};

# Build the web UI frontend
webDist = pkgs.buildNpmPackage {
pname = "hermes-web-ui";
version = "0.0.0";
src = ../web;
npmDepsHash = "sha256-Y0pOzdFG8BLjfvCLmsvqYpjxFjAQabXp1i7X9W/cCU4=";
buildPhase = ''
npx tsc -b
npx vite build --outDir dist
'';
installPhase = ''
cp -r dist $out
'';
};

runtimeDeps = with pkgs; [
nodejs_20 ripgrep git openssh ffmpeg tirith
];
Expand All @@ -31,12 +46,17 @@
runHook preInstall

mkdir -p $out/share/hermes-agent $out/bin

cp -r ${bundledSkills} $out/share/hermes-agent/skills

# Install pre-built web UI into the location the server expects
cp -r ${webDist} $out/share/hermes-agent/web_dist

${pkgs.lib.concatMapStringsSep "\n" (name: ''
makeWrapper ${hermesVenv}/bin/${name} $out/bin/${name} \
--suffix PATH : "${runtimePath}" \
--set HERMES_BUNDLED_SKILLS $out/share/hermes-agent/skills
--set HERMES_BUNDLED_SKILLS $out/share/hermes-agent/skills \
--set HERMES_WEB_DIST $out/share/hermes-agent/web_dist
'') [ "hermes" "hermes-agent" "hermes-acp" ]}

runHook postInstall
Expand Down
18 changes: 9 additions & 9 deletions nix/python.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nix/python.nix — uv2nix virtual environment builder
{
python311,
python312,
lib,
callPackage,
uv2nix,
Expand Down Expand Up @@ -37,28 +37,28 @@ let

pythonPackageOverrides = final: _prev:
if isAarch64Darwin then {
numpy = mkPrebuiltOverride final python311.pkgs.numpy { };
numpy = mkPrebuiltOverride final python312.pkgs.numpy { };

av = mkPrebuiltOverride final python311.pkgs.av { };
av = mkPrebuiltOverride final python312.pkgs.av { };

humanfriendly = mkPrebuiltOverride final python311.pkgs.humanfriendly { };
humanfriendly = mkPrebuiltOverride final python312.pkgs.humanfriendly { };

coloredlogs = mkPrebuiltOverride final python311.pkgs.coloredlogs {
coloredlogs = mkPrebuiltOverride final python312.pkgs.coloredlogs {
humanfriendly = [ ];
};

onnxruntime = mkPrebuiltOverride final python311.pkgs.onnxruntime {
onnxruntime = mkPrebuiltOverride final python312.pkgs.onnxruntime {
coloredlogs = [ ];
numpy = [ ];
packaging = [ ];
};

ctranslate2 = mkPrebuiltOverride final python311.pkgs.ctranslate2 {
ctranslate2 = mkPrebuiltOverride final python312.pkgs.ctranslate2 {
numpy = [ ];
pyyaml = [ ];
};

faster-whisper = mkPrebuiltOverride final python311.pkgs.faster-whisper {
faster-whisper = mkPrebuiltOverride final python312.pkgs.faster-whisper {
av = [ ];
ctranslate2 = [ ];
huggingface-hub = [ ];
Expand All @@ -70,7 +70,7 @@ let

pythonSet =
(callPackage pyproject-nix.build.packages {
python = python311;
python = python312;
}).overrideScope
(lib.composeManyExtensions [
pyproject-build-systems.overlays.default
Expand Down
1 change: 1 addition & 0 deletions scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@
"yuewang1@microsoft.com": "imink",
"1736355688@qq.com": "hedgeho9X",
"bernylinville@devopsthink.org": "bernylinville",
"code@booze.dog": "boozedog",
"brian@bde.io": "briandevans",
"hubin_ll@qq.com": "LLQWQ",
}
Expand Down
84 changes: 75 additions & 9 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.