diff --git a/larry.sh b/larry.sh index eacb76f..c323ad6 100755 --- a/larry.sh +++ b/larry.sh @@ -286,6 +286,8 @@ sync_from_manifest() { if [ "$updated" -gt 0 ] || [ "$failed" -gt 0 ]; then log "manifest sync: $updated updated, $failed failed, $count total (from $base)" fi + LARRY_SYNC_UPDATED_COUNT="$updated" + LARRY_SYNC_FAILED_COUNT="$failed" return 0 } @@ -303,8 +305,20 @@ self_update() { [ -f "$LARRY_HOME/.last-sync-version" ] \ && last_sync=$(tr -d '[:space:]' < "$LARRY_HOME/.last-sync-version" 2>/dev/null) if [ "$last_sync" != "$LARRY_VERSION" ]; then + LARRY_SYNC_UPDATED_COUNT=0 + LARRY_SYNC_FAILED_COUNT=0 if sync_from_manifest "$LARRY_BASE_URL"; then printf '%s\n' "$LARRY_VERSION" > "$LARRY_HOME/.last-sync-version" 2>/dev/null || true + if [ "${LARRY_JUST_UPDATED:-0}" = "1" ] && [ -n "${LARRY_PREV_VERSION:-}" ]; then + # We came in via a phase-B self-replace; phase A then synced the rest. + LARRY_UPDATE_NOTICE="updated v${LARRY_PREV_VERSION} → v${LARRY_VERSION} (${LARRY_SYNC_UPDATED_COUNT} files synced from manifest)" + elif [ "$LARRY_SYNC_UPDATED_COUNT" -gt 0 ]; then + if [ -n "$last_sync" ]; then + LARRY_UPDATE_NOTICE="manifest sync v${last_sync} → v${LARRY_VERSION} (${LARRY_SYNC_UPDATED_COUNT} files updated)" + else + LARRY_UPDATE_NOTICE="first-run sync at v${LARRY_VERSION} (${LARRY_SYNC_UPDATED_COUNT} files synced from manifest)" + fi + fi fi fi @@ -334,7 +348,7 @@ self_update() { rm -f "$tmp" # Force phase A on the next launch by invalidating the sync stamp. rm -f "$LARRY_HOME/.last-sync-version" 2>/dev/null || true - exec env LARRY_JUST_UPDATED=1 "$self" ${ARG_DIR:+"$ARG_DIR"} + exec env LARRY_JUST_UPDATED=1 LARRY_PREV_VERSION="$LARRY_VERSION" "$self" ${ARG_DIR:+"$ARG_DIR"} } self_update @@ -1081,7 +1095,18 @@ main_loop() { fi fi - larry_say "Larry-Anywhere v$LARRY_VERSION ready. Model: $LARRY_MODEL." + # ── Startup banner ───────────────────────────────────────────────────────── + # Always print the version; print a prominent "JUST UPDATED" badge when the + # current launch came from a self-update so Bryan can verify the chain fired. + if [ -n "${LARRY_UPDATE_NOTICE:-}" ]; then + echo "" + printf '%s%s═══════════════════════════════════════════════════════════════%s\n' "$C_GREEN" "$C_BOLD" "$C_RESET" + printf '%s%s ✓ LARRY UPDATED%s\n' "$C_GREEN" "$C_BOLD" "$C_RESET" + printf '%s%s %s%s\n' "$C_GREEN" "$C_BOLD" "$LARRY_UPDATE_NOTICE" "$C_RESET" + printf '%s%s═══════════════════════════════════════════════════════════════%s\n' "$C_GREEN" "$C_BOLD" "$C_RESET" + echo "" + fi + larry_say "${C_BOLD}Larry-Anywhere v$LARRY_VERSION${C_RESET} ready. Model: $LARRY_MODEL." larry_say "Type your message and press Enter. Use '<<' alone on a line to start multi-line (end with 'EOF'). /help for commands." echo ""