aidevops 3.31.66 → 3.31.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -60,7 +60,7 @@ The result: an AI operations platform that manages projects across every busines
60
60
  [![Copyright](https://img.shields.io/badge/Copyright-Marcus%20Quinn%202025--2026-blue.svg)](https://github.com/marcusquinn)
61
61
 
62
62
  <!-- Release & Version Info -->
63
- [![Version](https://img.shields.io/badge/Version-3.31.66-blue.svg)](https://github.com/marcusquinn/aidevops/releases)
63
+ [![Version](https://img.shields.io/badge/Version-3.31.68-blue.svg)](https://github.com/marcusquinn/aidevops/releases)
64
64
  [![npm version](https://img.shields.io/npm/v/aidevops)](https://www.npmjs.com/package/aidevops)
65
65
  [![Homebrew](https://img.shields.io/badge/homebrew-marcusquinn%2Ftap-orange)](https://github.com/marcusquinn/homebrew-tap)
66
66
  [![GitHub repository](https://img.shields.io/badge/github-repository-181717.svg?logo=github)](https://github.com/marcusquinn/aidevops)
package/VERSION CHANGED
@@ -1 +1 @@
1
- 3.31.66
1
+ 3.31.68
package/aidevops.sh CHANGED
@@ -5,7 +5,7 @@
5
5
  # AI DevOps Framework CLI
6
6
  # Usage: aidevops <command> [options]
7
7
  #
8
- # Version: 3.31.66
8
+ # Version: 3.31.68
9
9
 
10
10
  set -euo pipefail
11
11
 
@@ -206,6 +206,16 @@ source "${AIDEVOPS_CLI_MODULES_DIR}/aidevops-update-lib.sh"
206
206
  # shellcheck disable=SC1091
207
207
  source "${AIDEVOPS_CLI_MODULES_DIR}/aidevops-upgrade-planning-lib.sh"
208
208
 
209
+ _run_update_setup() {
210
+ local setup_script="${INSTALL_DIR}/setup.sh"
211
+ if [[ ! -f "$setup_script" ]]; then
212
+ print_error "setup.sh not found at $setup_script"
213
+ return 1
214
+ fi
215
+ bash "$setup_script" --stage ai-session
216
+ return $?
217
+ }
218
+
209
219
  # Update/upgrade command
210
220
  cmd_update() {
211
221
  local skip_project_sync=false
@@ -243,8 +253,8 @@ cmd_update() {
243
253
  deployed_version=$(cat "$HOME/.aidevops/agents/VERSION" 2>/dev/null || echo "none")
244
254
  if [[ "$repo_version" != "$deployed_version" ]]; then
245
255
  print_warning "Deployed agents ($deployed_version) don't match repo ($repo_version)"
246
- print_info "Re-running setup to sync agents..."
247
- bash "$INSTALL_DIR/setup.sh" --non-interactive
256
+ print_info "Re-running incremental setup to sync agents..."
257
+ _run_update_setup
248
258
  else
249
259
  # t2706: VERSION matches but .deployed-sha may lag HEAD when
250
260
  # fixes land between releases. Detect and redeploy on framework
@@ -267,8 +277,8 @@ cmd_update() {
267
277
  fi
268
278
  if [[ "$has_code_drift" -eq 1 ]]; then
269
279
  print_warning "Deployed scripts drifted (${deployed_sha:0:7}→${local_hash:0:7})"
270
- print_info "Re-running setup to deploy latest scripts..."
271
- bash "$INSTALL_DIR/setup.sh" --non-interactive
280
+ print_info "Re-running incremental setup to deploy latest scripts..."
281
+ _run_update_setup
272
282
  fi
273
283
  # GH#21735: workflow templates can change between
274
284
  # releases without triggering has_code_drift (templates
@@ -313,9 +323,9 @@ cmd_update() {
313
323
  # Verify supply chain integrity before applying changes
314
324
  _update_verify_signature
315
325
  echo ""
316
- print_info "Running setup to apply changes..."
326
+ print_info "Running incremental setup to apply changes (falls back to full setup if needed)..."
317
327
  local setup_exit=0
318
- bash "$INSTALL_DIR/setup.sh" --non-interactive || setup_exit=$?
328
+ _run_update_setup || setup_exit=$?
319
329
  git checkout -- . 2>/dev/null || true
320
330
  local repo_version deployed_version
321
331
  repo_version=$(cat "$INSTALL_DIR/VERSION" 2>/dev/null || echo "unknown")
@@ -770,6 +780,7 @@ _cmd_setup_help() {
770
780
  printf '%s\n' " tabby Sync Tabby terminal profiles only"
771
781
  printf '%s\n' " pulse Install/refresh the pulse scheduler only"
772
782
  printf '%s\n' " gui-desktop Install native macOS aidevops.app only"
783
+ printf '%s\n' " ai-session Apply changed deploy stages; fall back to full setup if needed"
773
784
  printf '%s\n' " full Run ./setup.sh --non-interactive"
774
785
  return 0
775
786
  }
@@ -830,7 +841,7 @@ cmd_setup() {
830
841
  _help_commands() {
831
842
  echo "Commands:"
832
843
  echo " init [features] Initialize aidevops in current project"
833
- echo " setup --scope <s> Run scoped setup/deploy (opencode, agents, hooks, tabby, pulse, gui-desktop, full)"
844
+ echo " setup --scope <s> Run scoped setup/deploy (opencode, agents, hooks, tabby, pulse, gui-desktop, ai-session, full)"
834
845
  echo " init-routines Scaffold private routines repo (--org <name> | --local)"
835
846
  echo " upgrade-planning Upgrade TODO.md/PLANS.md to latest templates"
836
847
  echo " features List available features for init"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aidevops",
3
- "version": "3.31.66",
3
+ "version": "3.31.68",
4
4
  "description": "AI DevOps Framework - AI-assisted development workflows, code quality, and deployment automation",
5
5
  "type": "module",
6
6
  "workspaces": [
package/setup.sh CHANGED
@@ -12,7 +12,7 @@ shopt -s inherit_errexit 2>/dev/null || true
12
12
  # AI Assistant Server Access Framework Setup Script
13
13
  # Helps developers set up the framework for their infrastructure
14
14
  #
15
- # Version: 3.31.66
15
+ # Version: 3.31.68
16
16
  #
17
17
  # Quick Install:
18
18
  # npm install -g aidevops && aidevops update (recommended)
@@ -38,6 +38,9 @@ SETUP_STAGE_HOOKS="setup_safety_hooks"
38
38
  SETUP_STAGE_TABBY="setup_tabby"
39
39
  SETUP_STAGE_PULSE="setup_supervisor_pulse"
40
40
  SETUP_STAGE_GUI_DESKTOP="setup_gui_desktop_app"
41
+ SETUP_STAGE_AI_SESSION="setup_ai_session_incremental"
42
+ SETUP_STAGE_OPENCODE_PLUGINS="setup_opencode_plugins"
43
+ SETUP_STAGE_HOTFIX_CONFIG="_deploy_hotfix_config"
41
44
  SETUP_GUI_APP_NAME="aidevops.app"
42
45
  SETUP_OS_DARWIN="Darwin"
43
46
  # Python compatibility floor used by setup checks and skill/tool gating.
@@ -392,8 +395,8 @@ parse_args() {
392
395
  echo "Use --clean after removing or renaming agents to sync deletions."
393
396
  echo "Use --interactive to control each step individually."
394
397
  echo "Use --non-interactive for CI/CD or AI agent shells (no stdin required)."
395
- echo "Use --stage for targeted updates: opencode, agents, hooks, tabby, pulse, gui-desktop, full."
396
- echo "Stage aliases: ${SETUP_STAGE_OPENCODE}, ${SETUP_STAGE_AGENTS}, ${SETUP_STAGE_HOOKS}, ${SETUP_STAGE_TABBY}, ${SETUP_STAGE_PULSE}, ${SETUP_STAGE_GUI_DESKTOP}."
398
+ echo "Use --stage for targeted updates: opencode, agents, hooks, tabby, pulse, gui-desktop, ai-session, full."
399
+ echo "Stage aliases: ${SETUP_STAGE_OPENCODE}, ${SETUP_STAGE_AGENTS}, ${SETUP_STAGE_HOOKS}, ${SETUP_STAGE_TABBY}, ${SETUP_STAGE_PULSE}, ${SETUP_STAGE_GUI_DESKTOP}, ${SETUP_STAGE_AI_SESSION}."
397
400
  echo "Install ${SETUP_GUI_APP_NAME} explicitly with --stage gui-desktop or AIDEVOPS_GUI_DESKTOP_INSTALL=true."
398
401
  echo "Use --update to check for tool updates after setup completes."
399
402
  exit 0
@@ -419,6 +422,7 @@ _setup_print_stage_help() {
419
422
  printf ' tabby | %s Sync Tabby profiles only\n' "$SETUP_STAGE_TABBY"
420
423
  printf ' pulse | %s Install/refresh pulse scheduler only\n' "$SETUP_STAGE_PULSE"
421
424
  printf ' gui-desktop | gui | app | %s Install native macOS %s only\n' "$SETUP_STAGE_GUI_DESKTOP" "$SETUP_GUI_APP_NAME"
425
+ printf ' ai-session | ai | %s Run changed deploy stages, then full setup on failure\n' "$SETUP_STAGE_AI_SESSION"
422
426
  printf '%s\n' " full Run the default full setup path"
423
427
  return 0
424
428
  }
@@ -432,6 +436,7 @@ _setup_canonical_stage() {
432
436
  tabby | "$SETUP_STAGE_TABBY") printf '%s' "$SETUP_STAGE_TABBY" ;;
433
437
  pulse | "$SETUP_STAGE_PULSE") printf '%s' "$SETUP_STAGE_PULSE" ;;
434
438
  gui-desktop | gui | app | "$SETUP_STAGE_GUI_DESKTOP") printf '%s' "$SETUP_STAGE_GUI_DESKTOP" ;;
439
+ ai-session | ai | "$SETUP_STAGE_AI_SESSION") printf '%s' "$SETUP_STAGE_AI_SESSION" ;;
435
440
  full) printf '%s' "full" ;;
436
441
  *) return 1 ;;
437
442
  esac
@@ -1185,6 +1190,185 @@ _setup_init_stage_timing_log() {
1185
1190
  return 0
1186
1191
  }
1187
1192
 
1193
+ _setup_ai_session_reset_plan() {
1194
+ _SETUP_AI_SESSION_NEEDS_AGENTS=0
1195
+ _SETUP_AI_SESSION_NEEDS_CLI=0
1196
+ _SETUP_AI_SESSION_NEEDS_HOOKS=0
1197
+ _SETUP_AI_SESSION_NEEDS_PULSE=0
1198
+ _SETUP_AI_SESSION_NEEDS_GUI=0
1199
+ _SETUP_AI_SESSION_REQUIRES_FULL=0
1200
+ return 0
1201
+ }
1202
+
1203
+ _setup_ai_session_setup_sh_version_only() {
1204
+ local deployed_sha="$1"
1205
+ local current_sha="$2"
1206
+ local diff_output=""
1207
+ local line=""
1208
+ local payload=""
1209
+
1210
+ diff_output=$(git -C "$INSTALL_DIR" diff --unified=0 "$deployed_sha" "$current_sha" -- setup.sh 2>/dev/null) || return 1
1211
+ while IFS= read -r line; do
1212
+ case "$line" in
1213
+ "diff --git "* | "index "* | "--- "* | "+++ "* | "@@"*)
1214
+ continue
1215
+ ;;
1216
+ +* | -*)
1217
+ payload="${line#?}"
1218
+ if [[ "$payload" != "# Version: 3.31.68
1219
+ return 1
1220
+ fi
1221
+ ;;
1222
+ esac
1223
+ done <<<"$diff_output"
1224
+
1225
+ return 0
1226
+ }
1227
+
1228
+ _setup_ai_session_plan_file() {
1229
+ local filepath="$1"
1230
+ local deployed_sha="$2"
1231
+ local current_sha="$3"
1232
+
1233
+ case "$filepath" in
1234
+ setup.sh)
1235
+ if _setup_ai_session_setup_sh_version_only "$deployed_sha" "$current_sha"; then
1236
+ print_info "setup.sh drift is release-version metadata only; incremental setup can continue"
1237
+ else
1238
+ print_warning "setup.sh changed beyond the release-version header; full setup required"
1239
+ _SETUP_AI_SESSION_REQUIRES_FULL=1
1240
+ fi
1241
+ ;;
1242
+ aidevops.sh)
1243
+ _SETUP_AI_SESSION_NEEDS_CLI=1
1244
+ ;;
1245
+ .agents/hooks/*)
1246
+ _SETUP_AI_SESSION_NEEDS_HOOKS=1
1247
+ ;;
1248
+ .agents/scripts/setup/modules/schedulers*.sh | .agents/scripts/setup/_scheduler_runtime.sh)
1249
+ _SETUP_AI_SESSION_NEEDS_PULSE=1
1250
+ ;;
1251
+ .agents/scripts/setup/modules/agent-deploy.sh | .agents/scripts/setup/modules/plugins.sh)
1252
+ :
1253
+ ;;
1254
+ .agents/scripts/setup/*)
1255
+ print_warning "Setup implementation changed ($filepath); full setup required"
1256
+ _SETUP_AI_SESSION_REQUIRES_FULL=1
1257
+ ;;
1258
+ packages/gui-api/* | packages/gui-desktop/* | packages/gui-shared/* | packages/gui-web/*)
1259
+ _SETUP_AI_SESSION_NEEDS_GUI=1
1260
+ ;;
1261
+ esac
1262
+
1263
+ return 0
1264
+ }
1265
+
1266
+ _setup_ai_session_build_plan() {
1267
+ local changed_files="$1"
1268
+ local deployed_sha="$2"
1269
+ local current_sha="$3"
1270
+ local filepath=""
1271
+
1272
+ _setup_ai_session_reset_plan
1273
+ # Deploying agents is the cheap, atomic baseline: it copies .agents/, writes
1274
+ # VERSION, writes .deployed-sha, and restarts pulse asynchronously.
1275
+ _SETUP_AI_SESSION_NEEDS_AGENTS=1
1276
+ while IFS= read -r filepath; do
1277
+ [[ -n "$filepath" ]] || continue
1278
+ _setup_ai_session_plan_file "$filepath" "$deployed_sha" "$current_sha"
1279
+ done <<<"$changed_files"
1280
+
1281
+ return 0
1282
+ }
1283
+
1284
+ _setup_ai_session_verify_deploy() {
1285
+ local expected_sha="$1"
1286
+ local repo_version=""
1287
+ local deployed_version=""
1288
+ local deployed_sha=""
1289
+
1290
+ if [[ -f "$INSTALL_DIR/VERSION" ]]; then
1291
+ repo_version=$(tr -d '[:space:]' <"$INSTALL_DIR/VERSION" 2>/dev/null) || repo_version=""
1292
+ fi
1293
+ if [[ -f "$HOME/.aidevops/agents/VERSION" ]]; then
1294
+ deployed_version=$(tr -d '[:space:]' <"$HOME/.aidevops/agents/VERSION" 2>/dev/null) || deployed_version=""
1295
+ fi
1296
+ if [[ -f "$HOME/.aidevops/.deployed-sha" ]]; then
1297
+ deployed_sha=$(tr -d '[:space:]' <"$HOME/.aidevops/.deployed-sha" 2>/dev/null) || deployed_sha=""
1298
+ fi
1299
+
1300
+ if [[ -z "$repo_version" || "$repo_version" != "$deployed_version" ]]; then
1301
+ print_warning "AI-session incremental verification failed: repo version=${repo_version:-unknown}, deployed=${deployed_version:-none}"
1302
+ return 1
1303
+ fi
1304
+ if [[ -z "$deployed_sha" || "$deployed_sha" != "$expected_sha" ]]; then
1305
+ print_warning "AI-session incremental verification failed: deployed SHA=${deployed_sha:-none}, expected=${expected_sha:0:12}"
1306
+ return 1
1307
+ fi
1308
+
1309
+ return 0
1310
+ }
1311
+
1312
+ _setup_run_ai_session_incremental() {
1313
+ local os="$1"
1314
+ local stamp_file="$HOME/.aidevops/.deployed-sha"
1315
+ local deployed_sha=""
1316
+ local current_sha=""
1317
+ local changed_files=""
1318
+
1319
+ print_info "AI-session setup mode: applying changed deploy stages only"
1320
+ if [[ ! -d "$INSTALL_DIR/.git" || ! -f "$stamp_file" ]]; then
1321
+ print_warning "AI-session incremental setup needs a git checkout and deployed SHA stamp"
1322
+ return 1
1323
+ fi
1324
+
1325
+ deployed_sha=$(tr -d '[:space:]' <"$stamp_file" 2>/dev/null) || deployed_sha=""
1326
+ current_sha=$(git -C "$INSTALL_DIR" rev-parse HEAD 2>/dev/null) || current_sha=""
1327
+ if [[ -z "$deployed_sha" || -z "$current_sha" ]]; then
1328
+ print_warning "AI-session incremental setup could not resolve deployed/current SHAs"
1329
+ return 1
1330
+ fi
1331
+
1332
+ if [[ "$deployed_sha" == "$current_sha" ]]; then
1333
+ print_success "AI-session setup: deployed SHA already matches current checkout"
1334
+ _setup_ai_session_verify_deploy "$current_sha" || return $?
1335
+ return 0
1336
+ fi
1337
+
1338
+ changed_files=$(git -C "$INSTALL_DIR" diff --name-only "$deployed_sha" "$current_sha" 2>/dev/null) || {
1339
+ print_warning "AI-session incremental setup could not diff ${deployed_sha:0:7}..${current_sha:0:7}"
1340
+ return 1
1341
+ }
1342
+
1343
+ _setup_ai_session_build_plan "$changed_files" "$deployed_sha" "$current_sha"
1344
+ if [[ "$_SETUP_AI_SESSION_REQUIRES_FULL" -eq 1 ]]; then
1345
+ return 1
1346
+ fi
1347
+
1348
+ _setup_init_stage_timing_log
1349
+ if [[ "$_SETUP_AI_SESSION_NEEDS_AGENTS" -eq 1 ]]; then
1350
+ _time_step "$SETUP_STAGE_AGENTS" deploy_aidevops_agents || return $?
1351
+ _time_step "$SETUP_STAGE_OPENCODE_PLUGINS" setup_opencode_plugins || return $?
1352
+ _time_step "$SETUP_STAGE_HOTFIX_CONFIG" _deploy_hotfix_config || return $?
1353
+ fi
1354
+ if [[ "$_SETUP_AI_SESSION_NEEDS_CLI" -eq 1 ]]; then
1355
+ _time_step "install_aidevops_cli" install_aidevops_cli || return $?
1356
+ fi
1357
+ if [[ "$_SETUP_AI_SESSION_NEEDS_HOOKS" -eq 1 ]]; then
1358
+ _time_step "$SETUP_STAGE_HOOKS" setup_safety_hooks || return $?
1359
+ fi
1360
+ if [[ "$_SETUP_AI_SESSION_NEEDS_PULSE" -eq 1 ]]; then
1361
+ _time_step "$SETUP_STAGE_PULSE" setup_supervisor_pulse "$os" || return $?
1362
+ fi
1363
+ if [[ "$_SETUP_AI_SESSION_NEEDS_GUI" -eq 1 ]]; then
1364
+ _time_step "setup_gui_desktop_app_opt_in" _setup_offer_gui_desktop_app || return $?
1365
+ fi
1366
+
1367
+ _setup_ai_session_verify_deploy "$current_sha" || return $?
1368
+ print_success "AI-session incremental setup complete (${deployed_sha:0:7}→${current_sha:0:7})"
1369
+ return 0
1370
+ }
1371
+
1188
1372
  _setup_run_scoped_stage() {
1189
1373
  local os="$1"
1190
1374
  local stage
@@ -1205,8 +1389,8 @@ _setup_run_scoped_stage() {
1205
1389
  ;;
1206
1390
  "$SETUP_STAGE_AGENTS")
1207
1391
  _time_step "$SETUP_STAGE_AGENTS" deploy_aidevops_agents
1208
- _time_step "setup_opencode_plugins" setup_opencode_plugins
1209
- _time_step "_deploy_hotfix_config" _deploy_hotfix_config
1392
+ _time_step "$SETUP_STAGE_OPENCODE_PLUGINS" setup_opencode_plugins
1393
+ _time_step "$SETUP_STAGE_HOTFIX_CONFIG" _deploy_hotfix_config
1210
1394
  ;;
1211
1395
  "$SETUP_STAGE_HOOKS")
1212
1396
  _time_step "$SETUP_STAGE_HOOKS" setup_safety_hooks
@@ -1220,6 +1404,13 @@ _setup_run_scoped_stage() {
1220
1404
  "$SETUP_STAGE_GUI_DESKTOP")
1221
1405
  _time_step "$SETUP_STAGE_GUI_DESKTOP" setup_gui_desktop_app
1222
1406
  ;;
1407
+ "$SETUP_STAGE_AI_SESSION")
1408
+ if ! _setup_run_ai_session_incremental "$os"; then
1409
+ print_warning "AI-session incremental setup unavailable or failed; falling back to full setup"
1410
+ _setup_run_non_interactive || return $?
1411
+ _setup_post_setup_steps "$os" || return $?
1412
+ fi
1413
+ ;;
1223
1414
  *)
1224
1415
  print_error "Unsupported canonical setup stage: $stage"
1225
1416
  return 1
@@ -1266,9 +1457,9 @@ _setup_run_non_interactive() {
1266
1457
  _time_step "$SETUP_STAGE_OPENCODE" setup_opencode_cli
1267
1458
  _time_step "validate_opencode_config" validate_opencode_config
1268
1459
  _time_step "$SETUP_STAGE_AGENTS" deploy_aidevops_agents
1269
- _time_step "setup_opencode_plugins" setup_opencode_plugins
1460
+ _time_step "$SETUP_STAGE_OPENCODE_PLUGINS" setup_opencode_plugins
1270
1461
  _time_step "_setup_install_pulse_plist_early" _setup_install_pulse_plist_early
1271
- _time_step "_deploy_hotfix_config" _deploy_hotfix_config
1462
+ _time_step "$SETUP_STAGE_HOTFIX_CONFIG" _deploy_hotfix_config
1272
1463
  _time_step "setup_opencode_desktop_launcher" setup_opencode_desktop_launcher
1273
1464
  _time_step "sync_agent_sources" sync_agent_sources
1274
1465
  _time_step "install_aidevops_cli" install_aidevops_cli