@lotargo/memory_plugin 1.0.0 → 1.0.2
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/index.js +1 -0
- package/mcp-server/setup.js +37 -7
- package/package.json +1 -1
package/mcp-server/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
|
+
import { ensureDir, readMemory, readMemoryRaw, writeMemory, today, MEMORY_DIR, GLOBAL_KEY, scopeKey, projectName } from "./memory.js";
|
|
5
6
|
const cliArgs = process.argv.slice(2);
|
|
6
7
|
if (cliArgs.includes("setup") || cliArgs.includes("install") || cliArgs.includes("--setup") || cliArgs.includes("-s")) {
|
|
7
8
|
const { runSetup } = await import("./setup.js");
|
package/mcp-server/setup.js
CHANGED
|
@@ -68,18 +68,48 @@ export async function runSetup() {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
// 3. Antigravity / Gemini CLI (~/.gemini/
|
|
71
|
+
// 3. Antigravity / Gemini CLI (~/.gemini/config/mcp_config.json & .agents/mcp_config.json)
|
|
72
72
|
if (doAntigravity) {
|
|
73
73
|
try {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
74
|
+
// Global Antigravity config
|
|
75
|
+
const geminiConfigDir = join(home, ".gemini", "config");
|
|
76
|
+
await mkdir(geminiConfigDir, { recursive: true });
|
|
77
|
+
const geminiConfigFile = join(geminiConfigDir, "mcp_config.json");
|
|
78
|
+
|
|
79
|
+
let config = {};
|
|
80
|
+
if (existsSync(geminiConfigFile)) {
|
|
81
|
+
try {
|
|
82
|
+
config = JSON.parse(await readFile(geminiConfigFile, "utf-8"));
|
|
83
|
+
} catch (e) {}
|
|
84
|
+
}
|
|
85
|
+
if (!config.mcpServers) config.mcpServers = {};
|
|
86
|
+
config.mcpServers["memory-agent"] = {
|
|
78
87
|
command: "npx",
|
|
79
88
|
args: ["-y", "@lotargo/memory_plugin"],
|
|
80
89
|
};
|
|
81
|
-
await writeFile(
|
|
82
|
-
|
|
90
|
+
await writeFile(geminiConfigFile, JSON.stringify(config, null, 2));
|
|
91
|
+
|
|
92
|
+
// Local workspace config (.agents/mcp_config.json) if in project
|
|
93
|
+
const cwd = process.cwd();
|
|
94
|
+
if (existsSync(join(cwd, ".agents")) || existsSync(join(cwd, "package.json")) || existsSync(join(cwd, ".git"))) {
|
|
95
|
+
const localAgentsDir = join(cwd, ".agents");
|
|
96
|
+
await mkdir(localAgentsDir, { recursive: true });
|
|
97
|
+
const localMcpFile = join(localAgentsDir, "mcp_config.json");
|
|
98
|
+
let localConfig = {};
|
|
99
|
+
if (existsSync(localMcpFile)) {
|
|
100
|
+
try {
|
|
101
|
+
localConfig = JSON.parse(await readFile(localMcpFile, "utf-8"));
|
|
102
|
+
} catch (e) {}
|
|
103
|
+
}
|
|
104
|
+
if (!localConfig.mcpServers) localConfig.mcpServers = {};
|
|
105
|
+
localConfig.mcpServers["memory-agent"] = {
|
|
106
|
+
command: "npx",
|
|
107
|
+
args: ["-y", "@lotargo/memory_plugin"],
|
|
108
|
+
};
|
|
109
|
+
await writeFile(localMcpFile, JSON.stringify(localConfig, null, 2));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
console.log(" [OK] Antigravity: configured MCP server in ~/.gemini/config/mcp_config.json and .agents/mcp_config.json");
|
|
83
113
|
configuredCount++;
|
|
84
114
|
} catch (err) {
|
|
85
115
|
console.log(" [SKIP] Antigravity setup skipped:", err.message);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lotargo/memory_plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
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/plugins/memory-plugin.js",
|