@lotargo/memory_plugin 1.2.2 → 1.2.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.
- package/mcp-server/setup.js +47 -6
- package/package.json +1 -1
package/mcp-server/setup.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { readFile, writeFile, mkdir } from "fs/promises";
|
|
1
|
+
import { readFile, writeFile, mkdir, cp, readdir } from "fs/promises";
|
|
2
2
|
import { existsSync } from "fs";
|
|
3
|
-
import { join } from "path";
|
|
3
|
+
import { join, dirname } from "path";
|
|
4
4
|
import { homedir } from "os";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
5
6
|
|
|
6
7
|
export async function runSetup() {
|
|
7
8
|
const args = process.argv.slice(2);
|
|
@@ -115,9 +116,12 @@ export async function runSetup() {
|
|
|
115
116
|
};
|
|
116
117
|
await writeFile(geminiConfigFile, JSON.stringify(config, null, 2));
|
|
117
118
|
|
|
118
|
-
// Local workspace config (.agents/mcp_config.json) if
|
|
119
|
+
// Local workspace config (.agents/mcp_config.json) only if .agents exists or --local flag is set
|
|
119
120
|
const cwd = process.cwd();
|
|
120
|
-
|
|
121
|
+
const hasAgentsDir = existsSync(join(cwd, ".agents"));
|
|
122
|
+
const isLocalRequested = args.includes("--local");
|
|
123
|
+
|
|
124
|
+
if (hasAgentsDir || isLocalRequested) {
|
|
121
125
|
const localAgentsDir = join(cwd, ".agents");
|
|
122
126
|
await mkdir(localAgentsDir, { recursive: true });
|
|
123
127
|
const localMcpFile = join(localAgentsDir, "mcp_config.json");
|
|
@@ -133,9 +137,10 @@ export async function runSetup() {
|
|
|
133
137
|
args: ["-y", "@lotargo/memory_plugin"],
|
|
134
138
|
};
|
|
135
139
|
await writeFile(localMcpFile, JSON.stringify(localConfig, null, 2));
|
|
140
|
+
console.log(" [OK] Antigravity: configured MCP server in ~/.gemini/config/mcp_config.json and .agents/mcp_config.json");
|
|
141
|
+
} else {
|
|
142
|
+
console.log(" [OK] Antigravity: configured MCP server in ~/.gemini/config/mcp_config.json");
|
|
136
143
|
}
|
|
137
|
-
|
|
138
|
-
console.log(" [OK] Antigravity: configured MCP server in ~/.gemini/config/mcp_config.json and .agents/mcp_config.json");
|
|
139
144
|
configuredCount++;
|
|
140
145
|
} catch (err) {
|
|
141
146
|
console.log(" [SKIP] Antigravity setup skipped:", err.message);
|
|
@@ -177,6 +182,42 @@ export async function runSetup() {
|
|
|
177
182
|
console.log(" [SKIP] Global prompt setup skipped:", err.message);
|
|
178
183
|
}
|
|
179
184
|
|
|
185
|
+
// 6. Global & Local Skill Installation (Antigravity, Codex, Claude Code)
|
|
186
|
+
try {
|
|
187
|
+
const packageDir = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
188
|
+
const packageSkillsDir = join(packageDir, "skills");
|
|
189
|
+
if (existsSync(packageSkillsDir)) {
|
|
190
|
+
const targets = [
|
|
191
|
+
{ name: "Antigravity", dir: join(home, ".gemini", "config", "skills") },
|
|
192
|
+
{ name: "Codex", dir: join(home, ".codex", "skills") },
|
|
193
|
+
{ name: "Claude Code", dir: join(home, ".claude", "skills") },
|
|
194
|
+
];
|
|
195
|
+
const cwd = process.cwd();
|
|
196
|
+
if (existsSync(join(cwd, ".agents"))) {
|
|
197
|
+
targets.push({ name: "Antigravity (local)", dir: join(cwd, ".agents", "skills") });
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
for (const target of targets) {
|
|
201
|
+
try {
|
|
202
|
+
await mkdir(target.dir, { recursive: true });
|
|
203
|
+
const entries = await readdir(packageSkillsDir, { withFileTypes: true });
|
|
204
|
+
for (const entry of entries) {
|
|
205
|
+
if (entry.isDirectory()) {
|
|
206
|
+
const src = join(packageSkillsDir, entry.name);
|
|
207
|
+
const dest = join(target.dir, entry.name);
|
|
208
|
+
await cp(src, dest, { recursive: true });
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
console.log(` [OK] ${target.name}: installed skills to ${target.dir}`);
|
|
212
|
+
} catch (e) {
|
|
213
|
+
console.log(` [SKIP] ${target.name} skill installation skipped:`, e.message);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
} catch (err) {
|
|
218
|
+
console.log(" [SKIP] Skill installation skipped:", err.message);
|
|
219
|
+
}
|
|
220
|
+
|
|
180
221
|
console.log(`\nSetup complete. Configured ${configuredCount} environment(s).\n`);
|
|
181
222
|
}
|
|
182
223
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lotargo/memory_plugin",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.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",
|