aidevops 3.31.67 → 3.31.69

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.67-blue.svg)](https://github.com/marcusquinn/aidevops/releases)
63
+ [![Version](https://img.shields.io/badge/Version-3.31.69-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.67
1
+ 3.31.69
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.67
8
+ # Version: 3.31.69
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.67",
3
+ "version": "3.31.69",
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.67
15
+ # Version: 3.31.69
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,187 @@ _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
+ local version_prefix=""
1210
+ version_prefix="# ""Version:"
1211
+
1212
+ diff_output=$(git -C "$INSTALL_DIR" diff --unified=0 "$deployed_sha" "$current_sha" -- setup.sh 2>/dev/null) || return 1
1213
+ while IFS= read -r line; do
1214
+ case "$line" in
1215
+ "diff --git "* | "index "* | "--- "* | "+++ "* | "@@"*)
1216
+ continue
1217
+ ;;
1218
+ +* | -*)
1219
+ payload="${line#?}"
1220
+ if [[ "$payload" != "$version_prefix "* ]]; then
1221
+ return 1
1222
+ fi
1223
+ ;;
1224
+ esac
1225
+ done <<<"$diff_output"
1226
+
1227
+ return 0
1228
+ }
1229
+
1230
+ _setup_ai_session_plan_file() {
1231
+ local filepath="$1"
1232
+ local deployed_sha="$2"
1233
+ local current_sha="$3"
1234
+
1235
+ case "$filepath" in
1236
+ setup.sh)
1237
+ if _setup_ai_session_setup_sh_version_only "$deployed_sha" "$current_sha"; then
1238
+ print_info "setup.sh drift is release-version metadata only; incremental setup can continue"
1239
+ else
1240
+ print_warning "setup.sh changed beyond the release-version header; full setup required"
1241
+ _SETUP_AI_SESSION_REQUIRES_FULL=1
1242
+ fi
1243
+ ;;
1244
+ aidevops.sh)
1245
+ _SETUP_AI_SESSION_NEEDS_CLI=1
1246
+ ;;
1247
+ .agents/hooks/*)
1248
+ _SETUP_AI_SESSION_NEEDS_HOOKS=1
1249
+ ;;
1250
+ .agents/scripts/setup/modules/schedulers*.sh | .agents/scripts/setup/_scheduler_runtime.sh)
1251
+ _SETUP_AI_SESSION_NEEDS_PULSE=1
1252
+ ;;
1253
+ .agents/scripts/setup/modules/agent-deploy.sh | .agents/scripts/setup/modules/plugins.sh)
1254
+ :
1255
+ ;;
1256
+ .agents/scripts/setup/*)
1257
+ print_warning "Setup implementation changed ($filepath); full setup required"
1258
+ _SETUP_AI_SESSION_REQUIRES_FULL=1
1259
+ ;;
1260
+ packages/gui-api/* | packages/gui-desktop/* | packages/gui-shared/* | packages/gui-web/*)
1261
+ _SETUP_AI_SESSION_NEEDS_GUI=1
1262
+ ;;
1263
+ esac
1264
+
1265
+ return 0
1266
+ }
1267
+
1268
+ _setup_ai_session_build_plan() {
1269
+ local changed_files="$1"
1270
+ local deployed_sha="$2"
1271
+ local current_sha="$3"
1272
+ local filepath=""
1273
+
1274
+ _setup_ai_session_reset_plan
1275
+ # Deploying agents is the cheap, atomic baseline: it copies .agents/, writes
1276
+ # VERSION, writes .deployed-sha, and restarts pulse asynchronously.
1277
+ _SETUP_AI_SESSION_NEEDS_AGENTS=1
1278
+ while IFS= read -r filepath; do
1279
+ [[ -n "$filepath" ]] || continue
1280
+ _setup_ai_session_plan_file "$filepath" "$deployed_sha" "$current_sha"
1281
+ done <<<"$changed_files"
1282
+
1283
+ return 0
1284
+ }
1285
+
1286
+ _setup_ai_session_verify_deploy() {
1287
+ local expected_sha="$1"
1288
+ local repo_version=""
1289
+ local deployed_version=""
1290
+ local deployed_sha=""
1291
+
1292
+ if [[ -f "$INSTALL_DIR/VERSION" ]]; then
1293
+ repo_version=$(tr -d '[:space:]' <"$INSTALL_DIR/VERSION" 2>/dev/null) || repo_version=""
1294
+ fi
1295
+ if [[ -f "$HOME/.aidevops/agents/VERSION" ]]; then
1296
+ deployed_version=$(tr -d '[:space:]' <"$HOME/.aidevops/agents/VERSION" 2>/dev/null) || deployed_version=""
1297
+ fi
1298
+ if [[ -f "$HOME/.aidevops/.deployed-sha" ]]; then
1299
+ deployed_sha=$(tr -d '[:space:]' <"$HOME/.aidevops/.deployed-sha" 2>/dev/null) || deployed_sha=""
1300
+ fi
1301
+
1302
+ if [[ -z "$repo_version" || "$repo_version" != "$deployed_version" ]]; then
1303
+ print_warning "AI-session incremental verification failed: repo version=${repo_version:-unknown}, deployed=${deployed_version:-none}"
1304
+ return 1
1305
+ fi
1306
+ if [[ -z "$deployed_sha" || "$deployed_sha" != "$expected_sha" ]]; then
1307
+ print_warning "AI-session incremental verification failed: deployed SHA=${deployed_sha:-none}, expected=${expected_sha:0:12}"
1308
+ return 1
1309
+ fi
1310
+
1311
+ return 0
1312
+ }
1313
+
1314
+ _setup_run_ai_session_incremental() {
1315
+ local os="$1"
1316
+ local stamp_file="$HOME/.aidevops/.deployed-sha"
1317
+ local deployed_sha=""
1318
+ local current_sha=""
1319
+ local changed_files=""
1320
+
1321
+ print_info "AI-session setup mode: applying changed deploy stages only"
1322
+ if [[ ! -d "$INSTALL_DIR/.git" || ! -f "$stamp_file" ]]; then
1323
+ print_warning "AI-session incremental setup needs a git checkout and deployed SHA stamp"
1324
+ return 1
1325
+ fi
1326
+
1327
+ deployed_sha=$(tr -d '[:space:]' <"$stamp_file" 2>/dev/null) || deployed_sha=""
1328
+ current_sha=$(git -C "$INSTALL_DIR" rev-parse HEAD 2>/dev/null) || current_sha=""
1329
+ if [[ -z "$deployed_sha" || -z "$current_sha" ]]; then
1330
+ print_warning "AI-session incremental setup could not resolve deployed/current SHAs"
1331
+ return 1
1332
+ fi
1333
+
1334
+ if [[ "$deployed_sha" == "$current_sha" ]]; then
1335
+ print_success "AI-session setup: deployed SHA already matches current checkout"
1336
+ _setup_ai_session_verify_deploy "$current_sha" || return $?
1337
+ return 0
1338
+ fi
1339
+
1340
+ changed_files=$(git -C "$INSTALL_DIR" diff --name-only "$deployed_sha" "$current_sha" 2>/dev/null) || {
1341
+ print_warning "AI-session incremental setup could not diff ${deployed_sha:0:7}..${current_sha:0:7}"
1342
+ return 1
1343
+ }
1344
+
1345
+ _setup_ai_session_build_plan "$changed_files" "$deployed_sha" "$current_sha"
1346
+ if [[ "$_SETUP_AI_SESSION_REQUIRES_FULL" -eq 1 ]]; then
1347
+ return 1
1348
+ fi
1349
+
1350
+ _setup_init_stage_timing_log
1351
+ if [[ "$_SETUP_AI_SESSION_NEEDS_AGENTS" -eq 1 ]]; then
1352
+ _time_step "$SETUP_STAGE_AGENTS" deploy_aidevops_agents || return $?
1353
+ _time_step "$SETUP_STAGE_OPENCODE_PLUGINS" setup_opencode_plugins || return $?
1354
+ _time_step "$SETUP_STAGE_HOTFIX_CONFIG" _deploy_hotfix_config || return $?
1355
+ fi
1356
+ if [[ "$_SETUP_AI_SESSION_NEEDS_CLI" -eq 1 ]]; then
1357
+ _time_step "install_aidevops_cli" install_aidevops_cli || return $?
1358
+ fi
1359
+ if [[ "$_SETUP_AI_SESSION_NEEDS_HOOKS" -eq 1 ]]; then
1360
+ _time_step "$SETUP_STAGE_HOOKS" setup_safety_hooks || return $?
1361
+ fi
1362
+ if [[ "$_SETUP_AI_SESSION_NEEDS_PULSE" -eq 1 ]]; then
1363
+ _time_step "$SETUP_STAGE_PULSE" setup_supervisor_pulse "$os" || return $?
1364
+ fi
1365
+ if [[ "$_SETUP_AI_SESSION_NEEDS_GUI" -eq 1 ]]; then
1366
+ _time_step "setup_gui_desktop_app_opt_in" _setup_offer_gui_desktop_app || return $?
1367
+ fi
1368
+
1369
+ _setup_ai_session_verify_deploy "$current_sha" || return $?
1370
+ print_success "AI-session incremental setup complete (${deployed_sha:0:7}→${current_sha:0:7})"
1371
+ return 0
1372
+ }
1373
+
1188
1374
  _setup_run_scoped_stage() {
1189
1375
  local os="$1"
1190
1376
  local stage
@@ -1205,8 +1391,8 @@ _setup_run_scoped_stage() {
1205
1391
  ;;
1206
1392
  "$SETUP_STAGE_AGENTS")
1207
1393
  _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
1394
+ _time_step "$SETUP_STAGE_OPENCODE_PLUGINS" setup_opencode_plugins
1395
+ _time_step "$SETUP_STAGE_HOTFIX_CONFIG" _deploy_hotfix_config
1210
1396
  ;;
1211
1397
  "$SETUP_STAGE_HOOKS")
1212
1398
  _time_step "$SETUP_STAGE_HOOKS" setup_safety_hooks
@@ -1220,6 +1406,13 @@ _setup_run_scoped_stage() {
1220
1406
  "$SETUP_STAGE_GUI_DESKTOP")
1221
1407
  _time_step "$SETUP_STAGE_GUI_DESKTOP" setup_gui_desktop_app
1222
1408
  ;;
1409
+ "$SETUP_STAGE_AI_SESSION")
1410
+ if ! _setup_run_ai_session_incremental "$os"; then
1411
+ print_warning "AI-session incremental setup unavailable or failed; falling back to full setup"
1412
+ _setup_run_non_interactive || return $?
1413
+ _setup_post_setup_steps "$os" || return $?
1414
+ fi
1415
+ ;;
1223
1416
  *)
1224
1417
  print_error "Unsupported canonical setup stage: $stage"
1225
1418
  return 1
@@ -1266,9 +1459,9 @@ _setup_run_non_interactive() {
1266
1459
  _time_step "$SETUP_STAGE_OPENCODE" setup_opencode_cli
1267
1460
  _time_step "validate_opencode_config" validate_opencode_config
1268
1461
  _time_step "$SETUP_STAGE_AGENTS" deploy_aidevops_agents
1269
- _time_step "setup_opencode_plugins" setup_opencode_plugins
1462
+ _time_step "$SETUP_STAGE_OPENCODE_PLUGINS" setup_opencode_plugins
1270
1463
  _time_step "_setup_install_pulse_plist_early" _setup_install_pulse_plist_early
1271
- _time_step "_deploy_hotfix_config" _deploy_hotfix_config
1464
+ _time_step "$SETUP_STAGE_HOTFIX_CONFIG" _deploy_hotfix_config
1272
1465
  _time_step "setup_opencode_desktop_launcher" setup_opencode_desktop_launcher
1273
1466
  _time_step "sync_agent_sources" sync_agent_sources
1274
1467
  _time_step "install_aidevops_cli" install_aidevops_cli