aidevops 3.13.55 → 3.13.57

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.55
1
+ 3.13.57
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.55
8
+ # Version: 3.13.57
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.55",
3
+ "version": "3.13.57",
4
4
  "description": "AI DevOps Framework - AI-assisted development workflows, code quality, and deployment automation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -952,6 +952,34 @@ disable_ondemand_mcps() {
952
952
  return 0
953
953
  }
954
954
 
955
+ # Run bounded opencode --version probe to detect config schema errors (GH#22079).
956
+ # Returns 0 when config looks valid (or opencode is unavailable / probe timed out),
957
+ # 1 when opencode explicitly reports "Configuration is invalid".
958
+ # Uses AIDEVOPS_OPENCODE_VERSION_TIMEOUT (default 5s) so a hung Node.js process
959
+ # cannot stall the non-interactive deploy path indefinitely.
960
+ _validate_opencode_config_schema() {
961
+ command -v opencode &>/dev/null || return 0
962
+ local validation_output
963
+ local _oc_timeout
964
+ local _oc_rc
965
+ _oc_timeout="${AIDEVOPS_OPENCODE_VERSION_TIMEOUT:-5}"
966
+ _oc_rc=0
967
+ # Prefer the shared helper sourced from _services.sh (always available when
968
+ # called from setup.sh); fall back to system timeout; last resort: unbounded.
969
+ if declare -F _setup_opencode_timeout_cmd >/dev/null 2>&1; then
970
+ validation_output=$(_setup_opencode_timeout_cmd "$_oc_timeout" opencode --version 2>&1) || _oc_rc=$?
971
+ elif command -v timeout >/dev/null 2>&1; then
972
+ validation_output=$(timeout "$_oc_timeout" opencode --version 2>&1) || _oc_rc=$?
973
+ else
974
+ validation_output=$(opencode --version 2>&1) || _oc_rc=$?
975
+ fi
976
+ # Exit 124 = timed out — not a config-invalid signal.
977
+ if [[ "$_oc_rc" -ne 0 && "$_oc_rc" -ne 124 ]] && [[ "$validation_output" == *"Configuration is invalid"* ]]; then
978
+ return 1
979
+ fi
980
+ return 0
981
+ }
982
+
955
983
  # Validate and repair OpenCode config schema
956
984
  # Fixes common issues from manual editing or AI-generated configs:
957
985
  # - MCP entries missing "type": "local" field
@@ -1010,16 +1038,10 @@ validate_opencode_config() {
1010
1038
  issues="${issues}\n - tools entries as objects instead of booleans: $(echo "$tools_as_objects" | tr '\n' ', ' | sed 's/,$//')"
1011
1039
  fi
1012
1040
 
1013
- # Check 3: Try to parse with opencode (if available) to catch other schema issues
1014
- if command -v opencode &>/dev/null; then
1015
- local validation_output
1016
- if ! validation_output=$(opencode --version 2>&1); then
1017
- # If opencode fails to start, config might be invalid
1018
- if [[ "$validation_output" == *"Configuration is invalid"* ]]; then
1019
- needs_repair=true
1020
- issues="${issues}\n - OpenCode reports invalid configuration"
1021
- fi
1022
- fi
1041
+ # Check 3: bounded opencode --version probe to catch other schema issues (GH#22079).
1042
+ if ! _validate_opencode_config_schema; then
1043
+ needs_repair=true
1044
+ issues="${issues}\n - OpenCode reports invalid configuration"
1023
1045
  fi
1024
1046
 
1025
1047
  if [[ "$needs_repair" == "true" ]]; then
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.55
15
+ # Version: 3.13.57
16
16
  #
17
17
  # Quick Install:
18
18
  # npm install -g aidevops && aidevops update (recommended)
@@ -1218,7 +1218,27 @@ _setup_acquire_noninteractive_setup_lock() {
1218
1218
  fi
1219
1219
  if _setup_lock_pid_alive "$owner_pid"; then
1220
1220
  [[ -r "$lock_dir/command" ]] && owner_cmd=$(tr '\n' ' ' <"$lock_dir/command" 2>/dev/null || true)
1221
- print_error "Another setup.sh --non-interactive process is already running (pid ${owner_pid}, lock ${lock_dir}). Exiting to avoid overlapping deployments. ${owner_cmd:+Command: ${owner_cmd}}"
1221
+ # Build actionable diagnostics: elapsed time since lock was acquired
1222
+ # and the currently-executing setup stage from the timing log.
1223
+ local _diag_elapsed="" _diag_stage=""
1224
+ local _diag_stl="$HOME/.aidevops/logs/setup-stage-timings.log"
1225
+ if [[ -r "$lock_dir/started_at" ]]; then
1226
+ local _diag_started_str="" _diag_started="" _diag_now="" _diag_secs=""
1227
+ _diag_started_str=$(tr -d '[:space:]' <"$lock_dir/started_at" 2>/dev/null || true)
1228
+ _diag_started=$(date -d "$_diag_started_str" +%s 2>/dev/null || \
1229
+ date -jf '%Y-%m-%dT%H:%M:%SZ' "$_diag_started_str" +%s 2>/dev/null || true)
1230
+ _diag_now=$(date +%s 2>/dev/null || true)
1231
+ if [[ "$_diag_started" =~ ^[0-9]+$ && "$_diag_now" =~ ^[0-9]+$ && "$_diag_now" -ge "$_diag_started" ]]; then
1232
+ _diag_secs=$((_diag_now - _diag_started))
1233
+ _diag_elapsed="elapsed ${_diag_secs}s; "
1234
+ fi
1235
+ fi
1236
+ if [[ -r "$_diag_stl" ]]; then
1237
+ local _diag_cur_stage=""
1238
+ _diag_cur_stage=$(awk -F'\t' '$4=="RUNNING"{s=$2} END{if(s)printf "%s",s}' "$_diag_stl" 2>/dev/null || true)
1239
+ [[ -n "$_diag_cur_stage" ]] && _diag_stage="stage: ${_diag_cur_stage}; "
1240
+ fi
1241
+ print_error "Another setup.sh --non-interactive is already running (pid ${owner_pid}; ${_diag_elapsed}${_diag_stage}lock: ${lock_dir}). Exiting to avoid overlapping deployments.${owner_cmd:+ Command: ${owner_cmd}} Diagnose: ${_diag_stl}"
1222
1242
  return 75
1223
1243
  fi
1224
1244