aidevops 3.1.24 → 3.1.25

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.25
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.25
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.25",
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,28 +432,47 @@ 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)"
458
+ # Register plugin if needed; treat broken symlinks as unregistered.
459
+ if [[ -L "$aidevops_plugin_dst" && -e "$aidevops_plugin_dst" ]]; then
460
+ print_success "aidevops plugin already registered at ~/.config/opencode/plugins/"
461
+ setup_track_configured "OpenCode plugins"
462
+ pool_plugin_registered="true"
463
+ elif [[ -L "$aidevops_plugin_dst" ]]; then
464
+ print_warning "Broken aidevops plugin symlink detected; recreating ~/.config/opencode/plugins/opencode-aidevops"
465
+ ln -sfn "$aidevops_plugin_src" "$aidevops_plugin_dst"
466
+ print_success "aidevops plugin registered at ~/.config/opencode/plugins/"
467
+ setup_track_configured "OpenCode plugins"
468
+ pool_plugin_registered="true"
469
+ elif [[ -d "$aidevops_plugin_dst" && -f "$aidevops_plugin_dst/index.mjs" ]]; then
470
+ print_success "aidevops plugin already registered at ~/.config/opencode/plugins/"
471
+ setup_track_configured "OpenCode plugins"
472
+ pool_plugin_registered="true"
473
+ else
474
+ ln -sfn "$aidevops_plugin_src" "$aidevops_plugin_dst"
475
+ print_success "aidevops plugin registered at ~/.config/opencode/plugins/"
509
476
  setup_track_configured "OpenCode plugins"
510
477
  pool_plugin_registered="true"
511
478
  fi
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.25
14
14
  #
15
15
  # Quick Install:
16
16
  # npm install -g aidevops && aidevops update (recommended)