@j0hanz/memdb 1.2.9 → 1.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 (56) hide show
  1. package/README.md +110 -287
  2. package/dist/assets/logo.svg +12 -0
  3. package/dist/config.d.ts +0 -1
  4. package/dist/config.js +0 -1
  5. package/dist/core/db.d.ts +6 -4
  6. package/dist/core/db.js +79 -39
  7. package/dist/core/memory-read.d.ts +1 -2
  8. package/dist/core/memory-read.js +28 -14
  9. package/dist/core/memory-write.d.ts +1 -2
  10. package/dist/core/memory-write.js +59 -82
  11. package/dist/core/relationships.d.ts +0 -1
  12. package/dist/core/relationships.js +4 -20
  13. package/dist/core/search.d.ts +0 -1
  14. package/dist/core/search.js +85 -101
  15. package/dist/index.d.ts +0 -1
  16. package/dist/index.js +36 -4
  17. package/dist/instructions.md +35 -27
  18. package/dist/logger.d.ts +0 -1
  19. package/dist/logger.js +0 -1
  20. package/dist/protocol-version-guard.d.ts +0 -1
  21. package/dist/protocol-version-guard.js +0 -1
  22. package/dist/schemas.d.ts +0 -1
  23. package/dist/schemas.js +12 -9
  24. package/dist/stdio-transport.d.ts +0 -1
  25. package/dist/stdio-transport.js +0 -1
  26. package/dist/tools.d.ts +1 -2
  27. package/dist/tools.js +194 -214
  28. package/dist/types.d.ts +0 -1
  29. package/dist/types.js +0 -1
  30. package/package.json +19 -17
  31. package/dist/config.d.ts.map +0 -1
  32. package/dist/config.js.map +0 -1
  33. package/dist/core/db.d.ts.map +0 -1
  34. package/dist/core/db.js.map +0 -1
  35. package/dist/core/memory-read.d.ts.map +0 -1
  36. package/dist/core/memory-read.js.map +0 -1
  37. package/dist/core/memory-write.d.ts.map +0 -1
  38. package/dist/core/memory-write.js.map +0 -1
  39. package/dist/core/relationships.d.ts.map +0 -1
  40. package/dist/core/relationships.js.map +0 -1
  41. package/dist/core/search.d.ts.map +0 -1
  42. package/dist/core/search.js.map +0 -1
  43. package/dist/index.d.ts.map +0 -1
  44. package/dist/index.js.map +0 -1
  45. package/dist/logger.d.ts.map +0 -1
  46. package/dist/logger.js.map +0 -1
  47. package/dist/protocol-version-guard.d.ts.map +0 -1
  48. package/dist/protocol-version-guard.js.map +0 -1
  49. package/dist/schemas.d.ts.map +0 -1
  50. package/dist/schemas.js.map +0 -1
  51. package/dist/stdio-transport.d.ts.map +0 -1
  52. package/dist/stdio-transport.js.map +0 -1
  53. package/dist/tools.d.ts.map +0 -1
  54. package/dist/tools.js.map +0 -1
  55. package/dist/types.d.ts.map +0 -1
  56. package/dist/types.js.map +0 -1
package/dist/tools.js CHANGED
@@ -19,6 +19,7 @@ const defaultDeps = {
19
19
  recallMemories,
20
20
  };
21
21
  const TOOL_TIMEOUT_MS = config.toolTimeoutMs;
22
+ const normalizeHash = (hash) => hash.toLowerCase();
22
23
  const isNonEmptyString = (value) => typeof value === 'string' && value.length > 0;
23
24
  const getErrorMessage = (error) => {
24
25
  if (error instanceof Error)
@@ -39,27 +40,6 @@ const createErrorResponse = (code, message, result) => {
39
40
  isError: true,
40
41
  };
41
42
  };
42
- const withTimeout = async (promise, ms, onTimeout, signal) => {
43
- if (ms <= 0)
44
- return await promise;
45
- let timeout;
46
- const timeoutPromise = new Promise((resolve) => {
47
- timeout = setTimeout(() => {
48
- if (signal && typeof signal.dispatchEvent === 'function') {
49
- signal.dispatchEvent(new Event('abort'));
50
- }
51
- resolve(onTimeout());
52
- }, ms);
53
- });
54
- try {
55
- return await Promise.race([promise, timeoutPromise]);
56
- }
57
- finally {
58
- if (timeout)
59
- clearTimeout(timeout);
60
- }
61
- };
62
- const createTimeoutResponse = () => createErrorResponse('E_TIMEOUT', `Tool execution timed out after ${TOOL_TIMEOUT_MS}ms`, { timeoutMs: TOOL_TIMEOUT_MS });
63
43
  const createSuccessResponse = (result) => {
64
44
  const structured = { ok: true, result };
65
45
  return {
@@ -67,20 +47,71 @@ const createSuccessResponse = (result) => {
67
47
  structuredContent: structured,
68
48
  };
69
49
  };
70
- const runHandlerSafely = async (code, handler, params) => {
71
- try {
72
- const controller = new AbortController();
73
- const resultPromise = Promise.resolve().then(() => handler(params, controller.signal));
74
- return await withTimeout(resultPromise, TOOL_TIMEOUT_MS, createTimeoutResponse, controller.signal);
75
- }
76
- catch (err) {
77
- return createErrorResponse(code, getErrorMessage(err));
50
+ class ToolFailure extends Error {
51
+ result;
52
+ code;
53
+ constructor(code, message, result) {
54
+ super(message);
55
+ this.result = result;
56
+ this.code = code;
78
57
  }
58
+ }
59
+ const createTimeoutResponse = (timeoutMs) => createErrorResponse('E_TIMEOUT', `Tool execution timed out after ${timeoutMs}ms`, { timeoutMs });
60
+ const createTimedToolHandler = (defaultErrorCode, timeoutMs, run) => {
61
+ return async (params) => {
62
+ const controller = new AbortController();
63
+ const ctx = { signal: controller.signal };
64
+ const execution = Promise.resolve().then(() => run(params, ctx));
65
+ if (timeoutMs <= 0) {
66
+ try {
67
+ return await execution;
68
+ }
69
+ catch (err) {
70
+ if (err instanceof ToolFailure) {
71
+ return createErrorResponse(err.code, err.message, err.result);
72
+ }
73
+ return createErrorResponse(defaultErrorCode, getErrorMessage(err));
74
+ }
75
+ }
76
+ let timeout;
77
+ const timeoutPromise = new Promise((resolve) => {
78
+ timeout = setTimeout(() => {
79
+ controller.abort();
80
+ resolve(createTimeoutResponse(timeoutMs));
81
+ }, timeoutMs);
82
+ });
83
+ try {
84
+ return await Promise.race([execution, timeoutPromise]);
85
+ }
86
+ catch (err) {
87
+ if (err instanceof ToolFailure) {
88
+ return createErrorResponse(err.code, err.message, err.result);
89
+ }
90
+ return createErrorResponse(defaultErrorCode, getErrorMessage(err));
91
+ }
92
+ finally {
93
+ if (timeout)
94
+ clearTimeout(timeout);
95
+ }
96
+ };
79
97
  };
80
- const wrapHandler = (code, handler) => {
81
- return async (params) => runHandlerSafely(code, handler, params);
98
+ const defineTool = (spec) => {
99
+ return {
100
+ name: spec.name,
101
+ options: {
102
+ title: spec.title,
103
+ description: spec.description,
104
+ inputSchema: spec.inputSchema,
105
+ outputSchema: spec.outputSchema,
106
+ ...(spec.annotations ? { annotations: spec.annotations } : {}),
107
+ },
108
+ handler: createTimedToolHandler(spec.errorCode, spec.timeoutMs ?? TOOL_TIMEOUT_MS, async (params, ctx) => {
109
+ const input = spec.inputSchema.parse(params);
110
+ const result = await spec.run(input, ctx);
111
+ return createSuccessResponse(result);
112
+ }),
113
+ };
82
114
  };
83
- const normalizeHash = (hash) => hash.toLowerCase();
84
115
  const toCreateMemoryInput = (input) => ({
85
116
  content: input.content,
86
117
  tags: input.tags,
@@ -89,247 +120,196 @@ const toCreateMemoryInput = (input) => ({
89
120
  ? {}
90
121
  : { memory_type: input.memory_type }),
91
122
  });
92
- const buildStoreMemoryTool = (deps) => ({
93
- name: 'store_memory',
94
- options: {
123
+ const buildTools = (deps) => [
124
+ defineTool({
125
+ name: 'store_memory',
95
126
  title: 'Store Memory',
96
127
  description: 'Store a new memory with tags',
97
128
  inputSchema: StoreMemoryInputSchema,
98
129
  outputSchema: DefaultOutputSchema,
99
130
  annotations: { idempotentHint: true },
100
- },
101
- handler: wrapHandler('E_STORE_MEMORY', async (params) => {
102
- const input = StoreMemoryInputSchema.parse(params);
103
- const result = await deps.createMemory(toCreateMemoryInput({
104
- content: input.content,
105
- tags: input.tags,
106
- importance: input.importance,
107
- memory_type: input.memory_type,
108
- }));
109
- return createSuccessResponse(result);
131
+ errorCode: 'E_STORE_MEMORY',
132
+ run: async (input) => {
133
+ const result = await deps.createMemory(toCreateMemoryInput({
134
+ content: input.content,
135
+ tags: input.tags,
136
+ importance: input.importance,
137
+ memory_type: input.memory_type,
138
+ }));
139
+ return result;
140
+ },
110
141
  }),
111
- });
112
- const buildStoreMemoriesTool = (deps) => ({
113
- name: 'store_memories',
114
- options: {
142
+ defineTool({
143
+ name: 'store_memories',
115
144
  title: 'Store Multiple Memories',
116
145
  description: 'Store multiple memories in a single batch operation. Returns per-item results with partial success support.',
117
146
  inputSchema: StoreMemoriesInputSchema,
118
147
  outputSchema: DefaultOutputSchema,
119
148
  annotations: { idempotentHint: true },
120
- },
121
- handler: wrapHandler('E_STORE_MEMORIES', async (params) => {
122
- const input = StoreMemoriesInputSchema.parse(params);
123
- const items = input.items.map((item) => toCreateMemoryInput({
124
- content: item.content,
125
- tags: item.tags,
126
- importance: item.importance,
127
- memory_type: item.memory_type,
128
- }));
129
- const result = await deps.createMemories(items);
130
- return createSuccessResponse(result);
149
+ errorCode: 'E_STORE_MEMORIES',
150
+ run: async (input, ctx) => {
151
+ const items = input.items.map((item) => toCreateMemoryInput({
152
+ content: item.content,
153
+ tags: item.tags,
154
+ importance: item.importance,
155
+ memory_type: item.memory_type,
156
+ }));
157
+ return await deps.createMemories(items, ctx.signal);
158
+ },
131
159
  }),
132
- });
133
- const buildGetMemoryTool = (deps) => ({
134
- name: 'get_memory',
135
- options: {
160
+ defineTool({
161
+ name: 'get_memory',
136
162
  title: 'Get Memory',
137
163
  description: 'Retrieve memory by hash',
138
164
  inputSchema: GetMemoryInputSchema,
139
165
  outputSchema: DefaultOutputSchema,
140
- },
141
- handler: wrapHandler('E_GET_MEMORY', async (params) => {
142
- const input = GetMemoryInputSchema.parse(params);
143
- const result = await deps.getMemory(normalizeHash(input.hash));
144
- if (!result) {
145
- return createErrorResponse('E_NOT_FOUND', 'Memory not found');
146
- }
147
- return createSuccessResponse(result);
166
+ errorCode: 'E_GET_MEMORY',
167
+ run: async (input) => {
168
+ const result = await deps.getMemory(normalizeHash(input.hash));
169
+ if (!result)
170
+ throw new ToolFailure('E_NOT_FOUND', 'Memory not found');
171
+ return result;
172
+ },
148
173
  }),
149
- });
150
- const buildDeleteMemoryTool = (deps) => ({
151
- name: 'delete_memory',
152
- options: {
174
+ defineTool({
175
+ name: 'delete_memory',
153
176
  title: 'Delete Memory',
154
177
  description: 'Delete by hash',
155
178
  inputSchema: DeleteMemoryInputSchema,
156
179
  outputSchema: DefaultOutputSchema,
157
180
  annotations: { destructiveHint: true },
158
- },
159
- handler: wrapHandler('E_DELETE_MEMORY', async (params) => {
160
- const input = DeleteMemoryInputSchema.parse(params);
161
- const result = await deps.deleteMemory(normalizeHash(input.hash));
162
- if (result.changes === 0) {
163
- return createErrorResponse('E_NOT_FOUND', 'Memory not found');
164
- }
165
- return createSuccessResponse({ deleted: true });
181
+ errorCode: 'E_DELETE_MEMORY',
182
+ run: async (input) => {
183
+ const result = await deps.deleteMemory(normalizeHash(input.hash));
184
+ if (result.changes === 0)
185
+ throw new ToolFailure('E_NOT_FOUND', 'Memory not found');
186
+ return { deleted: true };
187
+ },
166
188
  }),
167
- });
168
- const buildDeleteMemoriesTool = (deps) => ({
169
- name: 'delete_memories',
170
- options: {
189
+ defineTool({
190
+ name: 'delete_memories',
171
191
  title: 'Delete Multiple Memories',
172
192
  description: 'Delete multiple memories by hash in a single batch operation. Returns per-item results with partial success support.',
173
193
  inputSchema: DeleteMemoriesInputSchema,
174
194
  outputSchema: DefaultOutputSchema,
175
195
  annotations: { destructiveHint: true },
176
- },
177
- handler: wrapHandler('E_DELETE_MEMORIES', async (params) => {
178
- const input = DeleteMemoriesInputSchema.parse(params);
179
- const result = await deps.deleteMemories(input.hashes.map(normalizeHash));
180
- return createSuccessResponse(result);
196
+ errorCode: 'E_DELETE_MEMORIES',
197
+ run: async (input, ctx) => {
198
+ return await deps.deleteMemories(input.hashes.map(normalizeHash), ctx.signal);
199
+ },
181
200
  }),
182
- });
183
- const buildUpdateMemoryTool = (deps) => ({
184
- name: 'update_memory',
185
- options: {
201
+ defineTool({
202
+ name: 'update_memory',
186
203
  title: 'Update Memory',
187
204
  description: 'Update memory content. Returns new hash since content change affects the hash.',
188
205
  inputSchema: UpdateMemoryInputSchema,
189
206
  outputSchema: DefaultOutputSchema,
190
207
  annotations: { idempotentHint: true },
191
- },
192
- handler: wrapHandler('E_UPDATE_MEMORY', async (params) => {
193
- const input = UpdateMemoryInputSchema.parse(params);
194
- const result = await deps.updateMemory(normalizeHash(input.hash), {
195
- content: input.content,
196
- tags: input.tags,
197
- });
198
- return createSuccessResponse(result);
208
+ errorCode: 'E_UPDATE_MEMORY',
209
+ run: async (input) => {
210
+ return await deps.updateMemory(normalizeHash(input.hash), {
211
+ content: input.content,
212
+ tags: input.tags,
213
+ });
214
+ },
199
215
  }),
200
- });
201
- const buildCoreTools = (deps) => [
202
- buildStoreMemoryTool(deps),
203
- buildStoreMemoriesTool(deps),
204
- buildGetMemoryTool(deps),
205
- buildDeleteMemoryTool(deps),
206
- buildDeleteMemoriesTool(deps),
207
- buildUpdateMemoryTool(deps),
208
- ];
209
- const buildSearchTools = (deps) => [
210
- {
216
+ defineTool({
211
217
  name: 'search_memories',
212
- options: {
213
- title: 'Search Memories',
214
- description: 'Search memories by content and tags',
215
- inputSchema: SearchMemoriesInputSchema,
216
- outputSchema: DefaultOutputSchema,
217
- annotations: { readOnlyHint: true },
218
+ title: 'Search Memories',
219
+ description: 'Search memories by content and tags',
220
+ inputSchema: SearchMemoriesInputSchema,
221
+ outputSchema: DefaultOutputSchema,
222
+ annotations: { readOnlyHint: true },
223
+ errorCode: 'E_SEARCH_MEMORIES',
224
+ run: async (input, ctx) => {
225
+ return await deps.searchMemories({ query: input.query }, ctx.signal);
218
226
  },
219
- handler: wrapHandler('E_SEARCH_MEMORIES', async (params, signal) => {
220
- const input = SearchMemoriesInputSchema.parse(params);
221
- const result = await deps.searchMemories({ query: input.query }, signal);
222
- return createSuccessResponse(result);
223
- }),
224
- },
225
- {
227
+ }),
228
+ defineTool({
226
229
  name: 'recall',
227
- options: {
228
- title: 'Recall Memories',
229
- description: 'Search for memories and traverse relationships to return a connected graph cluster. ' +
230
- 'Use this for deeper context retrieval that follows knowledge graph connections.',
231
- inputSchema: RecallInputSchema,
232
- outputSchema: DefaultOutputSchema,
233
- annotations: { readOnlyHint: true },
234
- },
235
- handler: wrapHandler('E_RECALL', async (params, signal) => {
236
- const input = RecallInputSchema.parse(params);
237
- const result = await deps.recallMemories({
230
+ title: 'Recall Memories',
231
+ description: 'Search for memories and traverse relationships to return a connected graph cluster. ' +
232
+ 'Use this for deeper context retrieval that follows knowledge graph connections.',
233
+ inputSchema: RecallInputSchema,
234
+ outputSchema: DefaultOutputSchema,
235
+ annotations: { readOnlyHint: true },
236
+ errorCode: 'E_RECALL',
237
+ run: async (input, ctx) => {
238
+ return await deps.recallMemories({
238
239
  query: input.query,
239
240
  ...(input.depth !== undefined && { depth: input.depth }),
240
- }, signal);
241
- return createSuccessResponse(result);
242
- }),
243
- },
244
- ];
245
- const buildRelationshipTools = (deps) => [
246
- {
247
- name: 'create_relationship',
248
- options: {
249
- title: 'Create Relationship',
250
- description: 'Link two memories with a typed relationship. Creates a knowledge graph edge between memories.',
251
- inputSchema: CreateRelationshipInputSchema,
252
- outputSchema: DefaultOutputSchema,
253
- annotations: { idempotentHint: true },
241
+ }, ctx.signal);
254
242
  },
255
- handler: wrapHandler('E_CREATE_RELATIONSHIP', async (params) => {
256
- const input = CreateRelationshipInputSchema.parse(params);
257
- const result = await deps.createRelationship({
243
+ }),
244
+ defineTool({
245
+ name: 'create_relationship',
246
+ title: 'Create Relationship',
247
+ description: 'Link two memories with a typed relationship. Creates a knowledge graph edge between memories.',
248
+ inputSchema: CreateRelationshipInputSchema,
249
+ outputSchema: DefaultOutputSchema,
250
+ annotations: { idempotentHint: true },
251
+ errorCode: 'E_CREATE_RELATIONSHIP',
252
+ run: async (input) => {
253
+ return await deps.createRelationship({
258
254
  from_hash: normalizeHash(input.from_hash),
259
255
  to_hash: normalizeHash(input.to_hash),
260
256
  relation_type: input.relation_type,
261
257
  });
262
- return createSuccessResponse(result);
263
- }),
264
- },
265
- {
266
- name: 'get_relationships',
267
- options: {
268
- title: 'Get Relationships',
269
- description: 'Get all relationships for a memory. Returns linked memories with relationship types.',
270
- inputSchema: GetRelationshipsInputSchema,
271
- outputSchema: DefaultOutputSchema,
272
- annotations: { readOnlyHint: true },
273
258
  },
274
- handler: wrapHandler('E_GET_RELATIONSHIPS', async (params) => {
275
- const input = GetRelationshipsInputSchema.parse(params);
276
- const result = await deps.getRelationships({
259
+ }),
260
+ defineTool({
261
+ name: 'get_relationships',
262
+ title: 'Get Relationships',
263
+ description: 'Get all relationships for a memory. Returns linked memories with relationship types.',
264
+ inputSchema: GetRelationshipsInputSchema,
265
+ outputSchema: DefaultOutputSchema,
266
+ annotations: { readOnlyHint: true },
267
+ errorCode: 'E_GET_RELATIONSHIPS',
268
+ run: async (input) => {
269
+ return await deps.getRelationships({
277
270
  hash: normalizeHash(input.hash),
278
271
  ...(input.direction !== undefined && { direction: input.direction }),
279
272
  });
280
- return createSuccessResponse(result);
281
- }),
282
- },
283
- {
284
- name: 'delete_relationship',
285
- options: {
286
- title: 'Delete Relationship',
287
- description: 'Remove a relationship between two memories.',
288
- inputSchema: DeleteRelationshipInputSchema,
289
- outputSchema: DefaultOutputSchema,
290
- annotations: { destructiveHint: true },
291
273
  },
292
- handler: wrapHandler('E_DELETE_RELATIONSHIP', async (params) => {
293
- const input = DeleteRelationshipInputSchema.parse(params);
274
+ }),
275
+ defineTool({
276
+ name: 'delete_relationship',
277
+ title: 'Delete Relationship',
278
+ description: 'Remove a relationship between two memories.',
279
+ inputSchema: DeleteRelationshipInputSchema,
280
+ outputSchema: DefaultOutputSchema,
281
+ annotations: { destructiveHint: true },
282
+ errorCode: 'E_DELETE_RELATIONSHIP',
283
+ run: async (input) => {
294
284
  const result = await deps.deleteRelationship({
295
285
  from_hash: normalizeHash(input.from_hash),
296
286
  to_hash: normalizeHash(input.to_hash),
297
287
  relation_type: input.relation_type,
298
288
  });
299
- if (result.changes === 0) {
300
- return createErrorResponse('E_NOT_FOUND', 'Relationship not found');
301
- }
302
- return createSuccessResponse({ deleted: true });
303
- }),
304
- },
305
- ];
306
- const buildStatsTools = (deps) => [
307
- {
289
+ if (result.changes === 0)
290
+ throw new ToolFailure('E_NOT_FOUND', 'Relationship not found');
291
+ return { deleted: true };
292
+ },
293
+ }),
294
+ defineTool({
308
295
  name: 'memory_stats',
309
- options: {
310
- title: 'Memory Stats',
311
- description: 'Database statistics and health',
312
- inputSchema: MemoryStatsInputSchema,
313
- outputSchema: DefaultOutputSchema,
314
- annotations: { readOnlyHint: true },
296
+ title: 'Memory Stats',
297
+ description: 'Database statistics and health',
298
+ inputSchema: MemoryStatsInputSchema,
299
+ outputSchema: DefaultOutputSchema,
300
+ annotations: { readOnlyHint: true },
301
+ errorCode: 'E_MEMORY_STATS',
302
+ run: async () => {
303
+ return await deps.getStats();
315
304
  },
316
- handler: wrapHandler('E_MEMORY_STATS', async (params) => {
317
- MemoryStatsInputSchema.parse(params);
318
- const result = await deps.getStats();
319
- return createSuccessResponse(result);
320
- }),
321
- },
322
- ];
323
- const buildTools = (deps) => [
324
- ...buildCoreTools(deps),
325
- ...buildSearchTools(deps),
326
- ...buildRelationshipTools(deps),
327
- ...buildStatsTools(deps),
305
+ }),
328
306
  ];
329
- export function registerAllTools(server, deps = defaultDeps) {
307
+ export function registerAllTools(server, localIcon, deps = defaultDeps) {
330
308
  const tools = buildTools(deps);
309
+ const iconMetadata = localIcon
310
+ ? { icons: [{ src: localIcon, mimeType: 'image/svg+xml', sizes: ['any'] }] }
311
+ : {};
331
312
  for (const tool of tools) {
332
- server.registerTool(tool.name, tool.options, tool.handler);
313
+ server.registerTool(tool.name, { ...tool.options, ...iconMetadata }, tool.handler);
333
314
  }
334
315
  }
335
- //# sourceMappingURL=tools.js.map
package/dist/types.d.ts CHANGED
@@ -74,4 +74,3 @@ export interface RecallResult {
74
74
  readonly relationships: Relationship[];
75
75
  readonly depth: number;
76
76
  }
77
- //# sourceMappingURL=types.d.ts.map
package/dist/types.js CHANGED
@@ -8,4 +8,3 @@ export const MEMORY_TYPES = [
8
8
  'error',
9
9
  'gradient',
10
10
  ];
11
- //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@j0hanz/memdb",
3
- "version": "1.2.9",
3
+ "version": "1.3.0",
4
4
  "mcpName": "io.github.j0hanz/memdb",
5
5
  "description": "A SQLite-backed MCP memory server with local workspace storage.",
6
6
  "type": "module",
@@ -18,22 +18,24 @@
18
18
  "README.md"
19
19
  ],
20
20
  "scripts": {
21
- "clean": "node -e \"require('fs').rmSync('dist', {recursive:true, force:true}); require('fs').rmSync('.tsbuildinfo', {recursive:true, force:true}); ['tsconfig.tsbuildinfo', 'tsconfig.build.tsbuildinfo', 'tsconfig.test.tsbuildinfo'].forEach(f => require('fs').rmSync(f, {force:true}))\"",
22
- "validate:instructions": "node -e \"require('fs').accessSync('src/instructions.md')\"",
23
- "build": "npm run clean && tsc -p tsconfig.json && npm run validate:instructions && npm run copy:assets && node -e \"require('fs').chmodSync('dist/index.js', '755')\"",
24
- "copy:assets": "node -e \"require('fs').mkdirSync('dist', { recursive: true }); require('fs').copyFileSync('src/instructions.md', 'dist/instructions.md')\"",
21
+ "clean": "node scripts/tasks.mjs clean",
22
+ "validate:instructions": "node scripts/tasks.mjs validate:instructions",
23
+ "build": "node scripts/tasks.mjs build",
24
+ "copy:assets": "node scripts/tasks.mjs copy:assets",
25
25
  "prepare": "npm run build",
26
- "dev": "tsx watch src/index.ts",
26
+ "dev": "tsc --watch --preserveWatchOutput",
27
+ "dev:run": "node --env-file=.env --watch dist/index.js",
27
28
  "start": "node dist/index.js",
28
- "test": "node --import tsx/esm --test --test-concurrency=1 tests/*.test.ts",
29
- "test:coverage": "node --import tsx/esm --test --experimental-test-coverage tests/*.test.ts",
30
- "test:native": "node --experimental-strip-types tests/native-compat.test.ts",
31
- "duplication": "npx --yes jscpd -k 50 -f typescript -r json -o .jscpd src",
32
- "lint": "eslint .",
33
29
  "format": "prettier --write .",
34
- "format:check": "prettier --check .",
35
- "type-check": "tsc -p tsconfig.json --noEmit",
36
- "type-check:test": "tsc -p tsconfig.test.json --noEmit",
30
+ "type-check": "node scripts/tasks.mjs type-check",
31
+ "type-check:diagnostics": "tsc --noEmit --extendedDiagnostics",
32
+ "type-check:trace": "node -e \"require('fs').rmSync('.ts-trace',{recursive:true,force:true})\" && tsc --noEmit --generateTrace .ts-trace",
33
+ "lint": "eslint .",
34
+ "lint:fix": "eslint . --fix",
35
+ "test": "node scripts/tasks.mjs test",
36
+ "test:coverage": "node scripts/tasks.mjs test --coverage",
37
+ "knip": "knip",
38
+ "knip:fix": "knip --fix",
37
39
  "inspector": "npx @modelcontextprotocol/inspector",
38
40
  "prepublishOnly": "npm run lint && npm run type-check && npm run build"
39
41
  },
@@ -52,20 +54,20 @@
52
54
  "homepage": "https://github.com/j0hanz/memdb-mcp-server#readme",
53
55
  "license": "MIT",
54
56
  "dependencies": {
55
- "@modelcontextprotocol/sdk": "^1.25.3",
57
+ "@modelcontextprotocol/sdk": "^1.26.0",
56
58
  "zod": "^4.3.6"
57
59
  },
58
60
  "devDependencies": {
59
61
  "@eslint/js": "^9.39.2",
60
62
  "@trivago/prettier-plugin-sort-imports": "^6.0.2",
61
- "@types/node": "^25.1.0",
63
+ "@types/node": "^25.2.0",
62
64
  "eslint": "^9.39.2",
63
65
  "eslint-config-prettier": "^10.1.8",
64
66
  "eslint-plugin-de-morgan": "^2.0.0",
65
67
  "eslint-plugin-depend": "^1.4.0",
66
68
  "eslint-plugin-sonarjs": "^3.0.6",
67
69
  "eslint-plugin-unused-imports": "^4.3.0",
68
- "knip": "^5.82.1",
70
+ "knip": "^5.83.0",
69
71
  "prettier": "^3.8.1",
70
72
  "tsx": "^4.21.0",
71
73
  "typescript": "^5.9.3",
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,KAAK,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAoD1C,eAAO,MAAM,MAAM;;;;CAQlB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AAInC,MAAM,eAAe,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