@vheins/local-memory-mcp 0.18.5 → 0.18.7

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.5") {
85
- pkgVersion = "0.18.5";
84
+ if ("0.18.7") {
85
+ pkgVersion = "0.18.7";
86
86
  } else {
87
87
  let searchDir = __dirname2;
88
88
  for (let i = 0; i < 5; i++) {
@@ -1388,8 +1388,9 @@ var MemoryEntity = class extends BaseEntity {
1388
1388
  }
1389
1389
  searchByRepo(owner, repo, query = "", type, limit = 5) {
1390
1390
  const now = (/* @__PURE__ */ new Date()).toISOString();
1391
- let sql = "SELECT * FROM memories WHERE owner = ? AND repo = ? AND (content LIKE ? OR title LIKE ? OR tags LIKE ?) AND status = 'active' AND (expires_at IS NULL OR expires_at > ?)";
1392
- const params = [owner, repo, `%${query}%`, `%${query}%`, `%${query}%`, now];
1391
+ const ownerClause = owner ? "owner = ? AND " : "";
1392
+ let sql = `SELECT * FROM memories WHERE ${ownerClause}repo = ? AND (content LIKE ? OR title LIKE ? OR tags LIKE ?) AND status = 'active' AND (expires_at IS NULL OR expires_at > ?)`;
1393
+ const params = owner ? [owner, repo, `%${query}%`, `%${query}%`, `%${query}%`, now] : [repo, `%${query}%`, `%${query}%`, `%${query}%`, now];
1393
1394
  if (type) {
1394
1395
  sql += " AND type = ?";
1395
1396
  params.push(type);
@@ -1493,8 +1494,9 @@ var MemoryEntity = class extends BaseEntity {
1493
1494
  });
1494
1495
  }
1495
1496
  getRecentMemories(owner, repo, limit, offset = 0, includeArchived = false, excludeTypes = [], sortOrder = "DESC") {
1496
- let query = "SELECT * FROM memories WHERE owner = ? AND repo = ?";
1497
- const params = [owner, repo];
1497
+ const ownerClause = owner ? "owner = ? AND " : "";
1498
+ let query = `SELECT * FROM memories WHERE ${ownerClause}repo = ?`;
1499
+ const params = owner ? [owner, repo] : [repo];
1498
1500
  if (!includeArchived) {
1499
1501
  query += " AND status = 'active'";
1500
1502
  }
@@ -1508,8 +1510,9 @@ var MemoryEntity = class extends BaseEntity {
1508
1510
  return rows.map((row) => this.rowToMemoryEntry(row));
1509
1511
  }
1510
1512
  getTotalCount(owner, repo, includeArchived = false, excludeTypes = []) {
1511
- let sql = "SELECT COUNT(*) as count FROM memories WHERE owner = ? AND repo = ?";
1512
- const params = [owner, repo];
1513
+ const ownerClause = owner ? "owner = ? AND " : "";
1514
+ let sql = `SELECT COUNT(*) as count FROM memories WHERE ${ownerClause}repo = ?`;
1515
+ const params = owner ? [owner, repo] : [repo];
1513
1516
  if (!includeArchived) sql += " AND status = 'active'";
1514
1517
  if (excludeTypes.length > 0) {
1515
1518
  sql += ` AND type NOT IN (${excludeTypes.map(() => "?").join(",")})`;
@@ -1545,9 +1548,10 @@ var MemoryEntity = class extends BaseEntity {
1545
1548
  return row;
1546
1549
  }
1547
1550
  getAllMemoriesWithStats(owner, repo) {
1551
+ const ownerClause = owner ? "owner = ? AND " : "";
1548
1552
  const rows = this.all(
1549
- `SELECT *, CASE WHEN hit_count > 0 THEN CAST(recall_count AS REAL) / hit_count ELSE 0 END AS recall_rate FROM memories WHERE owner = ? AND repo = ? ORDER BY created_at DESC`,
1550
- [owner, repo]
1553
+ `SELECT *, CASE WHEN hit_count > 0 THEN CAST(recall_count AS REAL) / hit_count ELSE 0 END AS recall_rate FROM memories WHERE ${ownerClause}repo = ? ORDER BY created_at DESC`,
1554
+ owner ? [owner, repo] : [repo]
1551
1555
  );
1552
1556
  return rows.map((row) => ({
1553
1557
  ...this.rowToMemoryEntry(row),
@@ -4070,7 +4074,10 @@ var TOOL_DEFINITIONS = [
4070
4074
  inputSchema: {
4071
4075
  type: "object",
4072
4076
  properties: {
4073
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4077
+ owner: {
4078
+ type: "string",
4079
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4080
+ },
4074
4081
  repo: { type: "string", description: "Repository/project name. Optional when a single MCP root is active." },
4075
4082
  objective: { type: "string", minLength: 5, description: "Question or synthesis objective." },
4076
4083
  current_file_path: {
@@ -4119,7 +4126,7 @@ var TOOL_DEFINITIONS = [
4119
4126
  properties: {
4120
4127
  owner: {
4121
4128
  type: "string",
4122
- description: "Organization/namespace (e.g., GitHub org or username)"
4129
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4123
4130
  },
4124
4131
  repo: {
4125
4132
  type: "string",
@@ -4193,7 +4200,10 @@ var TOOL_DEFINITIONS = [
4193
4200
  inputSchema: {
4194
4201
  type: "object",
4195
4202
  properties: {
4196
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4203
+ owner: {
4204
+ type: "string",
4205
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4206
+ },
4197
4207
  repo: { type: "string", description: "Repository name" },
4198
4208
  id: { type: "string", format: "uuid", description: "Task ID (optional if task_code is provided)" },
4199
4209
  task_code: { type: "string", description: "Task code (e.g. TASK-001) (optional if id is provided)" },
@@ -4256,7 +4266,10 @@ var TOOL_DEFINITIONS = [
4256
4266
  scope: {
4257
4267
  type: "object",
4258
4268
  properties: {
4259
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4269
+ owner: {
4270
+ type: "string",
4271
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4272
+ },
4260
4273
  repo: { type: "string", description: "Repository/project name" },
4261
4274
  branch: { type: "string", description: "Git branch this memory relates to" },
4262
4275
  folder: { type: "string", description: "Subdirectory within the repo" },
@@ -4305,7 +4318,10 @@ var TOOL_DEFINITIONS = [
4305
4318
  scope: {
4306
4319
  type: "object",
4307
4320
  properties: {
4308
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4321
+ owner: {
4322
+ type: "string",
4323
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4324
+ },
4309
4325
  repo: { type: "string", description: "Repository/project name" },
4310
4326
  branch: { type: "string", description: "Git branch this memory relates to" },
4311
4327
  folder: { type: "string", description: "Subdirectory within the repo" },
@@ -4446,7 +4462,10 @@ var TOOL_DEFINITIONS = [
4446
4462
  description: "Search keyword to match against memory titles and content"
4447
4463
  },
4448
4464
  prompt: { type: "string", description: "Natural language prompt for semantic search" },
4449
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4465
+ owner: {
4466
+ type: "string",
4467
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4468
+ },
4450
4469
  repo: { type: "string", description: "Repository/project name" },
4451
4470
  current_tags: {
4452
4471
  type: "array",
@@ -4474,7 +4493,10 @@ var TOOL_DEFINITIONS = [
4474
4493
  scope: {
4475
4494
  type: "object",
4476
4495
  properties: {
4477
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4496
+ owner: {
4497
+ type: "string",
4498
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4499
+ },
4478
4500
  repo: { type: "string", description: "Repository/project name" },
4479
4501
  branch: { type: "string", description: "Git branch filter" },
4480
4502
  folder: { type: "string", description: "Subdirectory filter" },
@@ -4530,7 +4552,10 @@ var TOOL_DEFINITIONS = [
4530
4552
  inputSchema: {
4531
4553
  type: "object",
4532
4554
  properties: {
4533
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4555
+ owner: {
4556
+ type: "string",
4557
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4558
+ },
4534
4559
  repo: { type: "string", description: "Repository/project name" },
4535
4560
  signals: {
4536
4561
  type: "array",
@@ -4659,7 +4684,10 @@ var TOOL_DEFINITIONS = [
4659
4684
  inputSchema: {
4660
4685
  type: "object",
4661
4686
  properties: {
4662
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4687
+ owner: {
4688
+ type: "string",
4689
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4690
+ },
4663
4691
  repo: { type: "string", description: "Repository/project name (required)" },
4664
4692
  limit: {
4665
4693
  type: "number",
@@ -4733,7 +4761,10 @@ var TOOL_DEFINITIONS = [
4733
4761
  inputSchema: {
4734
4762
  type: "object",
4735
4763
  properties: {
4736
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4764
+ owner: {
4765
+ type: "string",
4766
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4767
+ },
4737
4768
  repo: { type: "string", description: "Repository/project name" },
4738
4769
  task_code: { type: "string", description: "Unique task code (e.g. TASK-001) (Required for single task)" },
4739
4770
  phase: { type: "string", description: "Project phase (Required for single task)" },
@@ -4846,7 +4877,10 @@ var TOOL_DEFINITIONS = [
4846
4877
  inputSchema: {
4847
4878
  type: "object",
4848
4879
  properties: {
4849
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4880
+ owner: {
4881
+ type: "string",
4882
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4883
+ },
4850
4884
  repo: { type: "string", description: "Repository name" },
4851
4885
  id: { type: "string", format: "uuid", description: "Task ID (for single update)" },
4852
4886
  ids: { type: "array", items: { type: "string", format: "uuid" }, description: "Task IDs (for bulk update)" },
@@ -4939,7 +4973,10 @@ var TOOL_DEFINITIONS = [
4939
4973
  inputSchema: {
4940
4974
  type: "object",
4941
4975
  properties: {
4942
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
4976
+ owner: {
4977
+ type: "string",
4978
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
4979
+ },
4943
4980
  repo: { type: "string", description: "Repository name" },
4944
4981
  id: {
4945
4982
  type: "string",
@@ -4977,7 +5014,10 @@ var TOOL_DEFINITIONS = [
4977
5014
  inputSchema: {
4978
5015
  type: "object",
4979
5016
  properties: {
4980
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5017
+ owner: {
5018
+ type: "string",
5019
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
5020
+ },
4981
5021
  repo: {
4982
5022
  type: "string",
4983
5023
  description: "Repository/project name (required)"
@@ -5054,7 +5094,10 @@ var TOOL_DEFINITIONS = [
5054
5094
  inputSchema: {
5055
5095
  type: "object",
5056
5096
  properties: {
5057
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5097
+ owner: {
5098
+ type: "string",
5099
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
5100
+ },
5058
5101
  repo: { type: "string", description: "Repository/project name" },
5059
5102
  query: {
5060
5103
  type: "string",
@@ -5112,7 +5155,10 @@ var TOOL_DEFINITIONS = [
5112
5155
  inputSchema: {
5113
5156
  type: "object",
5114
5157
  properties: {
5115
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5158
+ owner: {
5159
+ type: "string",
5160
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
5161
+ },
5116
5162
  repo: { type: "string", description: "Repository/project name" },
5117
5163
  from_agent: { type: "string", description: "Agent creating the handoff" },
5118
5164
  to_agent: { type: "string", description: "Optional target agent" },
@@ -5187,7 +5233,10 @@ var TOOL_DEFINITIONS = [
5187
5233
  inputSchema: {
5188
5234
  type: "object",
5189
5235
  properties: {
5190
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5236
+ owner: {
5237
+ type: "string",
5238
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
5239
+ },
5191
5240
  repo: { type: "string", description: "Repository/project name" },
5192
5241
  status: { type: "string", enum: ["pending", "accepted", "rejected", "expired"] },
5193
5242
  from_agent: { type: "string" },
@@ -5237,7 +5286,10 @@ var TOOL_DEFINITIONS = [
5237
5286
  inputSchema: {
5238
5287
  type: "object",
5239
5288
  properties: {
5240
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5289
+ owner: {
5290
+ type: "string",
5291
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
5292
+ },
5241
5293
  repo: { type: "string", description: "Repository/project name" },
5242
5294
  task_id: {
5243
5295
  type: "string",
@@ -5281,7 +5333,10 @@ var TOOL_DEFINITIONS = [
5281
5333
  inputSchema: {
5282
5334
  type: "object",
5283
5335
  properties: {
5284
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5336
+ owner: {
5337
+ type: "string",
5338
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
5339
+ },
5285
5340
  repo: { type: "string", description: "Repository/project name" },
5286
5341
  agent: { type: "string", description: "Optional agent filter" },
5287
5342
  active_only: { type: "boolean", description: "When true, return only unreleased claims" },
@@ -5330,7 +5385,10 @@ var TOOL_DEFINITIONS = [
5330
5385
  inputSchema: {
5331
5386
  type: "object",
5332
5387
  properties: {
5333
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5388
+ owner: {
5389
+ type: "string",
5390
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
5391
+ },
5334
5392
  repo: { type: "string", description: "Repository name" },
5335
5393
  task_id: {
5336
5394
  type: "string",
@@ -5368,7 +5426,10 @@ var TOOL_DEFINITIONS = [
5368
5426
  inputSchema: {
5369
5427
  type: "object",
5370
5428
  properties: {
5371
- owner: { type: "string", description: "Organization/namespace (e.g., GitHub org or username)" },
5429
+ owner: {
5430
+ type: "string",
5431
+ description: "GitHub repository owner (username or organization). For repo 'vheins/my-repo', owner='vheins'. CRITICAL: this is the GitHub owner, NOT the agent name. Do NOT use the calling agent's name."
5432
+ },
5372
5433
  name: { type: "string", minLength: 3, maxLength: 255, description: "Human-readable standard name" },
5373
5434
  content: {
5374
5435
  type: "string",
@@ -16,7 +16,7 @@ import {
16
16
  handleTaskClaim,
17
17
  listResources,
18
18
  logger
19
- } from "../chunk-FMBGGMV7.js";
19
+ } from "../chunk-OLPQSNH4.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-FMBGGMV7.js";
66
+ } from "../chunk-OLPQSNH4.js";
67
67
 
68
68
  // src/mcp/server.ts
69
69
  import readline from "readline";
@@ -2818,6 +2818,11 @@ function normalizeToolArguments(args, session2) {
2818
2818
  const repoVal2 = nextArgs.repo || "";
2819
2819
  const parsed = parseRepoInput(repoVal2, void 0);
2820
2820
  nextArgs.owner = parsed.owner || inferOwnerFromSession(session2) || "";
2821
+ if (nextArgs.owner && !repoVal2.includes("/")) {
2822
+ console.warn(
2823
+ `[router] owner inferred from session (${nextArgs.owner}) \u2014 may be incorrect. Agents should pass explicit owner/repo.`
2824
+ );
2825
+ }
2821
2826
  }
2822
2827
  if (scope && !scope.owner) {
2823
2828
  const repoVal2 = scope.repo || nextArgs.repo || "";
@@ -14,6 +14,19 @@ All data (memories, tasks, handoffs, claims) is scoped by **owner/repo**:
14
14
 
15
15
  Pass both `owner` and `repo` whenever a tool requires them. The `owner/repo` pair forms the unique data boundary.
16
16
 
17
+ ### Owner Rule (CRITICAL)
18
+
19
+ The `owner` field MUST be the GitHub username or organization that OWNS the repository. For example:
20
+
21
+ - Repo `vheins/sentinel-agent` → owner=`vheins`
22
+ - Repo `my-org/my-project` → owner=`my-org`
23
+
24
+ NEVER use the agent's name (e.g., `sentinel`, `test-executor`, `claude`) as the owner.
25
+ NEVER guess the owner from the working directory path.
26
+ If unsure, use `owner/repo` format for the `repo` parameter (e.g., `repo='vheins/sentinel-agent'`) — the server will extract the owner automatically.
27
+
28
+ Violation: tasks created with a wrong owner will be invisible to other agents querying with the correct owner.
29
+
17
30
  ## Session Start Mode
18
31
 
19
32
  Entry=orient → hydrate → ready Guard: S(N) req S(N-1)✅
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vheins/local-memory-mcp",
3
- "version": "0.18.5",
3
+ "version": "0.18.7",
4
4
  "description": "MCP Local Memory Service for coding copilot agents",
5
5
  "mcpName": "io.github.vheins/local-memory-mcp",
6
6
  "type": "module",