aidevops 3.5.682 → 3.5.683

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.5.682
1
+ 3.5.683
package/aidevops.sh CHANGED
@@ -3,7 +3,7 @@
3
3
  # AI DevOps Framework CLI
4
4
  # Usage: aidevops <command> [options]
5
5
  #
6
- # Version: 3.5.682
6
+ # Version: 3.5.683
7
7
 
8
8
  set -euo pipefail
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aidevops",
3
- "version": "3.5.682",
3
+ "version": "3.5.683",
4
4
  "description": "AI DevOps Framework - AI-assisted development workflows, code quality, and deployment automation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -636,6 +636,78 @@ _agent_source_dirs() {
636
636
  return 0
637
637
  }
638
638
 
639
+ # _collect_agent_files: print "abspath|relpath" lines for all deployable agent files
640
+ # under agents_source. Excludes AGENTS.md, SKILL.md stubs, and non-agent markdown.
641
+ # Output is consumed by deploy_agents_to_runtimes via a process substitution.
642
+ _collect_agent_files() {
643
+ local agents_source="$1"
644
+ local f bn
645
+
646
+ # Top-level agents
647
+ for f in "$agents_source"/*.md; do
648
+ [[ -f "$f" ]] || continue
649
+ bn=$(basename "$f")
650
+ [[ "$bn" == "AGENTS.md" ]] && continue
651
+ if _is_agent_definition "$f"; then
652
+ printf '%s|%s\n' "$f" "$bn"
653
+ fi
654
+ done
655
+
656
+ # Subagent directories (recursive)
657
+ local subdir
658
+ while IFS= read -r subdir; do
659
+ while IFS= read -r f; do
660
+ [[ -f "$f" ]] || continue
661
+ bn=$(basename "$f")
662
+ # Skip SKILL.md stubs — they're directory indexes, not real agents
663
+ [[ "$bn" == "SKILL.md" ]] && continue
664
+ if _is_agent_definition "$f"; then
665
+ local relpath="${f#"$agents_source"/}"
666
+ printf '%s|%s\n' "$f" "$relpath"
667
+ fi
668
+ done < <(find "$subdir" -name '*.md' -type f 2>/dev/null)
669
+ done < <(_agent_source_dirs "$agents_source")
670
+ return 0
671
+ }
672
+
673
+ # _deploy_agents_to_single_runtime: convert and copy all agent files to one runtime.
674
+ # Arguments: runtime_id agent_dir agent_list_file
675
+ # agent_list_file contains "abspath|relpath" lines produced by _collect_agent_files.
676
+ # Prints the count of successfully deployed agents to stdout.
677
+ _deploy_agents_to_single_runtime() {
678
+ local runtime_id="$1"
679
+ local agent_dir="$2"
680
+ local agent_list_file="$3"
681
+
682
+ # Only deploy if the runtime is actually installed
683
+ local binary config_path config_dir
684
+ binary=$(rt_binary "$runtime_id")
685
+ config_path=$(rt_config_path "$runtime_id")
686
+ config_dir="$(dirname "$config_path" 2>/dev/null)"
687
+
688
+ if ! type -P "$binary" >/dev/null 2>&1 && [[ ! -d "$config_dir" ]]; then
689
+ echo "0"
690
+ return 0
691
+ fi
692
+
693
+ mkdir -p "$agent_dir"
694
+ local agent_count=0
695
+ local src rel target target_parent
696
+
697
+ while IFS='|' read -r src rel; do
698
+ [[ -n "$src" && -n "$rel" ]] || continue
699
+ target="$agent_dir/$rel"
700
+ target_parent=$(dirname "$target")
701
+ [[ -d "$target_parent" ]] || mkdir -p "$target_parent"
702
+ if _convert_agent_frontmatter <"$src" >"$target"; then
703
+ agent_count=$((agent_count + 1))
704
+ fi
705
+ done <"$agent_list_file"
706
+
707
+ echo "$agent_count"
708
+ return 0
709
+ }
710
+
639
711
  # deploy_agents_to_runtimes: main entry point called by setup.sh.
640
712
  # Iterates all installed runtimes with agent directory support, converts and
641
713
  # deploys aidevops agents (top-level and subagent directories) to each runtime's
@@ -660,44 +732,16 @@ deploy_agents_to_runtimes() {
660
732
  return 0
661
733
  fi
662
734
 
663
- # Build the list of agent files to deploy (once, shared across runtimes).
664
- # Includes top-level *.md and all *.md in subagent directories that:
665
- # 1. Have name: in frontmatter (actual agent definitions)
666
- # 2. Are not SKILL.md stubs (directory index files)
667
- local -a agent_files=()
668
- local -a agent_relpaths=()
669
-
670
- # Top-level agents
671
- local f bn
672
- for f in "$agents_source"/*.md; do
673
- [[ -f "$f" ]] || continue
674
- bn=$(basename "$f")
675
- [[ "$bn" == "AGENTS.md" ]] && continue
676
- if _is_agent_definition "$f"; then
677
- agent_files+=("$f")
678
- agent_relpaths+=("$bn")
679
- fi
680
- done
681
-
682
- # Subagent directories (recursive)
683
- local subdir
684
- while IFS= read -r subdir; do
685
- while IFS= read -r f; do
686
- [[ -f "$f" ]] || continue
687
- bn=$(basename "$f")
688
- # Skip SKILL.md stubs — they're directory indexes, not real agents
689
- [[ "$bn" == "SKILL.md" ]] && continue
690
- if _is_agent_definition "$f"; then
691
- # Compute path relative to agents_source
692
- local relpath="${f#"$agents_source"/}"
693
- agent_files+=("$f")
694
- agent_relpaths+=("$relpath")
695
- fi
696
- done < <(find "$subdir" -name '*.md' -type f 2>/dev/null)
697
- done < <(_agent_source_dirs "$agents_source")
735
+ # Build the agent file list once (shared across all runtimes) into a temp file.
736
+ # Each line: "abspath|relpath"
737
+ local agent_list_file
738
+ agent_list_file=$(mktemp)
739
+ trap 'rm -f "${agent_list_file:-}"' RETURN
740
+ _collect_agent_files "$agents_source" >"$agent_list_file"
698
741
 
699
- local total_agents=${#agent_files[@]}
700
- if [[ $total_agents -eq 0 ]]; then
742
+ local total_agents
743
+ total_agents=$(wc -l <"$agent_list_file" | tr -d ' ')
744
+ if [[ "$total_agents" -eq 0 ]]; then
701
745
  print_warning "No agent definitions found in $agents_source"
702
746
  return 0
703
747
  fi
@@ -706,48 +750,19 @@ deploy_agents_to_runtimes() {
706
750
  local runtime_count=0
707
751
 
708
752
  # Deploy to each installed runtime
709
- local runtime_id agent_dir
753
+ local runtime_id agent_dir agent_count display_name
710
754
  while IFS= read -r runtime_id; do
711
755
  agent_dir=$(rt_agent_dir "$runtime_id")
712
756
  [[ -z "$agent_dir" ]] && continue
713
757
 
714
- # Only deploy if the runtime is actually installed
715
- local binary
716
- binary=$(rt_binary "$runtime_id")
717
- local config_path
718
- config_path=$(rt_config_path "$runtime_id")
719
- local config_dir
720
- config_dir="$(dirname "$config_path" 2>/dev/null)"
721
-
722
- if ! type -P "$binary" >/dev/null 2>&1 && [[ ! -d "$config_dir" ]]; then
723
- continue
758
+ agent_count=$(_deploy_agents_to_single_runtime "$runtime_id" "$agent_dir" "$agent_list_file")
759
+ # A count of 0 means runtime not installed (skipped) — don't increment runtime_count
760
+ if [[ "$agent_count" -gt 0 ]]; then
761
+ display_name=$(rt_display_name "$runtime_id")
762
+ print_info "Deployed $agent_count agents to $display_name ($agent_dir)"
763
+ deployed_count=$((deployed_count + agent_count))
764
+ runtime_count=$((runtime_count + 1))
724
765
  fi
725
-
726
- mkdir -p "$agent_dir"
727
- runtime_count=$((runtime_count + 1))
728
- local agent_count=0
729
- local i=0
730
-
731
- while [[ $i -lt $total_agents ]]; do
732
- local src="${agent_files[$i]}"
733
- local rel="${agent_relpaths[$i]}"
734
- local target="$agent_dir/$rel"
735
-
736
- # Ensure target subdirectory exists
737
- local target_parent
738
- target_parent=$(dirname "$target")
739
- [[ -d "$target_parent" ]] || mkdir -p "$target_parent"
740
-
741
- if _convert_agent_frontmatter <"$src" >"$target"; then
742
- agent_count=$((agent_count + 1))
743
- fi
744
- i=$((i + 1))
745
- done
746
-
747
- local display_name
748
- display_name=$(rt_display_name "$runtime_id")
749
- print_info "Deployed $agent_count agents to $display_name ($agent_dir)"
750
- deployed_count=$((deployed_count + agent_count))
751
766
  done < <(rt_list_with_agents)
752
767
 
753
768
  if [[ $runtime_count -eq 0 ]]; then
package/setup.sh CHANGED
@@ -10,7 +10,7 @@ shopt -s inherit_errexit 2>/dev/null || true
10
10
  # AI Assistant Server Access Framework Setup Script
11
11
  # Helps developers set up the framework for their infrastructure
12
12
  #
13
- # Version: 3.5.682
13
+ # Version: 3.5.683
14
14
  #
15
15
  # Quick Install:
16
16
  # npm install -g aidevops && aidevops update (recommended)