aidp 0.12.0 → 0.12.1
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.
- checksums.yaml +4 -4
- data/lib/aidp/cli/first_run_wizard.rb +11 -7
- data/lib/aidp/config/paths.rb +131 -0
- data/lib/aidp/config.rb +18 -4
- data/lib/aidp/harness/config_validator.rb +4 -3
- data/lib/aidp/harness/configuration.rb +2 -1
- data/lib/aidp/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e672ad3f8f54f1b3ad0cc4a804a63d1fa048709d47112497d5a4871d046dfb8b
|
4
|
+
data.tar.gz: 665d0b12e5dff272a0da11fd20d80299eaa4657ab7a87fe4e8b0f80e039e437d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 384734aed97d697dce2c06ac6bf6f52b161b6436081ff4feb3b8e99e8038bef2b62a9aa3613b21dc92705569741598b98dcbf72805868f6cbdf82a1a19c3c6dd
|
7
|
+
data.tar.gz: 3bd5a990c925f10bb1ad863097b1f0a1e84b682e2489b0793242c37cc4034eb6ac8777559cecb6acaef915391dfeb60337074267e52a1cc4c35aee87c793d672
|
@@ -4,6 +4,7 @@
|
|
4
4
|
require "yaml"
|
5
5
|
require "tty-prompt"
|
6
6
|
require_relative "../harness/provider_factory"
|
7
|
+
require_relative "../config/paths"
|
7
8
|
|
8
9
|
module Aidp
|
9
10
|
class CLI
|
@@ -96,13 +97,14 @@ module Aidp
|
|
96
97
|
display_message("Template not found: #{filename}", type: :error)
|
97
98
|
return nil
|
98
99
|
end
|
99
|
-
dest =
|
100
|
+
dest = Aidp::ConfigPaths.config_file(@project_dir)
|
101
|
+
Aidp::ConfigPaths.ensure_config_dir(@project_dir)
|
100
102
|
File.write(dest, File.read(src))
|
101
103
|
dest
|
102
104
|
end
|
103
105
|
|
104
106
|
def write_minimal_config(project_dir)
|
105
|
-
dest =
|
107
|
+
dest = Aidp::ConfigPaths.config_file(project_dir)
|
106
108
|
return dest if File.exist?(dest)
|
107
109
|
data = {
|
108
110
|
"harness" => {
|
@@ -118,18 +120,18 @@ module Aidp
|
|
118
120
|
}
|
119
121
|
}
|
120
122
|
}
|
121
|
-
|
123
|
+
Aidp::ConfigPaths.ensure_config_dir(project_dir)
|
122
124
|
File.write(dest, YAML.dump(data))
|
123
125
|
dest
|
124
126
|
end
|
125
127
|
|
126
128
|
def write_example_config(project_dir)
|
127
129
|
Aidp::Config.create_example_config(project_dir)
|
128
|
-
|
130
|
+
Aidp::ConfigPaths.config_file(project_dir)
|
129
131
|
end
|
130
132
|
|
131
133
|
def run_custom
|
132
|
-
dest =
|
134
|
+
dest = Aidp::ConfigPaths.config_file(@project_dir)
|
133
135
|
return dest if File.exist?(dest)
|
134
136
|
|
135
137
|
@prompt.say("Interactive custom configuration: press Enter to accept defaults shown in [brackets].")
|
@@ -169,12 +171,13 @@ module Aidp
|
|
169
171
|
},
|
170
172
|
"providers" => provider_section
|
171
173
|
}
|
174
|
+
Aidp::ConfigPaths.ensure_config_dir(@project_dir)
|
172
175
|
File.write(dest, YAML.dump(data))
|
173
176
|
dest
|
174
177
|
end
|
175
178
|
|
176
179
|
def run_custom_with_defaults(existing_config)
|
177
|
-
dest =
|
180
|
+
dest = Aidp::ConfigPaths.config_file(@project_dir)
|
178
181
|
|
179
182
|
# Extract current values from existing config
|
180
183
|
harness_config = existing_config[:harness] || existing_config["harness"] || {}
|
@@ -240,12 +243,13 @@ module Aidp
|
|
240
243
|
"providers" => provider_section
|
241
244
|
}
|
242
245
|
|
246
|
+
Aidp::ConfigPaths.ensure_config_dir(@project_dir)
|
243
247
|
File.write(dest, YAML.dump(data))
|
244
248
|
dest
|
245
249
|
end
|
246
250
|
|
247
251
|
def load_existing_config
|
248
|
-
config_file =
|
252
|
+
config_file = Aidp::ConfigPaths.config_file(@project_dir)
|
249
253
|
return nil unless File.exist?(config_file)
|
250
254
|
|
251
255
|
begin
|
@@ -0,0 +1,131 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "fileutils"
|
4
|
+
|
5
|
+
module Aidp
|
6
|
+
# Centralized path management for all AIDP internal files
|
7
|
+
# Ensures consistent file locations and prevents path-related bugs
|
8
|
+
module ConfigPaths
|
9
|
+
# Get the main AIDP directory for a project
|
10
|
+
def self.aidp_dir(project_dir = Dir.pwd)
|
11
|
+
File.join(project_dir, ".aidp")
|
12
|
+
end
|
13
|
+
|
14
|
+
# Get the main configuration file path
|
15
|
+
def self.config_file(project_dir = Dir.pwd)
|
16
|
+
File.join(aidp_dir(project_dir), "aidp.yml")
|
17
|
+
end
|
18
|
+
|
19
|
+
# Get the configuration directory path
|
20
|
+
def self.config_dir(project_dir = Dir.pwd)
|
21
|
+
aidp_dir(project_dir)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Get the progress directory path
|
25
|
+
def self.progress_dir(project_dir = Dir.pwd)
|
26
|
+
File.join(aidp_dir(project_dir), "progress")
|
27
|
+
end
|
28
|
+
|
29
|
+
# Get the execute progress file path
|
30
|
+
def self.execute_progress_file(project_dir = Dir.pwd)
|
31
|
+
File.join(progress_dir(project_dir), "execute.yml")
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get the analyze progress file path
|
35
|
+
def self.analyze_progress_file(project_dir = Dir.pwd)
|
36
|
+
File.join(progress_dir(project_dir), "analyze.yml")
|
37
|
+
end
|
38
|
+
|
39
|
+
# Get the harness state directory path
|
40
|
+
def self.harness_state_dir(project_dir = Dir.pwd)
|
41
|
+
File.join(aidp_dir(project_dir), "harness")
|
42
|
+
end
|
43
|
+
|
44
|
+
# Get the harness state file path for a specific mode
|
45
|
+
def self.harness_state_file(mode, project_dir = Dir.pwd)
|
46
|
+
File.join(harness_state_dir(project_dir), "#{mode}_state.json")
|
47
|
+
end
|
48
|
+
|
49
|
+
# Get the providers directory path
|
50
|
+
def self.providers_dir(project_dir = Dir.pwd)
|
51
|
+
File.join(aidp_dir(project_dir), "providers")
|
52
|
+
end
|
53
|
+
|
54
|
+
# Get the provider info file path
|
55
|
+
def self.provider_info_file(provider_name, project_dir = Dir.pwd)
|
56
|
+
File.join(providers_dir(project_dir), "#{provider_name}_info.yml")
|
57
|
+
end
|
58
|
+
|
59
|
+
# Get the jobs directory path
|
60
|
+
def self.jobs_dir(project_dir = Dir.pwd)
|
61
|
+
File.join(aidp_dir(project_dir), "jobs")
|
62
|
+
end
|
63
|
+
|
64
|
+
# Get the checkpoint file path
|
65
|
+
def self.checkpoint_file(project_dir = Dir.pwd)
|
66
|
+
File.join(aidp_dir(project_dir), "checkpoint.yml")
|
67
|
+
end
|
68
|
+
|
69
|
+
# Get the checkpoint history file path
|
70
|
+
def self.checkpoint_history_file(project_dir = Dir.pwd)
|
71
|
+
File.join(aidp_dir(project_dir), "checkpoint_history.jsonl")
|
72
|
+
end
|
73
|
+
|
74
|
+
# Get the JSON storage directory path
|
75
|
+
def self.json_storage_dir(project_dir = Dir.pwd)
|
76
|
+
File.join(aidp_dir(project_dir), "json")
|
77
|
+
end
|
78
|
+
|
79
|
+
# Check if the main configuration file exists
|
80
|
+
def self.config_exists?(project_dir = Dir.pwd)
|
81
|
+
File.exist?(config_file(project_dir))
|
82
|
+
end
|
83
|
+
|
84
|
+
# Ensure the main AIDP directory exists
|
85
|
+
def self.ensure_aidp_dir(project_dir = Dir.pwd)
|
86
|
+
dir = aidp_dir(project_dir)
|
87
|
+
FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
|
88
|
+
dir
|
89
|
+
end
|
90
|
+
|
91
|
+
# Ensure the configuration directory exists
|
92
|
+
def self.ensure_config_dir(project_dir = Dir.pwd)
|
93
|
+
ensure_aidp_dir(project_dir)
|
94
|
+
end
|
95
|
+
|
96
|
+
# Ensure the progress directory exists
|
97
|
+
def self.ensure_progress_dir(project_dir = Dir.pwd)
|
98
|
+
dir = progress_dir(project_dir)
|
99
|
+
FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
|
100
|
+
dir
|
101
|
+
end
|
102
|
+
|
103
|
+
# Ensure the harness state directory exists
|
104
|
+
def self.ensure_harness_state_dir(project_dir = Dir.pwd)
|
105
|
+
dir = harness_state_dir(project_dir)
|
106
|
+
FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
|
107
|
+
dir
|
108
|
+
end
|
109
|
+
|
110
|
+
# Ensure the providers directory exists
|
111
|
+
def self.ensure_providers_dir(project_dir = Dir.pwd)
|
112
|
+
dir = providers_dir(project_dir)
|
113
|
+
FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
|
114
|
+
dir
|
115
|
+
end
|
116
|
+
|
117
|
+
# Ensure the jobs directory exists
|
118
|
+
def self.ensure_jobs_dir(project_dir = Dir.pwd)
|
119
|
+
dir = jobs_dir(project_dir)
|
120
|
+
FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
|
121
|
+
dir
|
122
|
+
end
|
123
|
+
|
124
|
+
# Ensure the JSON storage directory exists
|
125
|
+
def self.ensure_json_storage_dir(project_dir = Dir.pwd)
|
126
|
+
dir = json_storage_dir(project_dir)
|
127
|
+
FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
|
128
|
+
dir
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
data/lib/aidp/config.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "yaml"
|
4
|
+
require_relative "config/paths"
|
4
5
|
|
5
6
|
module Aidp
|
6
7
|
# Configuration management for both execute and analyze modes
|
@@ -165,7 +166,7 @@ module Aidp
|
|
165
166
|
}.freeze
|
166
167
|
|
167
168
|
def self.load(project_dir = Dir.pwd)
|
168
|
-
config_file =
|
169
|
+
config_file = ConfigPaths.config_file(project_dir)
|
169
170
|
|
170
171
|
if File.exist?(config_file)
|
171
172
|
load_yaml_config(config_file)
|
@@ -244,15 +245,15 @@ module Aidp
|
|
244
245
|
|
245
246
|
# Check if configuration file exists
|
246
247
|
def self.config_exists?(project_dir = Dir.pwd)
|
247
|
-
|
248
|
+
ConfigPaths.config_exists?(project_dir)
|
248
249
|
end
|
249
250
|
|
250
251
|
# Create example configuration file
|
251
252
|
def self.create_example_config(project_dir = Dir.pwd)
|
252
|
-
config_path =
|
253
|
+
config_path = ConfigPaths.config_file(project_dir)
|
253
254
|
return false if File.exist?(config_path)
|
254
255
|
|
255
|
-
|
256
|
+
ConfigPaths.ensure_config_dir(project_dir)
|
256
257
|
|
257
258
|
example_config = {
|
258
259
|
harness: {
|
@@ -283,6 +284,19 @@ module Aidp
|
|
283
284
|
true
|
284
285
|
end
|
285
286
|
|
287
|
+
# Expose path methods for convenience
|
288
|
+
def self.config_file(project_dir = Dir.pwd)
|
289
|
+
ConfigPaths.config_file(project_dir)
|
290
|
+
end
|
291
|
+
|
292
|
+
def self.config_dir(project_dir = Dir.pwd)
|
293
|
+
ConfigPaths.config_dir(project_dir)
|
294
|
+
end
|
295
|
+
|
296
|
+
def self.aidp_dir(project_dir = Dir.pwd)
|
297
|
+
ConfigPaths.aidp_dir(project_dir)
|
298
|
+
end
|
299
|
+
|
286
300
|
private_class_method def self.load_yaml_config(config_file)
|
287
301
|
YAML.load_file(config_file) || {}
|
288
302
|
rescue => e
|
@@ -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
|
@@ -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 =
|
80
|
+
config_path = Aidp::ConfigPaths.config_file(@project_dir)
|
80
81
|
|
81
|
-
|
82
|
+
Aidp::ConfigPaths.ensure_config_dir(@project_dir)
|
82
83
|
File.write(config_path, YAML.dump(example_config))
|
83
84
|
true
|
84
85
|
end
|
@@ -244,7 +245,7 @@ module Aidp
|
|
244
245
|
private
|
245
246
|
|
246
247
|
def find_config_file
|
247
|
-
config_file =
|
248
|
+
config_file = Aidp::ConfigPaths.config_file(@project_dir)
|
248
249
|
|
249
250
|
if File.exist?(config_file)
|
250
251
|
config_file
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "../config"
|
4
|
+
require_relative "../config/paths"
|
4
5
|
|
5
6
|
module Aidp
|
6
7
|
module Harness
|
@@ -211,7 +212,7 @@ module Aidp
|
|
211
212
|
|
212
213
|
# Get configuration path
|
213
214
|
def config_path
|
214
|
-
|
215
|
+
Aidp::ConfigPaths.config_file(@project_dir)
|
215
216
|
end
|
216
217
|
|
217
218
|
# Get logging configuration
|
data/lib/aidp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aidp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bart Agapinan
|
@@ -253,6 +253,7 @@ files:
|
|
253
253
|
- lib/aidp/cli/mcp_dashboard.rb
|
254
254
|
- lib/aidp/cli/terminal_io.rb
|
255
255
|
- lib/aidp/config.rb
|
256
|
+
- lib/aidp/config/paths.rb
|
256
257
|
- lib/aidp/core_ext/class_attribute.rb
|
257
258
|
- lib/aidp/debug_logger.rb
|
258
259
|
- lib/aidp/debug_mixin.rb
|