@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.2") {
85
- pkgVersion = "0.18.2";
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
- "SELECT task_code, COUNT(*) as cnt FROM tasks GROUP BY owner, repo, task_code HAVING cnt > 1"
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
- const codes = dupRows.map((r) => `'${r.task_code}'`).join(", ");
677
- throw new Error(
678
- `Cannot create UNIQUE INDEX on (owner, repo, task_code): ${dupRows.length} duplicate task_code(s) found: ${codes}. Remove duplicates manually and re-run migration.`
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
- throw new Error("Could not create UNIQUE INDEX on tasks(owner, repo, task_code)");
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");
@@ -16,7 +16,7 @@ import {
16
16
  handleTaskClaim,
17
17
  listResources,
18
18
  logger
19
- } from "../chunk-AVM7ZGOJ.js";
19
+ } from "../chunk-IHDJKNX4.js";
20
20
 
21
21
  // src/dashboard/server.ts
22
22
  import express from "express";
@@ -63,7 +63,7 @@ import {
63
63
  toContextSlug,
64
64
  updateSessionFromInitialize,
65
65
  updateSessionRoots
66
- } from "../chunk-AVM7ZGOJ.js";
66
+ } from "../chunk-IHDJKNX4.js";
67
67
 
68
68
  // src/mcp/server.ts
69
69
  import readline from "readline";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vheins/local-memory-mcp",
3
- "version": "0.18.2",
3
+ "version": "0.18.3",
4
4
  "description": "MCP Local Memory Service for coding copilot agents",
5
5
  "mcpName": "io.github.vheins/local-memory-mcp",
6
6
  "type": "module",