claude-self-reflect 1.3.5 → 2.0.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.
Files changed (60) hide show
  1. package/.claude/agents/README.md +138 -0
  2. package/.claude/agents/docker-orchestrator.md +264 -0
  3. package/.claude/agents/documentation-writer.md +262 -0
  4. package/.claude/agents/import-debugger.md +203 -0
  5. package/.claude/agents/mcp-integration.md +286 -0
  6. package/.claude/agents/open-source-maintainer.md +150 -0
  7. package/.claude/agents/performance-tuner.md +276 -0
  8. package/.claude/agents/qdrant-specialist.md +138 -0
  9. package/.claude/agents/reflection-specialist.md +361 -0
  10. package/.claude/agents/search-optimizer.md +307 -0
  11. package/LICENSE +21 -0
  12. package/README.md +363 -0
  13. package/installer/cli.js +122 -0
  14. package/installer/postinstall.js +13 -0
  15. package/installer/setup-wizard.js +204 -0
  16. package/mcp-server/pyproject.toml +27 -0
  17. package/mcp-server/run-mcp.sh +21 -0
  18. package/mcp-server/src/__init__.py +1 -0
  19. package/mcp-server/src/__main__.py +23 -0
  20. package/mcp-server/src/server.py +316 -0
  21. package/mcp-server/src/server_v2.py +240 -0
  22. package/package.json +12 -36
  23. package/scripts/import-conversations-isolated.py +311 -0
  24. package/scripts/import-conversations-voyage-streaming.py +377 -0
  25. package/scripts/import-conversations-voyage.py +428 -0
  26. package/scripts/import-conversations.py +240 -0
  27. package/scripts/import-current-conversation.py +38 -0
  28. package/scripts/import-live-conversation.py +152 -0
  29. package/scripts/import-openai-enhanced.py +867 -0
  30. package/scripts/import-recent-only.py +29 -0
  31. package/scripts/import-single-project.py +278 -0
  32. package/scripts/import-watcher.py +169 -0
  33. package/config/claude-desktop-config.json +0 -12
  34. package/dist/cli.d.ts +0 -3
  35. package/dist/cli.d.ts.map +0 -1
  36. package/dist/cli.js +0 -55
  37. package/dist/cli.js.map +0 -1
  38. package/dist/embeddings-gemini.d.ts +0 -76
  39. package/dist/embeddings-gemini.d.ts.map +0 -1
  40. package/dist/embeddings-gemini.js +0 -158
  41. package/dist/embeddings-gemini.js.map +0 -1
  42. package/dist/embeddings.d.ts +0 -67
  43. package/dist/embeddings.d.ts.map +0 -1
  44. package/dist/embeddings.js +0 -252
  45. package/dist/embeddings.js.map +0 -1
  46. package/dist/index.d.ts +0 -3
  47. package/dist/index.d.ts.map +0 -1
  48. package/dist/index.js +0 -439
  49. package/dist/index.js.map +0 -1
  50. package/dist/project-isolation.d.ts +0 -29
  51. package/dist/project-isolation.d.ts.map +0 -1
  52. package/dist/project-isolation.js +0 -78
  53. package/dist/project-isolation.js.map +0 -1
  54. package/scripts/install-agent.js +0 -70
  55. package/scripts/setup-wizard.js +0 -596
  56. package/src/cli.ts +0 -56
  57. package/src/embeddings-gemini.ts +0 -176
  58. package/src/embeddings.ts +0 -296
  59. package/src/index.ts +0 -513
  60. package/src/project-isolation.ts +0 -93
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env python3
2
+ """Quick import of current conversation using Voyage AI"""
3
+
4
+ import os
5
+ import sys
6
+ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
7
+
8
+ import importlib.util
9
+ spec = importlib.util.spec_from_file_location("voyage_importer",
10
+ os.path.join(os.path.dirname(__file__), "import-conversations-voyage.py"))
11
+ voyage_module = importlib.util.module_from_spec(spec)
12
+ spec.loader.exec_module(voyage_module)
13
+ VoyageConversationImporter = voyage_module.VoyageConversationImporter
14
+
15
+ def main():
16
+ # Import just the current conversation
17
+ importer = VoyageConversationImporter()
18
+
19
+ project_path = "/Users/ramakrishnanannaswamy/.claude/projects/-Users-ramakrishnanannaswamy-memento-stack"
20
+ target_file = "a2ae66a2-41f5-4b07-ab8b-353b5174af34.jsonl"
21
+
22
+ print(f"Importing current conversation: {target_file}")
23
+
24
+ # Process just this file
25
+ file_path = os.path.join(project_path, target_file)
26
+ if os.path.exists(file_path):
27
+ chunks = importer.process_jsonl_file(file_path)
28
+ if chunks:
29
+ collection_name = importer.get_collection_name(os.path.basename(project_path))
30
+ importer.import_chunks(chunks, collection_name)
31
+ print(f"✅ Imported {len(chunks)} chunks from current conversation")
32
+ else:
33
+ print("❌ No chunks found in current conversation")
34
+ else:
35
+ print(f"❌ File not found: {file_path}")
36
+
37
+ if __name__ == "__main__":
38
+ main()
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env python3
2
+ """Import the currently active conversation file."""
3
+
4
+ import os
5
+ import sys
6
+ import json
7
+ import hashlib
8
+ from datetime import datetime, timedelta
9
+ from qdrant_client import QdrantClient
10
+ from qdrant_client.models import PointStruct, VectorParams, Distance
11
+ import backoff
12
+ import requests
13
+
14
+ # Configuration
15
+ QDRANT_URL = "http://localhost:6333"
16
+ VOYAGE_API_KEY = os.getenv("VOYAGE_KEY", "pa-wdTYGObaxhs-XFKX2r7WCczRwEVNb9eYMTSO3yrQhZI")
17
+ VOYAGE_API_URL = "https://api.voyageai.com/v1/embeddings"
18
+
19
+ @backoff.on_exception(backoff.expo, Exception, max_tries=3)
20
+ def generate_embedding(text):
21
+ """Generate embedding using Voyage AI."""
22
+ headers = {
23
+ "Authorization": f"Bearer {VOYAGE_API_KEY}",
24
+ "Content-Type": "application/json"
25
+ }
26
+
27
+ response = requests.post(
28
+ VOYAGE_API_URL,
29
+ headers=headers,
30
+ json={
31
+ "input": [text],
32
+ "model": "voyage-3-large"
33
+ }
34
+ )
35
+
36
+ if response.status_code != 200:
37
+ raise Exception(f"Voyage API error: {response.status_code} - {response.text}")
38
+
39
+ return response.json()["data"][0]["embedding"]
40
+
41
+ def import_conversation(file_path):
42
+ """Import a single conversation file."""
43
+ client = QdrantClient(url=QDRANT_URL)
44
+
45
+ # Determine collection name
46
+ project_path = "/Users/ramakrishnanannaswamy/memento-stack"
47
+ project_hash = hashlib.md5(project_path.encode()).hexdigest()[:8]
48
+ collection_name = f"conv_{project_hash}_voyage"
49
+
50
+ print(f"Importing to collection: {collection_name}")
51
+
52
+ # Ensure collection exists
53
+ collections = [c.name for c in client.get_collections().collections]
54
+ if collection_name not in collections:
55
+ client.create_collection(
56
+ collection_name=collection_name,
57
+ vectors_config=VectorParams(size=1024, distance=Distance.COSINE)
58
+ )
59
+
60
+ # Read recent messages (last 2 hours)
61
+ from datetime import timezone
62
+ cutoff = datetime.now(timezone.utc) - timedelta(hours=2)
63
+ points_to_import = []
64
+
65
+ with open(file_path, 'r') as f:
66
+ for line in f:
67
+ try:
68
+ entry = json.loads(line)
69
+ timestamp_str = entry.get('timestamp', '')
70
+
71
+ # Parse timestamp
72
+ if timestamp_str:
73
+ # Convert ISO format to datetime
74
+ timestamp = datetime.fromisoformat(timestamp_str.replace('Z', '+00:00'))
75
+
76
+ # Only import recent entries
77
+ if timestamp > cutoff:
78
+ # Extract message content
79
+ message = entry.get('message', {})
80
+ content = message.get('content', [])
81
+
82
+ # Extract text from content
83
+ text_parts = []
84
+ for item in content:
85
+ if isinstance(item, dict) and item.get('type') == 'text':
86
+ text_parts.append(item.get('text', ''))
87
+
88
+ if text_parts:
89
+ text = ' '.join(text_parts)
90
+
91
+ # Create unique ID
92
+ point_id = hashlib.md5(f"{entry.get('uuid', '')}_{timestamp_str}".encode()).hexdigest()
93
+
94
+ # Generate embedding
95
+ print(f"Generating embedding for entry from {timestamp_str[:19]}")
96
+ try:
97
+ embedding = generate_embedding(text[:8000]) # Limit text length
98
+
99
+ points_to_import.append(
100
+ PointStruct(
101
+ id=point_id,
102
+ vector=embedding,
103
+ payload={
104
+ "text": text[:2000],
105
+ "timestamp": timestamp.timestamp(),
106
+ "role": message.get('role', 'unknown'),
107
+ "conversation_id": entry.get('sessionId', ''),
108
+ "project": project_path
109
+ }
110
+ )
111
+ )
112
+
113
+ # Import in batches
114
+ if len(points_to_import) >= 10:
115
+ client.upsert(
116
+ collection_name=collection_name,
117
+ points=points_to_import
118
+ )
119
+ print(f"Imported batch of {len(points_to_import)} points")
120
+ points_to_import = []
121
+
122
+ except Exception as e:
123
+ print(f"Error generating embedding: {e}")
124
+
125
+ except json.JSONDecodeError:
126
+ continue
127
+
128
+ # Import remaining points
129
+ if points_to_import:
130
+ client.upsert(
131
+ collection_name=collection_name,
132
+ points=points_to_import
133
+ )
134
+ print(f"Imported final batch of {len(points_to_import)} points")
135
+
136
+ # Check collection status
137
+ info = client.get_collection(collection_name)
138
+ print(f"\nCollection {collection_name} now has {info.points_count} points")
139
+
140
+ def main():
141
+ file_path = os.path.expanduser("~/.claude/projects/-Users-ramakrishnanannaswamy-memento-stack/2bb5f256-bc0a-4a29-8807-f796a463fade.jsonl")
142
+
143
+ if not os.path.exists(file_path):
144
+ print(f"File not found: {file_path}")
145
+ return
146
+
147
+ print(f"Importing live conversation from: {file_path}")
148
+ import_conversation(file_path)
149
+ print("\nImport complete!")
150
+
151
+ if __name__ == "__main__":
152
+ main()