aidevops 3.1.24 → 3.1.26

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.24
1
+ 3.1.26
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.24
6
+ # Version: 3.1.26
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.24",
3
+ "version": "3.1.26",
4
4
  "description": "AI DevOps Framework - AI-assisted development workflows, code quality, and deployment automation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -424,58 +424,6 @@ setup_browser_tools() {
424
424
  return 0
425
425
  }
426
426
 
427
- add_opencode_plugin() {
428
- local plugin_name plugin_spec opencode_config
429
- plugin_name="$1"
430
- plugin_spec="$2"
431
- opencode_config="$3"
432
-
433
- # Check if plugin array exists and if plugin is already configured
434
- local has_plugin_array
435
- if jq -e '.plugin' "$opencode_config" >/dev/null 2>&1; then
436
- has_plugin_array="true"
437
- else
438
- has_plugin_array="false"
439
- fi
440
-
441
- if [[ "$has_plugin_array" == "true" ]]; then
442
- # Check if plugin is already in the array
443
- local plugin_exists
444
- if jq -e --arg p "$plugin_name" '.plugin | map(select(startswith($p))) | length > 0' "$opencode_config" >/dev/null 2>&1; then
445
- plugin_exists="true"
446
- else
447
- plugin_exists="false"
448
- fi
449
-
450
- if [[ "$plugin_exists" == "true" ]]; then
451
- # Update existing plugin to latest version
452
- local temp_file
453
- temp_file=$(mktemp)
454
- trap 'rm -f "${temp_file:-}"' RETURN
455
- jq --arg old "$plugin_name" --arg new "$plugin_spec" \
456
- '.plugin = [.plugin[] | if startswith($old) then $new else . end]' \
457
- "$opencode_config" >"$temp_file" && mv "$temp_file" "$opencode_config"
458
- print_success "Updated $plugin_name to latest version"
459
- else
460
- # Add plugin to existing array
461
- local temp_file
462
- temp_file=$(mktemp)
463
- trap 'rm -f "${temp_file:-}"' RETURN
464
- jq --arg p "$plugin_spec" '.plugin += [$p]' "$opencode_config" >"$temp_file" && mv "$temp_file" "$opencode_config"
465
- print_success "Added $plugin_name plugin to OpenCode config"
466
- fi
467
- else
468
- # Create plugin array with the plugin
469
- local temp_file
470
- temp_file=$(mktemp)
471
- trap 'rm -f "${temp_file:-}"' RETURN
472
- jq --arg p "$plugin_spec" '. + {plugin: [$p]}' "$opencode_config" >"$temp_file" && mv "$temp_file" "$opencode_config"
473
- print_success "Created plugin array with $plugin_name"
474
- fi
475
-
476
- return 0
477
- }
478
-
479
427
  setup_opencode_plugins() {
480
428
  # Check prerequisites before announcing setup (GH#5240)
481
429
  if ! command -v opencode &>/dev/null; then
@@ -484,31 +432,44 @@ setup_opencode_plugins() {
484
432
  return 0
485
433
  fi
486
434
 
487
- local opencode_config
488
- if ! opencode_config=$(find_opencode_config); then
489
- print_skip "OpenCode plugins" "OpenCode config not found" "Run 'opencode' once to create config, then re-run setup"
490
- setup_track_deferred "OpenCode plugins" "Run 'opencode' once to create config"
491
- return 0
492
- fi
435
+ # Prerequisites met — proceed with setup
436
+ print_info "Setting up OpenCode plugins..."
493
437
 
494
- if ! command -v jq &>/dev/null; then
495
- print_skip "OpenCode plugins" "jq not installed" "Install jq: brew install jq (macOS) or apt install jq"
496
- setup_track_deferred "OpenCode plugins" "Install jq"
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/
443
+ local plugins_dir="$HOME/.config/opencode/plugins"
444
+ local aidevops_plugin_src="$HOME/.aidevops/agents/plugins/opencode-aidevops"
445
+ local aidevops_plugin_dst="$plugins_dir/opencode-aidevops"
446
+ local pool_plugin_registered="false"
447
+ local aidevops_plugin_entrypoint="$aidevops_plugin_src/index.mjs"
448
+
449
+ if [[ ! -f "$aidevops_plugin_entrypoint" ]]; then
450
+ print_skip "OpenCode plugins" "aidevops plugin entry point not found: $aidevops_plugin_entrypoint"
451
+ setup_track_deferred "OpenCode plugins" "Install/restore aidevops plugin at $aidevops_plugin_entrypoint"
497
452
  return 0
498
453
  fi
499
454
 
500
- # Prerequisites met proceed with setup
501
- print_info "Setting up OpenCode plugins..."
455
+ # Create plugins directory if needed
456
+ mkdir -p "$plugins_dir"
502
457
 
503
- # Setup aidevops compaction plugin (local file plugin)
504
- local aidevops_plugin_path="$HOME/.aidevops/agents/plugins/opencode-aidevops/index.mjs"
505
- local pool_plugin_registered="false"
506
- if [[ -f "$aidevops_plugin_path" ]]; then
507
- add_opencode_plugin "file://$HOME/.aidevops" "file://${aidevops_plugin_path}" "$opencode_config"
508
- print_success "aidevops compaction plugin registered (preserves context across compaction)"
509
- setup_track_configured "OpenCode plugins"
510
- pool_plugin_registered="true"
458
+ # Register plugin if needed; treat broken symlinks as unregistered.
459
+ if [[ -L "$aidevops_plugin_dst" ]]; then
460
+ if [[ ! -e "$aidevops_plugin_dst" ]]; then
461
+ print_warning "Broken aidevops plugin symlink detected; recreating ~/.config/opencode/plugins/opencode-aidevops"
462
+ ln -sfn "$aidevops_plugin_src" "$aidevops_plugin_dst"
463
+ 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
468
+ ln -sfn "$aidevops_plugin_src" "$aidevops_plugin_dst"
469
+ print_success "aidevops plugin registered at ~/.config/opencode/plugins/"
511
470
  fi
471
+ setup_track_configured "OpenCode plugins"
472
+ pool_plugin_registered="true"
512
473
 
513
474
  # Note: opencode-anthropic-auth is built into OpenCode v1.1.36+
514
475
  # Adding it as an external plugin causes TypeError due to double-loading.
@@ -521,20 +482,16 @@ setup_opencode_plugins() {
521
482
  oc_raw_version=$(opencode --version 2>/dev/null | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || echo "0.0.0")
522
483
 
523
484
  local oc_major oc_minor oc_patch
524
- oc_major=$(printf '%s' "$oc_raw_version" | cut -d. -f1)
525
- oc_minor=$(printf '%s' "$oc_raw_version" | cut -d. -f2)
526
- oc_patch=$(printf '%s' "$oc_raw_version" | cut -d. -f3)
485
+ IFS='.' read -r oc_major oc_minor oc_patch <<<"$oc_raw_version"
527
486
  oc_major="${oc_major:-0}"
528
487
  oc_minor="${oc_minor:-0}"
529
488
  oc_patch="${oc_patch:-0}"
530
489
 
531
490
  # Compare against 1.2.30 (where built-in anthropic-auth was removed)
532
491
  local builtin_auth_removed="false"
533
- if [[ "$oc_major" -gt 1 ]]; then
534
- builtin_auth_removed="true"
535
- elif [[ "$oc_major" -eq 1 && "$oc_minor" -gt 2 ]]; then
536
- builtin_auth_removed="true"
537
- elif [[ "$oc_major" -eq 1 && "$oc_minor" -eq 2 && "$oc_patch" -ge 30 ]]; then
492
+ if [[ "$oc_major" -gt 1 ]] ||
493
+ [[ "$oc_major" -eq 1 && "$oc_minor" -gt 2 ]] ||
494
+ [[ "$oc_major" -eq 1 && "$oc_minor" -eq 2 && "$oc_patch" -ge 30 ]]; then
538
495
  builtin_auth_removed="true"
539
496
  fi
540
497
 
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.24
13
+ # Version: 3.1.26
14
14
  #
15
15
  # Quick Install:
16
16
  # npm install -g aidevops && aidevops update (recommended)