feat(ui): ensure cross-platform one-click setup and default Showcase UI routing

- Add explicit root route (/) in server.py to guarantee Showcase UI is served by default, routing /admin to the Admin Debug Console
- Enhance dynamic Angular dist detection across multiple standard output paths
- Add automated Node.js/npm detection and installation fallbacks to start scripts and installers across macOS, Linux, and Windows
- Automatically build Showcase UI when launching via start.sh, start.bat/start.ps1, or artemis ui if frontend artifacts are missing
- Add Node.js / npm and Showcase UI status inspection rows to artemis doctor
- Support artemis mcp --install for one-click IDE integration and add make build-ui target
This commit is contained in:
somew1nd committed 2026-08-18 17:22:49 -07:00
1 parent 6fa4768893
commit fc6ddad655
15 files changed
+598 -64

No files matched your search

+39 -3
View File
@@ -40,6 +40,9 @@ function Update-EnvironmentPath {
"$env:LOCALAPPDATA\Microsoft\WinGet\Links",
"$env:LOCALAPPDATA\Android\Sdk\platform-tools",
"$env:ProgramFiles\Android\platform-tools",
"$env:ProgramFiles\nodejs",
"${env:ProgramFiles(x86)}\nodejs",
"$env:APPDATA\npm",
"C:\ProgramData\chocolatey\bin",
"$env:USERPROFILE\scoop\shims",
"$env:USERPROFILE\.local\bin",
@@ -134,9 +137,42 @@ if (-not (Test-Path ".env")) {
Write-Host " ✔ .env configuration file exists." -ForegroundColor Green
}
# 5. Toolchain Readiness Summary
Write-Host "`n5. Toolchain Readiness Summary:" -ForegroundColor Yellow
$tools = @("adb", "ffmpeg", "scrcpy", "uv")
# 5. Check and Build Showcase UI (Angular)
Write-Host "`n5. Checking Showcase UI Build (Angular)..." -ForegroundColor Yellow
$ShowcaseIndex = "$RootDir\apps\showcase_ui\dist\frontend\browser\index.html"
$ShowcaseIndexAlt1 = "$RootDir\apps\showcase_ui\dist\browser\index.html"
$ShowcaseIndexAlt2 = "$RootDir\apps\showcase_ui\dist\index.html"
if ((-not (Test-Path $ShowcaseIndex)) -and (-not (Test-Path $ShowcaseIndexAlt1)) -and (-not (Test-Path $ShowcaseIndexAlt2))) {
if (-not (Test-CommandExists "npm")) {
if (Test-CommandExists "winget") {
Write-Host " ⚡ Node.js/npm not found. Installing Node.js LTS via WinGet..." -ForegroundColor Cyan
winget install --id OpenJS.NodeJS.LTS -e --accept-source-agreements --accept-package-agreements --silent 2>$null | Out-Null
Update-EnvironmentPath
}
}
if (Test-CommandExists "npm") {
Write-Host " 🎨 Compiling Angular Showcase UI..." -ForegroundColor Cyan
Push-Location "$RootDir\apps\showcase_ui"
try {
npm install --silent
npm run build
Write-Host " ✔ Showcase UI compiled successfully." -ForegroundColor Green
} catch {
Write-Host " ⚠ Failed to build Showcase UI: $_" -ForegroundColor DarkYellow
} finally {
Pop-Location
}
} else {
Write-Host " ⚠ Could not find npm. Showcase UI will show fallback notice on launch." -ForegroundColor DarkYellow
}
} else {
Write-Host " ✔ Showcase UI build already exists." -ForegroundColor Green
}
# 6. Toolchain Readiness Summary
Write-Host "`n6. Toolchain Readiness Summary:" -ForegroundColor Yellow
$tools = @("adb", "ffmpeg", "scrcpy", "uv", "npm")
foreach ($t in $tools) {
if (Test-CommandExists $t) {
$p = (Get-Command $t).Source
+39 -2
View File
@@ -247,11 +247,47 @@ setup_env_file() {
fi
}
# Function to check and build Showcase UI
setup_showcase_ui() {
echo -e "\n${BOLD}6. Checking Showcase UI Build (Angular)...${NC}"
local SHOWCASE_INDEX="${ROOT_DIR}/apps/showcase_ui/dist/frontend/browser/index.html"
local SHOWCASE_INDEX_ALT1="${ROOT_DIR}/apps/showcase_ui/dist/browser/index.html"
local SHOWCASE_INDEX_ALT2="${ROOT_DIR}/apps/showcase_ui/dist/index.html"
if [ ! -f "${SHOWCASE_INDEX}" ] && [ ! -f "${SHOWCASE_INDEX_ALT1}" ] && [ ! -f "${SHOWCASE_INDEX_ALT2}" ]; then
if ! has_cmd npm; then
echo -e " ${YELLOW}⚡ npm/Node.js not found. Auto-installing Node.js...${NC}"
if [ "${OS_TYPE}" = "Darwin" ] && has_cmd brew; then
brew install node >/dev/null 2>&1 || true
elif [ "${OS_TYPE}" = "Linux" ]; then
local SUDO_CMD=""
if [ "$(id -u)" -ne 0 ] && has_cmd sudo; then SUDO_CMD="sudo"; fi
if has_cmd apt-get; then
${SUDO_CMD} apt-get update -qq && ${SUDO_CMD} apt-get install -y -qq nodejs npm >/dev/null 2>&1 || true
elif has_cmd dnf; then
${SUDO_CMD} dnf install -y nodejs npm >/dev/null 2>&1 || true
elif has_cmd pacman; then
${SUDO_CMD} pacman -S --noconfirm nodejs npm >/dev/null 2>&1 || true
fi
fi
fi
if has_cmd npm; then
echo -e " ${YELLOW}🎨 Building Angular Showcase UI...${NC}"
(cd "${ROOT_DIR}/apps/showcase_ui" && npm install --silent && npm run build)
echo -e " ${GREEN}✓ Showcase UI compiled successfully.${NC}"
else
echo -e " ${YELLOW}⚠ Could not find npm. Showcase UI will show fallback notice on launch.${NC}"
fi
else
echo -e " ${GREEN}✓ Showcase UI build already exists.${NC}"
fi
}
# Function to display system readiness report
verify_readiness() {
echo -e "\n${BOLD}6. Toolchain Readiness Summary:${NC}"
echo -e "\n${BOLD}7. Toolchain Readiness Summary:${NC}"
local tools=("adb" "ffmpeg" "scrcpy" "uv" "python3")
local tools=("adb" "ffmpeg" "scrcpy" "uv" "python3" "npm")
for t in "${tools[@]}"; do
if has_cmd "$t"; then
local loc
@@ -268,6 +304,7 @@ install_system_packages
ensure_uv
setup_python_env
setup_env_file
setup_showcase_ui
verify_readiness
echo -e "\n${BOLD}${CYAN}======================================================${NC}"
+35 -1
View File
@@ -35,6 +35,9 @@ function Update-EnvironmentPath {
"$env:LOCALAPPDATA\Microsoft\WinGet\Links",
"$env:LOCALAPPDATA\Android\Sdk\platform-tools",
"$env:ProgramFiles\Android\platform-tools",
"$env:ProgramFiles\nodejs",
"${env:ProgramFiles(x86)}\nodejs",
"$env:APPDATA\npm",
"C:\ProgramData\chocolatey\bin",
"$env:USERPROFILE\scoop\shims",
"$env:USERPROFILE\.local\bin",
@@ -97,8 +100,39 @@ if (-not (Test-Path ".env")) {
Write-Host " 📦 Synchronizing Python runtime and project dependencies..." -ForegroundColor Cyan
uv sync --quiet
# 6. Launch unified Showcase UI & open browser
# 6. Check and build Showcase UI if not already compiled
$ShowcaseIndex = "$RootDir\apps\showcase_ui\dist\frontend\browser\index.html"
$ShowcaseIndexAlt1 = "$RootDir\apps\showcase_ui\dist\browser\index.html"
$ShowcaseIndexAlt2 = "$RootDir\apps\showcase_ui\dist\index.html"
if ((-not (Test-Path $ShowcaseIndex)) -and (-not (Test-Path $ShowcaseIndexAlt1)) -and (-not (Test-Path $ShowcaseIndexAlt2))) {
if (-not (Test-CommandExists "npm")) {
if (Test-CommandExists "winget") {
Write-Host " ⚡ Node.js/npm not found. Installing Node.js LTS via WinGet..." -ForegroundColor Yellow
winget install --id OpenJS.NodeJS.LTS -e --accept-source-agreements --accept-package-agreements --silent 2>$null | Out-Null
Update-EnvironmentPath
}
}
if (Test-CommandExists "npm") {
Write-Host " 🎨 Showcase UI build not found. Compiling Angular Showcase UI..." -ForegroundColor Yellow
Push-Location "$RootDir\apps\showcase_ui"
try {
npm install --silent
npm run build
Write-Host " ✔ Showcase UI compiled successfully." -ForegroundColor Green
} catch {
Write-Host " ⚠ Failed to build Showcase UI: $_" -ForegroundColor DarkYellow
} finally {
Pop-Location
}
} else {
Write-Host " ⚠ Node.js/npm not found. Please install Node.js (>= 18) to compile Showcase UI." -ForegroundColor DarkYellow
}
}
# 7. Launch unified Showcase UI & open browser
Write-Host " 🚀 Launching Artemis Showcase UI & Admin Console..." -ForegroundColor Green
Write-Host " 💡 Tip: Connect to Antigravity / Claude Desktop anytime: artemis mcp --install all" -ForegroundColor Cyan
if ($NoOpen) {
uv run artemis ui --port $Port --no-open
} else {