@danielsimonjr/memory-mcp 0.41.0 → 0.48.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.
@@ -9,4 +9,4 @@ export { ArchiveManager } from './ArchiveManager.js';
9
9
  export { BackupManager } from './BackupManager.js';
10
10
  export { ExportManager } from './ExportManager.js';
11
11
  export { ImportManager } from './ImportManager.js';
12
- export { ImportExportManager } from './ImportExportManager.js';
12
+ // Note: ExportFilter type moved to types/import-export.types.ts
package/dist/index.js CHANGED
@@ -1,44 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { promises as fs } from 'fs';
3
- import path from 'path';
4
- import { fileURLToPath } from 'url';
5
2
  import { logger } from './utils/logger.js';
6
3
  import { KnowledgeGraphManager } from './core/KnowledgeGraphManager.js';
7
4
  import { MCPServer } from './server/MCPServer.js';
8
- // Define memory file path using environment variable with fallback
9
- export const defaultMemoryPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'memory.jsonl');
10
- // Handle backward compatibility: migrate memory.json to memory.jsonl if needed
11
- export async function ensureMemoryFilePath() {
12
- if (process.env.MEMORY_FILE_PATH) {
13
- // Custom path provided, use it as-is (with absolute path resolution)
14
- return path.isAbsolute(process.env.MEMORY_FILE_PATH)
15
- ? process.env.MEMORY_FILE_PATH
16
- : path.join(path.dirname(fileURLToPath(import.meta.url)), process.env.MEMORY_FILE_PATH);
17
- }
18
- // No custom path set, check for backward compatibility migration
19
- const oldMemoryPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'memory.json');
20
- const newMemoryPath = defaultMemoryPath;
21
- try {
22
- // Check if old file exists and new file doesn't
23
- await fs.access(oldMemoryPath);
24
- try {
25
- await fs.access(newMemoryPath);
26
- // Both files exist, use new one (no migration needed)
27
- return newMemoryPath;
28
- }
29
- catch {
30
- // Old file exists, new file doesn't - migrate
31
- logger.info('Found legacy memory.json file, migrating to memory.jsonl for JSONL format compatibility');
32
- await fs.rename(oldMemoryPath, newMemoryPath);
33
- logger.info('Successfully migrated memory.json to memory.jsonl');
34
- return newMemoryPath;
35
- }
36
- }
37
- catch {
38
- // Old file doesn't exist, use new path
39
- return newMemoryPath;
40
- }
41
- }
5
+ // Import path utilities from canonical location (has path traversal protection)
6
+ import { defaultMemoryPath, ensureMemoryFilePath } from './utils/pathUtils.js';
7
+ // Re-export path utilities for backward compatibility
8
+ export { defaultMemoryPath, ensureMemoryFilePath };
42
9
  // Re-export KnowledgeGraphManager for backward compatibility
43
10
  export { KnowledgeGraphManager };
44
11
  let knowledgeGraphManager;
File without changes
File without changes