From 7c0f6c07a278f68d8898201b517ebf202c5d9441 Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Tue, 14 Apr 2026 11:15:14 +0800 Subject: [PATCH] fix: add npm build step for Web UI during installation The install script ran 'npm install' successfully but never built the web UI, causing web_dist/ to be missing from the pip package. The pyproject.toml declares hermes_cli = ['web_dist/**/*'] as package data, but web_dist is only created by 'npm run build' in the web/ subdirectory. This change: - Adds a 'build' script to the root package.json that builds the web UI - Adds 'npm run build' after 'npm install' in install_node_deps() - Failure is a warning (not fatal) since the CLI works without the Web UI --- package.json | 1 + scripts/install.sh | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/package.json b/package.json index 8d738c36e305..f07219b90483 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "An AI agent with advanced tool-calling capabilities, featuring a flexible toolsets system for organizing and managing tools.", "private": true, "scripts": { + "build": "cd web && npm install && npm run build", "postinstall": "echo '✅ Browser tools ready. Run: python run_agent.py --help'" }, "repository": { diff --git a/scripts/install.sh b/scripts/install.sh index 053d32380911..000bd71a13d8 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1079,6 +1079,15 @@ install_node_deps() { npm install --silent 2>/dev/null || { log_warn "npm install failed (browser tools may not work)" } + + # Build the web UI (web_dist/ is included in the pip package) + log_info "Building web UI..." + if ! npm run build 2>/dev/null; then + log_warn "Web UI build failed — CLI may lack the Web UI (not required for core functionality)" + else + log_success "Web UI built successfully" + fi + log_success "Node.js dependencies installed" # Install Playwright browser + system dependencies.