claude-evolve 1.6.23 → 1.6.25
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.
- package/lib/config.py +13 -8
- package/lib/config.sh +15 -11
- package/package.json +1 -1
package/lib/config.py
CHANGED
|
@@ -11,7 +11,6 @@ class Config:
|
|
|
11
11
|
|
|
12
12
|
# Default values matching config.sh
|
|
13
13
|
DEFAULTS = {
|
|
14
|
-
'evolution_dir': 'evolution',
|
|
15
14
|
'algorithm_file': 'algorithm.py',
|
|
16
15
|
'evaluator_file': 'evaluator.py',
|
|
17
16
|
'brief_file': 'BRIEF.md',
|
|
@@ -44,18 +43,24 @@ class Config:
|
|
|
44
43
|
|
|
45
44
|
def load(self, config_path=None, working_dir=None):
|
|
46
45
|
"""Load configuration from YAML file."""
|
|
47
|
-
#
|
|
46
|
+
# Initialize working_dir with a default
|
|
47
|
+
self.working_dir = Path('evolution')
|
|
48
|
+
|
|
49
|
+
# Determine self.working_dir (EVOLUTION_DIR equivalent) based on specified logic
|
|
50
|
+
if working_dir:
|
|
51
|
+
self.working_dir = Path(working_dir)
|
|
52
|
+
elif (Path('evolution') / 'evolution.csv').exists():
|
|
53
|
+
self.working_dir = Path('evolution')
|
|
54
|
+
elif Path('./evolution.csv').exists():
|
|
55
|
+
self.working_dir = Path('.')
|
|
56
|
+
|
|
57
|
+
# Determine local config file path relative to self.working_dir
|
|
48
58
|
local_config_path = None
|
|
49
59
|
if config_path:
|
|
50
60
|
# Explicit config path provided, treat as local
|
|
51
61
|
local_config_path = Path(config_path)
|
|
52
|
-
elif working_dir:
|
|
53
|
-
# Look for config.yaml in working directory
|
|
54
|
-
self.working_dir = Path(working_dir)
|
|
55
|
-
local_config_path = self.working_dir / 'config.yaml'
|
|
56
62
|
else:
|
|
57
|
-
|
|
58
|
-
local_config_path = Path('evolution/config.yaml')
|
|
63
|
+
local_config_path = self.working_dir / 'config.yaml'
|
|
59
64
|
|
|
60
65
|
# Store the resolved config_path for path resolution later
|
|
61
66
|
self.config_path = local_config_path
|
package/lib/config.sh
CHANGED
|
@@ -173,7 +173,7 @@ _load_yaml_config() {
|
|
|
173
173
|
# Load configuration from config file
|
|
174
174
|
load_config() {
|
|
175
175
|
# Set defaults first
|
|
176
|
-
EVOLUTION_DIR="$DEFAULT_EVOLUTION_DIR"
|
|
176
|
+
EVOLUTION_DIR="$DEFAULT_EVOLUTION_DIR" # Initialize with default
|
|
177
177
|
ALGORITHM_FILE="$DEFAULT_ALGORITHM_FILE"
|
|
178
178
|
EVALUATOR_FILE="$DEFAULT_EVALUATOR_FILE"
|
|
179
179
|
BRIEF_FILE="$DEFAULT_BRIEF_FILE"
|
|
@@ -181,6 +181,16 @@ load_config() {
|
|
|
181
181
|
OUTPUT_DIR="$DEFAULT_OUTPUT_DIR"
|
|
182
182
|
PARENT_SELECTION="$DEFAULT_PARENT_SELECTION"
|
|
183
183
|
PYTHON_CMD="$DEFAULT_PYTHON_CMD"
|
|
184
|
+
|
|
185
|
+
# Determine EVOLUTION_DIR based on specified logic, overriding default if found
|
|
186
|
+
local user_working_dir="$1"
|
|
187
|
+
if [[ -n "$user_working_dir" ]]; then
|
|
188
|
+
EVOLUTION_DIR="$user_working_dir"
|
|
189
|
+
elif [[ -f "evolution/evolution.csv" ]]; then
|
|
190
|
+
EVOLUTION_DIR="evolution"
|
|
191
|
+
elif [[ -f "./evolution.csv" ]]; then
|
|
192
|
+
EVOLUTION_DIR="."
|
|
193
|
+
fi
|
|
184
194
|
|
|
185
195
|
TOTAL_IDEAS="$DEFAULT_TOTAL_IDEAS"
|
|
186
196
|
NOVEL_EXPLORATION="$DEFAULT_NOVEL_EXPLORATION"
|
|
@@ -214,11 +224,8 @@ load_config() {
|
|
|
214
224
|
LLM_RUN="$DEFAULT_LLM_RUN"
|
|
215
225
|
LLM_IDEATE="$DEFAULT_LLM_IDEATE"
|
|
216
226
|
|
|
217
|
-
#
|
|
218
|
-
local local_config_file="
|
|
219
|
-
if [[ -n "$1" ]]; then
|
|
220
|
-
local_config_file="$1"
|
|
221
|
-
fi
|
|
227
|
+
# Determine local config file path relative to EVOLUTION_DIR
|
|
228
|
+
local local_config_file="$EVOLUTION_DIR/config.yaml"
|
|
222
229
|
|
|
223
230
|
# Load local config
|
|
224
231
|
_load_yaml_config "$local_config_file"
|
|
@@ -227,11 +234,8 @@ load_config() {
|
|
|
227
234
|
local global_config_file="$HOME/.config/claude-evolve/config.yaml"
|
|
228
235
|
_load_yaml_config "$global_config_file"
|
|
229
236
|
|
|
230
|
-
#
|
|
231
|
-
#
|
|
232
|
-
|
|
233
|
-
# Create full paths - ALL paths are relative to evolution_dir
|
|
234
|
-
# Make evolution_dir absolute if it's relative
|
|
237
|
+
# Create full paths - ALL paths are relative to EVOLUTION_DIR
|
|
238
|
+
# Make EVOLUTION_DIR absolute if it's relative
|
|
235
239
|
if [[ "$EVOLUTION_DIR" = /* ]]; then
|
|
236
240
|
FULL_EVOLUTION_DIR="$EVOLUTION_DIR"
|
|
237
241
|
else
|