claude-self-reflect 2.8.6 → 2.8.7
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/package.json
CHANGED
|
@@ -30,7 +30,33 @@ logger = logging.getLogger(__name__)
|
|
|
30
30
|
|
|
31
31
|
# Environment variables
|
|
32
32
|
QDRANT_URL = os.getenv("QDRANT_URL", "http://localhost:6333")
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
# Robust cross-platform state file resolution
|
|
35
|
+
def get_default_state_file():
|
|
36
|
+
"""Determine the default state file location with cross-platform support."""
|
|
37
|
+
from pathlib import Path
|
|
38
|
+
|
|
39
|
+
# Check if we're in Docker (more reliable than just checking /config)
|
|
40
|
+
docker_indicators = [
|
|
41
|
+
Path("/.dockerenv").exists(), # Docker creates this file
|
|
42
|
+
os.path.exists("/config") and os.access("/config", os.W_OK) # Mounted config dir with write access
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
if any(docker_indicators):
|
|
46
|
+
return "/config/imported-files.json"
|
|
47
|
+
|
|
48
|
+
# Use pathlib for cross-platform home directory path
|
|
49
|
+
home_state = Path.home() / ".claude-self-reflect" / "config" / "imported-files.json"
|
|
50
|
+
return str(home_state)
|
|
51
|
+
|
|
52
|
+
# Get state file path with env override support
|
|
53
|
+
env_state = os.getenv("STATE_FILE")
|
|
54
|
+
if env_state:
|
|
55
|
+
# Normalize any user-provided path to absolute
|
|
56
|
+
from pathlib import Path
|
|
57
|
+
STATE_FILE = str(Path(env_state).expanduser().resolve())
|
|
58
|
+
else:
|
|
59
|
+
STATE_FILE = get_default_state_file()
|
|
34
60
|
PREFER_LOCAL_EMBEDDINGS = os.getenv("PREFER_LOCAL_EMBEDDINGS", "true").lower() == "true"
|
|
35
61
|
VOYAGE_API_KEY = os.getenv("VOYAGE_KEY")
|
|
36
62
|
MAX_CHUNK_SIZE = int(os.getenv("MAX_CHUNK_SIZE", "50")) # Messages per chunk
|