claude-self-reflect 3.2.3 → 3.3.0
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/.claude/agents/claude-self-reflect-test.md +595 -528
- package/.claude/agents/documentation-writer.md +1 -1
- package/.claude/agents/qdrant-specialist.md +2 -2
- package/.claude/agents/reflection-specialist.md +61 -5
- package/.claude/agents/search-optimizer.md +9 -7
- package/README.md +16 -9
- package/mcp-server/pyproject.toml +1 -1
- package/mcp-server/run-mcp.sh +49 -5
- package/mcp-server/src/app_context.py +64 -0
- package/mcp-server/src/config.py +57 -0
- package/mcp-server/src/connection_pool.py +286 -0
- package/mcp-server/src/decay_manager.py +106 -0
- package/mcp-server/src/embedding_manager.py +64 -40
- package/mcp-server/src/embeddings_old.py +141 -0
- package/mcp-server/src/models.py +64 -0
- package/mcp-server/src/parallel_search.py +371 -0
- package/mcp-server/src/project_resolver.py +33 -46
- package/mcp-server/src/reflection_tools.py +206 -0
- package/mcp-server/src/rich_formatting.py +196 -0
- package/mcp-server/src/search_tools.py +826 -0
- package/mcp-server/src/server.py +140 -1715
- package/mcp-server/src/temporal_design.py +132 -0
- package/mcp-server/src/temporal_tools.py +597 -0
- package/mcp-server/src/temporal_utils.py +384 -0
- package/mcp-server/src/utils.py +150 -67
- package/package.json +11 -1
- package/scripts/add-timestamp-indexes.py +134 -0
- package/scripts/check-collections.py +29 -0
- package/scripts/debug-august-parsing.py +76 -0
- package/scripts/debug-import-single.py +91 -0
- package/scripts/debug-project-resolver.py +82 -0
- package/scripts/debug-temporal-tools.py +135 -0
- package/scripts/delta-metadata-update.py +547 -0
- package/scripts/import-conversations-unified.py +65 -6
- package/scripts/importer/utils/project_normalizer.py +22 -9
- package/scripts/precompact-hook.sh +33 -0
- package/scripts/streaming-watcher.py +1443 -0
- package/scripts/utils.py +39 -0
- package/shared/__init__.py +5 -0
- package/shared/normalization.py +54 -0
package/scripts/utils.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Shared utilities for claude-self-reflect MCP server and scripts."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def normalize_project_name(project_path: str, _depth: int = 0) -> str:
|
|
7
|
+
"""
|
|
8
|
+
Simplified project name normalization for consistent hashing.
|
|
9
|
+
|
|
10
|
+
Examples:
|
|
11
|
+
'/Users/name/.claude/projects/-Users-name-projects-myproject' -> 'myproject'
|
|
12
|
+
'-Users-name-projects-myproject' -> 'myproject'
|
|
13
|
+
'/path/to/myproject' -> 'myproject'
|
|
14
|
+
'myproject' -> 'myproject'
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
project_path: Project path or name in any format
|
|
18
|
+
_depth: Internal recursion depth counter (for backwards compatibility)
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
Normalized project name suitable for consistent hashing
|
|
22
|
+
"""
|
|
23
|
+
if not project_path:
|
|
24
|
+
return ""
|
|
25
|
+
|
|
26
|
+
path = Path(project_path.rstrip('/'))
|
|
27
|
+
|
|
28
|
+
# Extract the final directory name
|
|
29
|
+
final_component = path.name
|
|
30
|
+
|
|
31
|
+
# If it's Claude's dash-separated format, extract project name
|
|
32
|
+
if final_component.startswith('-') and 'projects' in final_component:
|
|
33
|
+
# Find the last occurrence of 'projects-' to handle edge cases
|
|
34
|
+
idx = final_component.rfind('projects-')
|
|
35
|
+
if idx != -1:
|
|
36
|
+
return final_component[idx + len('projects-'):]
|
|
37
|
+
|
|
38
|
+
# For regular paths, just return the directory name
|
|
39
|
+
return final_component if final_component else path.parent.name
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Shared normalization utilities for claude-self-reflect.
|
|
2
|
+
|
|
3
|
+
This module provides the single source of truth for project name normalization,
|
|
4
|
+
ensuring consistent hashing across import scripts and the MCP server.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def normalize_project_name(project_path: str, _depth: int = 0) -> str:
|
|
11
|
+
"""
|
|
12
|
+
Normalize project name for consistent hashing across import/search.
|
|
13
|
+
|
|
14
|
+
This is the authoritative normalization function used by both:
|
|
15
|
+
- Import scripts (import-conversations-unified.py)
|
|
16
|
+
- MCP server (server.py)
|
|
17
|
+
|
|
18
|
+
Examples:
|
|
19
|
+
'/Users/name/.claude/projects/-Users-name-projects-myproject' -> 'myproject'
|
|
20
|
+
'-Users-name-projects-myproject' -> 'myproject'
|
|
21
|
+
'/path/to/myproject' -> 'myproject'
|
|
22
|
+
'myproject' -> 'myproject'
|
|
23
|
+
|
|
24
|
+
Special handling for Claude's dash-separated format:
|
|
25
|
+
When a path component starts with '-' and contains 'projects',
|
|
26
|
+
we extract everything after 'projects-' as the project name.
|
|
27
|
+
This handles dashes in project names correctly.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
project_path: Project path or name in any format
|
|
31
|
+
_depth: Internal recursion depth counter (for backwards compatibility)
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
Normalized project name suitable for consistent hashing
|
|
35
|
+
"""
|
|
36
|
+
if not project_path:
|
|
37
|
+
return ""
|
|
38
|
+
|
|
39
|
+
path = Path(project_path.rstrip('/'))
|
|
40
|
+
|
|
41
|
+
# Extract the final directory name
|
|
42
|
+
final_component = path.name
|
|
43
|
+
|
|
44
|
+
# If it's Claude's dash-separated format, extract project name
|
|
45
|
+
if final_component.startswith('-') and 'projects' in final_component:
|
|
46
|
+
# Find the last occurrence of 'projects-' to handle edge cases
|
|
47
|
+
# This correctly extracts 'claude-self-reflect' from:
|
|
48
|
+
# '-Users-ramakrishnanannaswamy-projects-claude-self-reflect'
|
|
49
|
+
idx = final_component.rfind('projects-')
|
|
50
|
+
if idx != -1:
|
|
51
|
+
return final_component[idx + len('projects-'):]
|
|
52
|
+
|
|
53
|
+
# For regular paths, just return the directory name
|
|
54
|
+
return final_component if final_component else path.parent.name
|