@danielsimonjr/memory-mcp 12.8.3 → 12.9.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.
- package/README.md +15 -15
- package/dist/server/toolHandlers.d.ts +9 -0
- package/dist/server/toolHandlers.d.ts.map +1 -1
- package/dist/server/toolHandlers.js +20 -0
- package/package.json +10 -8
package/README.md
CHANGED
|
@@ -178,14 +178,14 @@ git clone https://github.com/danielsimonjr/memory-mcp.git
|
|
|
178
178
|
cd memory-mcp
|
|
179
179
|
|
|
180
180
|
# Install and build
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
bun install
|
|
182
|
+
bun run build
|
|
183
183
|
|
|
184
|
-
# Run tests (
|
|
185
|
-
|
|
184
|
+
# Run tests (794 tests, ~85% statement coverage)
|
|
185
|
+
bun run test
|
|
186
186
|
|
|
187
187
|
# Type check
|
|
188
|
-
|
|
188
|
+
bun run typecheck
|
|
189
189
|
```
|
|
190
190
|
|
|
191
191
|
### Claude Desktop Configuration
|
|
@@ -774,20 +774,20 @@ node dist/migrate-from-jsonl-to-sqlite.js --from memory.db --to memory.jsonl
|
|
|
774
774
|
|
|
775
775
|
### Prerequisites
|
|
776
776
|
|
|
777
|
-
-
|
|
778
|
-
-
|
|
779
|
-
- TypeScript
|
|
777
|
+
- Bun 1.4+ (install + scripts; `bun.lock` is authoritative)
|
|
778
|
+
- Node.js 22+ (shipped runtime — CI smokes `dist/` under Node)
|
|
779
|
+
- TypeScript 7+
|
|
780
780
|
|
|
781
781
|
### Build Commands
|
|
782
782
|
|
|
783
783
|
```bash
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
784
|
+
bun install # Install dependencies
|
|
785
|
+
bun run build # Build TypeScript
|
|
786
|
+
bun run test # Run tests (794 tests across 37 files; ~85% coverage)
|
|
787
|
+
bun run typecheck # Strict type checking
|
|
788
|
+
bun run watch # Development watch mode
|
|
789
|
+
bun run clean # Remove dist/ directory
|
|
790
|
+
bun run docs:deps # Generate dependency graph
|
|
791
791
|
```
|
|
792
792
|
|
|
793
793
|
### Architecture
|
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
* @module server/toolHandlers
|
|
9
9
|
*/
|
|
10
10
|
import { formatToolResponse, type ManagerContext } from '@danielsimonjr/memoryjs';
|
|
11
|
+
/**
|
|
12
|
+
* Read the active project scope for a context.
|
|
13
|
+
*
|
|
14
|
+
* The scope is per-context session state set by the `set_project_scope` tool.
|
|
15
|
+
* It is held in a WeakMap because `ctx.defaultProjectId` is readonly.
|
|
16
|
+
*
|
|
17
|
+
* @param ctx - The manager context to read the scope from.
|
|
18
|
+
* @returns The active project id, or `undefined` when no scope is set.
|
|
19
|
+
*/
|
|
11
20
|
export declare function getActiveProjectScope(ctx: ManagerContext): string | undefined;
|
|
12
21
|
/**
|
|
13
22
|
* Tool response type for MCP SDK compatibility.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolHandlers.d.ts","sourceRoot":"","sources":["../../src/server/toolHandlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,kBAAkB,EA2ClB,KAAK,cAAc,EAyBpB,MAAM,yBAAyB,CAAC;AAyBjC,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAE7E;AAgFD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CACxB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,OAAO,CAAC,YAAY,CAAC,CAAC;AAiF3B,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"toolHandlers.d.ts","sourceRoot":"","sources":["../../src/server/toolHandlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,kBAAkB,EA2ClB,KAAK,cAAc,EAyBpB,MAAM,yBAAyB,CAAC;AAyBjC;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAE7E;AAgFD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CACxB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,OAAO,CAAC,YAAY,CAAC,CAAC;AAiF3B,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAkvGpD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,YAAY,CAAC,CAiBvB"}
|
|
@@ -29,6 +29,15 @@ const queryCostEstimatorMap = new WeakMap();
|
|
|
29
29
|
// `set_project_scope` tool; handlers may consult `getActiveProjectScope(ctx)`
|
|
30
30
|
// when they want to auto-apply the scope.
|
|
31
31
|
const projectScopeMap = new WeakMap();
|
|
32
|
+
/**
|
|
33
|
+
* Read the active project scope for a context.
|
|
34
|
+
*
|
|
35
|
+
* The scope is per-context session state set by the `set_project_scope` tool.
|
|
36
|
+
* It is held in a WeakMap because `ctx.defaultProjectId` is readonly.
|
|
37
|
+
*
|
|
38
|
+
* @param ctx - The manager context to read the scope from.
|
|
39
|
+
* @returns The active project id, or `undefined` when no scope is set.
|
|
40
|
+
*/
|
|
32
41
|
export function getActiveProjectScope(ctx) {
|
|
33
42
|
return projectScopeMap.get(ctx);
|
|
34
43
|
}
|
|
@@ -1244,6 +1253,17 @@ export const toolHandlers = {
|
|
|
1244
1253
|
return formatTextResponse('No active consolidation scheduler found. Start one first with start_consolidation.');
|
|
1245
1254
|
}
|
|
1246
1255
|
scheduler.stop();
|
|
1256
|
+
// `stop()` clears the interval but cannot cancel a cycle already running:
|
|
1257
|
+
// `runConsolidationCycle` checks `running` only on entry, then awaits a full
|
|
1258
|
+
// graph save. `start()` fires one cycle IMMEDIATELY -- it does not wait for
|
|
1259
|
+
// the interval, which defaults to an hour -- so a start/stop pair always
|
|
1260
|
+
// leaves a write in flight. Returning "stopped" there is a lie the caller
|
|
1261
|
+
// acts on: teardown that deletes the storage directory races the write and
|
|
1262
|
+
// logs `ConsolidationScheduler cycle error: ENOENT ... memory.jsonl.tmp.*`.
|
|
1263
|
+
// memoryjs 4.2.0 exposes that cycle as `initialCyclePromise`; awaiting it
|
|
1264
|
+
// makes "stopped" mean quiesced. The cycle handles its own errors, so this
|
|
1265
|
+
// settles rather than rejects.
|
|
1266
|
+
await scheduler.initialCyclePromise;
|
|
1247
1267
|
return formatTextResponse('Consolidation scheduler stopped');
|
|
1248
1268
|
},
|
|
1249
1269
|
run_consolidation_now: async (ctx) => {
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielsimonjr/memory-mcp",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.9.0",
|
|
4
4
|
"description": "Enhanced MCP memory server with hierarchies, compression, archiving, graph algorithms, semantic search, temporal KG, RBAC, bitemporal validity, OCC, procedural memory, causal reasoning, world model, do_not_remember exclusions, decision rationale, project context, heuristic guidelines, tool affordance + observer, observation dedup, spell correction, event memory, reconstructive memory, relation consolidation, agent reflection, and 241 advanced tools",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"packageManager": "bun@1.4.2",
|
|
6
7
|
"engines": {
|
|
7
|
-
"node": ">=22.0.0"
|
|
8
|
+
"node": ">=22.0.0",
|
|
9
|
+
"bun": ">=1.4.2"
|
|
8
10
|
},
|
|
9
11
|
"author": "Daniel Simon Jr. (https://github.com/danielsimonjr)",
|
|
10
12
|
"homepage": "https://github.com/danielsimonjr/memory-mcp",
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
],
|
|
49
51
|
"scripts": {
|
|
50
52
|
"build": "tsc",
|
|
51
|
-
"prepare": "
|
|
53
|
+
"prepare": "tsc",
|
|
52
54
|
"watch": "tsc --watch",
|
|
53
55
|
"test": "vitest run --coverage",
|
|
54
56
|
"typecheck": "tsc --noEmit --noUnusedLocals --noUnusedParameters --strict",
|
|
@@ -58,20 +60,20 @@
|
|
|
58
60
|
"tools:build": "cd tools/chunking-for-files && npm run build && cd ../compress-for-context && npm run build && cd ../create-dependency-graph && npm run build && cd ../migrate-from-jsonl-to-sqlite && npm run build"
|
|
59
61
|
},
|
|
60
62
|
"dependencies": {
|
|
61
|
-
"@danielsimonjr/memoryjs": "^
|
|
63
|
+
"@danielsimonjr/memoryjs": "^4.2.0",
|
|
62
64
|
"@modelcontextprotocol/core": "^2.0.0",
|
|
63
65
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
64
|
-
"zod": "^4.
|
|
66
|
+
"zod": "^4.6.2"
|
|
65
67
|
},
|
|
66
68
|
"overrides": {
|
|
67
|
-
"better-sqlite3": "^
|
|
69
|
+
"better-sqlite3": "^13.0.3"
|
|
68
70
|
},
|
|
69
71
|
"devDependencies": {
|
|
70
72
|
"@types/node": "^26",
|
|
71
|
-
"@vitest/coverage-v8": "^
|
|
73
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
72
74
|
"esbuild": "^0.28.2",
|
|
73
75
|
"shx": "^0.4.0",
|
|
74
76
|
"typescript": "^7.0.2",
|
|
75
|
-
"vitest": "^
|
|
77
|
+
"vitest": "^5.0.0"
|
|
76
78
|
}
|
|
77
79
|
}
|