@vheins/local-memory-mcp 0.18.2 → 0.18.4
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.
|
@@ -81,8 +81,8 @@ function loadServerInstructions() {
|
|
|
81
81
|
// src/mcp/capabilities.ts
|
|
82
82
|
var __dirname2 = path2.dirname(fileURLToPath2(import.meta.url));
|
|
83
83
|
var pkgVersion = "0.1.0";
|
|
84
|
-
if ("0.18.
|
|
85
|
-
pkgVersion = "0.18.
|
|
84
|
+
if ("0.18.4") {
|
|
85
|
+
pkgVersion = "0.18.4";
|
|
86
86
|
} else {
|
|
87
87
|
let searchDir = __dirname2;
|
|
88
88
|
for (let i = 0; i < 5; i++) {
|
|
@@ -277,14 +277,14 @@ var MigrationManager = class {
|
|
|
277
277
|
this.db = db;
|
|
278
278
|
}
|
|
279
279
|
db;
|
|
280
|
-
run(sql) {
|
|
281
|
-
this.db.prepare(sql).run();
|
|
280
|
+
run(sql, ...params) {
|
|
281
|
+
this.db.prepare(sql).run(...params);
|
|
282
282
|
}
|
|
283
283
|
exec(sql) {
|
|
284
284
|
this.db.exec(sql);
|
|
285
285
|
}
|
|
286
|
-
all(sql) {
|
|
287
|
-
return this.db.prepare(sql).all();
|
|
286
|
+
all(sql, ...params) {
|
|
287
|
+
return this.db.prepare(sql).all(...params);
|
|
288
288
|
}
|
|
289
289
|
get(sql) {
|
|
290
290
|
return this.db.prepare(sql).get();
|
|
@@ -669,16 +669,40 @@ var MigrationManager = class {
|
|
|
669
669
|
try {
|
|
670
670
|
this.exec(`CREATE UNIQUE INDEX IF NOT EXISTS idx_tasks_code_owner_repo ON tasks(owner, repo, task_code);`);
|
|
671
671
|
} catch {
|
|
672
|
-
const dupRows = this.all(
|
|
673
|
-
|
|
674
|
-
|
|
672
|
+
const dupRows = this.all(`
|
|
673
|
+
SELECT task_code, owner, repo, COUNT(*) as cnt
|
|
674
|
+
FROM tasks
|
|
675
|
+
GROUP BY owner, repo, task_code
|
|
676
|
+
HAVING cnt > 1
|
|
677
|
+
`);
|
|
675
678
|
if (dupRows.length > 0) {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
679
|
+
console.log(`Found ${dupRows.length} duplicate task_code(s). Deduplicating...`);
|
|
680
|
+
for (const dup of dupRows) {
|
|
681
|
+
const idsToDelete = this.all(
|
|
682
|
+
`SELECT t1.id FROM tasks t1
|
|
683
|
+
WHERE t1.owner = ? AND t1.repo = ? AND t1.task_code = ?
|
|
684
|
+
AND t1.id != (
|
|
685
|
+
SELECT t2.id FROM tasks t2
|
|
686
|
+
WHERE t2.owner = ? AND t2.repo = ? AND t2.task_code = ?
|
|
687
|
+
ORDER BY t2.updated_at DESC
|
|
688
|
+
LIMIT 1
|
|
689
|
+
)`,
|
|
690
|
+
dup.owner,
|
|
691
|
+
dup.repo,
|
|
692
|
+
dup.task_code,
|
|
693
|
+
dup.owner,
|
|
694
|
+
dup.repo,
|
|
695
|
+
dup.task_code
|
|
696
|
+
);
|
|
697
|
+
for (const row of idsToDelete) {
|
|
698
|
+
this.run("DELETE FROM task_comments WHERE task_id = ?", row.id);
|
|
699
|
+
this.run("DELETE FROM tasks WHERE id = ?", row.id);
|
|
700
|
+
}
|
|
701
|
+
console.log(` Deduplicated ${dup.task_code}: kept 1, removed ${idsToDelete.length}`);
|
|
702
|
+
}
|
|
680
703
|
}
|
|
681
|
-
|
|
704
|
+
this.exec(`CREATE UNIQUE INDEX IF NOT EXISTS idx_tasks_code_owner_repo ON tasks(owner, repo, task_code);`);
|
|
705
|
+
console.log("UNIQUE INDEX on (owner, repo, task_code) created after deduplication.");
|
|
682
706
|
}
|
|
683
707
|
try {
|
|
684
708
|
this.run("UPDATE tasks SET task_code = substr(id, 1, 8) WHERE task_code IS NULL");
|
package/dist/dashboard/server.js
CHANGED
package/dist/mcp/server.js
CHANGED