@lotargo/memory_plugin 1.1.4 → 1.1.5

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.
@@ -31,6 +31,7 @@ export async function getExtractor(modelName = null, progressCallback = null) {
31
31
  env.allowRemoteModels = true;
32
32
  env.remoteHost = "https://huggingface.co";
33
33
  env.remotePathTemplate = "{model}/resolve/{revision}/";
34
+ env.sharp = false;
34
35
 
35
36
  const pipelineOpts = { quantized: true };
36
37
  if (progressCallback) {
@@ -112,6 +113,11 @@ export async function getReranker(modelName = "Xenova/bge-reranker-base", progre
112
113
 
113
114
  const { pipeline, env } = await import("@xenova/transformers");
114
115
  env.cacheDir = MODELS_DIR;
116
+ env.allowLocalModels = true;
117
+ env.allowRemoteModels = true;
118
+ env.remoteHost = "https://huggingface.co";
119
+ env.remotePathTemplate = "{model}/resolve/{revision}/";
120
+ env.sharp = false;
115
121
 
116
122
  const pipelineOpts = { quantized: true };
117
123
  if (progressCallback) {
@@ -6,17 +6,39 @@ if (process.env.npm_config_global === "true" || process.env.MEMORY_PREINSTALL_FO
6
6
  try {
7
7
  const currentPid = process.pid;
8
8
  const ppid = process.ppid;
9
+
9
10
  if (process.platform === "win32") {
10
- // Safely attempt to terminate orphaned background memory node processes
11
11
  try {
12
- execSync(`wmic process where "name='node.exe' and commandline like '%memory_plugin%' and ProcessId!=${currentPid} and ProcessId!=${ppid}" call terminate`, { stdio: "ignore" });
12
+ const psCmd = `Get-CimInstance Win32_Process | Where-Object { ($_.CommandLine -like '*mcp-server/index.js*' -or $_.CommandLine -like '*mcp-server\\\\index.js*') -and $_.CommandLine -notlike '*install*' -and $_.ProcessId -ne ${currentPid} -and $_.ProcessId -ne ${ppid} } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }`;
13
+ execSync(`powershell -NoProfile -NonInteractive -Command "${psCmd}"`, { stdio: "ignore" });
13
14
  } catch {}
14
15
  } else {
15
16
  try {
16
- execSync(`pkill -f "memory-agent|memory_plugin" || true`, { stdio: "ignore" });
17
+ const psOutput = execSync(`ps -eo pid,ppid,args 2>/dev/null || true`, { encoding: "utf-8" });
18
+ const lines = psOutput.split("\n");
19
+ for (const line of lines) {
20
+ const trimmed = line.trim();
21
+ if (!trimmed) continue;
22
+ const parts = trimmed.split(/\s+/);
23
+ const pid = parseInt(parts[0], 10);
24
+ const parentPid = parseInt(parts[1], 10);
25
+ const cmd = parts.slice(2).join(" ");
26
+
27
+ if (!pid || pid === currentPid || pid === ppid || parentPid === currentPid) continue;
28
+
29
+ const isServer = cmd.includes("mcp-server/index.js") || cmd.includes("mcp-server/index.js");
30
+ const isInstaller = /npm|npx|yarn|pnpm|preinstall|install/i.test(cmd);
31
+
32
+ if (isServer && !isInstaller) {
33
+ try {
34
+ process.kill(pid, "SIGTERM");
35
+ } catch {}
36
+ }
37
+ }
17
38
  } catch {}
18
39
  }
19
40
  } catch (e) {
20
41
  // Ignore errors
21
42
  }
22
43
  }
44
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotargo/memory_plugin",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Persistent memory agent for coding AI tools — remembers user preferences and project context across sessions. Works with Antigravity, OpenCode, Claude Code, and Codex.",
5
5
  "type": "module",
6
6
  "main": "opencode-plugin/index.js",