aidevops 3.13.66 → 3.13.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/VERSION CHANGED
@@ -1 +1 @@
1
- 3.13.66
1
+ 3.13.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.13.66
8
+ # Version: 3.13.68
9
9
 
10
10
  set -euo pipefail
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aidevops",
3
- "version": "3.13.66",
3
+ "version": "3.13.68",
4
4
  "description": "AI DevOps Framework - AI-assisted development workflows, code quality, and deployment automation",
5
5
  "type": "module",
6
6
  "bin": {
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.13.66
15
+ # Version: 3.13.68
16
16
  #
17
17
  # Quick Install:
18
18
  # npm install -g aidevops && aidevops update (recommended)
@@ -1144,6 +1144,16 @@ _setup_lock_pid_alive() {
1144
1144
  return $?
1145
1145
  }
1146
1146
 
1147
+ _setup_lock_pid_is_noninteractive_setup() {
1148
+ local pid="$1"
1149
+ local owner_args=""
1150
+ [[ "$pid" =~ ^[0-9]+$ ]] || return 1
1151
+ owner_args=$(ps -p "$pid" -o args= 2>/dev/null || true)
1152
+ [[ -n "$owner_args" ]] || return 0
1153
+ [[ "$owner_args" == *"setup.sh"* && "$owner_args" == *"--non-interactive"* ]]
1154
+ return $?
1155
+ }
1156
+
1147
1157
  _setup_lock_dir_age_seconds() {
1148
1158
  local lock_dir="$1"
1149
1159
  local lock_mtime=""
@@ -1177,12 +1187,23 @@ _setup_register_child_pid() {
1177
1187
 
1178
1188
  _setup_cleanup_noninteractive_children() {
1179
1189
  local pid=""
1180
- [[ "${SETUP_NONINTERACTIVE_TERMINATING:-false}" == "true" ]] || return 0
1190
+ local grace_s="${AIDEVOPS_SETUP_CHILD_TERM_GRACE_S:-2}"
1191
+ local has_live_child=false
1192
+ [[ "$grace_s" =~ ^[0-9]+$ ]] || grace_s=2
1181
1193
  for pid in ${SETUP_NONINTERACTIVE_CHILD_PIDS:-}; do
1182
1194
  if _setup_lock_pid_alive "$pid"; then
1195
+ has_live_child=true
1183
1196
  kill -TERM "$pid" 2>/dev/null || true
1184
1197
  fi
1185
1198
  done
1199
+ if [[ "$has_live_child" == "true" && "$grace_s" -gt 0 ]]; then
1200
+ sleep "$grace_s" 2>/dev/null || true
1201
+ fi
1202
+ for pid in ${SETUP_NONINTERACTIVE_CHILD_PIDS:-}; do
1203
+ if _setup_lock_pid_alive "$pid"; then
1204
+ kill -KILL "$pid" 2>/dev/null || true
1205
+ fi
1206
+ done
1186
1207
  for pid in ${SETUP_NONINTERACTIVE_CHILD_PIDS:-}; do
1187
1208
  wait "$pid" 2>/dev/null || true
1188
1209
  done
@@ -1229,7 +1250,7 @@ _setup_acquire_noninteractive_setup_lock() {
1229
1250
  printf '%s\n' "$$" >"$lock_dir/owner.pid" 2>/dev/null || true
1230
1251
  printf '%s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" >"$lock_dir/started_at" 2>/dev/null || true
1231
1252
  printf '%s\n' "$0 $*" >"$lock_dir/command" 2>/dev/null || true
1232
- trap _setup_release_noninteractive_setup_lock EXIT
1253
+ trap '_setup_cleanup_noninteractive_children; _setup_release_noninteractive_setup_lock' EXIT
1233
1254
  trap '_setup_noninteractive_signal_exit TERM' TERM
1234
1255
  trap '_setup_noninteractive_signal_exit INT' INT
1235
1256
  return 0
@@ -1253,6 +1274,18 @@ _setup_acquire_noninteractive_setup_lock() {
1253
1274
  continue
1254
1275
  fi
1255
1276
  if _setup_lock_pid_alive "$owner_pid"; then
1277
+ if ! _setup_lock_pid_is_noninteractive_setup "$owner_pid"; then
1278
+ local _owner_lock_age="0"
1279
+ _owner_lock_age=$(_setup_lock_dir_age_seconds "$lock_dir")
1280
+ if [[ "$_owner_lock_age" -le 300 ]]; then
1281
+ print_error "Another setup.sh --non-interactive process may be acquiring the deploy lock (pid ${owner_pid}; lock: ${lock_dir}, age ${_owner_lock_age}s). Exiting to avoid overlapping deployments."
1282
+ return 75
1283
+ fi
1284
+ print_warning "Removing stale setup.sh --non-interactive lock at ${lock_dir}; owner pid ${owner_pid} no longer appears to be setup.sh --non-interactive (age ${_owner_lock_age}s)"
1285
+ rm -rf "$lock_dir" 2>/dev/null || true
1286
+ attempts=$((attempts + 1))
1287
+ continue
1288
+ fi
1256
1289
  [[ -r "$lock_dir/command" ]] && owner_cmd=$(tr '\n' ' ' <"$lock_dir/command" 2>/dev/null || true)
1257
1290
  # Build actionable diagnostics: elapsed time since lock was acquired
1258
1291
  # and the currently-executing setup stage from the timing log.