claude-evolve 1.6.22 → 1.6.24
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 +12 -8
- package/lib/config.sh +16 -18
- 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,23 @@ class Config:
|
|
|
44
43
|
|
|
45
44
|
def load(self, config_path=None, working_dir=None):
|
|
46
45
|
"""Load configuration from YAML file."""
|
|
47
|
-
# Determine
|
|
46
|
+
# Determine self.working_dir (EVOLUTION_DIR equivalent) based on specified logic
|
|
47
|
+
if working_dir:
|
|
48
|
+
self.working_dir = Path(working_dir)
|
|
49
|
+
elif (Path('evolution') / 'evolution.csv').exists():
|
|
50
|
+
self.working_dir = Path('evolution')
|
|
51
|
+
elif Path('./evolution.csv').exists():
|
|
52
|
+
self.working_dir = Path('.')
|
|
53
|
+
else:
|
|
54
|
+
self.working_dir = Path('evolution') # Default
|
|
55
|
+
|
|
56
|
+
# Determine local config file path relative to self.working_dir
|
|
48
57
|
local_config_path = None
|
|
49
58
|
if config_path:
|
|
50
59
|
# Explicit config path provided, treat as local
|
|
51
60
|
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
61
|
else:
|
|
57
|
-
|
|
58
|
-
local_config_path = Path('evolution/config.yaml')
|
|
62
|
+
local_config_path = self.working_dir / 'config.yaml'
|
|
59
63
|
|
|
60
64
|
# Store the resolved config_path for path resolution later
|
|
61
65
|
self.config_path = local_config_path
|
package/lib/config.sh
CHANGED
|
@@ -172,8 +172,19 @@ _load_yaml_config() {
|
|
|
172
172
|
|
|
173
173
|
# Load configuration from config file
|
|
174
174
|
load_config() {
|
|
175
|
+
# Determine EVOLUTION_DIR based on specified logic
|
|
176
|
+
local user_working_dir="$1"
|
|
177
|
+
if [[ -n "$user_working_dir" ]]; then
|
|
178
|
+
EVOLUTION_DIR="$user_working_dir"
|
|
179
|
+
elif [[ -f "evolution/evolution.csv" ]]; then
|
|
180
|
+
EVOLUTION_DIR="evolution"
|
|
181
|
+
elif [[ -f "./evolution.csv" ]]; then
|
|
182
|
+
EVOLUTION_DIR="."
|
|
183
|
+
else
|
|
184
|
+
EVOLUTION_DIR="$DEFAULT_EVOLUTION_DIR"
|
|
185
|
+
fi
|
|
186
|
+
|
|
175
187
|
# Set defaults first
|
|
176
|
-
EVOLUTION_DIR="$DEFAULT_EVOLUTION_DIR"
|
|
177
188
|
ALGORITHM_FILE="$DEFAULT_ALGORITHM_FILE"
|
|
178
189
|
EVALUATOR_FILE="$DEFAULT_EVALUATOR_FILE"
|
|
179
190
|
BRIEF_FILE="$DEFAULT_BRIEF_FILE"
|
|
@@ -214,12 +225,8 @@ load_config() {
|
|
|
214
225
|
LLM_RUN="$DEFAULT_LLM_RUN"
|
|
215
226
|
LLM_IDEATE="$DEFAULT_LLM_IDEATE"
|
|
216
227
|
|
|
217
|
-
# Determine local config file path
|
|
218
|
-
local local_config_file="
|
|
219
|
-
if [[ -n "$1" ]]; then
|
|
220
|
-
# If a config file is explicitly provided, use it as the local config
|
|
221
|
-
local_config_file="$1"
|
|
222
|
-
fi
|
|
228
|
+
# Determine local config file path relative to EVOLUTION_DIR
|
|
229
|
+
local local_config_file="$EVOLUTION_DIR/config.yaml"
|
|
223
230
|
|
|
224
231
|
# Load local config
|
|
225
232
|
_load_yaml_config "$local_config_file"
|
|
@@ -227,18 +234,9 @@ load_config() {
|
|
|
227
234
|
# Load global config (overrides local config)
|
|
228
235
|
local global_config_file="$HOME/.config/claude-evolve/config.yaml"
|
|
229
236
|
_load_yaml_config "$global_config_file"
|
|
230
|
-
|
|
231
|
-
# If LAST_CONFIG_FILE_LOADED is set, use its directory to infer evolution_dir
|
|
232
|
-
if [[ -n "$LAST_CONFIG_FILE_LOADED" ]]; then
|
|
233
|
-
local config_dir=$(dirname "$LAST_CONFIG_FILE_LOADED")
|
|
234
|
-
if [[ "$config_dir" != "" && "$config_dir" != "." ]]; then
|
|
235
|
-
EVOLUTION_DIR="$config_dir"
|
|
236
|
-
echo "[DEBUG] Using evolution directory from last loaded config path: $EVOLUTION_DIR" >&2
|
|
237
|
-
fi
|
|
238
|
-
fi
|
|
239
237
|
|
|
240
|
-
# Create full paths - ALL paths are relative to
|
|
241
|
-
# Make
|
|
238
|
+
# Create full paths - ALL paths are relative to EVOLUTION_DIR
|
|
239
|
+
# Make EVOLUTION_DIR absolute if it's relative
|
|
242
240
|
if [[ "$EVOLUTION_DIR" = /* ]]; then
|
|
243
241
|
FULL_EVOLUTION_DIR="$EVOLUTION_DIR"
|
|
244
242
|
else
|