Module: Aidp::ConfigPaths

Defined in:
lib/aidp/config/paths.rb

Overview

Centralized path management for all AIDP internal files Ensures consistent file locations and prevents path-related bugs

Class Method Summary collapse

Class Method Details

.aidp_dir(project_dir = Dir.pwd) ⇒ Object

Get the main AIDP directory for a project



10
11
12
# File 'lib/aidp/config/paths.rb', line 10

def self.aidp_dir(project_dir = Dir.pwd)
  File.join(project_dir, ".aidp")
end

.analyze_progress_file(project_dir = Dir.pwd) ⇒ Object

Get the analyze progress file path



35
36
37
# File 'lib/aidp/config/paths.rb', line 35

def self.analyze_progress_file(project_dir = Dir.pwd)
  File.join(progress_dir(project_dir), "analyze.yml")
end

.checkpoint_file(project_dir = Dir.pwd) ⇒ Object

Get the checkpoint file path



65
66
67
# File 'lib/aidp/config/paths.rb', line 65

def self.checkpoint_file(project_dir = Dir.pwd)
  File.join(aidp_dir(project_dir), "checkpoint.yml")
end

.checkpoint_history_file(project_dir = Dir.pwd) ⇒ Object

Get the checkpoint history file path



70
71
72
# File 'lib/aidp/config/paths.rb', line 70

def self.checkpoint_history_file(project_dir = Dir.pwd)
  File.join(aidp_dir(project_dir), "checkpoint_history.jsonl")
end

.config_dir(project_dir = Dir.pwd) ⇒ Object

Get the configuration directory path



20
21
22
# File 'lib/aidp/config/paths.rb', line 20

def self.config_dir(project_dir = Dir.pwd)
  aidp_dir(project_dir)
end

.config_exists?(project_dir = Dir.pwd) ⇒ Boolean

Check if the main configuration file exists

Returns:

  • (Boolean)


80
81
82
# File 'lib/aidp/config/paths.rb', line 80

def self.config_exists?(project_dir = Dir.pwd)
  File.exist?(config_file(project_dir))
end

.config_file(project_dir = Dir.pwd) ⇒ Object

Get the main configuration file path



15
16
17
# File 'lib/aidp/config/paths.rb', line 15

def self.config_file(project_dir = Dir.pwd)
  File.join(aidp_dir(project_dir), "aidp.yml")
end

.ensure_aidp_dir(project_dir = Dir.pwd) ⇒ Object

Ensure the main AIDP directory exists



85
86
87
88
89
# File 'lib/aidp/config/paths.rb', line 85

def self.ensure_aidp_dir(project_dir = Dir.pwd)
  dir = aidp_dir(project_dir)
  FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
  dir
end

.ensure_config_dir(project_dir = Dir.pwd) ⇒ Object

Ensure the configuration directory exists



92
93
94
# File 'lib/aidp/config/paths.rb', line 92

def self.ensure_config_dir(project_dir = Dir.pwd)
  ensure_aidp_dir(project_dir)
end

.ensure_harness_state_dir(project_dir = Dir.pwd) ⇒ Object

Ensure the harness state directory exists



104
105
106
107
108
# File 'lib/aidp/config/paths.rb', line 104

def self.ensure_harness_state_dir(project_dir = Dir.pwd)
  dir = harness_state_dir(project_dir)
  FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
  dir
end

.ensure_jobs_dir(project_dir = Dir.pwd) ⇒ Object

Ensure the jobs directory exists



118
119
120
121
122
# File 'lib/aidp/config/paths.rb', line 118

def self.ensure_jobs_dir(project_dir = Dir.pwd)
  dir = jobs_dir(project_dir)
  FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
  dir
end

.ensure_json_storage_dir(project_dir = Dir.pwd) ⇒ Object

Ensure the JSON storage directory exists



125
126
127
128
129
# File 'lib/aidp/config/paths.rb', line 125

def self.ensure_json_storage_dir(project_dir = Dir.pwd)
  dir = json_storage_dir(project_dir)
  FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
  dir
end

.ensure_progress_dir(project_dir = Dir.pwd) ⇒ Object

Ensure the progress directory exists



97
98
99
100
101
# File 'lib/aidp/config/paths.rb', line 97

def self.ensure_progress_dir(project_dir = Dir.pwd)
  dir = progress_dir(project_dir)
  FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
  dir
end

.ensure_providers_dir(project_dir = Dir.pwd) ⇒ Object

Ensure the providers directory exists



111
112
113
114
115
# File 'lib/aidp/config/paths.rb', line 111

def self.ensure_providers_dir(project_dir = Dir.pwd)
  dir = providers_dir(project_dir)
  FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
  dir
end

.execute_progress_file(project_dir = Dir.pwd) ⇒ Object

Get the execute progress file path



30
31
32
# File 'lib/aidp/config/paths.rb', line 30

def self.execute_progress_file(project_dir = Dir.pwd)
  File.join(progress_dir(project_dir), "execute.yml")
end

.harness_state_dir(project_dir = Dir.pwd) ⇒ Object

Get the harness state directory path



40
41
42
# File 'lib/aidp/config/paths.rb', line 40

def self.harness_state_dir(project_dir = Dir.pwd)
  File.join(aidp_dir(project_dir), "harness")
end

.harness_state_file(mode, project_dir = Dir.pwd) ⇒ Object

Get the harness state file path for a specific mode



45
46
47
# File 'lib/aidp/config/paths.rb', line 45

def self.harness_state_file(mode, project_dir = Dir.pwd)
  File.join(harness_state_dir(project_dir), "#{mode}_state.json")
end

.jobs_dir(project_dir = Dir.pwd) ⇒ Object

Get the jobs directory path



60
61
62
# File 'lib/aidp/config/paths.rb', line 60

def self.jobs_dir(project_dir = Dir.pwd)
  File.join(aidp_dir(project_dir), "jobs")
end

.json_storage_dir(project_dir = Dir.pwd) ⇒ Object

Get the JSON storage directory path



75
76
77
# File 'lib/aidp/config/paths.rb', line 75

def self.json_storage_dir(project_dir = Dir.pwd)
  File.join(aidp_dir(project_dir), "json")
end

.progress_dir(project_dir = Dir.pwd) ⇒ Object

Get the progress directory path



25
26
27
# File 'lib/aidp/config/paths.rb', line 25

def self.progress_dir(project_dir = Dir.pwd)
  File.join(aidp_dir(project_dir), "progress")
end

.provider_info_file(provider_name, project_dir = Dir.pwd) ⇒ Object

Get the provider info file path



55
56
57
# File 'lib/aidp/config/paths.rb', line 55

def self.provider_info_file(provider_name, project_dir = Dir.pwd)
  File.join(providers_dir(project_dir), "#{provider_name}_info.yml")
end

.providers_dir(project_dir = Dir.pwd) ⇒ Object

Get the providers directory path



50
51
52
# File 'lib/aidp/config/paths.rb', line 50

def self.providers_dir(project_dir = Dir.pwd)
  File.join(aidp_dir(project_dir), "providers")
end