aidevops 3.8.76 → 3.8.78

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.8.76
1
+ 3.8.78
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.8.76
8
+ # Version: 3.8.78
9
9
 
10
10
  set -euo pipefail
11
11
 
@@ -294,9 +294,11 @@ _compute_repo_registration_defaults() {
294
294
  # Infer the init_scope for a repo when not explicitly set.
295
295
  # Priority: .aidevops.json > repos.json entry > context inference.
296
296
  # Returns one of: minimal, standard, public
297
- # Usage: _infer_init_scope <project_root>
297
+ # Usage: _infer_init_scope <project_root> [is_local_only]
298
+ # Pass is_local_only="true" when the caller already has it to avoid redundant I/O.
298
299
  _infer_init_scope() {
299
300
  local project_root="$1"
301
+ local is_local_only="${2:-}"
300
302
 
301
303
  # 1. Check .aidevops.json
302
304
  if [[ -f "$project_root/.aidevops.json" ]]; then
@@ -308,41 +310,37 @@ _infer_init_scope() {
308
310
  fi
309
311
  fi
310
312
 
311
- # 2. Check repos.json entry
313
+ # 2. Check repos.json entry — single jq pass reads both init_scope and local_only
312
314
  if command -v jq &>/dev/null && [[ -f "${REPOS_FILE:-$HOME/.config/aidevops/repos.json}" ]]; then
313
315
  local repos_file="${REPOS_FILE:-$HOME/.config/aidevops/repos.json}"
314
316
  local canonical_path
315
317
  canonical_path=$(cd "$project_root" 2>/dev/null && pwd -P) || canonical_path="$project_root"
316
- local repo_scope
317
- repo_scope=$(jq -r --arg path "$canonical_path" \
318
- '(.initialized_repos[] | select(.path == $path) | .init_scope) // empty' \
319
- "$repos_file" 2>/dev/null || echo "")
320
- if [[ -n "$repo_scope" ]]; then
321
- echo "$repo_scope"
322
- return 0
318
+ local repo_data
319
+ repo_data=$(jq -r --arg path "$canonical_path" \
320
+ '.initialized_repos[] | select(.path == $path) | "\(.init_scope // "")|\(.local_only // "false")"' \
321
+ "$repos_file" 2>/dev/null | head -n 1 || echo "")
322
+ if [[ -n "$repo_data" ]]; then
323
+ local repo_scope="${repo_data%|*}"
324
+ local repo_local="${repo_data#*|}"
325
+ if [[ -n "$repo_scope" ]]; then
326
+ echo "$repo_scope"
327
+ return 0
328
+ fi
329
+ # Repo found but no explicit scope — pick up local_only for context inference below
330
+ [[ -z "$is_local_only" ]] && is_local_only="$repo_local"
323
331
  fi
324
332
  fi
325
333
 
326
334
  # 3. Context inference
327
- # local_only or no remote → minimal
328
- if ! git -C "$project_root" remote get-url origin &>/dev/null 2>&1; then
335
+ # Use pre-computed is_local_only when available; fall back to git remote check
336
+ if [[ "$is_local_only" == "true" ]]; then
329
337
  echo "minimal"
330
338
  return 0
331
339
  fi
332
340
 
333
- # Check repos.json for local_only flag
334
- if command -v jq &>/dev/null && [[ -f "${REPOS_FILE:-$HOME/.config/aidevops/repos.json}" ]]; then
335
- local repos_file="${REPOS_FILE:-$HOME/.config/aidevops/repos.json}"
336
- local canonical_path
337
- canonical_path=$(cd "$project_root" 2>/dev/null && pwd -P) || canonical_path="$project_root"
338
- local is_local
339
- is_local=$(jq -r --arg path "$canonical_path" \
340
- '(.initialized_repos[] | select(.path == $path) | .local_only) // false' \
341
- "$repos_file" 2>/dev/null || echo "false")
342
- if [[ "$is_local" == "true" ]]; then
343
- echo "minimal"
344
- return 0
345
- fi
341
+ if ! git -C "$project_root" remote get-url origin &>/dev/null 2>&1; then
342
+ echo "minimal"
343
+ return 0
346
344
  fi
347
345
 
348
346
  # Default: standard (backward compatible)
@@ -487,9 +485,9 @@ register_repo() {
487
485
  local DEFAULT_PRIORITY=""
488
486
  eval "$(_compute_repo_registration_defaults "$repo_path" "$slug" "$is_local_only" "$maintainer")"
489
487
 
490
- # Infer default init_scope for new registrations
488
+ # Infer default init_scope; pass is_local_only (already computed) to skip redundant I/O
491
489
  local default_init_scope
492
- default_init_scope=$(_infer_init_scope "$repo_path")
490
+ default_init_scope=$(_infer_init_scope "$repo_path" "$is_local_only")
493
491
 
494
492
  # Check if repo already registered
495
493
  if jq -e --arg path "$repo_path" '.initialized_repos[] | select(.path == $path)' "$REPOS_FILE" &>/dev/null; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aidevops",
3
- "version": "3.8.76",
3
+ "version": "3.8.78",
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.8.76
15
+ # Version: 3.8.78
16
16
  #
17
17
  # Quick Install:
18
18
  # npm install -g aidevops && aidevops update (recommended)