a85500aec83a52415dbeaa51ee8ff74ada5f5b4a
7 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5ce656037e |
Refactor worker commands from npm scripts to claude-mem CLI
- Updated all instances of `npm run worker:restart` to `claude-mem restart` in documentation and code comments for consistency. - Modified error messages and logging to reflect the new command structure. - Adjusted worker management commands in various troubleshooting documents. - Changed the worker status check message to guide users towards the new command. |
||
|
|
db3794762f |
chore: remove all better-sqlite3 references from codebase (#357)
* fix: export/import scripts now use API instead of direct DB access Export script fix: - Add format=json parameter to SearchManager for raw data output - Add getSdkSessionsBySessionIds method to SessionStore - Add POST /api/sdk-sessions/batch endpoint to DataRoutes - Refactor export-memories.ts to use HTTP API Import script fix: - Add import methods to SessionStore with duplicate detection - Add POST /api/import endpoint to DataRoutes - Refactor import-memories.ts to use HTTP API 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: update analyze-transformations-smart.js to use bun:sqlite Replace better-sqlite3 import with bun:sqlite to align with v7.1.0 migration. * chore: remove all better-sqlite3 references from codebase - Updated scripts/analyze-transformations-smart.js to use bun:sqlite - Merged PR #332: Refactored import/export scripts to use worker API instead of direct DB access - Updated PM2-to-Bun migration documentation All better-sqlite3 references have been removed from source code. Documentation references remain as appropriate historical context. * build: update plugin artifacts with merged changes Include built artifacts from PR #332 merge and analyze-transformations-smart.js update. --------- Co-authored-by: lee <loyalpartner@163.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|
|
61488042d8 |
Mem-search enhancements: table output, simplified API, Sonnet default, and removed fake URIs (#317)
* feat: Add batch fetching for observations and update documentation - Implemented a new endpoint for fetching multiple observations by IDs in a single request. - Updated the DataRoutes to include a POST /api/observations/batch endpoint. - Enhanced SKILL.md documentation to reflect changes in the search process and batch fetching capabilities. - Increased the default limit for search results from 5 to 40 for better usability. * feat!: Fix timeline parameter passing with SearchManager alignment BREAKING CHANGE: Timeline MCP tools now use standardized parameter names - anchor_id → anchor - before → depth_before - after → depth_after - obs_type → type (timeline tool only) Fixes timeline endpoint failures caused by parameter name mismatch between MCP layer and SearchManager. Adds new SessionStore methods for fetching prompts and session summaries by ID. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * docs: reframe timeline parameter fix as bug fix, not breaking change The timeline tools were completely broken due to parameter name mismatch. There's nothing to migrate from since the old parameters never worked. Co-authored-by: Alex Newman <thedotmack@users.noreply.github.com> * Refactor mem-search documentation and optimize API tool definitions - Updated SKILL.md to emphasize batch fetching for observations, clarifying usage and efficiency. - Removed deprecated tools from mcp-server.ts and streamlined tool definitions for clarity. - Enhanced formatting in FormattingService.ts for better output readability. - Adjusted SearchManager.ts to improve result headers and removed unnecessary search tips from combined text. * Refactor FormattingService and SearchManager for table-based output - Updated FormattingService to format search results as tables, including methods for formatting observations, sessions, and user prompts. - Removed JSON format handling from SearchManager and streamlined result formatting to consistently use table format. - Enhanced readability and consistency in search tips and formatting logic. - Introduced token estimation for observations and improved time formatting. * refactor: update documentation and API references for version bump and search functionalities * Refactor code structure for improved readability and maintainability * chore: change default model from haiku to sonnet 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: unify timeline formatting across search and context services Extract shared timeline formatting utilities into reusable module to align MCP search output format with context-generator's date/file-grouped format. Changes: - Create src/shared/timeline-formatting.ts with reusable utilities (parseJsonArray, formatDateTime, formatTime, formatDate, toRelativePath, extractFirstFile, groupByDate) - Refactor context-generator.ts to use shared utilities - Update SearchManager.search() to use date/file grouping - Add search-specific row formatters to FormattingService - Fix timeline methods to extract actual file paths from metadata instead of hardcoding 'General' - Remove Work column from search output (kept in context output) Result: Consistent date/file-grouped markdown formatting across both systems while maintaining their different column requirements. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: remove redundant legend from search output Remove legend from search/timeline results since it's already shown in SessionStart context. Saves ~30 tokens per search result. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Refactor session summary rendering to remove links - Removed link generation for session summaries in context generation and search manager. - Updated output formatting to exclude links while maintaining the session summary structure. - Adjusted related components in TimelineService to ensure consistency across the application. * fix: move skillPath declaration outside try block to fix scoping bug The skillPath variable was declared inside the try block but referenced in the catch block for error logging. Since const is block-scoped, this would cause a ReferenceError when the error handler executes. Moved skillPath declaration before the try block so it's accessible in both try and catch scopes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: address PR #317 code review feedback **Critical Fixes:** - Replace happy_path_error__with_fallback debug calls with proper logger methods in mcp-server.ts - All HTTP API calls now use logger.debug/error for consistent logging **Code Quality Improvements:** - Extract 90-day recency window magic numbers to named constants - Added RECENCY_WINDOW_DAYS and RECENCY_WINDOW_MS constants in SearchManager **Documentation:** - Document model cost implications of Haiku → Sonnet upgrade in CHANGELOG - Provide clear migration path for users who want to revert to Haiku 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: simplify CHANGELOG - remove cost documentation Removed model cost comparison documentation per user feedback. Kept only the technical code quality improvements. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Alex Newman <thedotmack@users.noreply.github.com> |
||
|
|
f923c0cdd5 |
fix: complete better-sqlite3 to bun:sqlite migration
Must Fix: - Remove better-sqlite3 logic from smart-install.js (5 sections) - Update all documentation to reference bun:sqlite (7 files) Should Fix: - Add defensive break statement in worker-cli.ts:38 Nice to Have: - Add port validation in ProcessManager.start() (1024-65535) - Add one-time marker for PM2 cleanup migration - Verify clearPortCache() wiring (already correct) Addresses PR #248 review feedback (comment #3648517713) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|
|
fc5c2d5e07 |
Refactor settings management to use ~/.claude-mem/settings.json
- Updated paths in troubleshooting documentation to reflect new settings file location. - Modified diagnostics and reference files to read from ~/.claude-mem/settings.json. - Introduced getWorkerPort utility for cleaner worker port retrieval. - Enhanced ChromaSync and SDKAgent to load Python version and Claude path from settings. - Updated SettingsRoutes to validate new settings: CLAUDE_MEM_LOG_LEVEL and CLAUDE_MEM_PYTHON_VERSION. - Added early-settings module to load settings for logger and other early-stage modules. - Adjusted logger to use early-loaded log level setting. - Refactored paths to utilize early-loaded data directory setting. |
||
|
|
ca4f046777 |
feat: Add search skill with progressive disclosure and refactor existing skills
Enhancements: - Added search skill with 10 HTTP API endpoints for memory queries - Refactored version-bump and troubleshoot skills using progressive disclosure pattern - Added operations/ subdirectories for detailed skill documentation - Updated CLAUDE.md with skill-based search architecture - Enhanced worker service with search API endpoints - Updated CHANGELOG.md with v5.4.0 migration details Technical changes: - New plugin/skills/search/ directory with SKILL.md - New .claude/skills/version-bump/operations/ (workflow.md, scenarios.md) - New plugin/skills/troubleshoot/operations/ (common-issues.md, worker.md) - Modified src/services/worker-service.ts (added search endpoints) - Modified plugin/scripts/worker-service.cjs (rebuilt with search API) - Reduced main skill files by 89% using progressive disclosure - Token savings: ~2,250 tokens per session start 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|
|
fda069bb07 |
Fix GitHub issues #76, #74, #75 + session lifecycle improvements (#77)
* Refactor context-hook: Fix anti-patterns and improve maintainability This refactor addresses all anti-patterns documented in CLAUDE.md, improving code quality without changing behavior. **Dead Code Removed:** - Eliminated unused useIndexView parameter throughout - Cleaned up entry point logic **Magic Numbers → Named Constants:** - CHARS_PER_TOKEN_ESTIMATE = 4 (token estimation) - SUMMARY_LOOKAHEAD = 1 (explains +1 in query) - Added clarifying comment for DISPLAY_SESSION_COUNT **Code Duplication Eliminated:** - Reduced 34 lines to 4 lines with renderSummaryField() helper - Replaced 4 identical summary field rendering blocks **Error Handling Added:** - parseJsonArray() now catches JSON.parse exceptions - Prevents session crashes from malformed data **Type Safety Improved:** - Added SessionSummary interface (replaced inline type cast) - Added SummaryTimelineItem for timeline items - Proper Map typing: Map<string, TimelineItem[]> **Variable Naming Clarity:** - summariesWithOffset → summariesForTimeline - isMostRecent → shouldShowLink (explains purpose) - dayTimelines → itemsByDay - nextSummary → olderSummary (correct chronology) **Better Documentation:** - Explained confusing timeline offset logic - Removed apologetic comments, added clarifying ones **Impact:** - 28 lines saved from duplication elimination - Zero behavioral changes (output identical) - Improved maintainability and type safety 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix context-hook to respect settings.json contextDepth The context-hook was ignoring the user's contextDepth setting from the web UI (stored in ~/.claude-mem/settings.json) and always using the default of 50 observations. **Problem:** - Web UI sets contextDepth in ~/.claude-mem/settings.json - Context-hook only read from process.env.CLAUDE_MEM_CONTEXT_OBSERVATIONS - User's preference of 7 observations was ignored, always showing 50 **Solution:** - Added getContextDepth() function following same pattern as getWorkerPort() - Priority: settings.json > env var > default (50) - Validates contextDepth is a positive number **Testing:** - Verified with contextDepth: 7 → shows 7 observations ✓ - Verified with contextDepth: 3 → shows 3 observations ✓ - Settings properly respected on every session start **Files Changed:** - src/hooks/context-hook.ts: Added getContextDepth() + imports - plugin/scripts/context-hook.js: Built output 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix context-hook to read from correct settings file location **Critical Bug Fix:** Previous commit read from completely wrong location with wrong field name. **What was wrong:** - Reading from: ~/.claude-mem/settings.json (doesn't exist) - Looking for: contextDepth (wrong field) - Result: Always falling back to default of 50 **What's fixed:** - Reading from: ~/.claude/settings.json (correct location) - Looking for: env.CLAUDE_MEM_CONTEXT_OBSERVATIONS (correct field) - Matches pattern used in worker-service.ts **Testing:** - With CLAUDE_MEM_CONTEXT_OBSERVATIONS: "15" → shows 15 observations ✓ - With CLAUDE_MEM_CONTEXT_OBSERVATIONS: "5" → shows 5 observations ✓ - Web UI settings now properly respected **Files Changed:** - src/hooks/context-hook.ts: Fixed path and field name in getContextDepth() - plugin/scripts/context-hook.js: Built output 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix GitHub issues #76, #74, #75 + session lifecycle improvements Bug Fixes: - Fix PM2 'Process 0 not found' error (#76): Changed pm2 restart to pm2 start (idempotent) - Fix troubleshooting skill distribution (#74, #75): Moved from .claude/skills/ to plugin/skills/ Session Lifecycle Improvements: - Added session lifecycle context to SDK agent prompt - Changed summary framing from "final report" to "progress checkpoint" - Updated summary prompts to use progressive tense ("so far", "actively working on") - Added buildContinuationPrompt() for prompt #2+ to avoid re-initialization - SessionManager now restores prompt counter from database - SDKAgent conditionally uses init vs continuation prompt based on prompt number These changes improve context-loading task handling and reduce incorrect "file not found" reports in summaries (partial fix for #73 - awaiting user feedback). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Release v5.3.0: Session lifecycle improvements and bug fixes Improvements: - Session prompt counter now restored from DB on worker restart - Continuation prompts for prompt #2+ (lightweight, avoids re-init) - Summary framing changed from "final report" to "progress checkpoint" - PM2 start command (idempotent, fixes "Process 0 not found" error) - Troubleshooting skill moved to plugin/skills/ for proper distribution Technical changes: - SessionManager loads prompt_counter from DB on initialization - SDKAgent uses buildContinuationPrompt() for requests #2+ - Updated summary prompt to clarify mid-session checkpoints - Fixed worker-utils.ts to use pm2 start instead of pm2 restart - Moved .claude/skills/troubleshoot → plugin/skills/troubleshoot Fixes: - GitHub issue #76: PM2 "Process 0 not found" error - GitHub issue #74, #75: Troubleshooting skill not distributed - GitHub issue #73 (partial): Context-loading tasks reported as failed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> |