aidp 0.12.0 → 0.13.0

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aidp/analyze/json_file_storage.rb +21 -21
  3. data/lib/aidp/cli/enhanced_input.rb +114 -0
  4. data/lib/aidp/cli/first_run_wizard.rb +12 -14
  5. data/lib/aidp/cli/mcp_dashboard.rb +3 -3
  6. data/lib/aidp/cli/terminal_io.rb +26 -0
  7. data/lib/aidp/cli.rb +4 -4
  8. data/lib/aidp/config/paths.rb +131 -0
  9. data/lib/aidp/config.rb +18 -4
  10. data/lib/aidp/harness/condition_detector.rb +6 -6
  11. data/lib/aidp/harness/config_loader.rb +23 -23
  12. data/lib/aidp/harness/config_manager.rb +61 -61
  13. data/lib/aidp/harness/config_validator.rb +13 -12
  14. data/lib/aidp/harness/configuration.rb +30 -29
  15. data/lib/aidp/harness/error_handler.rb +13 -13
  16. data/lib/aidp/harness/provider_config.rb +79 -79
  17. data/lib/aidp/harness/provider_factory.rb +40 -40
  18. data/lib/aidp/harness/provider_info.rb +37 -20
  19. data/lib/aidp/harness/provider_manager.rb +58 -53
  20. data/lib/aidp/harness/provider_type_checker.rb +6 -6
  21. data/lib/aidp/harness/runner.rb +7 -7
  22. data/lib/aidp/harness/status_display.rb +33 -46
  23. data/lib/aidp/harness/ui/enhanced_workflow_selector.rb +2 -1
  24. data/lib/aidp/harness/ui/job_monitor.rb +7 -7
  25. data/lib/aidp/harness/user_interface.rb +43 -43
  26. data/lib/aidp/providers/anthropic.rb +100 -26
  27. data/lib/aidp/providers/base.rb +13 -0
  28. data/lib/aidp/providers/codex.rb +28 -27
  29. data/lib/aidp/providers/cursor.rb +141 -34
  30. data/lib/aidp/providers/github_copilot.rb +26 -26
  31. data/lib/aidp/providers/macos_ui.rb +2 -18
  32. data/lib/aidp/providers/opencode.rb +26 -26
  33. data/lib/aidp/version.rb +1 -1
  34. data/lib/aidp/workflows/guided_agent.rb +344 -23
  35. metadata +3 -1
@@ -23,7 +23,7 @@ module Aidp
23
23
  validation_result = @validator.load_and_validate
24
24
 
25
25
  if validation_result[:valid]
26
- @config_cache = @validator.get_validated_config
26
+ @config_cache = @validator.validated_config
27
27
  @last_loaded = Time.now
28
28
 
29
29
  # Log warnings if any
@@ -40,7 +40,7 @@ module Aidp
40
40
  end
41
41
 
42
42
  # Get harness configuration with defaults
43
- def get_harness_config(force_reload = false)
43
+ def harness_config(force_reload = false)
44
44
  config = load_config(force_reload)
45
45
  return nil unless config
46
46
 
@@ -48,7 +48,7 @@ module Aidp
48
48
  end
49
49
 
50
50
  # Get provider configuration with defaults
51
- def get_provider_config(provider_name, force_reload = false)
51
+ def provider_config(provider_name, force_reload = false)
52
52
  config = load_config(force_reload)
53
53
  return nil unless config
54
54
 
@@ -57,7 +57,7 @@ module Aidp
57
57
  end
58
58
 
59
59
  # Get all provider configurations
60
- def get_all_provider_configs(force_reload = false)
60
+ def all_provider_configs(force_reload = false)
61
61
  config = load_config(force_reload)
62
62
  return {} unless config
63
63
 
@@ -65,7 +65,7 @@ module Aidp
65
65
  end
66
66
 
67
67
  # Get configured provider names
68
- def get_configured_providers(force_reload = false)
68
+ def configured_providers(force_reload = false)
69
69
  config = load_config(force_reload)
70
70
  return [] unless config
71
71
 
@@ -94,7 +94,7 @@ module Aidp
94
94
  end
95
95
 
96
96
  # Get configuration summary
97
- def get_config_summary
97
+ def config_summary
98
98
  @validator.get_summary
99
99
  end
100
100
 
@@ -109,7 +109,7 @@ module Aidp
109
109
  end
110
110
 
111
111
  # Get configuration with specific overrides
112
- def get_config_with_overrides(overrides = {})
112
+ def config_with_overrides(overrides = {})
113
113
  base_config = load_config
114
114
  return nil unless base_config
115
115
 
@@ -117,17 +117,17 @@ module Aidp
117
117
  end
118
118
 
119
119
  # Get harness configuration with overrides
120
- def get_harness_config_with_overrides(overrides = {})
121
- harness_config = get_harness_config
122
- return nil unless harness_config
120
+ def harness_config_with_overrides(overrides = {})
121
+ base_harness_config = harness_config
122
+ return nil unless base_harness_config
123
123
 
124
124
  harness_overrides = overrides[:harness] || overrides["harness"] || {}
125
- deep_merge(harness_config, harness_overrides)
125
+ deep_merge(base_harness_config, harness_overrides)
126
126
  end
127
127
 
128
128
  # Get provider configuration with overrides
129
- def get_provider_config_with_overrides(provider_name, overrides = {})
130
- provider_config = get_provider_config(provider_name)
129
+ def provider_config_with_overrides(provider_name, overrides = {})
130
+ provider_config = provider_config(provider_name)
131
131
  return nil unless provider_config
132
132
 
133
133
  provider_overrides = overrides[:providers]&.dig(provider_name.to_sym) ||
@@ -158,34 +158,34 @@ module Aidp
158
158
  end
159
159
 
160
160
  # Get validation errors
161
- def get_validation_errors
161
+ def validation_errors
162
162
  validation_result = @validator.validate_existing
163
163
  validation_result[:errors] || []
164
164
  end
165
165
 
166
166
  # Get validation warnings
167
- def get_validation_warnings
167
+ def validation_warnings
168
168
  validation_result = @validator.validate_existing
169
169
  validation_result[:warnings] || []
170
170
  end
171
171
 
172
172
  # Get configuration for specific harness mode
173
- def get_mode_config(mode, force_reload = false)
173
+ def mode_config(mode, force_reload = false)
174
174
  config = load_config(force_reload)
175
175
  return nil unless config
176
176
 
177
177
  case mode.to_s
178
178
  when "analyze"
179
- get_analyze_mode_config(config)
179
+ analyze_mode_config(config)
180
180
  when "execute"
181
- get_execute_mode_config(config)
181
+ execute_mode_config(config)
182
182
  else
183
183
  config
184
184
  end
185
185
  end
186
186
 
187
187
  # Get environment-specific configuration
188
- def get_environment_config(environment = nil, force_reload = false)
188
+ def environment_config(environment = nil, force_reload = false)
189
189
  environment ||= ENV["AIDP_ENV"] || "development"
190
190
  config = load_config(force_reload)
191
191
  return nil unless config
@@ -214,7 +214,7 @@ module Aidp
214
214
  end
215
215
 
216
216
  # Get configuration with feature flags
217
- def get_config_with_features(features = {}, force_reload = false)
217
+ def config_with_features(features = {}, force_reload = false)
218
218
  config = load_config(force_reload)
219
219
  return nil unless config
220
220
 
@@ -250,7 +250,7 @@ module Aidp
250
250
  end
251
251
 
252
252
  # Get configuration with time-based overrides
253
- def get_time_based_config(force_reload = false)
253
+ def time_based_config(force_reload = false)
254
254
  config = load_config(force_reload)
255
255
  return nil unless config
256
256
 
@@ -340,12 +340,12 @@ module Aidp
340
340
  result
341
341
  end
342
342
 
343
- def get_analyze_mode_config(config)
343
+ def analyze_mode_config(config)
344
344
  analyze_overrides = config[:analyze_mode] || config["analyze_mode"] || {}
345
345
  merge_overrides(config, analyze_overrides)
346
346
  end
347
347
 
348
- def get_execute_mode_config(config)
348
+ def execute_mode_config(config)
349
349
  execute_overrides = config[:execute_mode] || config["execute_mode"] || {}
350
350
  merge_overrides(config, execute_overrides)
351
351
  end
@@ -18,7 +18,7 @@ module Aidp
18
18
  end
19
19
 
20
20
  # Get complete configuration
21
- def get_config(options = {})
21
+ def config(options = {})
22
22
  cache_key = "config_#{options.hash}"
23
23
 
24
24
  if cache_valid?(cache_key)
@@ -31,16 +31,16 @@ module Aidp
31
31
  end
32
32
 
33
33
  # Get harness configuration
34
- def get_harness_config(options = {})
35
- config = get_config(options)
34
+ def harness_config(options = {})
35
+ config = config(options)
36
36
  return nil unless config
37
37
 
38
38
  config[:harness] || {}
39
39
  end
40
40
 
41
41
  # Get provider configuration
42
- def get_provider_config(provider_name, options = {})
43
- config = get_config(options)
42
+ def provider_config(provider_name, options = {})
43
+ config = config(options)
44
44
  return nil unless config
45
45
 
46
46
  providers = config[:providers] || {}
@@ -48,38 +48,38 @@ module Aidp
48
48
  end
49
49
 
50
50
  # Get all provider configurations
51
- def get_all_providers(options = {})
52
- config = get_config(options)
51
+ def all_providers(options = {})
52
+ config = config(options)
53
53
  return {} unless config
54
54
 
55
55
  config[:providers] || {}
56
56
  end
57
57
 
58
58
  # Get configured provider names
59
- def get_provider_names(options = {})
60
- providers = get_all_providers(options)
59
+ def provider_names(options = {})
60
+ providers = all_providers(options)
61
61
  providers.keys.map(&:to_s)
62
62
  end
63
63
 
64
64
  # Get default provider
65
- def get_default_provider(options = {})
66
- harness_config = get_harness_config(options)
65
+ def default_provider(options = {})
66
+ harness_config = harness_config(options)
67
67
  harness_config[:default_provider] || harness_config["default_provider"]
68
68
  end
69
69
 
70
70
  # Get fallback providers
71
- def get_fallback_providers(options = {})
72
- harness_config = get_harness_config(options)
71
+ def fallback_providers(options = {})
72
+ harness_config = harness_config(options)
73
73
  fallback_providers = harness_config[:fallback_providers] || harness_config["fallback_providers"] || []
74
74
 
75
75
  # Ensure fallback providers are configured
76
- configured_providers = get_provider_names(options)
76
+ configured_providers = provider_names(options)
77
77
  fallback_providers.select { |provider| configured_providers.include?(provider) }
78
78
  end
79
79
 
80
80
  # Get provider weights
81
- def get_provider_weights(options = {})
82
- harness_config = get_harness_config(options)
81
+ def provider_weights(options = {})
82
+ harness_config = harness_config(options)
83
83
  weights = harness_config[:provider_weights] || harness_config["provider_weights"] || {}
84
84
 
85
85
  # Normalize weights to ensure they're positive integers
@@ -87,8 +87,8 @@ module Aidp
87
87
  end
88
88
 
89
89
  # Get retry configuration
90
- def get_retry_config(options = {})
91
- harness_config = get_harness_config(options)
90
+ def retry_config(options = {})
91
+ harness_config = harness_config(options)
92
92
  retry_config = harness_config[:retry] || harness_config["retry"] || {}
93
93
 
94
94
  {
@@ -102,8 +102,8 @@ module Aidp
102
102
  end
103
103
 
104
104
  # Get circuit breaker configuration
105
- def get_circuit_breaker_config(options = {})
106
- harness_config = get_harness_config(options)
105
+ def circuit_breaker_config(options = {})
106
+ harness_config = harness_config(options)
107
107
  cb_config = harness_config[:circuit_breaker] || harness_config["circuit_breaker"] || {}
108
108
 
109
109
  {
@@ -115,8 +115,8 @@ module Aidp
115
115
  end
116
116
 
117
117
  # Get rate limit configuration
118
- def get_rate_limit_config(options = {})
119
- harness_config = get_harness_config(options)
118
+ def rate_limit_config(options = {})
119
+ harness_config = harness_config(options)
120
120
  rate_limit_config = harness_config[:rate_limit] || harness_config["rate_limit"] || {}
121
121
 
122
122
  {
@@ -128,8 +128,8 @@ module Aidp
128
128
  end
129
129
 
130
130
  # Get load balancing configuration
131
- def get_load_balancing_config(options = {})
132
- harness_config = get_harness_config(options)
131
+ def load_balancing_config(options = {})
132
+ harness_config = harness_config(options)
133
133
  lb_config = harness_config[:load_balancing] || harness_config["load_balancing"] || {}
134
134
 
135
135
  {
@@ -141,8 +141,8 @@ module Aidp
141
141
  end
142
142
 
143
143
  # Get model switching configuration
144
- def get_model_switching_config(options = {})
145
- harness_config = get_harness_config(options)
144
+ def model_switching_config(options = {})
145
+ harness_config = harness_config(options)
146
146
  ms_config = harness_config[:model_switching] || harness_config["model_switching"] || {}
147
147
 
148
148
  {
@@ -154,8 +154,8 @@ module Aidp
154
154
  end
155
155
 
156
156
  # Get health check configuration
157
- def get_health_check_config(options = {})
158
- harness_config = get_harness_config(options)
157
+ def health_check_config(options = {})
158
+ harness_config = harness_config(options)
159
159
  hc_config = harness_config[:health_check] || harness_config["health_check"] || {}
160
160
 
161
161
  {
@@ -168,8 +168,8 @@ module Aidp
168
168
  end
169
169
 
170
170
  # Get metrics configuration
171
- def get_metrics_config(options = {})
172
- harness_config = get_harness_config(options)
171
+ def metrics_config(options = {})
172
+ harness_config = harness_config(options)
173
173
  metrics_config = harness_config[:metrics] || harness_config["metrics"] || {}
174
174
 
175
175
  {
@@ -181,8 +181,8 @@ module Aidp
181
181
  end
182
182
 
183
183
  # Get session configuration
184
- def get_session_config(options = {})
185
- harness_config = get_harness_config(options)
184
+ def session_config(options = {})
185
+ harness_config = harness_config(options)
186
186
  session_config = harness_config[:session] || harness_config["session"] || {}
187
187
 
188
188
  {
@@ -194,8 +194,8 @@ module Aidp
194
194
  end
195
195
 
196
196
  # Get provider models
197
- def get_provider_models(provider_name, options = {})
198
- provider_config = get_provider_config(provider_name, options)
197
+ def provider_models(provider_name, options = {})
198
+ provider_config = provider_config(provider_name, options)
199
199
  return [] unless provider_config
200
200
 
201
201
  models = provider_config[:models] || provider_config["models"] || []
@@ -203,8 +203,8 @@ module Aidp
203
203
  end
204
204
 
205
205
  # Get provider model weights
206
- def get_provider_model_weights(provider_name, options = {})
207
- provider_config = get_provider_config(provider_name, options)
206
+ def provider_model_weights(provider_name, options = {})
207
+ provider_config = provider_config(provider_name, options)
208
208
  return {} unless provider_config
209
209
 
210
210
  weights = provider_config[:model_weights] || provider_config["model_weights"] || {}
@@ -212,8 +212,8 @@ module Aidp
212
212
  end
213
213
 
214
214
  # Get provider model configuration
215
- def get_provider_model_config(provider_name, model_name, options = {})
216
- provider_config = get_provider_config(provider_name, options)
215
+ def provider_model_config(provider_name, model_name, options = {})
216
+ provider_config = provider_config(provider_name, options)
217
217
  return {} unless provider_config
218
218
 
219
219
  models_config = provider_config[:models_config] || provider_config["models_config"] || {}
@@ -227,8 +227,8 @@ module Aidp
227
227
  end
228
228
 
229
229
  # Get provider features
230
- def get_provider_features(provider_name, options = {})
231
- provider_config = get_provider_config(provider_name, options)
230
+ def provider_features(provider_name, options = {})
231
+ provider_config = provider_config(provider_name, options)
232
232
  return {} unless provider_config
233
233
 
234
234
  features = provider_config[:features] || provider_config["features"] || {}
@@ -242,8 +242,8 @@ module Aidp
242
242
  end
243
243
 
244
244
  # Get provider monitoring configuration
245
- def get_provider_monitoring_config(provider_name, options = {})
246
- provider_config = get_provider_config(provider_name, options)
245
+ def provider_monitoring_config(provider_name, options = {})
246
+ provider_config = provider_config(provider_name, options)
247
247
  return {} unless provider_config
248
248
 
249
249
  monitoring = provider_config[:monitoring] || provider_config["monitoring"] || {}
@@ -256,21 +256,21 @@ module Aidp
256
256
 
257
257
  # Check if provider supports feature
258
258
  def provider_supports_feature?(provider_name, feature, options = {})
259
- features = get_provider_features(provider_name, options)
259
+ features = provider_features(provider_name, options)
260
260
  features[feature.to_sym] == true
261
261
  end
262
262
 
263
263
  # Get provider priority
264
- def get_provider_priority(provider_name, options = {})
265
- provider_config = get_provider_config(provider_name, options)
264
+ def provider_priority(provider_name, options = {})
265
+ provider_config = provider_config(provider_name, options)
266
266
  return 1 unless provider_config
267
267
 
268
268
  provider_config[:priority] || provider_config["priority"] || 1
269
269
  end
270
270
 
271
271
  # Get provider type
272
- def get_provider_type(provider_name, options = {})
273
- provider_config = get_provider_config(provider_name, options)
272
+ def provider_type(provider_name, options = {})
273
+ provider_config = provider_config(provider_name, options)
274
274
  return nil unless provider_config
275
275
 
276
276
  provider_config[:type] || provider_config["type"]
@@ -279,16 +279,16 @@ module Aidp
279
279
  # Provider type checking methods are now provided by ProviderTypeChecker module
280
280
 
281
281
  # Get provider max tokens
282
- def get_provider_max_tokens(provider_name, options = {})
283
- provider_config = get_provider_config(provider_name, options)
282
+ def provider_max_tokens(provider_name, options = {})
283
+ provider_config = provider_config(provider_name, options)
284
284
  return nil unless provider_config
285
285
 
286
286
  provider_config[:max_tokens] || provider_config["max_tokens"]
287
287
  end
288
288
 
289
289
  # Get provider default flags
290
- def get_provider_default_flags(provider_name, options = {})
291
- provider_config = get_provider_config(provider_name, options)
290
+ def provider_default_flags(provider_name, options = {})
291
+ provider_config = provider_config(provider_name, options)
292
292
  return [] unless provider_config
293
293
 
294
294
  flags = provider_config[:default_flags] || provider_config["default_flags"] || []
@@ -296,8 +296,8 @@ module Aidp
296
296
  end
297
297
 
298
298
  # Get provider auth configuration
299
- def get_provider_auth_config(provider_name, options = {})
300
- provider_config = get_provider_config(provider_name, options)
299
+ def provider_auth_config(provider_name, options = {})
300
+ provider_config = provider_config(provider_name, options)
301
301
  return {} unless provider_config
302
302
 
303
303
  auth = provider_config[:auth] || provider_config["auth"] || {}
@@ -309,8 +309,8 @@ module Aidp
309
309
  end
310
310
 
311
311
  # Get provider endpoints
312
- def get_provider_endpoints(provider_name, options = {})
313
- provider_config = get_provider_config(provider_name, options)
312
+ def provider_endpoints(provider_name, options = {})
313
+ provider_config = provider_config(provider_name, options)
314
314
  return {} unless provider_config
315
315
 
316
316
  endpoints = provider_config[:endpoints] || provider_config["endpoints"] || {}
@@ -326,13 +326,13 @@ module Aidp
326
326
  end
327
327
 
328
328
  # Get validation errors
329
- def get_validation_errors
330
- @loader.get_validation_errors
329
+ def validation_errors
330
+ @loader.validation_errors
331
331
  end
332
332
 
333
333
  # Get validation warnings
334
- def get_validation_warnings
335
- @loader.get_validation_warnings
334
+ def validation_warnings
335
+ @loader.validation_warnings
336
336
  end
337
337
 
338
338
  # Reload configuration
@@ -343,8 +343,8 @@ module Aidp
343
343
  end
344
344
 
345
345
  # Get configuration summary
346
- def get_config_summary
347
- @loader.get_config_summary
346
+ def config_summary
347
+ @loader.config_summary
348
348
  end
349
349
 
350
350
  private
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "yaml"
4
4
  require_relative "config_schema"
5
+ require_relative "../config/paths"
5
6
 
6
7
  module Aidp
7
8
  module Harness
@@ -40,7 +41,7 @@ module Aidp
40
41
  end
41
42
 
42
43
  # Get configuration with defaults applied
43
- def get_validated_config
44
+ def validated_config
44
45
  return nil unless @validation_result&.dig(:valid)
45
46
 
46
47
  ConfigSchema.apply_defaults(@config)
@@ -76,9 +77,9 @@ module Aidp
76
77
  return false if config_exists?
77
78
 
78
79
  example_config = ConfigSchema.generate_example
79
- config_path = File.join(@project_dir, ".aidp", "aidp.yml")
80
+ config_path = Aidp::ConfigPaths.config_file(@project_dir)
80
81
 
81
- FileUtils.mkdir_p(File.dirname(config_path))
82
+ Aidp::ConfigPaths.ensure_config_dir(@project_dir)
82
83
  File.write(config_path, YAML.dump(example_config))
83
84
  true
84
85
  end
@@ -109,7 +110,7 @@ module Aidp
109
110
  end
110
111
 
111
112
  # Get configuration summary
112
- def get_summary
113
+ def summary
113
114
  return {error: "No configuration file found"} unless @config_file
114
115
 
115
116
  load_config
@@ -156,7 +157,7 @@ module Aidp
156
157
  end
157
158
 
158
159
  # Get provider configuration with defaults
159
- def get_provider_config(provider_name)
160
+ def provider_config(provider_name)
160
161
  return nil unless @config_file
161
162
 
162
163
  load_config
@@ -194,7 +195,7 @@ module Aidp
194
195
  end
195
196
 
196
197
  # Get harness configuration with defaults
197
- def get_harness_config
198
+ def harness_config
198
199
  return nil unless @config_file
199
200
 
200
201
  load_config
@@ -211,17 +212,17 @@ module Aidp
211
212
 
212
213
  load_config
213
214
  validate_config
214
- validated_config = get_validated_config
215
- return nil unless validated_config
215
+ config = validated_config
216
+ return nil unless config
216
217
 
217
218
  case format
218
219
  when :yaml
219
- YAML.dump(validated_config)
220
+ YAML.dump(config)
220
221
  when :json
221
222
  require "json"
222
- JSON.pretty_generate(validated_config)
223
+ JSON.pretty_generate(config)
223
224
  when :ruby
224
- "CONFIG = #{validated_config.inspect}"
225
+ "CONFIG = #{config.inspect}"
225
226
  else
226
227
  raise ArgumentError, "Unsupported format: #{format}"
227
228
  end
@@ -244,7 +245,7 @@ module Aidp
244
245
  private
245
246
 
246
247
  def find_config_file
247
- config_file = File.join(@project_dir, ".aidp", "aidp.yml")
248
+ config_file = Aidp::ConfigPaths.config_file(@project_dir)
248
249
 
249
250
  if File.exist?(config_file)
250
251
  config_file