aidevops 3.1.38 → 3.1.40

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.38
1
+ 3.1.40
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.38
6
+ # Version: 3.1.40
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.38",
3
+ "version": "3.1.40",
4
4
  "description": "AI DevOps Framework - AI-assisted development workflows, code quality, and deployment automation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,6 +41,8 @@ check_opencode_prompt_drift() {
41
41
  local drift_script=".agents/scripts/opencode-prompt-drift-check.sh"
42
42
  if [[ -f "$drift_script" ]]; then
43
43
  local output exit_code=0
44
+ # 2>/dev/null is intentional: --quiet mode suppresses expected output; all exit
45
+ # codes (0=in-sync, 1=drift, other=error) are handled explicitly below.
44
46
  output=$(bash "$drift_script" --quiet 2>/dev/null) || exit_code=$?
45
47
  if [[ "$exit_code" -eq 1 && "$output" == PROMPT_DRIFT* ]]; then
46
48
  local local_hash upstream_hash
@@ -460,24 +460,60 @@ setup_opencode_plugins() {
460
460
  local already_registered
461
461
  already_registered=$(jq --arg url "$plugin_url" \
462
462
  '(.plugin // []) | map(select(. == $url)) | length' \
463
- "$opencode_config" 2>/dev/null || echo "0")
463
+ "$opencode_config" || echo "0")
464
464
 
465
465
  if [[ "$already_registered" -eq 0 ]]; then
466
466
  # Add the plugin URL to the array (create array if absent)
467
467
  local tmp_config="${opencode_config}.tmp.$$"
468
468
  if jq --arg url "$plugin_url" \
469
469
  '.plugin = ((.plugin // []) + [$url] | unique)' \
470
- "$opencode_config" >"$tmp_config" 2>/dev/null; then
470
+ "$opencode_config" >"$tmp_config"; then
471
471
  mv "$tmp_config" "$opencode_config"
472
472
  print_success "aidevops plugin registered in opencode.json"
473
473
  else
474
474
  rm -f "$tmp_config"
475
- print_warning "Failed to update opencode.json plugin array"
475
+ print_warning "Failed to update opencode.json plugin array (file: $opencode_config)"
476
476
  fi
477
477
  else
478
478
  print_success "aidevops plugin already registered in opencode.json"
479
479
  fi
480
480
  pool_plugin_registered="true"
481
+
482
+ # --- Register opencode-cursor-oauth plugin (npm, auto-installed by OpenCode) ---
483
+ local cursor_plugin="opencode-cursor-oauth"
484
+ local cursor_already
485
+ cursor_already=$(jq --arg p "$cursor_plugin" \
486
+ '(.plugin // []) | map(select(. == $p)) | length' \
487
+ "$opencode_config" 2>/dev/null || echo "0")
488
+
489
+ if [[ "$cursor_already" -eq 0 ]]; then
490
+ local tmp_cursor="${opencode_config}.tmp.$$"
491
+ if jq --arg p "$cursor_plugin" \
492
+ '.plugin = ((.plugin // []) + [$p] | unique)' \
493
+ "$opencode_config" >"$tmp_cursor" 2>/dev/null; then
494
+ mv "$tmp_cursor" "$opencode_config"
495
+ print_success "Cursor OAuth plugin registered in opencode.json"
496
+ else
497
+ rm -f "$tmp_cursor"
498
+ print_warning "Failed to register Cursor OAuth plugin"
499
+ fi
500
+ else
501
+ print_success "Cursor OAuth plugin already registered"
502
+ fi
503
+
504
+ # --- Ensure cursor provider stub exists (required by opencode-cursor-oauth) ---
505
+ local has_cursor_provider
506
+ has_cursor_provider=$(jq '.provider.cursor // empty' "$opencode_config" 2>/dev/null || true)
507
+ if [[ -z "$has_cursor_provider" ]]; then
508
+ local tmp_cursor_prov="${opencode_config}.tmp.$$"
509
+ if jq '.provider.cursor = {"name": "Cursor"}' \
510
+ "$opencode_config" >"$tmp_cursor_prov" 2>/dev/null; then
511
+ mv "$tmp_cursor_prov" "$opencode_config"
512
+ print_success "Cursor provider stub added to opencode.json"
513
+ else
514
+ rm -f "$tmp_cursor_prov"
515
+ fi
516
+ fi
481
517
  else
482
518
  if [[ -z "${opencode_config:-}" ]]; then
483
519
  print_info "opencode.json not found — run 'opencode' once to create it, then re-run setup"
@@ -498,7 +534,6 @@ setup_opencode_plugins() {
498
534
  fi
499
535
 
500
536
  setup_track_configured "OpenCode plugins"
501
- pool_plugin_registered="true"
502
537
 
503
538
  # Note: opencode-anthropic-auth is built into OpenCode v1.1.36+
504
539
  # Adding it as an external plugin causes TypeError due to double-loading.
@@ -534,9 +569,13 @@ setup_opencode_plugins() {
534
569
  print_info " 4. Complete the OAuth flow in your browser"
535
570
  print_info " 5. Repeat to add more accounts for automatic rotation"
536
571
  print_info " 6. Switch to 'Anthropic' provider and select a model to start chatting"
572
+ print_info ""
573
+ print_info "For Cursor Pro accounts:"
574
+ print_info " Run: opencode auth login --provider cursor"
575
+ print_info " Or from shell: oauth-pool-helper.sh add cursor"
576
+ print_info ""
537
577
  print_info " Health check: /models-pool-check"
538
578
  print_info " Manage accounts: /model-accounts-pool list|status|remove"
539
- print_info " Docs: ~/.aidevops/agents/tools/opencode/opencode-anthropic-auth.md"
540
579
  else
541
580
  print_warning "aidevops OpenCode plugin was not registered; 'Anthropic Pool' may be unavailable"
542
581
  print_info "Re-run aidevops setup to register the plugin, then run: opencode auth login"
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.38
13
+ # Version: 3.1.40
14
14
  #
15
15
  # Quick Install:
16
16
  # npm install -g aidevops && aidevops update (recommended)