@vheins/local-memory-mcp 0.19.10 → 0.19.11

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.
@@ -1914,6 +1914,14 @@ var TaskEntity = class extends BaseEntity {
1914
1914
  }
1915
1915
  }
1916
1916
  const rows = this.all(query, params);
1917
+ if (rows.length === 0 && owner) {
1918
+ const fallbackQuery = query.replace(/t\.owner\s*=\s*\?\s*AND\s*/i, "");
1919
+ const fallbackParams = params.slice(1);
1920
+ const fallbackRows = this.all(fallbackQuery, fallbackParams);
1921
+ if (fallbackRows.length > 0) {
1922
+ return fallbackRows.map((r) => this.rowToTask(r));
1923
+ }
1924
+ }
1917
1925
  return rows.map((r) => this.rowToTask(r));
1918
1926
  }
1919
1927
  countTasks(owner, repo, status, search) {
@@ -1994,6 +2002,14 @@ var TaskEntity = class extends BaseEntity {
1994
2002
  }
1995
2003
  }
1996
2004
  const rows = this.all(query, params);
2005
+ if (rows.length === 0 && owner) {
2006
+ const fallbackQuery = query.replace(/t\.owner\s*=\s*\?\s*AND\s*/i, "");
2007
+ const fallbackParams = params.slice(1);
2008
+ const fallbackRows = this.all(fallbackQuery, fallbackParams);
2009
+ if (fallbackRows.length > 0) {
2010
+ return fallbackRows.map((r) => this.rowToTask(r));
2011
+ }
2012
+ }
1997
2013
  return rows.map((r) => this.rowToTask(r));
1998
2014
  }
1999
2015
  countTasksByMultipleStatuses(owner, repo, statuses, search) {
@@ -3447,6 +3463,7 @@ var RealVectorStore = class {
3447
3463
  };
3448
3464
 
3449
3465
  // src/mcp/session.ts
3466
+ import fs4 from "fs";
3450
3467
  import path3 from "path";
3451
3468
  import { fileURLToPath } from "url";
3452
3469
  function createSessionContext() {
@@ -3505,8 +3522,31 @@ function inferRepoFromSession(session) {
3505
3522
  }
3506
3523
  return void 0;
3507
3524
  }
3525
+ function inferOwnerFromGit(cwd) {
3526
+ try {
3527
+ const gitConfigPath = path3.join(cwd, ".git", "config");
3528
+ if (!fs4.existsSync(gitConfigPath)) return void 0;
3529
+ const content = fs4.readFileSync(gitConfigPath, "utf-8");
3530
+ const match = content.match(
3531
+ /url\s*=\s*(?:git@github\.com:|https?:\/\/github\.com\/|git:\/\/github\.com\/)([^\/\s]+)/
3532
+ );
3533
+ return match?.[1] || void 0;
3534
+ } catch {
3535
+ return void 0;
3536
+ }
3537
+ }
3508
3538
  function inferOwnerFromSession(session) {
3509
3539
  const roots = getFilesystemRoots(session);
3540
+ let cwd;
3541
+ if (roots.length === 1) {
3542
+ cwd = roots[0];
3543
+ } else if (roots.length === 0 && session) {
3544
+ cwd = process.cwd();
3545
+ }
3546
+ if (cwd) {
3547
+ const gitOwner = inferOwnerFromGit(cwd);
3548
+ if (gitOwner) return gitOwner;
3549
+ }
3510
3550
  if (roots.length === 1) {
3511
3551
  const parts = roots[0].split(path3.sep).filter(Boolean);
3512
3552
  if (parts.length >= 2) {
@@ -3515,8 +3555,8 @@ function inferOwnerFromSession(session) {
3515
3555
  }
3516
3556
  if (roots.length === 0) {
3517
3557
  if (!session) return void 0;
3518
- const cwd = process.cwd();
3519
- const parts = cwd.split(path3.sep).filter(Boolean);
3558
+ const workdir = process.cwd();
3559
+ const parts = workdir.split(path3.sep).filter(Boolean);
3520
3560
  if (parts.length >= 2) {
3521
3561
  return parts[parts.length - 2];
3522
3562
  }
@@ -3525,7 +3565,7 @@ function inferOwnerFromSession(session) {
3525
3565
  }
3526
3566
 
3527
3567
  // src/mcp/prompts/loader.ts
3528
- import fs4 from "fs";
3568
+ import fs5 from "fs";
3529
3569
  import path4 from "path";
3530
3570
  import { fileURLToPath as fileURLToPath2 } from "url";
3531
3571
  import matter from "gray-matter";
@@ -3541,8 +3581,8 @@ function findPromptDir() {
3541
3581
  "./definitions"
3542
3582
  ].map((relPath) => path4.resolve(__dirname, relPath));
3543
3583
  for (const dir of candidates) {
3544
- if (fs4.existsSync(dir)) {
3545
- const files = fs4.readdirSync(dir);
3584
+ if (fs5.existsSync(dir)) {
3585
+ const files = fs5.readdirSync(dir);
3546
3586
  if (files.some((f) => f.endsWith(".md"))) {
3547
3587
  return dir;
3548
3588
  }
@@ -3553,17 +3593,17 @@ function findPromptDir() {
3553
3593
  var PROMPT_DIR = findPromptDir();
3554
3594
  var promptCache = /* @__PURE__ */ new Map();
3555
3595
  function listPromptFiles() {
3556
- if (!fs4.existsSync(PROMPT_DIR)) return [];
3557
- return fs4.readdirSync(PROMPT_DIR).filter((file) => file.endsWith(".md")).map((file) => file.replace(/\.md$/, "")).sort();
3596
+ if (!fs5.existsSync(PROMPT_DIR)) return [];
3597
+ return fs5.readdirSync(PROMPT_DIR).filter((file) => file.endsWith(".md")).map((file) => file.replace(/\.md$/, "")).sort();
3558
3598
  }
3559
3599
  function loadPromptFromMarkdown(name) {
3560
3600
  const cached = promptCache.get(name);
3561
3601
  if (cached) return cached;
3562
3602
  const filePath = path4.join(PROMPT_DIR, `${name}.md`);
3563
- if (!fs4.existsSync(filePath)) {
3603
+ if (!fs5.existsSync(filePath)) {
3564
3604
  throw new Error(`Prompt file not found: ${filePath}`);
3565
3605
  }
3566
- const fileContent = fs4.readFileSync(filePath, "utf-8");
3606
+ const fileContent = fs5.readFileSync(filePath, "utf-8");
3567
3607
  const { data, content } = matter(fileContent);
3568
3608
  const result = {
3569
3609
  name: data.name || name,
@@ -3585,9 +3625,9 @@ function findServerInstructionsDir() {
3585
3625
  "./server"
3586
3626
  ].map((relPath) => path4.resolve(__dirname, relPath));
3587
3627
  for (const dir of candidates) {
3588
- if (fs4.existsSync(dir)) {
3628
+ if (fs5.existsSync(dir)) {
3589
3629
  const filePath = path4.join(dir, "instructions.md");
3590
- if (fs4.existsSync(filePath)) {
3630
+ if (fs5.existsSync(filePath)) {
3591
3631
  return dir;
3592
3632
  }
3593
3633
  }
@@ -3599,10 +3639,10 @@ var serverInstructionsCache = null;
3599
3639
  function loadServerInstructions() {
3600
3640
  if (serverInstructionsCache !== null) return serverInstructionsCache;
3601
3641
  const filePath = path4.join(SERVER_DIR, "instructions.md");
3602
- if (!fs4.existsSync(filePath)) {
3642
+ if (!fs5.existsSync(filePath)) {
3603
3643
  throw new Error(`Server instructions file not found: ${filePath}`);
3604
3644
  }
3605
- const fileContent = fs4.readFileSync(filePath, "utf-8");
3645
+ const fileContent = fs5.readFileSync(filePath, "utf-8");
3606
3646
  const { content } = matter(fileContent);
3607
3647
  serverInstructionsCache = content.trim();
3608
3648
  return serverInstructionsCache;
@@ -15,7 +15,7 @@ import {
15
15
  handleTaskClaim,
16
16
  listResources,
17
17
  logger
18
- } from "../chunk-QOGYLJYW.js";
18
+ } from "../chunk-YFS66G2U.js";
19
19
 
20
20
  // src/dashboard/server.ts
21
21
  import express from "express";
@@ -61,7 +61,7 @@ import {
61
61
  parseRepoInput,
62
62
  rankCompletionValues,
63
63
  toContextSlug
64
- } from "../chunk-QOGYLJYW.js";
64
+ } from "../chunk-YFS66G2U.js";
65
65
 
66
66
  // src/mcp/server.ts
67
67
  import { serveStdio } from "@modelcontextprotocol/server/stdio";
@@ -74,8 +74,8 @@ import path from "path";
74
74
  import { fileURLToPath } from "url";
75
75
  var __dirname = path.dirname(fileURLToPath(import.meta.url));
76
76
  var pkgVersion = "0.1.0";
77
- if ("0.19.10") {
78
- pkgVersion = "0.19.10";
77
+ if ("0.19.11") {
78
+ pkgVersion = "0.19.11";
79
79
  } else {
80
80
  let searchDir = __dirname;
81
81
  for (let i = 0; i < 5; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vheins/local-memory-mcp",
3
- "version": "0.19.10",
3
+ "version": "0.19.11",
4
4
  "description": "MCP Local Memory Service for coding copilot agents",
5
5
  "mcpName": "io.github.vheins/local-memory-mcp",
6
6
  "type": "module",