Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

daemon: auto-upgrade on plugin version drift (#302)

Aurora Capitale33b8eb239ad
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index cb21f2dd..fcc87a53 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -11,7 +11,7 @@
"name": "ops",
"description": "Business operations command center for Claude Code — 37 skills, 19 agents, smart background daemon. Manage communications (WhatsApp/Email/Slack/Telegram), projects, infrastructure (AWS), revenue (Stripe+RevenueCat), e-commerce, marketing, monitoring (Datadog/New Relic/OTEL), voice, and smart home (Homey Pro). Includes /gtm go-to-market planner, /ops:projects portfolio dashboard, /ops:ops-home control surface, and YOLO autonomous mode with 4 parallel C-suite agents.",
"source": "./claude-ops",
- "version": "2.10.1",
+ "version": "2.10.2",
"category": "productivity",
"keywords": [
"ops",
diff --git a/claude-ops/.claude-plugin/plugin.json b/claude-ops/.claude-plugin/plugin.json
index 0b8d95cb..4cbc9b6e 100644
--- a/claude-ops/.claude-plugin/plugin.json
+++ b/claude-ops/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "ops",
- "version": "2.10.1",
+ "version": "2.10.2",
"description": "Business operations command center for Claude Code — 37 skills, 19 agents, and a smart background daemon that manage communications (WhatsApp/Email/Slack/Telegram), projects, infrastructure (all AWS services), revenue (Stripe + RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4/GSC), monitoring (Datadog/New Relic/OTEL), and voice (Bland AI/ElevenLabs/Whisper). Includes /gtm go-to-market planner, /ops:projects portfolio dashboard, YOLO mode for autonomous operation with 4 parallel C-suite agents, and /ops:ops-home smart home control via Homey Pro.",
"author": {
"name": "Lifecycle Innovations Limited",
diff --git a/claude-ops/bin/ops-dash b/claude-ops/bin/ops-dash
index 935e040e..a2429879 100755
--- a/claude-ops/bin/ops-dash
+++ b/claude-ops/bin/ops-dash
@@ -1271,10 +1271,13 @@ render_section_actions() {
YOLO_LIST_NONEMPTY=""
echo "$YOLO_LIST" | grep -q '[^[:space:]]' && YOLO_LIST_NONEMPTY="1" || true
+ # Pad YOLO_IND to a fixed visible width (15 cols) so the a/d row aligns
+ # regardless of whether reports exist. "🤖 REPORT READY" = 15 visible cols
+ # (emoji renders as 2 cols). "no reports" = 10 cols, needs 5 trailing spaces.
if [[ -n "$YOLO_LIST_NONEMPTY" ]]; then
YOLO_IND="${BCYN}🤖 REPORT READY${RST}"
else
- YOLO_IND="${DIM2}no reports${RST}"
+ YOLO_IND="${DIM2}no reports${RST} "
fi
p ""
@@ -1289,7 +1292,7 @@ render_section_actions() {
sp " ${DIMX}│${RST} ${DIMX}│${RST}"
sp " ${DIMX}│${RST} ${BWHT}POWER${RST} ${BWHT}COMMS${RST} ${DIMX}│${RST}"
sp " ${DIMX}│${RST} ${DIMX}│${RST}"
- sp " ${DIMX}│${RST} ${BMAG}a${RST} ${WHT}YOLO mode${RST} ${YOLO_IND} ${BCYN}d${RST} ${WHT}Send message${RST} ${DIMX}│${RST}"
+ sp " ${DIMX}│${RST} ${BMAG}a${RST} ${WHT}YOLO mode${RST} ${YOLO_IND} ${BCYN}d${RST} ${WHT}Send message${RST} ${DIMX}│${RST}"
sp " ${DIMX}│${RST} ${BMAG}b${RST} ${WHT}Auto-merge PRs${RST} ${BCYN}e${RST} ${WHT}C-suite reports${RST} ${DIMX}│${RST}"
sp " ${DIMX}│${RST} ${BMAG}c${RST} ${WHT}Setup wizard${RST} ${DIMX}│${RST}"
sp " ${DIMX}│${RST} ${DIMX}│${RST}"
diff --git a/claude-ops/scripts/ops-daemon.sh b/claude-ops/scripts/ops-daemon.sh
index 54bb0078..4051253c 100755
--- a/claude-ops/scripts/ops-daemon.sh
+++ b/claude-ops/scripts/ops-daemon.sh
@@ -1052,6 +1052,55 @@ PY
# ── Phase 16: credential expiry (offline) ────────────────────────────────
# Reads *_expires_at / *_created_at from preferences.json and warns:
+# ── Self-upgrade on plugin version drift ──────────────────────────────────
+# Detects when a newer plugin cache version has been installed (e.g. via
+# `/plugin upgrade`) but the running daemon is still on the old version.
+# When drift is detected, calls ops-daemon-manager.sh upgrade — which rewrites
+# the plist + reloads launchd, causing this daemon process to exit and a
+# fresh one to start from the new cache. Idempotent. macOS-only.
+#
+# Runs every 5 minutes to keep cost low. Safe under SessionStart hook race
+# (manager script's mac_unload/load are themselves idempotent).
+check_self_upgrade() {
+ [[ "$(uname -s)" == "Darwin" ]] || return 0
+ local LAST_CHECK="$DATA_DIR/cache/.self_upgrade_ts"
+ local now; now=$(date +%s)
+ mkdir -p "$DATA_DIR/cache" 2>/dev/null || true
+ if [[ -f "$LAST_CHECK" ]]; then
+ local last; last=$(cat "$LAST_CHECK" 2>/dev/null || echo 0)
+ if (( now - last < 300 )); then return 0; fi
+ fi
+ date +%s > "$LAST_CHECK"
+
+ local cache_dir="$HOME/.claude/plugins/cache/ops-marketplace/ops"
+ [[ -d "$cache_dir" ]] || return 0
+
+ # Resolve newest installed version via lexicographic sort (semver-safe enough
+ # for our 2.x line; major bumps are rare and would trigger anyway).
+ local newest
+ newest=$(ls -1 "$cache_dir" 2>/dev/null | sort -V | tail -1)
+ [[ -n "$newest" ]] || return 0
+
+ local newest_root="$cache_dir/$newest"
+ local current_root="${CLAUDE_PLUGIN_ROOT:-}"
+ [[ -d "$newest_root/scripts" ]] || return 0
+
+ # No drift if we're already on newest
+ if [[ "$current_root" == "$newest_root" ]]; then return 0; fi
+
+ log "SELF-UPGRADE: drift detected — running=$current_root newest=$newest_root"
+ local mgr="$newest_root/scripts/ops-daemon-manager.sh"
+ if [[ -x "$mgr" ]]; then
+ # Fire-and-forget — manager will SIGTERM us via mac_unload. We exit on
+ # signal; launchd reloads us from the new plist path.
+ CLAUDE_PLUGIN_ROOT="$newest_root" bash "$mgr" upgrade --plugin-root "$newest_root" >> "$LOG_FILE" 2>&1 &
+ log "SELF-UPGRADE: triggered manager upgrade to $newest"
+ else
+ log "SELF-UPGRADE: manager not executable at $mgr — skipping"
+ fi
+}
+
+# Credential expiry & rotation alerts. Warns when a stored key:
# - expires within WARN_DAYS (7)
# - keys older than MAX_KEY_AGE_DAYS (180) — rotation recommended
# Strictly offline — never makes a network call. Dedups per (credential, day).
@@ -1712,6 +1761,7 @@ while true; do
# ── Phase 16: infrastructure hardening ───────────────────────────────────
check_rate_limits # Every 5 min: reset rollover windows + warnings
check_credential_expiry # Hourly: offline check of *_expires_at / *_created_at
+ check_self_upgrade # Every 5 min: auto-upgrade plist on version drift
write_daemon_health