@lotargo/memory_plugin 1.1.3 → 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) {
@@ -1,20 +1,44 @@
1
1
  import { execSync } from "child_process";
2
2
 
3
- try {
4
- if (process.platform === "win32") {
5
- // Forcefully stop any running Node processes executing memory-agent or index.js to unlock DLLs/EXEs
6
- try {
7
- execSync('wmic process where "name=\'node.exe\' and commandline like \'%memory-agent%\'" call terminate', { stdio: "ignore" });
8
- } catch {}
9
- try {
10
- execSync('wmic process where "name=\'node.exe\' and commandline like \'%memory_plugin%\'" call terminate', { stdio: "ignore" });
11
- } catch {}
12
- } else {
13
- // Linux / macOS: use pkill
14
- try {
15
- execSync('pkill -f "memory-agent|memory_plugin" || true', { stdio: "ignore" });
16
- } catch {}
3
+ // Only run graceful process termination during explicit global npm updates
4
+ // Skip if running interactively or inside active MCP sessions to avoid EOF drops
5
+ if (process.env.npm_config_global === "true" || process.env.MEMORY_PREINSTALL_FORCE === "true") {
6
+ try {
7
+ const currentPid = process.pid;
8
+ const ppid = process.ppid;
9
+
10
+ if (process.platform === "win32") {
11
+ try {
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" });
14
+ } catch {}
15
+ } else {
16
+ try {
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
+ }
38
+ } catch {}
39
+ }
40
+ } catch (e) {
41
+ // Ignore errors
17
42
  }
18
- } catch (e) {
19
- // Ignore errors if no processes were running
20
43
  }
44
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotargo/memory_plugin",
3
- "version": "1.1.3",
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",