@vheins/local-memory-mcp 0.8.20 → 0.8.21
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.
|
@@ -3,8 +3,8 @@ import { fileURLToPath } from "url";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
5
|
var pkgVersion = "0.1.0";
|
|
6
|
-
if ("0.8.
|
|
7
|
-
pkgVersion = "0.8.
|
|
6
|
+
if ("0.8.21") {
|
|
7
|
+
pkgVersion = "0.8.21";
|
|
8
8
|
} else {
|
|
9
9
|
let searchDir = __dirname;
|
|
10
10
|
for (let i = 0; i < 5; i++) {
|
package/dist/dashboard/server.js
CHANGED
package/dist/mcp/server.js
CHANGED
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
setLogLevel,
|
|
44
44
|
updateSessionFromInitialize,
|
|
45
45
|
updateSessionRoots
|
|
46
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-KZGXPYG7.js";
|
|
47
47
|
|
|
48
48
|
// src/mcp/server.ts
|
|
49
49
|
import readline from "readline";
|
|
@@ -192,14 +192,6 @@ var McpContentSchema = z.discriminatedUnion("type", [
|
|
|
192
192
|
mimeType: z.string(),
|
|
193
193
|
annotations: McpAnnotationsSchema
|
|
194
194
|
}),
|
|
195
|
-
z.object({
|
|
196
|
-
type: z.literal("resource_link"),
|
|
197
|
-
uri: z.string(),
|
|
198
|
-
name: z.string(),
|
|
199
|
-
description: z.string().optional(),
|
|
200
|
-
mimeType: z.string().optional(),
|
|
201
|
-
annotations: McpAnnotationsSchema
|
|
202
|
-
}),
|
|
203
195
|
z.object({
|
|
204
196
|
type: z.literal("resource"),
|
|
205
197
|
resource: z.object({
|
|
@@ -212,7 +204,6 @@ var McpContentSchema = z.discriminatedUnion("type", [
|
|
|
212
204
|
]);
|
|
213
205
|
function createMcpResponse(data, summary, options) {
|
|
214
206
|
const {
|
|
215
|
-
resourceLinks,
|
|
216
207
|
structuredContentPathHint,
|
|
217
208
|
contentSummary,
|
|
218
209
|
includeSerializedStructuredContent = false
|
|
@@ -252,15 +243,6 @@ function createMcpResponse(data, summary, options) {
|
|
|
252
243
|
text: `${summary.trim()} ${pointerText}`
|
|
253
244
|
});
|
|
254
245
|
}
|
|
255
|
-
for (const link of resourceLinks || []) {
|
|
256
|
-
content.push({
|
|
257
|
-
type: "resource_link",
|
|
258
|
-
uri: link.uri,
|
|
259
|
-
name: link.name,
|
|
260
|
-
mimeType: link.mimeType,
|
|
261
|
-
annotations: link.annotations
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
246
|
const response = {
|
|
265
247
|
structuredContent: finalData,
|
|
266
248
|
isError: false
|
|
@@ -412,30 +394,7 @@ async function handleMemoryStore(params, db2, vectors2) {
|
|
|
412
394
|
{
|
|
413
395
|
contentSummary: `Stored [${entry.code}] "${entry.title}" in repo "${entry.scope.repo}".`,
|
|
414
396
|
structuredContentPathHint: "code",
|
|
415
|
-
includeSerializedStructuredContent: validated.structured
|
|
416
|
-
resourceLinks: [
|
|
417
|
-
{
|
|
418
|
-
uri: `memory://${entry.id}`,
|
|
419
|
-
name: entry.title,
|
|
420
|
-
description: `Stored memory [${entry.code}] in repo ${entry.scope.repo}`,
|
|
421
|
-
mimeType: "application/json",
|
|
422
|
-
annotations: {
|
|
423
|
-
audience: ["assistant"],
|
|
424
|
-
priority: 0.9,
|
|
425
|
-
lastModified: entry.updated_at
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
uri: `repository://${encodeURIComponent(entry.scope.repo)}/memories`,
|
|
430
|
-
name: `Memory Index (${entry.scope.repo})`,
|
|
431
|
-
description: "Repository memory index",
|
|
432
|
-
mimeType: "application/json",
|
|
433
|
-
annotations: {
|
|
434
|
-
audience: ["assistant"],
|
|
435
|
-
priority: 0.6
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
]
|
|
397
|
+
includeSerializedStructuredContent: validated.structured
|
|
439
398
|
}
|
|
440
399
|
);
|
|
441
400
|
}
|
|
@@ -491,19 +450,7 @@ async function handleMemoryUpdate(params, db2, vectors2) {
|
|
|
491
450
|
`Updated memory ${validated.id} in repo "${existing.scope.repo}". Fields: ${Object.keys(updates).join(", ") || "none"}.`,
|
|
492
451
|
{
|
|
493
452
|
structuredContentPathHint: "updatedFields",
|
|
494
|
-
includeSerializedStructuredContent: validated.structured
|
|
495
|
-
resourceLinks: [
|
|
496
|
-
{
|
|
497
|
-
uri: `memory://${validated.id}`,
|
|
498
|
-
name: existing.title || validated.id,
|
|
499
|
-
description: `Updated memory [${existing.code}] in repo ${existing.scope.repo}`,
|
|
500
|
-
mimeType: "application/json",
|
|
501
|
-
annotations: {
|
|
502
|
-
audience: ["assistant"],
|
|
503
|
-
priority: 0.9
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
]
|
|
453
|
+
includeSerializedStructuredContent: validated.structured
|
|
507
454
|
}
|
|
508
455
|
);
|
|
509
456
|
}
|
|
@@ -943,19 +890,7 @@ async function handleTaskList(args, storage) {
|
|
|
943
890
|
}
|
|
944
891
|
return createMcpResponse(structuredData, contentSummary || "", {
|
|
945
892
|
contentSummary,
|
|
946
|
-
includeSerializedStructuredContent: isStructuredRequest
|
|
947
|
-
resourceLinks: [
|
|
948
|
-
{
|
|
949
|
-
uri: `repository://${encodeURIComponent(repo)}/tasks`,
|
|
950
|
-
name: `Task Index (${repo})`,
|
|
951
|
-
description: `Repository task index for ${repo}`,
|
|
952
|
-
mimeType: "application/json",
|
|
953
|
-
annotations: {
|
|
954
|
-
audience: ["assistant"],
|
|
955
|
-
priority: 0.6
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
]
|
|
893
|
+
includeSerializedStructuredContent: isStructuredRequest
|
|
959
894
|
});
|
|
960
895
|
}
|
|
961
896
|
async function handleTaskCreate(args, storage) {
|
|
@@ -1024,43 +959,10 @@ async function handleTaskCreate(args, storage) {
|
|
|
1024
959
|
createdTasks.push(task2.task_code);
|
|
1025
960
|
task2._temp_id = task2.id;
|
|
1026
961
|
}
|
|
1027
|
-
const resourceLinks = bulkTasks.slice(0, 10).map((t) => {
|
|
1028
|
-
const taskCode = t.task_code;
|
|
1029
|
-
const taskId2 = t._temp_id;
|
|
1030
|
-
return {
|
|
1031
|
-
uri: `task://${taskId2}`,
|
|
1032
|
-
name: `Task [${taskCode}]`,
|
|
1033
|
-
description: `Created task [${taskCode}] in repo ${repo}`,
|
|
1034
|
-
mimeType: "application/json",
|
|
1035
|
-
annotations: {
|
|
1036
|
-
audience: ["assistant"],
|
|
1037
|
-
priority: 0.9
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
});
|
|
1041
|
-
resourceLinks.push({
|
|
1042
|
-
uri: `repository://${encodeURIComponent(repo)}/tasks`,
|
|
1043
|
-
name: `Task Index (${repo})`,
|
|
1044
|
-
description: `Repository task index for ${repo}`,
|
|
1045
|
-
mimeType: "application/json",
|
|
1046
|
-
annotations: {
|
|
1047
|
-
audience: ["assistant"],
|
|
1048
|
-
priority: 0.6
|
|
1049
|
-
}
|
|
1050
|
-
});
|
|
1051
962
|
return createMcpResponse(
|
|
1052
963
|
{ success: true, repo, createdCount: bulkTasks.length, taskCodes: createdTasks },
|
|
1053
964
|
`Created ${bulkTasks.length} tasks in repo "${repo}".`,
|
|
1054
|
-
{
|
|
1055
|
-
includeSerializedStructuredContent: parsed.structured || false,
|
|
1056
|
-
resourceLinks: resourceLinks.map((link) => ({
|
|
1057
|
-
...link,
|
|
1058
|
-
annotations: {
|
|
1059
|
-
...link.annotations,
|
|
1060
|
-
audience: link.annotations.audience
|
|
1061
|
-
}
|
|
1062
|
-
}))
|
|
1063
|
-
}
|
|
965
|
+
{ includeSerializedStructuredContent: parsed.structured || false }
|
|
1064
966
|
);
|
|
1065
967
|
}
|
|
1066
968
|
const {
|
|
@@ -1138,31 +1040,7 @@ async function handleTaskCreate(args, storage) {
|
|
|
1138
1040
|
depends_on: task.depends_on
|
|
1139
1041
|
},
|
|
1140
1042
|
`Created task [${task.task_code}] ${task.title} in repo "${task.repo}" with status "${task.status}".`,
|
|
1141
|
-
{
|
|
1142
|
-
includeSerializedStructuredContent: parsed.structured || false,
|
|
1143
|
-
resourceLinks: [
|
|
1144
|
-
{
|
|
1145
|
-
uri: `task://${task.id}`,
|
|
1146
|
-
name: `Task [${task.task_code}]`,
|
|
1147
|
-
description: `Created task [${task.task_code}] in repo ${task.repo}`,
|
|
1148
|
-
mimeType: "application/json",
|
|
1149
|
-
annotations: {
|
|
1150
|
-
audience: ["assistant"],
|
|
1151
|
-
priority: 0.9
|
|
1152
|
-
}
|
|
1153
|
-
},
|
|
1154
|
-
{
|
|
1155
|
-
uri: `repository://${encodeURIComponent(task.repo)}/tasks`,
|
|
1156
|
-
name: `Task Index (${task.repo})`,
|
|
1157
|
-
description: `Repository task index for ${task.repo}`,
|
|
1158
|
-
mimeType: "application/json",
|
|
1159
|
-
annotations: {
|
|
1160
|
-
audience: ["assistant"],
|
|
1161
|
-
priority: 0.6
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
]
|
|
1165
|
-
}
|
|
1043
|
+
{ includeSerializedStructuredContent: parsed.structured || false }
|
|
1166
1044
|
);
|
|
1167
1045
|
}
|
|
1168
1046
|
async function handleTaskCreateInteractive(args, storage, options = {}) {
|
|
@@ -1344,26 +1222,6 @@ async function handleTaskUpdate(args, storage, vectors2) {
|
|
|
1344
1222
|
updatedTasks.push({ id: targetId, code: updates.task_code || existingTask.task_code });
|
|
1345
1223
|
updatedCount++;
|
|
1346
1224
|
}
|
|
1347
|
-
const resourceLinks = updatedTasks.slice(0, 10).map((t) => ({
|
|
1348
|
-
uri: `task://${t.id}`,
|
|
1349
|
-
name: `Task [${t.code}]`,
|
|
1350
|
-
description: `Updated task [${t.code}] in repo ${repo}`,
|
|
1351
|
-
mimeType: "application/json",
|
|
1352
|
-
annotations: {
|
|
1353
|
-
audience: ["assistant"],
|
|
1354
|
-
priority: 0.9
|
|
1355
|
-
}
|
|
1356
|
-
}));
|
|
1357
|
-
resourceLinks.push({
|
|
1358
|
-
uri: `repository://${encodeURIComponent(repo)}/tasks`,
|
|
1359
|
-
name: `Task Index (${repo})`,
|
|
1360
|
-
description: `Repository task index for ${repo}`,
|
|
1361
|
-
mimeType: "application/json",
|
|
1362
|
-
annotations: {
|
|
1363
|
-
audience: ["assistant"],
|
|
1364
|
-
priority: 0.6
|
|
1365
|
-
}
|
|
1366
|
-
});
|
|
1367
1225
|
const isCompleted = updates.status === "completed" && updatedCount > 0;
|
|
1368
1226
|
const summaryText = isCompleted ? `Updated ${updatedCount} task(s) in repo "${repo}". \u2705 Task marked as completed \u2014 don't forget to commit your changes!` : `Updated ${updatedCount} task(s) in repo "${repo}".`;
|
|
1369
1227
|
const response = createMcpResponse(
|
|
@@ -1377,16 +1235,7 @@ async function handleTaskUpdate(args, storage, vectors2) {
|
|
|
1377
1235
|
updatedFields: Object.keys(updates)
|
|
1378
1236
|
},
|
|
1379
1237
|
summaryText,
|
|
1380
|
-
{
|
|
1381
|
-
includeSerializedStructuredContent: updateData.structured,
|
|
1382
|
-
resourceLinks: resourceLinks.map((link) => ({
|
|
1383
|
-
...link,
|
|
1384
|
-
annotations: {
|
|
1385
|
-
...link.annotations,
|
|
1386
|
-
audience: link.annotations.audience
|
|
1387
|
-
}
|
|
1388
|
-
}))
|
|
1389
|
-
}
|
|
1238
|
+
{ includeSerializedStructuredContent: updateData.structured }
|
|
1390
1239
|
);
|
|
1391
1240
|
if (completedTaskIds.length > 0) {
|
|
1392
1241
|
setImmediate(async () => {
|
|
@@ -1420,21 +1269,7 @@ async function handleTaskDelete(args, storage) {
|
|
|
1420
1269
|
deletedCount: targetIds.length
|
|
1421
1270
|
},
|
|
1422
1271
|
`Deleted ${targetIds.length} task(s) from repo "${repo}".`,
|
|
1423
|
-
{
|
|
1424
|
-
includeSerializedStructuredContent: validated.structured,
|
|
1425
|
-
resourceLinks: [
|
|
1426
|
-
{
|
|
1427
|
-
uri: `repository://${encodeURIComponent(repo)}/tasks`,
|
|
1428
|
-
name: `Task Index (${repo})`,
|
|
1429
|
-
description: `Repository task index for ${repo}`,
|
|
1430
|
-
mimeType: "application/json",
|
|
1431
|
-
annotations: {
|
|
1432
|
-
audience: ["assistant"],
|
|
1433
|
-
priority: 0.6
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
]
|
|
1437
|
-
}
|
|
1272
|
+
{ includeSerializedStructuredContent: validated.structured }
|
|
1438
1273
|
);
|
|
1439
1274
|
}
|
|
1440
1275
|
|
|
@@ -1714,19 +1549,7 @@ async function handleMemoryDelete(params, db2, vectors2, onProgress) {
|
|
|
1714
1549
|
`Deleted ${deletedCount} memory entry(ies) from repo "${lastRepo}".`,
|
|
1715
1550
|
{
|
|
1716
1551
|
structuredContentPathHint: "deletedCount",
|
|
1717
|
-
includeSerializedStructuredContent: structured
|
|
1718
|
-
resourceLinks: [
|
|
1719
|
-
{
|
|
1720
|
-
uri: `repository://${encodeURIComponent(lastRepo)}/memories`,
|
|
1721
|
-
name: `Memory Index (${lastRepo})`,
|
|
1722
|
-
description: "Repository memory index after deletion",
|
|
1723
|
-
mimeType: "application/json",
|
|
1724
|
-
annotations: {
|
|
1725
|
-
audience: ["assistant"],
|
|
1726
|
-
priority: 0.5
|
|
1727
|
-
}
|
|
1728
|
-
}
|
|
1729
|
-
]
|
|
1552
|
+
includeSerializedStructuredContent: structured
|
|
1730
1553
|
}
|
|
1731
1554
|
);
|
|
1732
1555
|
}
|