@vheins/local-memory-mcp 0.9.14 → 0.9.16

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.9.14") {
7
- pkgVersion = "0.9.14";
6
+ if ("0.9.16") {
7
+ pkgVersion = "0.9.16";
8
8
  } else {
9
9
  let searchDir = __dirname;
10
10
  for (let i = 0; i < 5; i++) {
@@ -1949,7 +1949,10 @@ var TaskEntity = class extends BaseEntity {
1949
1949
  dateFilter = "1=1";
1950
1950
  }
1951
1951
  const createdDateFilter = dateFilter.replace("COALESCE(finished_at, created_at)", "created_at");
1952
- const completedDateFilter = dateFilter.replace("COALESCE(finished_at, created_at)", "COALESCE(finished_at, updated_at)");
1952
+ const completedDateFilter = dateFilter.replace(
1953
+ "COALESCE(finished_at, created_at)",
1954
+ "COALESCE(finished_at, updated_at)"
1955
+ );
1953
1956
  const createdRepoFilter = repo ? "repo = ? AND " : "";
1954
1957
  const completedRepoFilter = repo ? "repo = ? AND " : "";
1955
1958
  const query = `
@@ -2189,8 +2192,12 @@ var SystemEntity = class extends BaseEntity {
2189
2192
  "SELECT COUNT(*) as count FROM memories WHERE expires_at IS NOT NULL AND expires_at > ? AND expires_at <= ?",
2190
2193
  [(/* @__PURE__ */ new Date()).toISOString(), new Date(Date.now() + 7 * 86400 * 1e3).toISOString()]
2191
2194
  );
2192
- const typeStats = this.all("SELECT type, COUNT(*) as count FROM memories GROUP BY type");
2193
- const taskRows = this.all("SELECT status, COUNT(*) as count FROM tasks GROUP BY status");
2195
+ const typeStats = this.all(
2196
+ "SELECT type, COUNT(*) as count FROM memories GROUP BY type"
2197
+ );
2198
+ const taskRows = this.all(
2199
+ "SELECT status, COUNT(*) as count FROM tasks GROUP BY status"
2200
+ );
2194
2201
  const repos = this.listRepoNavigation().sort((a, b) => {
2195
2202
  const pressureA = a.blockedCount * 5 + a.inProgressCount * 3 + a.pendingCount * 2 + a.pendingHandoffs * 2 + a.activeClaims;
2196
2203
  const pressureB = b.blockedCount * 5 + b.inProgressCount * 3 + b.pendingCount * 2 + b.pendingHandoffs * 2 + b.activeClaims;
@@ -2227,7 +2234,9 @@ var SystemEntity = class extends BaseEntity {
2227
2234
  byType,
2228
2235
  taskStats: this.buildTaskStats(taskRows),
2229
2236
  repoCount: repos.length,
2230
- activeRepoCount: repos.filter((repo) => repo.inProgressCount > 0 || repo.pendingCount > 0 || repo.blockedCount > 0).length,
2237
+ activeRepoCount: repos.filter(
2238
+ (repo) => repo.inProgressCount > 0 || repo.pendingCount > 0 || repo.blockedCount > 0
2239
+ ).length,
2231
2240
  coordination: {
2232
2241
  activeClaims: activeClaimsRow?.count ?? 0,
2233
2242
  agentsClaiming: agentsClaimingRow?.count ?? 0,
@@ -2428,10 +2437,7 @@ var StandardEntity = class extends BaseEntity {
2428
2437
  getByIds(ids) {
2429
2438
  if (ids.length === 0) return [];
2430
2439
  const placeholders = ids.map(() => "?").join(",");
2431
- const rows = this.all(
2432
- `SELECT * FROM coding_standards WHERE id IN (${placeholders})`,
2433
- ids
2434
- );
2440
+ const rows = this.all(`SELECT * FROM coding_standards WHERE id IN (${placeholders})`, ids);
2435
2441
  return rows.map((row) => this.rowToEntry(row));
2436
2442
  }
2437
2443
  update(id, updates) {
@@ -2599,7 +2605,9 @@ var HandoffEntity = class extends BaseEntity {
2599
2605
  `SELECT h.*, t.task_code
2600
2606
  FROM handoffs h
2601
2607
  LEFT JOIN tasks t ON h.task_id = t.id
2602
- WHERE ${conditions.map((condition) => condition.replace(/\brepo\b/g, "h.repo").replace(/\bstatus\b/g, "h.status").replace(/\bto_agent\b/g, "h.to_agent").replace(/\bfrom_agent\b/g, "h.from_agent")).join(" AND ")}
2608
+ WHERE ${conditions.map(
2609
+ (condition) => condition.replace(/\brepo\b/g, "h.repo").replace(/\bstatus\b/g, "h.status").replace(/\bto_agent\b/g, "h.to_agent").replace(/\bfrom_agent\b/g, "h.from_agent")
2610
+ ).join(" AND ")}
2603
2611
  ORDER BY h.created_at DESC LIMIT ? OFFSET ?`,
2604
2612
  values
2605
2613
  );
@@ -2624,19 +2632,17 @@ var HandoffEntity = class extends BaseEntity {
2624
2632
  return result.changes > 0;
2625
2633
  }
2626
2634
  updatePendingHandoffsForTask(task_id, status) {
2627
- const result = this.run(
2628
- "UPDATE handoffs SET status = ?, updated_at = ? WHERE task_id = ? AND status = 'pending'",
2629
- [status, (/* @__PURE__ */ new Date()).toISOString(), task_id]
2630
- );
2635
+ const result = this.run("UPDATE handoffs SET status = ?, updated_at = ? WHERE task_id = ? AND status = 'pending'", [
2636
+ status,
2637
+ (/* @__PURE__ */ new Date()).toISOString(),
2638
+ task_id
2639
+ ]);
2631
2640
  return result.changes;
2632
2641
  }
2633
2642
  claimTask(params) {
2634
2643
  const now = (/* @__PURE__ */ new Date()).toISOString();
2635
2644
  const id = randomUUID();
2636
- this.run(
2637
- "UPDATE claims SET released_at = ? WHERE task_id = ? AND released_at IS NULL",
2638
- [now, params.task_id]
2639
- );
2645
+ this.run("UPDATE claims SET released_at = ? WHERE task_id = ? AND released_at IS NULL", [now, params.task_id]);
2640
2646
  this.run(
2641
2647
  `INSERT INTO claims (id, repo, task_id, agent, role, claimed_at, released_at, metadata)
2642
2648
  VALUES (?, ?, ?, ?, ?, ?, NULL, ?)`,
@@ -2706,7 +2712,9 @@ var HandoffEntity = class extends BaseEntity {
2706
2712
  `SELECT c.*, t.task_code
2707
2713
  FROM claims c
2708
2714
  LEFT JOIN tasks t ON c.task_id = t.id
2709
- WHERE ${conditions.map((condition) => condition.replace(/\brepo\b/g, "c.repo").replace(/\bagent\b/g, "c.agent").replace(/released_at/g, "c.released_at")).join(" AND ")}
2715
+ WHERE ${conditions.map(
2716
+ (condition) => condition.replace(/\brepo\b/g, "c.repo").replace(/\bagent\b/g, "c.agent").replace(/released_at/g, "c.released_at")
2717
+ ).join(" AND ")}
2710
2718
  ORDER BY c.claimed_at DESC LIMIT ? OFFSET ?`,
2711
2719
  values
2712
2720
  );
@@ -3117,13 +3125,7 @@ var MemoryScopeSchema = z.object({
3117
3125
  folder: z.string().optional(),
3118
3126
  language: z.string().optional()
3119
3127
  });
3120
- var MemoryTypeSchema = z.enum([
3121
- "code_fact",
3122
- "decision",
3123
- "mistake",
3124
- "pattern",
3125
- "task_archive"
3126
- ]);
3128
+ var MemoryTypeSchema = z.enum(["code_fact", "decision", "mistake", "pattern", "task_archive"]);
3127
3129
  var MemoryStoreSchema = z.object({
3128
3130
  code: z.string().max(20).optional(),
3129
3131
  type: MemoryTypeSchema,
@@ -3355,9 +3357,12 @@ var HandoffCreateSchema = z.object({
3355
3357
  structured: z.boolean().default(false)
3356
3358
  }).refine((data) => !(data.task_id && data.task_code), {
3357
3359
  message: "Provide either task_id or task_code, not both"
3358
- }).refine((data) => data.to_agent || data.task_id || data.task_code || data.context?.next_steps || data.context?.blockers || data.context?.remaining_work, {
3359
- message: "Handoffs must identify a target agent, linked task, next_steps, blockers, or remaining_work. Do not create pending handoffs for completed-work summaries."
3360
- });
3360
+ }).refine(
3361
+ (data) => data.to_agent || data.task_id || data.task_code || data.context?.next_steps || data.context?.blockers || data.context?.remaining_work,
3362
+ {
3363
+ message: "Handoffs must identify a target agent, linked task, next_steps, blockers, or remaining_work. Do not create pending handoffs for completed-work summaries."
3364
+ }
3365
+ );
3361
3366
  var HandoffUpdateSchema = z.object({
3362
3367
  id: z.string().uuid(),
3363
3368
  status: HandoffStatusSchema,
@@ -3530,7 +3535,13 @@ var TOOL_DEFINITIONS = [
3530
3535
  title: { type: "string", minLength: 3, maxLength: 100 },
3531
3536
  description: { type: "string", minLength: 1 },
3532
3537
  status: { type: "string", enum: ["backlog", "pending"], default: "backlog" },
3533
- priority: { type: "number", minimum: 1, maximum: 5, default: 3, description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical." },
3538
+ priority: {
3539
+ type: "number",
3540
+ minimum: 1,
3541
+ maximum: 5,
3542
+ default: 3,
3543
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
3544
+ },
3534
3545
  agent: { type: "string" },
3535
3546
  role: { type: "string" },
3536
3547
  doc_path: { type: "string" },
@@ -3610,13 +3621,7 @@ var TOOL_DEFINITIONS = [
3610
3621
  properties: {
3611
3622
  type: {
3612
3623
  type: "string",
3613
- enum: [
3614
- "code_fact",
3615
- "decision",
3616
- "mistake",
3617
- "pattern",
3618
- "task_archive"
3619
- ],
3624
+ enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"],
3620
3625
  description: "Type of durable knowledge being stored. Coordination types such as file_claim are intentionally unsupported."
3621
3626
  },
3622
3627
  title: {
@@ -3673,7 +3678,11 @@ var TOOL_DEFINITIONS = [
3673
3678
  },
3674
3679
  ttlDays: { type: "number", minimum: 1 },
3675
3680
  supersedes: { type: "string", format: "uuid" },
3676
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON of the stored memory." }
3681
+ structured: {
3682
+ type: "boolean",
3683
+ default: false,
3684
+ description: "If true, returns structured JSON of the stored memory."
3685
+ }
3677
3686
  },
3678
3687
  required: ["type", "title", "content", "importance", "scope", "agent", "model"]
3679
3688
  },
@@ -3737,13 +3746,7 @@ var TOOL_DEFINITIONS = [
3737
3746
  id: { type: "string", format: "uuid" },
3738
3747
  type: {
3739
3748
  type: "string",
3740
- enum: [
3741
- "code_fact",
3742
- "decision",
3743
- "mistake",
3744
- "pattern",
3745
- "task_archive"
3746
- ]
3749
+ enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"]
3747
3750
  },
3748
3751
  title: { type: "string", minLength: 3, maxLength: 100 },
3749
3752
  content: { type: "string", minLength: 10 },
@@ -3756,7 +3759,11 @@ var TOOL_DEFINITIONS = [
3756
3759
  metadata: { type: "object" },
3757
3760
  is_global: { type: "boolean" },
3758
3761
  completed_at: { type: "string" },
3759
- structured: { type: "boolean", default: false, description: "If true, returns structured JSON of the updated memory." }
3762
+ structured: {
3763
+ type: "boolean",
3764
+ default: false,
3765
+ description: "If true, returns structured JSON of the updated memory."
3766
+ }
3760
3767
  },
3761
3768
  required: ["id"]
3762
3769
  },
@@ -3798,13 +3805,7 @@ var TOOL_DEFINITIONS = [
3798
3805
  type: "array",
3799
3806
  items: {
3800
3807
  type: "string",
3801
- enum: [
3802
- "code_fact",
3803
- "decision",
3804
- "mistake",
3805
- "pattern",
3806
- "task_archive"
3807
- ]
3808
+ enum: ["code_fact", "decision", "mistake", "pattern", "task_archive"]
3808
3809
  }
3809
3810
  },
3810
3811
  minImportance: { type: "number", minimum: 1, maximum: 5 },
@@ -4066,7 +4067,13 @@ var TOOL_DEFINITIONS = [
4066
4067
  default: "backlog",
4067
4068
  description: "New tasks MUST start in 'backlog' if there are already 10 pending tasks. Otherwise can start in 'pending'."
4068
4069
  },
4069
- priority: { type: "number", minimum: 1, maximum: 5, default: 3, description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical." },
4070
+ priority: {
4071
+ type: "number",
4072
+ minimum: 1,
4073
+ maximum: 5,
4074
+ default: 3,
4075
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4076
+ },
4070
4077
  agent: { type: "string" },
4071
4078
  role: { type: "string" },
4072
4079
  doc_path: { type: "string" },
@@ -4085,7 +4092,13 @@ var TOOL_DEFINITIONS = [
4085
4092
  title: { type: "string", minLength: 3, maxLength: 100 },
4086
4093
  description: { type: "string" },
4087
4094
  status: { type: "string", enum: ["backlog", "pending"], default: "backlog" },
4088
- priority: { type: "number", minimum: 1, maximum: 5, default: 3, description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical." },
4095
+ priority: {
4096
+ type: "number",
4097
+ minimum: 1,
4098
+ maximum: 5,
4099
+ default: 3,
4100
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4101
+ },
4089
4102
  agent: { type: "string" },
4090
4103
  role: { type: "string" },
4091
4104
  doc_path: { type: "string" },
@@ -4144,7 +4157,12 @@ var TOOL_DEFINITIONS = [
4144
4157
  enum: ["backlog", "pending", "in_progress", "completed", "canceled", "blocked"],
4145
4158
  description: "New status. Transitions from 'backlog', 'pending' or 'blocked' to 'completed' are NOT allowed."
4146
4159
  },
4147
- priority: { type: "number", minimum: 1, maximum: 5, description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical." },
4160
+ priority: {
4161
+ type: "number",
4162
+ minimum: 1,
4163
+ maximum: 5,
4164
+ description: "Task priority where 1=Low, 2=Normal, 3=Medium, 4=High, 5=Critical."
4165
+ },
4148
4166
  agent: { type: "string" },
4149
4167
  role: { type: "string" },
4150
4168
  model: { type: "string" },
@@ -4433,7 +4451,11 @@ var TOOL_DEFINITIONS = [
4433
4451
  type: "object",
4434
4452
  properties: {
4435
4453
  repo: { type: "string", description: "Repository name" },
4436
- task_id: { type: "string", format: "uuid", description: "Task id to claim. Optional if task_code is provided." },
4454
+ task_id: {
4455
+ type: "string",
4456
+ format: "uuid",
4457
+ description: "Task id to claim. Optional if task_code is provided."
4458
+ },
4437
4459
  task_code: { type: "string", description: "Task code to claim. Optional if task_id is provided." },
4438
4460
  agent: { type: "string", description: "Claiming agent name" },
4439
4461
  role: { type: "string", description: "Claiming agent role" },
@@ -4520,7 +4542,11 @@ var TOOL_DEFINITIONS = [
4520
4542
  type: "object",
4521
4543
  properties: {
4522
4544
  repo: { type: "string", description: "Repository name" },
4523
- task_id: { type: "string", format: "uuid", description: "Task id to release. Optional if task_code is provided." },
4545
+ task_id: {
4546
+ type: "string",
4547
+ format: "uuid",
4548
+ description: "Task id to release. Optional if task_code is provided."
4549
+ },
4524
4550
  task_code: { type: "string", description: "Task code to release. Optional if task_id is provided." },
4525
4551
  agent: { type: "string", description: "Optional agent name to release only that claim" },
4526
4552
  structured: { type: "boolean", default: false }
@@ -4553,8 +4579,16 @@ var TOOL_DEFINITIONS = [
4553
4579
  type: "object",
4554
4580
  properties: {
4555
4581
  name: { type: "string", minLength: 3, maxLength: 255, description: "Human-readable standard name" },
4556
- content: { type: "string", minLength: 10, description: "One atomic, actionable standard written as concise Markdown" },
4557
- parent_id: { type: "string", format: "uuid", description: "Optional parent standard ID when this rule is a child/specialization." },
4582
+ content: {
4583
+ type: "string",
4584
+ minLength: 10,
4585
+ description: "One atomic, actionable standard written as concise Markdown"
4586
+ },
4587
+ parent_id: {
4588
+ type: "string",
4589
+ format: "uuid",
4590
+ description: "Optional parent standard ID when this rule is a child/specialization."
4591
+ },
4558
4592
  context: { type: "string", description: "Context or category (e.g., 'error-handling', 'security')" },
4559
4593
  version: { type: "string", description: "Version of the standard (e.g., '1.0.0')" },
4560
4594
  language: { type: "string", description: "Programming language (e.g., 'typescript', 'python')" },
@@ -4563,7 +4597,10 @@ var TOOL_DEFINITIONS = [
4563
4597
  items: { type: "string" },
4564
4598
  description: "Technology stack (e.g., ['react', 'nextjs'])"
4565
4599
  },
4566
- repo: { type: "string", description: "Repository name for repo-specific standards. Omit only for global standards." },
4600
+ repo: {
4601
+ type: "string",
4602
+ description: "Repository name for repo-specific standards. Omit only for global standards."
4603
+ },
4567
4604
  is_global: { type: "boolean", description: "Whether standard applies globally or repo-specific" },
4568
4605
  tags: {
4569
4606
  type: "array",