aidevops 3.1.28 → 3.1.29

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.1.28
1
+ 3.1.29
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.1.28
6
+ # Version: 3.1.29
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.1.28",
3
+ "version": "3.1.29",
4
4
  "description": "AI DevOps Framework - AI-assisted development workflows, code quality, and deployment automation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -435,11 +435,10 @@ setup_opencode_plugins() {
435
435
  # Prerequisites met — proceed with setup
436
436
  print_info "Setting up OpenCode plugins..."
437
437
 
438
- # Setup aidevops plugin via local plugin directory (not opencode.json plugin array).
439
- # OpenCode's plugin array is npm-only. Local plugins must be symlinked to:
440
- # ~/.config/opencode/plugins/ (global)
441
- # .opencode/plugins/ (project-level)
442
- # See: https://opencode.ai/docs/plugins/
438
+ # Register aidevops plugin using two complementary mechanisms:
439
+ # 1. file:// URL in opencode.json "plugin" array (works on all tested versions)
440
+ # 2. Symlink in ~/.config/opencode/plugins/ (newer OpenCode convention)
441
+ # Both are idempotent — the plugin's registerPoolProvider() checks before adding.
443
442
  local plugins_dir="$HOME/.config/opencode/plugins"
444
443
  local aidevops_plugin_src="$HOME/.aidevops/agents/plugins/opencode-aidevops"
445
444
  local aidevops_plugin_dst="$plugins_dir/opencode-aidevops"
@@ -452,22 +451,52 @@ setup_opencode_plugins() {
452
451
  return 0
453
452
  fi
454
453
 
455
- # Create plugins directory if needed
456
- mkdir -p "$plugins_dir"
454
+ # --- Mechanism 1: file:// URL in opencode.json plugin array ---
455
+ # This is the primary mechanism — proven to work on OpenCode 1.2.x.
456
+ local opencode_config
457
+ local plugin_url="file://${aidevops_plugin_entrypoint}"
458
+ if opencode_config=$(find_opencode_config) && command -v jq &>/dev/null; then
459
+ # Check if the plugin URL is already in the array
460
+ local already_registered
461
+ already_registered=$(jq --arg url "$plugin_url" \
462
+ '(.plugin // []) | map(select(. == $url)) | length' \
463
+ "$opencode_config" 2>/dev/null || echo "0")
464
+
465
+ if [[ "$already_registered" -eq 0 ]]; then
466
+ # Add the plugin URL to the array (create array if absent)
467
+ local tmp_config="${opencode_config}.tmp.$$"
468
+ if jq --arg url "$plugin_url" \
469
+ '.plugin = ((.plugin // []) + [$url] | unique)' \
470
+ "$opencode_config" >"$tmp_config" 2>/dev/null; then
471
+ mv "$tmp_config" "$opencode_config"
472
+ print_success "aidevops plugin registered in opencode.json"
473
+ else
474
+ rm -f "$tmp_config"
475
+ print_warning "Failed to update opencode.json plugin array"
476
+ fi
477
+ else
478
+ print_success "aidevops plugin already registered in opencode.json"
479
+ fi
480
+ pool_plugin_registered="true"
481
+ else
482
+ if [[ -z "${opencode_config:-}" ]]; then
483
+ print_info "opencode.json not found — run 'opencode' once to create it, then re-run setup"
484
+ else
485
+ print_info "jq not installed — cannot update opencode.json plugin array"
486
+ fi
487
+ fi
457
488
 
458
- # Register plugin if needed; treat broken symlinks as unregistered.
489
+ # --- Mechanism 2: symlink in plugins directory (belt-and-suspenders) ---
490
+ mkdir -p "$plugins_dir"
459
491
  if [[ -L "$aidevops_plugin_dst" ]]; then
460
492
  if [[ ! -e "$aidevops_plugin_dst" ]]; then
461
- print_warning "Broken aidevops plugin symlink detected; recreating ~/.config/opencode/plugins/opencode-aidevops"
493
+ print_warning "Broken aidevops plugin symlink detected; recreating"
462
494
  ln -sfn "$aidevops_plugin_src" "$aidevops_plugin_dst"
463
495
  fi
464
- print_success "aidevops plugin already registered at ~/.config/opencode/plugins/"
465
- elif [[ -d "$aidevops_plugin_dst" && -f "$aidevops_plugin_dst/index.mjs" ]]; then
466
- print_success "aidevops plugin already registered at ~/.config/opencode/plugins/"
467
- else
496
+ elif [[ ! -d "$aidevops_plugin_dst" ]]; then
468
497
  ln -sfn "$aidevops_plugin_src" "$aidevops_plugin_dst"
469
- print_success "aidevops plugin registered at ~/.config/opencode/plugins/"
470
498
  fi
499
+
471
500
  setup_track_configured "OpenCode plugins"
472
501
  pool_plugin_registered="true"
473
502
 
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.1.28
13
+ # Version: 3.1.29
14
14
  #
15
15
  # Quick Install:
16
16
  # npm install -g aidevops && aidevops update (recommended)