aidevops 2.100.7 → 2.100.8

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
- 2.100.7
1
+ 2.100.8
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.100.7
6
+ # Version: 2.100.8
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.100.7",
3
+ "version": "2.100.8",
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.100.7
6
+ # Version: 2.100.8
7
7
  #
8
8
  # Quick Install (one-liner):
9
9
  # bash <(curl -fsSL https://aidevops.dev/install)
@@ -412,6 +412,85 @@ disable_ondemand_mcps() {
412
412
  return 0
413
413
  }
414
414
 
415
+ # Validate and repair OpenCode config schema
416
+ # Fixes common issues from manual editing or AI-generated configs:
417
+ # - MCP entries missing "type": "local" field
418
+ # - tools entries as objects {} instead of booleans
419
+ # If invalid, backs up and regenerates using the generator script
420
+ validate_opencode_config() {
421
+ local opencode_config
422
+ opencode_config=$(find_opencode_config) || return 0
423
+
424
+ if [[ ! -f "$opencode_config" ]]; then
425
+ return 0
426
+ fi
427
+
428
+ if ! command -v jq &> /dev/null; then
429
+ return 0
430
+ fi
431
+
432
+ local needs_repair=false
433
+ local issues=""
434
+
435
+ # Check 1: MCP entries must have "type" field (usually "local")
436
+ # Invalid: {"mcp": {"foo": {"command": "..."}}}
437
+ # Valid: {"mcp": {"foo": {"type": "local", "command": "..."}}}
438
+ local mcps_without_type
439
+ mcps_without_type=$(jq -r '.mcp // {} | to_entries[] | select(.value.type == null and .value.command != null) | .key' "$opencode_config" 2>/dev/null | head -5)
440
+ if [[ -n "$mcps_without_type" ]]; then
441
+ needs_repair=true
442
+ issues="${issues}\n - MCP entries missing 'type' field: $(echo "$mcps_without_type" | tr '\n' ', ' | sed 's/,$//')"
443
+ fi
444
+
445
+ # Check 2: tools entries must be booleans, not objects
446
+ # Invalid: {"tools": {"gh_grep": {}}}
447
+ # Valid: {"tools": {"gh_grep": true}}
448
+ local tools_as_objects
449
+ tools_as_objects=$(jq -r '.tools // {} | to_entries[] | select(.value | type == "object") | .key' "$opencode_config" 2>/dev/null | head -5)
450
+ if [[ -n "$tools_as_objects" ]]; then
451
+ needs_repair=true
452
+ issues="${issues}\n - tools entries as objects instead of booleans: $(echo "$tools_as_objects" | tr '\n' ', ' | sed 's/,$//')"
453
+ fi
454
+
455
+ # Check 3: Try to parse with opencode (if available) to catch other schema issues
456
+ if command -v opencode &> /dev/null; then
457
+ local validation_output
458
+ if ! validation_output=$(opencode --version 2>&1); then
459
+ # If opencode fails to start, config might be invalid
460
+ if echo "$validation_output" | grep -q "Configuration is invalid"; then
461
+ needs_repair=true
462
+ issues="${issues}\n - OpenCode reports invalid configuration"
463
+ fi
464
+ fi
465
+ fi
466
+
467
+ if [[ "$needs_repair" == "true" ]]; then
468
+ print_warning "OpenCode config has schema issues:$issues"
469
+
470
+ # Backup the invalid config
471
+ create_backup_with_rotation "$opencode_config" "opencode"
472
+ print_info "Backed up invalid config"
473
+
474
+ # Remove the invalid config so generator creates fresh one
475
+ rm -f "$opencode_config"
476
+
477
+ # Regenerate using the generator script
478
+ local generator_script="$HOME/.aidevops/agents/scripts/generate-opencode-agents.sh"
479
+ if [[ -x "$generator_script" ]]; then
480
+ print_info "Regenerating OpenCode config with correct schema..."
481
+ if "$generator_script" > /dev/null 2>&1; then
482
+ print_success "OpenCode config regenerated successfully"
483
+ else
484
+ print_warning "Config regeneration failed - run manually: $generator_script"
485
+ fi
486
+ else
487
+ print_warning "Generator script not found - run setup.sh again after agents are deployed"
488
+ fi
489
+ fi
490
+
491
+ return 0
492
+ }
493
+
415
494
  # Migrate old config-backups to new per-type backup structure
416
495
  # This runs once to clean up the legacy backup directory
417
496
  migrate_old_backups() {
@@ -3418,6 +3497,7 @@ main() {
3418
3497
  confirm_step "Migrate loop state from .claude/ to .agent/loop-state/" && migrate_loop_state_directories
3419
3498
  confirm_step "Cleanup deprecated agent paths" && cleanup_deprecated_paths
3420
3499
  confirm_step "Cleanup deprecated MCP entries (hetzner, serper, etc.)" && cleanup_deprecated_mcps
3500
+ confirm_step "Validate and repair OpenCode config schema" && validate_opencode_config
3421
3501
  confirm_step "Extract OpenCode prompts" && extract_opencode_prompts
3422
3502
  confirm_step "Check OpenCode prompt drift" && check_opencode_prompt_drift
3423
3503
  confirm_step "Deploy aidevops agents to ~/.aidevops/agents/" && deploy_aidevops_agents