diff --git a/image-recipe/build-auto-installer-iso.sh b/image-recipe/build-auto-installer-iso.sh index bf9675fa..c12a3dd1 100755 --- a/image-recipe/build-auto-installer-iso.sh +++ b/image-recipe/build-auto-installer-iso.sh @@ -1222,8 +1222,12 @@ fi # Include AIUI web app (Claude chat interface) AIUI_INCLUDED=0 -# Search multiple locations for a pre-built AIUI app +# Search multiple locations for a pre-built AIUI app. +# demo/aiui is the canonical AIUI bundle checked into the repo and is +# tried first so ISO builds on a fresh clone work without needing any +# external AIUI checkout. for AIUI_DIR in \ + "$SCRIPT_DIR/../demo/aiui" \ "$SCRIPT_DIR/../../AIUI/packages/app/dist" \ "$HOME/AIUI/packages/app/dist" \ "/home/archipelago/AIUI/packages/app/dist" \ @@ -1246,7 +1250,7 @@ done if [ "$AIUI_INCLUDED" = "0" ]; then echo " ⚠️ AIUI not found — build it first:" echo " cd ~/AIUI/packages/app && VITE_BASE_PATH=/aiui/ npx vite build" - echo " Searched: ~/AIUI, /home/archipelago/AIUI, /opt/archipelago/web-ui/aiui" + echo " Searched: demo/aiui, ~/AIUI, /home/archipelago/AIUI, /opt/archipelago/web-ui/aiui" fi # Copy app manifests diff --git a/scripts/self-update.sh b/scripts/self-update.sh index 4261cd0e..f203a6b5 100755 --- a/scripts/self-update.sh +++ b/scripts/self-update.sh @@ -157,12 +157,23 @@ else exit 1 fi -# Install frontend (preserve aiui and claude-login.html) +# Install frontend (always ship fresh AIUI from demo/aiui; preserve claude-login.html) BUILT_WEB="$REPO_DIR/web/dist/neode-ui" if [ -d "$BUILT_WEB" ]; then - # Sync new files, preserving aiui/ and claude-login.html + # Bake AIUI into the built tree so rsync --delete does not wipe it. + # demo/aiui is the canonical AIUI bundle checked into the repo; copying + # it here means every self-update ships a matching AIUI version instead + # of preserving whatever stale copy happened to be on disk (which is + # empty on nodes where an earlier ad-hoc deploy blew it away). + if [ -d "$REPO_DIR/demo/aiui" ] && [ -f "$REPO_DIR/demo/aiui/index.html" ]; then + log "Staging AIUI bundle from demo/aiui into frontend dist..." + rm -rf "$BUILT_WEB/aiui" + cp -r "$REPO_DIR/demo/aiui" "$BUILT_WEB/aiui" + else + warn "demo/aiui not found in repo; existing /opt/archipelago/web-ui/aiui will be wiped by rsync --delete" + fi + # Sync new files, preserving claude-login.html (per-node admin bookmark) sudo rsync -a --delete \ - --exclude 'aiui' \ --exclude 'claude-login.html' \ "$BUILT_WEB/" "$INSTALL_WEB/" ok "Frontend installed"