@lotargo/memory_plugin 1.2.4 → 1.2.6

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.
package/README.md CHANGED
@@ -9,6 +9,7 @@
9
9
  <br>
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/@lotargo/memory_plugin)](https://www.npmjs.com/package/@lotargo/memory_plugin)
12
+ [![npm downloads](https://img.shields.io/npm/dt/@lotargo/memory_plugin)](https://www.npmjs.com/package/@lotargo/memory_plugin)
12
13
  [![license](https://img.shields.io/badge/license-MIT-blue)](./LICENSE)
13
14
  [![node version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org)
14
15
  [![mcp](https://img.shields.io/badge/MCP-Supported-8A2BE2)](https://modelcontextprotocol.io)
@@ -1,7 +1,11 @@
1
1
  import { execSync } from "child_process";
2
2
 
3
+ // Skip preinstall entirely in CI / Docker / Jules containers
4
+ if (process.env.CI || process.env.CONTINUOUS_INTEGRATION || process.env.DEBIAN_FRONTEND === "noninteractive" || process.cwd().startsWith("/app")) {
5
+ process.exit(0);
6
+ }
7
+
3
8
  // 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
9
  if (process.env.npm_config_global === "true" || process.env.MEMORY_PREINSTALL_FORCE === "true") {
6
10
  try {
7
11
  const currentPid = process.pid;
@@ -187,7 +187,9 @@ export async function runSetup() {
187
187
  const packageDir = dirname(dirname(fileURLToPath(import.meta.url)));
188
188
  const packageSkillsDir = join(packageDir, "skills");
189
189
  if (existsSync(packageSkillsDir)) {
190
+ const opencodeDir = process.env.OPENCODE_CONFIG_DIR || join(home, ".config", "opencode");
190
191
  const targets = [
192
+ { name: "OpenCode", dir: join(opencodeDir, "skills") },
191
193
  { name: "Antigravity", dir: join(home, ".gemini", "config", "skills") },
192
194
  { name: "Codex", dir: join(home, ".codex", "skills") },
193
195
  { name: "Claude Code", dir: join(home, ".claude", "skills") },
@@ -1,14 +1,31 @@
1
- const { readFile, writeFile, mkdir } = await import("fs/promises");
1
+ const { readFile, writeFile, mkdir, cp, readdir } = await import("fs/promises");
2
2
  const { existsSync } = await import("fs");
3
- const { join, basename } = await import("path");
3
+ const { join, basename, dirname } = await import("path");
4
4
  const { homedir } = await import("os");
5
+ const { fileURLToPath } = await import("url");
5
6
 
6
7
  const CONFIG_DIR = process.env.OPENCODE_CONFIG_DIR || join(homedir(), ".config", "opencode");
7
8
  const MEMORY_DIR = join(CONFIG_DIR, "memory");
9
+ const SKILLS_DIR = join(CONFIG_DIR, "skills");
8
10
  const GLOBAL_KEY = "global";
9
11
 
10
12
  async function ensureDir() {
11
13
  if (!existsSync(MEMORY_DIR)) await mkdir(MEMORY_DIR, { recursive: true });
14
+ try {
15
+ const pluginDir = dirname(fileURLToPath(import.meta.url));
16
+ const packageSkillsDir = join(pluginDir, "..", "skills");
17
+ if (existsSync(packageSkillsDir)) {
18
+ await mkdir(SKILLS_DIR, { recursive: true });
19
+ const entries = await readdir(packageSkillsDir, { withFileTypes: true });
20
+ for (const entry of entries) {
21
+ if (entry.isDirectory()) {
22
+ const src = join(packageSkillsDir, entry.name);
23
+ const dest = join(SKILLS_DIR, entry.name);
24
+ await cp(src, dest, { recursive: true });
25
+ }
26
+ }
27
+ }
28
+ } catch (e) {}
12
29
  }
13
30
 
14
31
  function projectName(worktree, directory) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotargo/memory_plugin",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
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",