aidevops 2.78.0 → 2.79.0

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.
Files changed (4) hide show
  1. package/VERSION +1 -1
  2. package/aidevops.sh +1 -1
  3. package/package.json +1 -1
  4. package/setup.sh +151 -86
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.78.0
1
+ 2.79.0
package/aidevops.sh CHANGED
@@ -3,7 +3,7 @@
3
3
  # AI DevOps Framework CLI
4
4
  # Usage: aidevops <command> [options]
5
5
  #
6
- # Version: 2.78.0
6
+ # Version: 2.79.0
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": "2.78.0",
3
+ "version": "2.79.0",
4
4
  "description": "AI DevOps Framework - AI-assisted development workflows, code quality, and deployment automation",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/setup.sh CHANGED
@@ -3,7 +3,7 @@
3
3
  # AI Assistant Server Access Framework Setup Script
4
4
  # Helps developers set up the framework for their infrastructure
5
5
  #
6
- # Version: 2.78.0
6
+ # Version: 2.79.0
7
7
  #
8
8
  # Quick Install (one-liner):
9
9
  # bash <(curl -fsSL https://aidevops.dev/install)
@@ -168,6 +168,77 @@ cleanup_deprecated_paths() {
168
168
  return 0
169
169
  }
170
170
 
171
+ # Remove deprecated MCP entries from opencode.json
172
+ # These MCPs have been replaced by curl-based subagents (zero context cost)
173
+ cleanup_deprecated_mcps() {
174
+ local opencode_config="$HOME/.config/opencode/opencode.json"
175
+
176
+ if [[ ! -f "$opencode_config" ]]; then
177
+ return 0
178
+ fi
179
+
180
+ if ! command -v jq &> /dev/null; then
181
+ return 0
182
+ fi
183
+
184
+ # MCPs replaced by curl subagents in v2.79.0
185
+ local deprecated_mcps=(
186
+ "hetzner-awardsapp"
187
+ "hetzner-brandlight"
188
+ "hetzner-marcusquinn"
189
+ "hetzner-storagebox"
190
+ "ahrefs"
191
+ "serper"
192
+ "dataforseo"
193
+ "hostinger-api"
194
+ "shadcn"
195
+ )
196
+
197
+ # Tool rules to remove (for MCPs that no longer exist)
198
+ local deprecated_tools=(
199
+ "hetzner-*"
200
+ "hostinger-api_*"
201
+ "ahrefs_*"
202
+ "dataforseo_*"
203
+ "serper_*"
204
+ "shadcn_*"
205
+ )
206
+
207
+ local cleaned=0
208
+ local tmp_config
209
+ tmp_config=$(mktemp)
210
+
211
+ cp "$opencode_config" "$tmp_config"
212
+
213
+ for mcp in "${deprecated_mcps[@]}"; do
214
+ if jq -e ".mcp[\"$mcp\"]" "$tmp_config" > /dev/null 2>&1; then
215
+ jq "del(.mcp[\"$mcp\"])" "$tmp_config" > "${tmp_config}.new" && mv "${tmp_config}.new" "$tmp_config"
216
+ ((cleaned++))
217
+ fi
218
+ done
219
+
220
+ for tool in "${deprecated_tools[@]}"; do
221
+ if jq -e ".tools[\"$tool\"]" "$tmp_config" > /dev/null 2>&1; then
222
+ jq "del(.tools[\"$tool\"])" "$tmp_config" > "${tmp_config}.new" && mv "${tmp_config}.new" "$tmp_config"
223
+ fi
224
+ done
225
+
226
+ # Also remove deprecated tool refs from SEO agent
227
+ if jq -e '.agent.SEO.tools["dataforseo_*"]' "$tmp_config" > /dev/null 2>&1; then
228
+ jq 'del(.agent.SEO.tools["dataforseo_*"]) | del(.agent.SEO.tools["serper_*"]) | del(.agent.SEO.tools["ahrefs_*"])' "$tmp_config" > "${tmp_config}.new" && mv "${tmp_config}.new" "$tmp_config"
229
+ fi
230
+
231
+ if [[ $cleaned -gt 0 ]]; then
232
+ create_backup_with_rotation "$opencode_config" "opencode"
233
+ mv "$tmp_config" "$opencode_config"
234
+ print_info "Removed $cleaned deprecated MCP(s) from opencode.json (replaced by curl subagents)"
235
+ else
236
+ rm -f "$tmp_config"
237
+ fi
238
+
239
+ return 0
240
+ }
241
+
171
242
  # Migrate old config-backups to new per-type backup structure
172
243
  # This runs once to clean up the legacy backup directory
173
244
  migrate_old_backups() {
@@ -2662,98 +2733,48 @@ EOF
2662
2733
  }
2663
2734
 
2664
2735
  setup_seo_mcps() {
2665
- print_info "Setting up SEO MCP servers..."
2666
-
2667
- local has_node=false
2668
- local has_python=false
2669
- local has_uv=false
2670
-
2671
- # Check Node.js
2672
- if command -v node &> /dev/null; then
2673
- has_node=true
2674
- fi
2675
-
2676
- # Check Python (prefer Homebrew/pyenv over system)
2677
- if find_python3 &> /dev/null; then
2678
- has_python=true
2679
- fi
2680
-
2681
- # Check uv (Python package manager)
2682
- if command -v uv &> /dev/null; then
2683
- has_uv=true
2684
- elif command -v uvx &> /dev/null; then
2685
- has_uv=true
2686
- fi
2687
-
2688
- # DataForSEO MCP (Node.js based)
2689
- if [[ "$has_node" == "true" ]]; then
2690
- print_info "DataForSEO MCP available via: npx dataforseo-mcp-server"
2691
- print_info "Configure credentials in ~/.config/aidevops/mcp-env.sh:"
2692
- print_info " DATAFORSEO_USERNAME and DATAFORSEO_PASSWORD"
2693
- else
2694
- print_warning "Node.js not found - DataForSEO MCP requires Node.js"
2695
- fi
2696
-
2697
- # Serper MCP (Python based, uses uv/uvx)
2698
- if [[ "$has_uv" == "true" ]]; then
2699
- print_info "Serper MCP available via: uvx serper-mcp-server"
2700
- print_info "Configure credentials in ~/.config/aidevops/mcp-env.sh:"
2701
- print_info " SERPER_API_KEY"
2702
- elif [[ "$has_python" == "true" ]]; then
2703
- print_info "Serper MCP available via: pip install serper-mcp-server"
2704
- print_info "Then run: python3 -m serper_mcp_server"
2705
- print_info "Configure credentials in ~/.config/aidevops/mcp-env.sh:"
2706
- print_info " SERPER_API_KEY"
2707
-
2708
- # Offer to install uv for better experience
2709
- read -r -p "Install uv (recommended Python package manager)? (y/n): " install_uv
2710
- if [[ "$install_uv" == "y" ]]; then
2711
- print_info "Installing uv..."
2712
- curl -LsSf https://astral.sh/uv/install.sh | sh
2713
- if [[ $? -eq 0 ]]; then
2714
- print_success "uv installed successfully"
2715
- print_info "Restart your terminal or run: source ~/.bashrc (or ~/.zshrc)"
2716
- else
2717
- print_warning "Failed to install uv"
2718
- fi
2719
- fi
2720
- else
2721
- print_warning "Python not found - Serper MCP requires Python 3.11+"
2722
- fi
2723
-
2736
+ print_info "Setting up SEO integrations..."
2737
+
2738
+ # SEO services use curl-based subagents (no MCP needed)
2739
+ # Subagents: serper.md, dataforseo.md, ahrefs.md, google-search-console.md
2740
+ print_info "SEO uses curl-based subagents (zero context cost until invoked)"
2741
+
2724
2742
  # Check if credentials are configured
2725
2743
  if [[ -f "$HOME/.config/aidevops/mcp-env.sh" ]]; then
2726
2744
  # shellcheck source=/dev/null
2727
2745
  source "$HOME/.config/aidevops/mcp-env.sh"
2728
2746
 
2729
- if [[ -n "$DATAFORSEO_USERNAME" && -n "$DATAFORSEO_PASSWORD" ]]; then
2730
- print_success "DataForSEO credentials configured"
2731
- else
2732
- print_info "DataForSEO: Set credentials with:"
2733
- print_info " bash ~/.aidevops/agents/scripts/setup-local-api-keys.sh set DATAFORSEO_USERNAME your_username"
2734
- print_info " bash ~/.aidevops/agents/scripts/setup-local-api-keys.sh set DATAFORSEO_PASSWORD your_password"
2735
- fi
2747
+ [[ -n "$DATAFORSEO_USERNAME" ]] && print_success "DataForSEO credentials configured" || \
2748
+ print_info "DataForSEO: set DATAFORSEO_USERNAME and DATAFORSEO_PASSWORD in mcp-env.sh"
2736
2749
 
2737
- if [[ -n "$SERPER_API_KEY" ]]; then
2738
- print_success "Serper API key configured"
2739
- else
2740
- print_info "Serper: Set API key with:"
2741
- print_info " bash ~/.aidevops/agents/scripts/setup-local-api-keys.sh set SERPER_API_KEY your_key"
2742
- fi
2750
+ [[ -n "$SERPER_API_KEY" ]] && print_success "Serper API key configured" || \
2751
+ print_info "Serper: set SERPER_API_KEY in mcp-env.sh"
2752
+
2753
+ [[ -n "$AHREFS_API_KEY" ]] && print_success "Ahrefs API key configured" || \
2754
+ print_info "Ahrefs: set AHREFS_API_KEY in mcp-env.sh"
2743
2755
  else
2744
- print_info "Configure SEO API credentials:"
2745
- print_info " bash ~/.aidevops/agents/scripts/setup-local-api-keys.sh setup"
2756
+ print_info "Configure SEO API credentials in ~/.config/aidevops/mcp-env.sh"
2757
+ fi
2758
+
2759
+ # GSC uses MCP (OAuth2 complexity warrants it)
2760
+ local gsc_creds="$HOME/.config/aidevops/gsc-credentials.json"
2761
+ if [[ -f "$gsc_creds" ]]; then
2762
+ print_success "Google Search Console credentials configured"
2763
+ else
2764
+ print_info "GSC: Create service account JSON at $gsc_creds"
2765
+ print_info " See: ~/.aidevops/agents/seo/google-search-console.md"
2746
2766
  fi
2747
2767
 
2748
- print_info "SEO MCP documentation: ~/.aidevops/agents/seo/"
2768
+ print_info "SEO documentation: ~/.aidevops/agents/seo/"
2749
2769
  return 0
2750
2770
  }
2751
2771
 
2752
- # Setup Google Analytics MCP (disabled by default)
2772
+ # Setup Google Analytics MCP (uses shared GSC service account credentials)
2753
2773
  setup_google_analytics_mcp() {
2754
2774
  print_info "Setting up Google Analytics MCP..."
2755
2775
 
2756
2776
  local opencode_config="$HOME/.config/opencode/opencode.json"
2777
+ local gsc_creds="$HOME/.config/aidevops/gsc-credentials.json"
2757
2778
 
2758
2779
  # Check if opencode.json exists
2759
2780
  if [[ ! -f "$opencode_config" ]]; then
@@ -2776,28 +2797,66 @@ setup_google_analytics_mcp() {
2776
2797
  return 0
2777
2798
  fi
2778
2799
 
2800
+ # Auto-detect credentials from shared GSC service account
2801
+ local creds_path=""
2802
+ local project_id=""
2803
+ local enable_mcp="false"
2804
+
2805
+ if [[ -f "$gsc_creds" ]]; then
2806
+ creds_path="$gsc_creds"
2807
+ # Extract project_id from service account JSON
2808
+ project_id=$(jq -r '.project_id // empty' "$gsc_creds" 2>/dev/null)
2809
+ if [[ -n "$project_id" ]]; then
2810
+ enable_mcp="true"
2811
+ print_success "Found GSC credentials - sharing with Google Analytics MCP"
2812
+ print_info "Project: $project_id"
2813
+ fi
2814
+ fi
2815
+
2779
2816
  # Check if google-analytics-mcp already exists in config
2780
2817
  if jq -e '.mcp["google-analytics-mcp"]' "$opencode_config" > /dev/null 2>&1; then
2781
- print_info "Google Analytics MCP already configured in OpenCode"
2818
+ # Update existing entry if we have credentials now
2819
+ if [[ "$enable_mcp" == "true" ]]; then
2820
+ local tmp_config
2821
+ tmp_config=$(mktemp)
2822
+ if jq --arg creds "$creds_path" --arg proj "$project_id" \
2823
+ '.mcp["google-analytics-mcp"].environment.GOOGLE_APPLICATION_CREDENTIALS = $creds |
2824
+ .mcp["google-analytics-mcp"].environment.GOOGLE_PROJECT_ID = $proj |
2825
+ .mcp["google-analytics-mcp"].enabled = true' \
2826
+ "$opencode_config" > "$tmp_config" 2>/dev/null; then
2827
+ mv "$tmp_config" "$opencode_config"
2828
+ print_success "Updated Google Analytics MCP with GSC credentials (enabled)"
2829
+ else
2830
+ rm -f "$tmp_config"
2831
+ print_warning "Failed to update Google Analytics MCP config"
2832
+ fi
2833
+ else
2834
+ print_info "Google Analytics MCP already configured in OpenCode"
2835
+ fi
2782
2836
  return 0
2783
2837
  fi
2784
2838
 
2785
- # Add google-analytics-mcp to opencode.json (disabled by default)
2839
+ # Add google-analytics-mcp to opencode.json
2786
2840
  local tmp_config
2787
2841
  tmp_config=$(mktemp)
2788
2842
 
2789
- if jq '.mcp["google-analytics-mcp"] = {
2843
+ if jq --arg creds "$creds_path" --arg proj "$project_id" --argjson enabled "$enable_mcp" \
2844
+ '.mcp["google-analytics-mcp"] = {
2790
2845
  "type": "local",
2791
2846
  "command": ["pipx", "run", "analytics-mcp"],
2792
2847
  "environment": {
2793
- "GOOGLE_APPLICATION_CREDENTIALS": "",
2794
- "GOOGLE_PROJECT_ID": ""
2848
+ "GOOGLE_APPLICATION_CREDENTIALS": $creds,
2849
+ "GOOGLE_PROJECT_ID": $proj
2795
2850
  },
2796
- "enabled": false
2851
+ "enabled": $enabled
2797
2852
  }' "$opencode_config" > "$tmp_config" 2>/dev/null; then
2798
2853
  mv "$tmp_config" "$opencode_config"
2799
- print_success "Added Google Analytics MCP to OpenCode (disabled by default)"
2800
- print_info "To enable: Set credentials and change enabled to true in opencode.json"
2854
+ if [[ "$enable_mcp" == "true" ]]; then
2855
+ print_success "Added Google Analytics MCP to OpenCode (enabled with GSC credentials)"
2856
+ else
2857
+ print_success "Added Google Analytics MCP to OpenCode (disabled - no credentials found)"
2858
+ print_info "To enable: Create service account JSON at $gsc_creds"
2859
+ fi
2801
2860
  print_info "Or use the google-analytics subagent which enables it automatically"
2802
2861
  else
2803
2862
  rm -f "$tmp_config"
@@ -2956,6 +3015,7 @@ main() {
2956
3015
  confirm_step "Migrate old backups to new structure" && migrate_old_backups
2957
3016
  confirm_step "Migrate loop state from .claude/ to .agent/loop-state/" && migrate_loop_state_directories
2958
3017
  confirm_step "Cleanup deprecated agent paths" && cleanup_deprecated_paths
3018
+ confirm_step "Cleanup deprecated MCP entries (hetzner, serper, etc.)" && cleanup_deprecated_mcps
2959
3019
  confirm_step "Extract OpenCode prompts" && extract_opencode_prompts
2960
3020
  confirm_step "Check OpenCode prompt drift" && check_opencode_prompt_drift
2961
3021
  confirm_step "Deploy aidevops agents to ~/.aidevops/agents/" && deploy_aidevops_agents
@@ -2970,7 +3030,7 @@ main() {
2970
3030
  confirm_step "Setup Augment Context Engine MCP" && setup_augment_context_engine
2971
3031
  confirm_step "Setup osgrep (local semantic search)" && setup_osgrep
2972
3032
  confirm_step "Setup Beads task management" && setup_beads
2973
- confirm_step "Setup SEO MCP servers (DataForSEO, Serper)" && setup_seo_mcps
3033
+ confirm_step "Setup SEO integrations (curl subagents)" && setup_seo_mcps
2974
3034
  confirm_step "Setup Google Analytics MCP" && setup_google_analytics_mcp
2975
3035
  confirm_step "Setup browser automation tools" && setup_browser_tools
2976
3036
  confirm_step "Setup AI orchestration frameworks info" && setup_ai_orchestration
@@ -3017,8 +3077,13 @@ echo " aidevops uninstall - Remove aidevops"
3017
3077
  echo "• Augment Context Engine - Cloud semantic codebase retrieval"
3018
3078
  echo "• Context7 - Real-time library documentation"
3019
3079
  echo "• osgrep - Local semantic search (100% private)"
3080
+ echo "• GSC - Google Search Console (MCP + OAuth2)"
3081
+ echo "• Google Analytics - Analytics data (shared GSC credentials)"
3082
+ echo ""
3083
+ echo "SEO Integrations (curl subagents - no MCP overhead):"
3020
3084
  echo "• DataForSEO - Comprehensive SEO data APIs"
3021
3085
  echo "• Serper - Google Search API"
3086
+ echo "• Ahrefs - Backlink and keyword data"
3022
3087
  echo ""
3023
3088
  echo "DSPy & DSPyGround Integration:"
3024
3089
  echo "• ./.agent/scripts/dspy-helper.sh - DSPy prompt optimization toolkit"