@danielsimonjr/memory-mcp 9.8.2 → 9.8.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagerContext.d.ts","sourceRoot":"","sources":["../../src/core/ManagerContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ManagerContext.d.ts","sourceRoot":"","sources":["../../src/core/ManagerContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAA6C,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D;;;GAGG;AACH,qBAAa,cAAc;IAGzB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;IAC/C,OAAO,CAAC,QAAQ,C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
|
import path from 'path';
|
|
11
|
-
import {
|
|
11
|
+
import { createStorageFromPath } from './StorageFactory.js';
|
|
12
12
|
import { EntityManager } from './EntityManager.js';
|
|
13
13
|
import { RelationManager } from './RelationManager.js';
|
|
14
14
|
import { ObservationManager } from './ObservationManager.js';
|
|
@@ -27,6 +27,8 @@ import { getEmbeddingConfig } from '../utils/constants.js';
|
|
|
27
27
|
* Provides direct manager access for toolHandlers.
|
|
28
28
|
*/
|
|
29
29
|
export class ManagerContext {
|
|
30
|
+
// Type as GraphStorage for manager compatibility; actual instance may be SQLiteStorage
|
|
31
|
+
// which implements the same interface via duck typing
|
|
30
32
|
storage;
|
|
31
33
|
savedSearchesFilePath;
|
|
32
34
|
tagAliasesFilePath;
|
|
@@ -49,7 +51,9 @@ export class ManagerContext {
|
|
|
49
51
|
const basename = path.basename(memoryFilePath, path.extname(memoryFilePath));
|
|
50
52
|
this.savedSearchesFilePath = path.join(dir, `${basename}-saved-searches.jsonl`);
|
|
51
53
|
this.tagAliasesFilePath = path.join(dir, `${basename}-tag-aliases.jsonl`);
|
|
52
|
-
|
|
54
|
+
// Use StorageFactory to respect MEMORY_STORAGE_TYPE environment variable
|
|
55
|
+
// Type assertion: SQLiteStorage implements same interface as GraphStorage
|
|
56
|
+
this.storage = createStorageFromPath(memoryFilePath);
|
|
53
57
|
}
|
|
54
58
|
// ==================== MANAGER ACCESSORS ====================
|
|
55
59
|
// Use these for direct manager access in toolHandlers
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -2,22 +2,29 @@
|
|
|
2
2
|
* Simple logging utility for the Memory MCP Server
|
|
3
3
|
*
|
|
4
4
|
* Provides consistent log formatting with levels: debug, info, warn, error
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT: All log output goes to stderr to avoid interfering with
|
|
7
|
+
* JSON-RPC communication on stdout when running as an MCP server.
|
|
5
8
|
*/
|
|
6
9
|
export declare const logger: {
|
|
7
10
|
/**
|
|
8
11
|
* Debug level logging (verbose, for development)
|
|
12
|
+
* Output: stderr (to avoid interfering with JSON-RPC)
|
|
9
13
|
*/
|
|
10
14
|
debug: (msg: string, ...args: unknown[]) => void;
|
|
11
15
|
/**
|
|
12
16
|
* Info level logging (general informational messages)
|
|
17
|
+
* Output: stderr (to avoid interfering with JSON-RPC)
|
|
13
18
|
*/
|
|
14
19
|
info: (msg: string, ...args: unknown[]) => void;
|
|
15
20
|
/**
|
|
16
21
|
* Warning level logging (warnings that don't prevent operation)
|
|
22
|
+
* Output: stderr (native console.warn behavior)
|
|
17
23
|
*/
|
|
18
24
|
warn: (msg: string, ...args: unknown[]) => void;
|
|
19
25
|
/**
|
|
20
26
|
* Error level logging (errors that affect functionality)
|
|
27
|
+
* Output: stderr (native console.error behavior)
|
|
21
28
|
*/
|
|
22
29
|
error: (msg: string, ...args: unknown[]) => void;
|
|
23
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,MAAM;IACjB;;;OAGG;iBACU,MAAM,WAAW,OAAO,EAAE,KAAG,IAAI;IAM9C;;;OAGG;gBACS,MAAM,WAAW,OAAO,EAAE,KAAG,IAAI;IAI7C;;;OAGG;gBACS,MAAM,WAAW,OAAO,EAAE,KAAG,IAAI;IAI7C;;;OAGG;iBACU,MAAM,WAAW,OAAO,EAAE,KAAG,IAAI;CAG/C,CAAC"}
|
package/dist/utils/logger.js
CHANGED
|
@@ -2,30 +2,37 @@
|
|
|
2
2
|
* Simple logging utility for the Memory MCP Server
|
|
3
3
|
*
|
|
4
4
|
* Provides consistent log formatting with levels: debug, info, warn, error
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT: All log output goes to stderr to avoid interfering with
|
|
7
|
+
* JSON-RPC communication on stdout when running as an MCP server.
|
|
5
8
|
*/
|
|
6
9
|
export const logger = {
|
|
7
10
|
/**
|
|
8
11
|
* Debug level logging (verbose, for development)
|
|
12
|
+
* Output: stderr (to avoid interfering with JSON-RPC)
|
|
9
13
|
*/
|
|
10
14
|
debug: (msg, ...args) => {
|
|
11
15
|
if (process.env.LOG_LEVEL === 'debug') {
|
|
12
|
-
console.
|
|
16
|
+
console.error(`[DEBUG] ${msg}`, ...args);
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
/**
|
|
16
20
|
* Info level logging (general informational messages)
|
|
21
|
+
* Output: stderr (to avoid interfering with JSON-RPC)
|
|
17
22
|
*/
|
|
18
23
|
info: (msg, ...args) => {
|
|
19
|
-
console.
|
|
24
|
+
console.error(`[INFO] ${msg}`, ...args);
|
|
20
25
|
},
|
|
21
26
|
/**
|
|
22
27
|
* Warning level logging (warnings that don't prevent operation)
|
|
28
|
+
* Output: stderr (native console.warn behavior)
|
|
23
29
|
*/
|
|
24
30
|
warn: (msg, ...args) => {
|
|
25
31
|
console.warn(`[WARN] ${msg}`, ...args);
|
|
26
32
|
},
|
|
27
33
|
/**
|
|
28
34
|
* Error level logging (errors that affect functionality)
|
|
35
|
+
* Output: stderr (native console.error behavior)
|
|
29
36
|
*/
|
|
30
37
|
error: (msg, ...args) => {
|
|
31
38
|
console.error(`[ERROR] ${msg}`, ...args);
|
package/package.json
CHANGED