claude-self-reflect 2.4.9 → 2.4.11
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/Dockerfile.importer +4 -1
- package/Dockerfile.importer-isolated +4 -3
- package/Dockerfile.mcp-server +4 -1
- package/Dockerfile.streaming-importer +4 -4
- package/Dockerfile.watcher +3 -3
- package/README.md +9 -0
- package/mcp-server/pyproject.toml +1 -1
- package/package.json +1 -1
- package/scripts/import-conversations-unified.py +8 -1
- package/scripts/import-watcher.py +33 -0
package/Dockerfile.importer
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
FROM python:3.
|
|
1
|
+
FROM python:3.12-slim
|
|
2
2
|
|
|
3
3
|
WORKDIR /app
|
|
4
4
|
|
|
5
|
+
# Update system packages for security
|
|
6
|
+
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
|
|
7
|
+
|
|
5
8
|
# Install dependencies
|
|
6
9
|
COPY scripts/requirements.txt .
|
|
7
10
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
FROM python:3.
|
|
1
|
+
FROM python:3.12-slim
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# Update system packages for security and install curl
|
|
4
|
+
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
|
|
4
5
|
curl \
|
|
5
6
|
&& rm -rf /var/lib/apt/lists/*
|
|
6
7
|
|
|
@@ -11,7 +12,7 @@ RUN pip install --no-cache-dir \
|
|
|
11
12
|
numpy
|
|
12
13
|
|
|
13
14
|
# Copy the import script with proper permissions
|
|
14
|
-
COPY scripts/import-conversations-
|
|
15
|
+
COPY scripts/import-conversations-unified.py /app/import.py
|
|
15
16
|
RUN chmod +x /app/import.py
|
|
16
17
|
|
|
17
18
|
WORKDIR /app
|
package/Dockerfile.mcp-server
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
FROM python:3.
|
|
1
|
+
FROM python:3.12-slim
|
|
2
2
|
|
|
3
3
|
WORKDIR /app
|
|
4
4
|
|
|
5
|
+
# Update system packages for security
|
|
6
|
+
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
|
|
7
|
+
|
|
5
8
|
# Copy the MCP server package files
|
|
6
9
|
COPY mcp-server/pyproject.toml ./
|
|
7
10
|
COPY mcp-server/src ./src
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
FROM python:3.
|
|
1
|
+
FROM python:3.12-slim
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
3
|
+
# Update system packages for security and install build dependencies
|
|
4
|
+
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
|
|
5
5
|
gcc \
|
|
6
6
|
g++ \
|
|
7
7
|
&& rm -rf /var/lib/apt/lists/*
|
|
8
8
|
|
|
9
9
|
# Install Python dependencies with specific versions for stability
|
|
10
10
|
# Install torch first from PyTorch index
|
|
11
|
-
RUN pip install --no-cache-dir torch==2.0
|
|
11
|
+
RUN pip install --no-cache-dir torch==2.3.0 --index-url https://download.pytorch.org/whl/cpu
|
|
12
12
|
|
|
13
13
|
# Install other dependencies from default PyPI
|
|
14
14
|
RUN pip install --no-cache-dir \
|
package/Dockerfile.watcher
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
FROM python:3.
|
|
1
|
+
FROM python:3.12-slim
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
RUN apt-get update && apt-get install -y \
|
|
3
|
+
# Update system packages for security and install build dependencies for psutil
|
|
4
|
+
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
|
|
5
5
|
gcc \
|
|
6
6
|
python3-dev \
|
|
7
7
|
&& rm -rf /var/lib/apt/lists/*
|
package/README.md
CHANGED
|
@@ -26,6 +26,15 @@ Your conversations become searchable. Your decisions stay remembered. Your conte
|
|
|
26
26
|
- **Node.js** 16+ (for the setup wizard)
|
|
27
27
|
- **Claude Desktop** app
|
|
28
28
|
|
|
29
|
+
## System Requirements
|
|
30
|
+
|
|
31
|
+
### Memory
|
|
32
|
+
- **Docker Memory**: 2GB minimum (4GB recommended for initial setup)
|
|
33
|
+
- **First Import**: May take 2-7 minutes to process all conversations
|
|
34
|
+
- **Subsequent Imports**: <60 seconds (only processes new/changed files)
|
|
35
|
+
|
|
36
|
+
💡 **First-Time User Note**: The initial import processes your entire conversation history. This is a one-time operation. After that, the system only imports new conversations, making it much faster and using less memory.
|
|
37
|
+
|
|
29
38
|
## Install
|
|
30
39
|
|
|
31
40
|
### Quick Start (Local Mode - Default)
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import sys
|
|
|
8
8
|
import json
|
|
9
9
|
import glob
|
|
10
10
|
import hashlib
|
|
11
|
+
import gc
|
|
11
12
|
from datetime import datetime
|
|
12
13
|
from typing import List, Dict, Any
|
|
13
14
|
import logging
|
|
@@ -29,7 +30,7 @@ from tenacity import (
|
|
|
29
30
|
QDRANT_URL = os.getenv("QDRANT_URL", "http://localhost:6333")
|
|
30
31
|
LOGS_DIR = os.getenv("LOGS_DIR", "/logs")
|
|
31
32
|
STATE_FILE = os.getenv("STATE_FILE", "/config/imported-files.json")
|
|
32
|
-
BATCH_SIZE = int(os.getenv("BATCH_SIZE", "
|
|
33
|
+
BATCH_SIZE = int(os.getenv("BATCH_SIZE", "10")) # Reduced from 100 to prevent OOM
|
|
33
34
|
PREFER_LOCAL_EMBEDDINGS = os.getenv("PREFER_LOCAL_EMBEDDINGS", "false").lower() == "true"
|
|
34
35
|
VOYAGE_API_KEY = os.getenv("VOYAGE_KEY")
|
|
35
36
|
|
|
@@ -305,6 +306,12 @@ def import_project(project_path: Path, collection_name: str, state: dict) -> int
|
|
|
305
306
|
# Update state for this file
|
|
306
307
|
update_file_state(jsonl_file, state, file_chunks)
|
|
307
308
|
|
|
309
|
+
# Save state after each file to prevent loss on OOM
|
|
310
|
+
save_state(state)
|
|
311
|
+
|
|
312
|
+
# Force garbage collection to free memory
|
|
313
|
+
gc.collect()
|
|
314
|
+
|
|
308
315
|
except Exception as e:
|
|
309
316
|
logger.error(f"Failed to import {jsonl_file}: {e}")
|
|
310
317
|
import traceback
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Simple watcher that runs import periodically."""
|
|
3
|
+
|
|
4
|
+
import time
|
|
5
|
+
import subprocess
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
from datetime import datetime
|
|
9
|
+
|
|
10
|
+
WATCH_INTERVAL = int(os.getenv('WATCH_INTERVAL', '60'))
|
|
11
|
+
|
|
12
|
+
print(f"[Watcher] Starting import watcher with {WATCH_INTERVAL}s interval", flush=True)
|
|
13
|
+
|
|
14
|
+
while True:
|
|
15
|
+
try:
|
|
16
|
+
print(f"[Watcher] Running import at {datetime.now().isoformat()}", flush=True)
|
|
17
|
+
result = subprocess.run([
|
|
18
|
+
sys.executable,
|
|
19
|
+
"/scripts/import-conversations-unified.py"
|
|
20
|
+
], capture_output=True, text=True)
|
|
21
|
+
|
|
22
|
+
if result.returncode == 0:
|
|
23
|
+
print(f"[Watcher] Import completed successfully", flush=True)
|
|
24
|
+
else:
|
|
25
|
+
print(f"[Watcher] Import failed with code {result.returncode}", flush=True)
|
|
26
|
+
if result.stderr:
|
|
27
|
+
print(f"[Watcher] Error: {result.stderr}", flush=True)
|
|
28
|
+
|
|
29
|
+
except Exception as e:
|
|
30
|
+
print(f"[Watcher] Error: {e}", flush=True)
|
|
31
|
+
|
|
32
|
+
print(f"[Watcher] Sleeping for {WATCH_INTERVAL} seconds...", flush=True)
|
|
33
|
+
time.sleep(WATCH_INTERVAL)
|