Class: Aidp::Setup::Wizard
- Inherits:
-
Object
- Object
- Aidp::Setup::Wizard
- Defined in:
- lib/aidp/setup/wizard.rb
Overview
Interactive setup wizard for configuring AIDP. Guides the user through provider, work loop, NFR, logging, and mode settings while remaining idempotent and safe to re-run.
Constant Summary collapse
- SCHEMA_VERSION =
1- DEVCONTAINER_COMPONENT =
"setup_wizard.devcontainer"- DEFAULT_AUTOCONFIG_TIERS =
%w[mini standard pro].freeze
- LEGACY_TIER_ALIASES =
{ advanced: :pro }.freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Expose state for testability.
-
#discovery_threads ⇒ Object
readonly
Expose state for testability.
-
#dry_run ⇒ Object
readonly
Returns the value of attribute dry_run.
-
#existing_config ⇒ Object
readonly
Expose state for testability.
-
#project_dir ⇒ Object
readonly
Returns the value of attribute project_dir.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
-
#warnings ⇒ Object
readonly
Expose state for testability.
Instance Method Summary collapse
-
#initialize(project_dir = Dir.pwd, prompt: nil, dry_run: false) ⇒ Wizard
constructor
A new instance of Wizard.
- #run ⇒ Object
- #saved? ⇒ Boolean
Constructor Details
#initialize(project_dir = Dir.pwd, prompt: nil, dry_run: false) ⇒ Wizard
Returns a new instance of Wizard.
29 30 31 32 33 34 35 36 37 |
# File 'lib/aidp/setup/wizard.rb', line 29 def initialize(project_dir = Dir.pwd, prompt: nil, dry_run: false) @project_dir = project_dir @prompt = prompt || TTY::Prompt.new @dry_run = dry_run @warnings = [] @existing_config = load_existing_config @config = deep_symbolize(@existing_config) @saved = false end |
Instance Attribute Details
#config ⇒ Object (readonly)
Expose state for testability
27 28 29 |
# File 'lib/aidp/setup/wizard.rb', line 27 def config @config end |
#discovery_threads ⇒ Object (readonly)
Expose state for testability
27 28 29 |
# File 'lib/aidp/setup/wizard.rb', line 27 def discovery_threads @discovery_threads end |
#dry_run ⇒ Object (readonly)
Returns the value of attribute dry_run.
25 26 27 |
# File 'lib/aidp/setup/wizard.rb', line 25 def dry_run @dry_run end |
#existing_config ⇒ Object (readonly)
Expose state for testability
27 28 29 |
# File 'lib/aidp/setup/wizard.rb', line 27 def existing_config @existing_config end |
#project_dir ⇒ Object (readonly)
Returns the value of attribute project_dir.
25 26 27 |
# File 'lib/aidp/setup/wizard.rb', line 25 def project_dir @project_dir end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
25 26 27 |
# File 'lib/aidp/setup/wizard.rb', line 25 def prompt @prompt end |
#warnings ⇒ Object (readonly)
Expose state for testability
27 28 29 |
# File 'lib/aidp/setup/wizard.rb', line 27 def warnings @warnings end |
Instance Method Details
#run ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/aidp/setup/wizard.rb', line 39 def run display_welcome # Normalize any legacy tier/model_family entries before prompting normalize_existing_model_families! normalize_existing_thinking_tiers! return @saved if skip_wizard? configure_providers configure_harness_settings configure_thinking_tiers configure_work_loop configure_branching configure_artifacts configure_nfrs configure_logging configure_auto_update configure_modes configure_devcontainer yaml_content = generate_yaml display_preview(yaml_content) display_diff(yaml_content) if @existing_config.any? return true if dry_run_mode?(yaml_content) if prompt.yes?("Save this configuration?", default: true) save_config(yaml_content) prompt.ok("✅ Configuration saved to #{relative_config_path}") show_next_steps display_warnings @saved = true else prompt.warn("Configuration not saved") display_warnings end @saved end |
#saved? ⇒ Boolean
78 79 80 |
# File 'lib/aidp/setup/wizard.rb', line 78 def saved? @saved end |