@lotargo/memory_plugin 1.1.2 → 1.1.4

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.
@@ -0,0 +1,22 @@
1
+ import { execSync } from "child_process";
2
+
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
+ if (process.platform === "win32") {
10
+ // Safely attempt to terminate orphaned background memory node processes
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" });
13
+ } catch {}
14
+ } else {
15
+ try {
16
+ execSync(`pkill -f "memory-agent|memory_plugin" || true`, { stdio: "ignore" });
17
+ } catch {}
18
+ }
19
+ } catch (e) {
20
+ // Ignore errors
21
+ }
22
+ }
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@lotargo/memory_plugin",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
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",
7
+ "scripts": {
8
+ "preinstall": "node mcp-server/preinstall.js || true"
9
+ },
7
10
  "bin": {
8
11
  "memory_plugin": "mcp-server/index.js",
9
12
  "memory-agent": "mcp-server/index.js",
@@ -24,6 +27,7 @@
24
27
  "mcp-server/index.js",
25
28
  "mcp-server/memory.js",
26
29
  "mcp-server/setup.js",
30
+ "mcp-server/preinstall.js",
27
31
  "skills"
28
32
  ],
29
33
  "keywords": [