superlocalmemory 2.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.
Files changed (100) hide show
  1. package/ATTRIBUTION.md +140 -0
  2. package/CHANGELOG.md +1749 -0
  3. package/LICENSE +21 -0
  4. package/README.md +600 -0
  5. package/bin/aider-smart +72 -0
  6. package/bin/slm +202 -0
  7. package/bin/slm-npm +73 -0
  8. package/bin/slm.bat +195 -0
  9. package/bin/slm.cmd +10 -0
  10. package/bin/superlocalmemoryv2:list +3 -0
  11. package/bin/superlocalmemoryv2:profile +3 -0
  12. package/bin/superlocalmemoryv2:recall +3 -0
  13. package/bin/superlocalmemoryv2:remember +3 -0
  14. package/bin/superlocalmemoryv2:reset +3 -0
  15. package/bin/superlocalmemoryv2:status +3 -0
  16. package/completions/slm.bash +58 -0
  17. package/completions/slm.zsh +76 -0
  18. package/configs/antigravity-mcp.json +13 -0
  19. package/configs/chatgpt-desktop-mcp.json +7 -0
  20. package/configs/claude-desktop-mcp.json +15 -0
  21. package/configs/codex-mcp.toml +13 -0
  22. package/configs/cody-commands.json +29 -0
  23. package/configs/continue-mcp.yaml +14 -0
  24. package/configs/continue-skills.yaml +26 -0
  25. package/configs/cursor-mcp.json +15 -0
  26. package/configs/gemini-cli-mcp.json +11 -0
  27. package/configs/jetbrains-mcp.json +11 -0
  28. package/configs/opencode-mcp.json +12 -0
  29. package/configs/perplexity-mcp.json +9 -0
  30. package/configs/vscode-copilot-mcp.json +12 -0
  31. package/configs/windsurf-mcp.json +16 -0
  32. package/configs/zed-mcp.json +12 -0
  33. package/docs/ARCHITECTURE.md +877 -0
  34. package/docs/CLI-COMMANDS-REFERENCE.md +425 -0
  35. package/docs/COMPETITIVE-ANALYSIS.md +210 -0
  36. package/docs/COMPRESSION-README.md +390 -0
  37. package/docs/GRAPH-ENGINE.md +503 -0
  38. package/docs/MCP-MANUAL-SETUP.md +720 -0
  39. package/docs/MCP-TROUBLESHOOTING.md +787 -0
  40. package/docs/PATTERN-LEARNING.md +363 -0
  41. package/docs/PROFILES-GUIDE.md +453 -0
  42. package/docs/RESET-GUIDE.md +353 -0
  43. package/docs/SEARCH-ENGINE-V2.2.0.md +748 -0
  44. package/docs/SEARCH-INTEGRATION-GUIDE.md +502 -0
  45. package/docs/UI-SERVER.md +254 -0
  46. package/docs/UNIVERSAL-INTEGRATION.md +432 -0
  47. package/docs/V2.2.0-OPTIONAL-SEARCH.md +666 -0
  48. package/docs/WINDOWS-INSTALL-README.txt +34 -0
  49. package/docs/WINDOWS-POST-INSTALL.txt +45 -0
  50. package/docs/example_graph_usage.py +148 -0
  51. package/hooks/memory-list-skill.js +130 -0
  52. package/hooks/memory-profile-skill.js +284 -0
  53. package/hooks/memory-recall-skill.js +109 -0
  54. package/hooks/memory-remember-skill.js +127 -0
  55. package/hooks/memory-reset-skill.js +274 -0
  56. package/install-skills.sh +436 -0
  57. package/install.ps1 +417 -0
  58. package/install.sh +755 -0
  59. package/mcp_server.py +585 -0
  60. package/package.json +94 -0
  61. package/requirements-core.txt +24 -0
  62. package/requirements.txt +10 -0
  63. package/scripts/postinstall.js +126 -0
  64. package/scripts/preuninstall.js +57 -0
  65. package/skills/slm-build-graph/SKILL.md +423 -0
  66. package/skills/slm-list-recent/SKILL.md +348 -0
  67. package/skills/slm-recall/SKILL.md +325 -0
  68. package/skills/slm-remember/SKILL.md +194 -0
  69. package/skills/slm-status/SKILL.md +363 -0
  70. package/skills/slm-switch-profile/SKILL.md +442 -0
  71. package/src/__pycache__/cache_manager.cpython-312.pyc +0 -0
  72. package/src/__pycache__/embedding_engine.cpython-312.pyc +0 -0
  73. package/src/__pycache__/graph_engine.cpython-312.pyc +0 -0
  74. package/src/__pycache__/hnsw_index.cpython-312.pyc +0 -0
  75. package/src/__pycache__/hybrid_search.cpython-312.pyc +0 -0
  76. package/src/__pycache__/memory-profiles.cpython-312.pyc +0 -0
  77. package/src/__pycache__/memory-reset.cpython-312.pyc +0 -0
  78. package/src/__pycache__/memory_compression.cpython-312.pyc +0 -0
  79. package/src/__pycache__/memory_store_v2.cpython-312.pyc +0 -0
  80. package/src/__pycache__/migrate_v1_to_v2.cpython-312.pyc +0 -0
  81. package/src/__pycache__/pattern_learner.cpython-312.pyc +0 -0
  82. package/src/__pycache__/query_optimizer.cpython-312.pyc +0 -0
  83. package/src/__pycache__/search_engine_v2.cpython-312.pyc +0 -0
  84. package/src/__pycache__/setup_validator.cpython-312.pyc +0 -0
  85. package/src/__pycache__/tree_manager.cpython-312.pyc +0 -0
  86. package/src/cache_manager.py +520 -0
  87. package/src/embedding_engine.py +671 -0
  88. package/src/graph_engine.py +970 -0
  89. package/src/hnsw_index.py +626 -0
  90. package/src/hybrid_search.py +693 -0
  91. package/src/memory-profiles.py +518 -0
  92. package/src/memory-reset.py +485 -0
  93. package/src/memory_compression.py +999 -0
  94. package/src/memory_store_v2.py +1088 -0
  95. package/src/migrate_v1_to_v2.py +638 -0
  96. package/src/pattern_learner.py +898 -0
  97. package/src/query_optimizer.py +513 -0
  98. package/src/search_engine_v2.py +403 -0
  99. package/src/setup_validator.py +479 -0
  100. package/src/tree_manager.py +720 -0
@@ -0,0 +1,436 @@
1
+ #!/bin/bash
2
+
3
+ # SuperLocalMemory V2 - Universal Skills Installer
4
+ # Installs skills for Claude Code, Codex, Gemini CLI, Antigravity, and Windsurf
5
+
6
+ set -e
7
+
8
+ # Colors for output
9
+ RED='\033[0;31m'
10
+ GREEN='\033[0;32m'
11
+ YELLOW='\033[1;33m'
12
+ BLUE='\033[0;34m'
13
+ NC='\033[0m' # No Color
14
+
15
+ # Configuration
16
+ REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
17
+ SKILLS_SOURCE="$REPO_DIR/skills"
18
+
19
+ # Parse arguments
20
+ AUTO_MODE=false
21
+ for arg in "$@"; do
22
+ case $arg in
23
+ --auto)
24
+ AUTO_MODE=true
25
+ shift
26
+ ;;
27
+ esac
28
+ done
29
+
30
+ # Tool definitions (parallel arrays for bash 3.2 compatibility)
31
+ TOOL_IDS=("claude_code" "codex" "gemini_cli" "antigravity" "windsurf" "cursor" "vscode_copilot")
32
+ TOOL_NAMES=("Claude Code" "Codex" "Gemini CLI" "Antigravity" "Windsurf" "Cursor" "VS Code/Copilot")
33
+ TOOL_DIRS=(
34
+ "$HOME/.claude/skills"
35
+ "$HOME/.codex/skills"
36
+ "$HOME/.gemini/skills"
37
+ "$HOME/.gemini/antigravity/skills"
38
+ "$HOME/.windsurf/skills"
39
+ "$HOME/.cursor/skills"
40
+ "$HOME/.copilot/skills"
41
+ )
42
+
43
+ # Helper function to get tool name by ID
44
+ get_tool_name() {
45
+ local tool_id="$1"
46
+ for i in "${!TOOL_IDS[@]}"; do
47
+ if [ "${TOOL_IDS[$i]}" = "$tool_id" ]; then
48
+ echo "${TOOL_NAMES[$i]}"
49
+ return
50
+ fi
51
+ done
52
+ echo "$tool_id"
53
+ }
54
+
55
+ # Helper function to get tool directory by ID
56
+ get_tool_dir() {
57
+ local tool_id="$1"
58
+ for i in "${!TOOL_IDS[@]}"; do
59
+ if [ "${TOOL_IDS[$i]}" = "$tool_id" ]; then
60
+ echo "${TOOL_DIRS[$i]}"
61
+ return
62
+ fi
63
+ done
64
+ echo ""
65
+ }
66
+
67
+ # Skills to install (from skills/ directory)
68
+ SKILLS=(
69
+ "slm-remember"
70
+ "slm-recall"
71
+ "slm-status"
72
+ "slm-list-recent"
73
+ "slm-build-graph"
74
+ "slm-switch-profile"
75
+ )
76
+
77
+ echo "=========================================="
78
+ echo "SuperLocalMemory V2 - Universal Skills Installer"
79
+ echo "=========================================="
80
+ echo ""
81
+
82
+ # Check if SuperLocalMemory V2 is installed
83
+ if [ ! -d "$HOME/.claude-memory" ]; then
84
+ echo -e "${YELLOW}Warning:${NC} SuperLocalMemory V2 not found at ~/.claude-memory/"
85
+ echo "Skills require SuperLocalMemory V2 to be installed first."
86
+ echo ""
87
+ if [ "$AUTO_MODE" = true ]; then
88
+ echo "Auto mode: continuing anyway..."
89
+ else
90
+ read -p "Do you want to continue anyway? (y/n) " -n 1 -r
91
+ echo ""
92
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
93
+ echo "Installation cancelled."
94
+ echo "Please install SuperLocalMemory V2 first: ./install.sh"
95
+ exit 1
96
+ fi
97
+ fi
98
+ fi
99
+
100
+ # Check if skills source directory exists
101
+ if [ ! -d "$SKILLS_SOURCE" ]; then
102
+ echo -e "${RED}Error:${NC} Skills directory not found: $SKILLS_SOURCE"
103
+ echo "Please run this script from the SuperLocalMemoryV2-repo directory."
104
+ exit 1
105
+ fi
106
+
107
+ # Verify all skill directories exist
108
+ echo "Verifying skill files..."
109
+ MISSING_SKILLS=0
110
+ for skill in "${SKILLS[@]}"; do
111
+ if [ ! -d "$SKILLS_SOURCE/$skill" ]; then
112
+ echo -e "${RED}✗${NC} Missing: $skill/"
113
+ ((MISSING_SKILLS++))
114
+ elif [ ! -f "$SKILLS_SOURCE/$skill/SKILL.md" ]; then
115
+ echo -e "${RED}✗${NC} Missing: $skill/SKILL.md"
116
+ ((MISSING_SKILLS++))
117
+ else
118
+ echo -e "${GREEN}✓${NC} Found: $skill/SKILL.md"
119
+ fi
120
+ done
121
+
122
+ if [ "$MISSING_SKILLS" -gt 0 ]; then
123
+ echo -e "${RED}Error:${NC} $MISSING_SKILLS skill(s) missing. Cannot proceed."
124
+ exit 1
125
+ fi
126
+
127
+ echo ""
128
+ echo "Found ${#SKILLS[@]} skills to install"
129
+ echo ""
130
+
131
+ # Detect available tools
132
+ echo "=========================================="
133
+ echo "Detecting AI Tools"
134
+ echo "=========================================="
135
+ echo ""
136
+
137
+ DETECTED_TOOLS=()
138
+
139
+ for i in "${!TOOL_IDS[@]}"; do
140
+ tool_id="${TOOL_IDS[$i]}"
141
+ tool_name="${TOOL_NAMES[$i]}"
142
+ tool_dir="${TOOL_DIRS[$i]}"
143
+ parent_dir=$(dirname "$tool_dir")
144
+
145
+ # Check if parent directory exists (tool is installed)
146
+ if [ -d "$parent_dir" ]; then
147
+ echo -e "${GREEN}✓${NC} $tool_name detected: $tool_dir"
148
+ DETECTED_TOOLS+=("$tool_id")
149
+ else
150
+ echo -e "${BLUE}○${NC} $tool_name not found: $parent_dir"
151
+ fi
152
+ done
153
+
154
+ echo ""
155
+
156
+ if [ ${#DETECTED_TOOLS[@]} -eq 0 ]; then
157
+ if [ "$AUTO_MODE" = true ]; then
158
+ echo -e "${YELLOW}Warning:${NC} No supported AI tools detected. Skipping skills installation."
159
+ echo ""
160
+ exit 0
161
+ fi
162
+ echo -e "${YELLOW}Warning:${NC} No supported AI tools detected."
163
+ echo ""
164
+ echo "Supported tools:"
165
+ for i in "${!TOOL_IDS[@]}"; do
166
+ echo " - ${TOOL_NAMES[$i]}: ${TOOL_DIRS[$i]}"
167
+ done
168
+ echo ""
169
+ read -p "Do you want to continue and create directories anyway? (y/n) " -n 1 -r
170
+ echo ""
171
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
172
+ echo "Installation cancelled."
173
+ exit 1
174
+ fi
175
+ # If user wants to continue, add all tools to install list
176
+ for tool_id in "${TOOL_IDS[@]}"; do
177
+ DETECTED_TOOLS+=("$tool_id")
178
+ done
179
+ else
180
+ echo "Will install skills for ${#DETECTED_TOOLS[@]} tool(s)"
181
+ echo ""
182
+ fi
183
+
184
+ # Ask user for installation method
185
+ if [ "$AUTO_MODE" = true ]; then
186
+ METHOD="symlink"
187
+ echo "Auto mode: Using symlink method..."
188
+ else
189
+ echo "Installation Methods:"
190
+ echo " 1. Symlink (recommended) - Changes in repo reflect immediately"
191
+ echo " 2. Copy - Stable, requires manual updates"
192
+ echo ""
193
+ read -p "Choose installation method (1 or 2): " -n 1 -r
194
+ echo ""
195
+ echo ""
196
+
197
+ if [[ $REPLY == "1" ]]; then
198
+ METHOD="symlink"
199
+ echo "Installing via symlink..."
200
+ elif [[ $REPLY == "2" ]]; then
201
+ METHOD="copy"
202
+ echo "Installing via copy..."
203
+ else
204
+ echo -e "${RED}Invalid choice.${NC} Please enter 1 or 2."
205
+ exit 1
206
+ fi
207
+ fi
208
+
209
+ echo ""
210
+
211
+ # Install skills for each detected tool
212
+ TOTAL_INSTALLED=0
213
+ TOTAL_FAILED=0
214
+ TOTAL_SKIPPED=0
215
+
216
+ for tool_id in "${DETECTED_TOOLS[@]}"; do
217
+ tool_name=$(get_tool_name "$tool_id")
218
+ echo "=========================================="
219
+ echo "Installing for: $tool_name"
220
+ echo "=========================================="
221
+
222
+ skills_dir=$(get_tool_dir "$tool_id")
223
+
224
+ # Create skills directory if it doesn't exist
225
+ if [ ! -d "$skills_dir" ]; then
226
+ echo "Creating directory: $skills_dir"
227
+ if mkdir -p "$skills_dir"; then
228
+ echo -e "${GREEN}✓${NC} Directory created"
229
+ else
230
+ echo -e "${RED}✗${NC} Failed to create directory"
231
+ echo ""
232
+ ((TOTAL_SKIPPED+=${#SKILLS[@]}))
233
+ continue
234
+ fi
235
+ else
236
+ echo "Directory exists: $skills_dir"
237
+ fi
238
+
239
+ echo ""
240
+
241
+ # Install each skill
242
+ for skill in "${SKILLS[@]}"; do
243
+ source_file="$SKILLS_SOURCE/$skill/SKILL.md"
244
+ target_file="$skills_dir/$skill.md"
245
+
246
+ # Remove existing file or symlink
247
+ if [ -e "$target_file" ] || [ -L "$target_file" ]; then
248
+ rm "$target_file"
249
+ fi
250
+
251
+ if [ "$METHOD" == "symlink" ]; then
252
+ if ln -s "$source_file" "$target_file" 2>/dev/null; then
253
+ echo -e "${GREEN}✓${NC} Symlinked: $skill.md"
254
+ ((TOTAL_INSTALLED++))
255
+ else
256
+ echo -e "${RED}✗${NC} Failed to symlink: $skill.md"
257
+ ((TOTAL_FAILED++))
258
+ fi
259
+ else
260
+ if cp "$source_file" "$target_file" 2>/dev/null; then
261
+ echo -e "${GREEN}✓${NC} Copied: $skill.md"
262
+ ((TOTAL_INSTALLED++))
263
+ else
264
+ echo -e "${RED}✗${NC} Failed to copy: $skill.md"
265
+ ((TOTAL_FAILED++))
266
+ fi
267
+ fi
268
+ done
269
+
270
+ # Make skills executable (if they have execute permissions)
271
+ chmod +x "$skills_dir"/*.md 2>/dev/null || true
272
+
273
+ echo ""
274
+ done
275
+
276
+ # Installation Summary
277
+ echo "=========================================="
278
+ echo "Installation Summary"
279
+ echo "=========================================="
280
+ echo ""
281
+ echo -e "Tools configured: ${BLUE}${#DETECTED_TOOLS[@]}${NC}"
282
+ echo -e "Skills installed: ${GREEN}$TOTAL_INSTALLED${NC}"
283
+ if [ "$TOTAL_FAILED" -gt 0 ]; then
284
+ echo -e "Failed: ${RED}$TOTAL_FAILED${NC}"
285
+ fi
286
+ if [ "$TOTAL_SKIPPED" -gt 0 ]; then
287
+ echo -e "Skipped: ${YELLOW}$TOTAL_SKIPPED${NC}"
288
+ fi
289
+ echo "Installation method: $METHOD"
290
+ echo ""
291
+
292
+ # List installation locations
293
+ echo "Skills installed to:"
294
+ for tool_id in "${DETECTED_TOOLS[@]}"; do
295
+ tool_name=$(get_tool_name "$tool_id")
296
+ tool_dir=$(get_tool_dir "$tool_id")
297
+ if [ -d "$tool_dir" ] && [ "$(ls -A "$tool_dir"/*.md 2>/dev/null | wc -l | tr -d ' ')" -gt 0 ]; then
298
+ count=$(ls -1 "$tool_dir"/*.md 2>/dev/null | wc -l | tr -d ' ')
299
+ echo -e " ${GREEN}✓${NC} $tool_name: $tool_dir ($count skills)"
300
+ fi
301
+ done
302
+
303
+ echo ""
304
+
305
+ # Verify installation
306
+ EXPECTED_TOTAL=$((${#DETECTED_TOOLS[@]} * ${#SKILLS[@]}))
307
+ if [ "$TOTAL_INSTALLED" -eq "$EXPECTED_TOTAL" ]; then
308
+ echo -e "${GREEN}✓${NC} All skills installed successfully!"
309
+ else
310
+ echo -e "${YELLOW}⚠${NC} Some skills failed to install."
311
+ echo "Expected: $EXPECTED_TOTAL, Installed: $TOTAL_INSTALLED"
312
+ fi
313
+
314
+ echo ""
315
+
316
+ # List available skills
317
+ echo "=========================================="
318
+ echo "Available Skills"
319
+ echo "=========================================="
320
+ echo ""
321
+ for skill in "${SKILLS[@]}"; do
322
+ echo " • $skill"
323
+ done
324
+ echo ""
325
+
326
+ # Legacy Claude CLI skills (from claude-skills/)
327
+ if [ -d "$REPO_DIR/claude-skills" ] && [ -d "$HOME/.claude/skills" ]; then
328
+ echo "=========================================="
329
+ echo "Legacy Claude CLI Skills"
330
+ echo "=========================================="
331
+ echo ""
332
+ echo "Found legacy claude-skills/ directory for Claude CLI."
333
+ echo "These are different from the universal skills above."
334
+ echo ""
335
+ if [ "$AUTO_MODE" = true ]; then
336
+ REPLY="y"
337
+ else
338
+ read -p "Do you want to install legacy Claude CLI skills too? (y/n) " -n 1 -r
339
+ echo ""
340
+ echo ""
341
+ fi
342
+
343
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
344
+ LEGACY_COUNT=0
345
+ for skill_file in "$REPO_DIR/claude-skills"/superlocalmemoryv2-*.md; do
346
+ if [ -f "$skill_file" ]; then
347
+ skill_name=$(basename "$skill_file")
348
+ target="$HOME/.claude/skills/$skill_name"
349
+
350
+ if [ -e "$target" ] || [ -L "$target" ]; then
351
+ rm "$target"
352
+ fi
353
+
354
+ if [ "$METHOD" == "symlink" ]; then
355
+ ln -s "$skill_file" "$target" 2>/dev/null && ((LEGACY_COUNT++))
356
+ else
357
+ cp "$skill_file" "$target" 2>/dev/null && ((LEGACY_COUNT++))
358
+ fi
359
+ fi
360
+ done
361
+ echo -e "${GREEN}✓${NC} Installed $LEGACY_COUNT legacy Claude CLI skills"
362
+ echo ""
363
+ fi
364
+ fi
365
+
366
+ # Next Steps
367
+ echo "=========================================="
368
+ echo "Next Steps"
369
+ echo "=========================================="
370
+ echo ""
371
+ echo "1. ${YELLOW}Restart your AI tool${NC} to load the new skills"
372
+ echo ""
373
+ echo "2. Verify skills are loaded:"
374
+ for tool_id in "${DETECTED_TOOLS[@]}"; do
375
+ case "$tool_id" in
376
+ "claude_code")
377
+ echo " ${GREEN}claude${NC} (type /skills to list)"
378
+ ;;
379
+ "codex")
380
+ echo " ${GREEN}codex${NC} (type /skills to list)"
381
+ ;;
382
+ "gemini_cli")
383
+ echo " ${GREEN}gemini${NC} (check available commands)"
384
+ ;;
385
+ "antigravity")
386
+ echo " ${GREEN}antigravity${NC} (check available commands)"
387
+ ;;
388
+ "windsurf")
389
+ echo " ${GREEN}windsurf${NC} (check available commands)"
390
+ ;;
391
+ "cursor")
392
+ echo " ${GREEN}cursor${NC} (check available commands)"
393
+ ;;
394
+ "vscode_copilot")
395
+ echo " ${GREEN}VS Code/Copilot${NC} (check available commands)"
396
+ ;;
397
+ esac
398
+ done
399
+ echo ""
400
+ echo "3. Try your first skill:"
401
+ echo " ${GREEN}/slm-status${NC} or ${GREEN}/slm-remember \"test\"${NC}"
402
+ echo ""
403
+ echo "4. Read skill documentation:"
404
+ echo " Each skill has detailed docs in: $SKILLS_SOURCE/<skill-name>/SKILL.md"
405
+ echo ""
406
+
407
+ if [ "$METHOD" == "symlink" ]; then
408
+ echo "Note: Using symlinks. To update skills:"
409
+ echo " cd $REPO_DIR"
410
+ echo " git pull"
411
+ echo " # Restart your AI tool"
412
+ echo ""
413
+ fi
414
+
415
+ if [ "$METHOD" == "copy" ]; then
416
+ echo "Note: Using copies. To update skills:"
417
+ echo " cd $REPO_DIR"
418
+ echo " git pull"
419
+ echo " ./install-skills.sh"
420
+ echo " # Choose option 2 again"
421
+ echo ""
422
+ fi
423
+
424
+ echo "=========================================="
425
+ echo ""
426
+ echo -e "${GREEN}✓ Universal skills installation complete!${NC}"
427
+ echo ""
428
+ echo "Skills installed for:"
429
+ for tool_id in "${DETECTED_TOOLS[@]}"; do
430
+ tool_name=$(get_tool_name "$tool_id")
431
+ echo " • $tool_name"
432
+ done
433
+ echo ""
434
+ echo "Remember: Skills are OPTIONAL convenience wrappers."
435
+ echo "SuperLocalMemory V2 works standalone via terminal commands."
436
+ echo ""