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



9
# File 'lib/aidp/config_paths.rb', line 9

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

.analyze_progress_file(project_dir = Dir.pwd) ⇒ Object



14
# File 'lib/aidp/config_paths.rb', line 14

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

.checkpoint_file(project_dir = Dir.pwd) ⇒ Object



20
# File 'lib/aidp/config_paths.rb', line 20

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

.checkpoint_history_file(project_dir = Dir.pwd) ⇒ Object



21
# File 'lib/aidp/config_paths.rb', line 21

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

.config_dir(project_dir = Dir.pwd) ⇒ Object



11
# File 'lib/aidp/config_paths.rb', line 11

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

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

Returns:

  • (Boolean)


39
40
41
# File 'lib/aidp/config_paths.rb', line 39

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

.config_file(project_dir = Dir.pwd) ⇒ Object



10
# File 'lib/aidp/config_paths.rb', line 10

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

.database_file(project_dir = Dir.pwd) ⇒ Object

Database path



37
# File 'lib/aidp/config_paths.rb', line 37

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

.ensure_aidp_dir(project_dir = Dir.pwd) ⇒ Object



43
44
45
46
47
# File 'lib/aidp/config_paths.rb', line 43

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



49
50
51
# File 'lib/aidp/config_paths.rb', line 49

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

.ensure_evaluations_dir(project_dir = Dir.pwd) ⇒ Object



83
84
85
86
87
# File 'lib/aidp/config_paths.rb', line 83

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

.ensure_harness_state_dir(project_dir = Dir.pwd) ⇒ Object



59
60
61
62
63
# File 'lib/aidp/config_paths.rb', line 59

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



71
72
73
74
75
# File 'lib/aidp/config_paths.rb', line 71

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



77
78
79
80
81
# File 'lib/aidp/config_paths.rb', line 77

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



53
54
55
56
57
# File 'lib/aidp/config_paths.rb', line 53

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_prompts_dir(project_dir = Dir.pwd) ⇒ Object



95
96
97
98
99
# File 'lib/aidp/config_paths.rb', line 95

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

.ensure_providers_dir(project_dir = Dir.pwd) ⇒ Object



65
66
67
68
69
# File 'lib/aidp/config_paths.rb', line 65

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

.ensure_security_dir(project_dir = Dir.pwd) ⇒ Object



89
90
91
92
93
# File 'lib/aidp/config_paths.rb', line 89

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

.evaluations_dir(project_dir = Dir.pwd) ⇒ Object



26
# File 'lib/aidp/config_paths.rb', line 26

def self.evaluations_dir(project_dir = Dir.pwd) = File.join(aidp_dir(project_dir), "evaluations")

.evaluations_index_file(project_dir = Dir.pwd) ⇒ Object



27
# File 'lib/aidp/config_paths.rb', line 27

def self.evaluations_index_file(project_dir = Dir.pwd) = File.join(evaluations_dir(project_dir), "index.json")

.execute_progress_file(project_dir = Dir.pwd) ⇒ Object



13
# File 'lib/aidp/config_paths.rb', line 13

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

.harness_state_dir(project_dir = Dir.pwd) ⇒ Object



15
# File 'lib/aidp/config_paths.rb', line 15

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

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



16
# File 'lib/aidp/config_paths.rb', line 16

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

.jobs_dir(project_dir = Dir.pwd) ⇒ Object



19
# File 'lib/aidp/config_paths.rb', line 19

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

.json_storage_dir(project_dir = Dir.pwd) ⇒ Object



22
# File 'lib/aidp/config_paths.rb', line 22

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

.logs_dir(project_dir = Dir.pwd) ⇒ Object



25
# File 'lib/aidp/config_paths.rb', line 25

def self.logs_dir(project_dir = Dir.pwd) = File.join(aidp_dir(project_dir), "logs")

.model_cache_dir(project_dir = Dir.pwd) ⇒ Object



23
# File 'lib/aidp/config_paths.rb', line 23

def self.model_cache_dir(project_dir = Dir.pwd) = File.join(aidp_dir(project_dir), "model_cache")

.progress_dir(project_dir = Dir.pwd) ⇒ Object



12
# File 'lib/aidp/config_paths.rb', line 12

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

.prompts_dir(project_dir = Dir.pwd) ⇒ Object

Prompt template paths (feedback is stored in SQLite database)



30
# File 'lib/aidp/config_paths.rb', line 30

def self.prompts_dir(project_dir = Dir.pwd) = File.join(aidp_dir(project_dir), "prompts")

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



18
# File 'lib/aidp/config_paths.rb', line 18

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

.providers_dir(project_dir = Dir.pwd) ⇒ Object



17
# File 'lib/aidp/config_paths.rb', line 17

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

.secrets_registry_file(project_dir = Dir.pwd) ⇒ Object



34
# File 'lib/aidp/config_paths.rb', line 34

def self.secrets_registry_file(project_dir = Dir.pwd) = File.join(security_dir(project_dir), "secrets_registry.json")

.security_dir(project_dir = Dir.pwd) ⇒ Object

Security module paths



33
# File 'lib/aidp/config_paths.rb', line 33

def self.security_dir(project_dir = Dir.pwd) = File.join(aidp_dir(project_dir), "security")

.work_loop_dir(project_dir = Dir.pwd) ⇒ Object



24
# File 'lib/aidp/config_paths.rb', line 24

def self.work_loop_dir(project_dir = Dir.pwd) = File.join(aidp_dir(project_dir), "work_loop")