@vheins/local-memory-mcp 0.18.2 → 0.18.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.
|
@@ -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.3") {
|
|
85
|
+
pkgVersion = "0.18.3";
|
|
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,33 @@ 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 rowsToDelete = this.all(
|
|
682
|
+
`SELECT id FROM tasks
|
|
683
|
+
WHERE owner = ? AND repo = ? AND task_code = ?
|
|
684
|
+
ORDER BY updated_at DESC
|
|
685
|
+
OFFSET 1`,
|
|
686
|
+
dup.owner,
|
|
687
|
+
dup.repo,
|
|
688
|
+
dup.task_code
|
|
689
|
+
);
|
|
690
|
+
for (const row of rowsToDelete) {
|
|
691
|
+
this.run("DELETE FROM task_comments WHERE task_id = ?", row.id);
|
|
692
|
+
this.run("DELETE FROM tasks WHERE id = ?", row.id);
|
|
693
|
+
}
|
|
694
|
+
console.log(` Deduplicated ${dup.task_code}: kept 1, removed ${rowsToDelete.length}`);
|
|
695
|
+
}
|
|
680
696
|
}
|
|
681
|
-
|
|
697
|
+
this.exec(`CREATE UNIQUE INDEX IF NOT EXISTS idx_tasks_code_owner_repo ON tasks(owner, repo, task_code);`);
|
|
698
|
+
console.log("UNIQUE INDEX on (owner, repo, task_code) created after deduplication.");
|
|
682
699
|
}
|
|
683
700
|
try {
|
|
684
701
|
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