engram-mcp-server 1.7.2 → 1.7.3

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.
Files changed (38) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +194 -358
  3. package/dist/constants.d.ts +21 -0
  4. package/dist/constants.d.ts.map +1 -1
  5. package/dist/constants.js +47 -1
  6. package/dist/constants.js.map +1 -1
  7. package/dist/database.d.ts +1 -1
  8. package/dist/database.d.ts.map +1 -1
  9. package/dist/database.js +47 -16
  10. package/dist/database.js.map +1 -1
  11. package/dist/global-db.d.ts.map +1 -1
  12. package/dist/global-db.js +3 -0
  13. package/dist/global-db.js.map +1 -1
  14. package/dist/index.js +3 -2
  15. package/dist/index.js.map +1 -1
  16. package/dist/installer/config-writer.d.ts +31 -10
  17. package/dist/installer/config-writer.d.ts.map +1 -1
  18. package/dist/installer/config-writer.js +79 -15
  19. package/dist/installer/config-writer.js.map +1 -1
  20. package/dist/installer/ide-configs.d.ts +9 -0
  21. package/dist/installer/ide-configs.d.ts.map +1 -1
  22. package/dist/installer/ide-configs.js +7 -19
  23. package/dist/installer/ide-configs.js.map +1 -1
  24. package/dist/installer/ide-detector.d.ts +10 -6
  25. package/dist/installer/ide-detector.d.ts.map +1 -1
  26. package/dist/installer/ide-detector.js +32 -7
  27. package/dist/installer/ide-detector.js.map +1 -1
  28. package/dist/installer/index.d.ts.map +1 -1
  29. package/dist/installer/index.js +25 -6
  30. package/dist/installer/index.js.map +1 -1
  31. package/dist/utils.d.ts +4 -1
  32. package/dist/utils.d.ts.map +1 -1
  33. package/dist/utils.js +149 -13
  34. package/dist/utils.js.map +1 -1
  35. package/package.json +2 -3
  36. package/scripts/fix-mcp-config.js +0 -23
  37. package/scripts/inject-release-notes.js +0 -67
  38. package/scripts/install-mcp.js +0 -175
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "engram-mcp-server",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "Engram — Persistent Memory Cortex for AI coding agents. Gives agents session continuity, change tracking, decision logging, and project intelligence across sessions.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -9,8 +9,7 @@
9
9
  "engram-mcp-server": "dist/index.js"
10
10
  },
11
11
  "files": [
12
- "dist/",
13
- "scripts/"
12
+ "dist/"
14
13
  ],
15
14
  "repository": {
16
15
  "type": "git",
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
- // One-shot script: update Claude Code MCP config to use local dev build
3
- import { readFileSync, writeFileSync } from 'fs';
4
- import { homedir } from 'os';
5
- import { join } from 'path';
6
-
7
- const configPath = join(homedir(), '.claude.json');
8
- const localBuild = join(homedir(), 'Documents', 'MCP Builder', 'Engram', 'dist', 'index.js');
9
-
10
- const config = JSON.parse(readFileSync(configPath, 'utf8'));
11
-
12
- config.mcpServers.engram = {
13
- type: 'stdio',
14
- command: 'node',
15
- args: [localBuild]
16
- };
17
-
18
- writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8');
19
-
20
- const verify = JSON.parse(readFileSync(configPath, 'utf8'));
21
- console.log('✓ Engram MCP config updated:');
22
- console.log(JSON.stringify(verify.mcpServers.engram, null, 2));
23
- console.log('\nRestart Claude Code to activate v1.5.0.');
@@ -1,67 +0,0 @@
1
- #!/usr/bin/env node
2
- // ============================================================================
3
- // Engram — Release Notes Injector
4
- //
5
- // Reads the latest version section from RELEASE_NOTES.md and injects it into
6
- // package.json as the `releaseNotes` field before publishing.
7
- // The npm registry then serves this field alongside the version metadata,
8
- // allowing the update check service to fetch changelog in a single HTTP call.
9
- //
10
- // Usage (called automatically by the prepack script):
11
- // node scripts/inject-release-notes.js
12
- // ============================================================================
13
-
14
- import fs from "fs";
15
- import path from "path";
16
- import { fileURLToPath } from "url";
17
-
18
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
19
- const ROOT = path.resolve(__dirname, "..");
20
- const RELEASE_NOTES_PATH = path.join(ROOT, "RELEASE_NOTES.md");
21
- const PACKAGE_JSON_PATH = path.join(ROOT, "package.json");
22
-
23
- // ─── Read files ──────────────────────────────────────────────────────
24
-
25
- const pkg = JSON.parse(fs.readFileSync(PACKAGE_JSON_PATH, "utf-8"));
26
- // Normalize CRLF → LF so the injected string is clean regardless of OS
27
- const notes = fs.readFileSync(RELEASE_NOTES_PATH, "utf-8").replace(/\r\n/g, "\n");
28
-
29
- // ─── Extract the latest version section ──────────────────────────────
30
- // The file starts with the latest version heading (# vX.Y.Z — ...).
31
- // We take everything up to the next top-level heading or the "## Fixes" block,
32
- // so each publish only embeds the notes for that specific release.
33
-
34
- const lines = notes.split("\n");
35
- const sectionLines = [];
36
- let inSection = false;
37
-
38
- for (const line of lines) {
39
- // First top-level heading = the latest version section
40
- if (line.startsWith("# v") && !inSection) {
41
- inSection = true;
42
- sectionLines.push(line);
43
- continue;
44
- }
45
-
46
- // Stop at the next top-level version heading or a "---" section separator
47
- // that introduces historical patch notes (e.g. "## Fixes in v1.2.x")
48
- if (inSection) {
49
- if (line.startsWith("# v")) break; // Next version block
50
- sectionLines.push(line);
51
- }
52
- }
53
-
54
- const releaseNotes = sectionLines.join("\n").trim();
55
-
56
- if (!releaseNotes) {
57
- console.error("❌ inject-release-notes: could not extract release notes from RELEASE_NOTES.md");
58
- process.exit(1);
59
- }
60
-
61
- // ─── Inject into package.json ─────────────────────────────────────────
62
-
63
- pkg.releaseNotes = releaseNotes;
64
-
65
- fs.writeFileSync(PACKAGE_JSON_PATH, JSON.stringify(pkg, null, 2) + "\n", "utf-8");
66
-
67
- console.log(`✅ inject-release-notes: injected ${releaseNotes.length} chars into package.json (v${pkg.version})`);
@@ -1,175 +0,0 @@
1
- #!/usr/bin/env node
2
- // ============================================================================
3
- // Engram — IDE Auto-Installer
4
- // Adds Engram to your IDE's MCP config with the correct path automatically.
5
- //
6
- // Usage:
7
- // node scripts/install-mcp.js (auto-detects IDEs)
8
- // node scripts/install-mcp.js --ide cursor (specific IDE)
9
- // node scripts/install-mcp.js --list (show detected IDEs)
10
- // ============================================================================
11
-
12
- import fs from "fs";
13
- import path from "path";
14
- import os from "os";
15
- import { fileURLToPath } from "url";
16
-
17
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
18
- const ENGRAM_DIST = path.resolve(__dirname, "..", "dist", "index.js");
19
- const HOME = os.homedir();
20
- const APPDATA = process.env.APPDATA || path.join(HOME, ".config");
21
-
22
- // ─── IDE Config Locations ────────────────────────────────────────────
23
-
24
- const IDE_CONFIGS = {
25
- antigravity: {
26
- name: "Antigravity IDE",
27
- paths: [
28
- path.join(HOME, ".gemini", "antigravity", "mcp_config.json"),
29
- ],
30
- format: "mcpServers",
31
- },
32
- cursor: {
33
- name: "Cursor",
34
- paths: [
35
- path.join(HOME, ".cursor", "mcp.json"),
36
- path.join(APPDATA, "Cursor", "mcp.json"),
37
- ],
38
- format: "mcpServers",
39
- },
40
- vscode: {
41
- name: "VS Code (Copilot)",
42
- paths: [
43
- path.join(APPDATA, "Code", "User", "mcp.json"),
44
- path.join(HOME, ".vscode", "mcp.json"),
45
- ],
46
- format: "servers",
47
- },
48
- cline: {
49
- name: "Cline / Roo Code",
50
- paths: [
51
- path.join(APPDATA, "Code", "User", "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json"),
52
- path.join(HOME, ".cline", "mcp_settings.json"),
53
- ],
54
- format: "mcpServers",
55
- },
56
- windsurf: {
57
- name: "Windsurf",
58
- paths: [
59
- path.join(HOME, ".codeium", "windsurf", "mcp_config.json"),
60
- path.join(APPDATA, "Windsurf", "mcp.json"),
61
- ],
62
- format: "mcpServers",
63
- },
64
- };
65
-
66
- // ─── Engram Entry ────────────────────────────────────────────────────
67
-
68
- function makeEngramEntry(format) {
69
- const entry = {
70
- command: "node",
71
- args: [ENGRAM_DIST.replace(/\\/g, "/")],
72
- env: {},
73
- };
74
-
75
- if (format === "servers") {
76
- // VS Code uses a slightly different shape
77
- return { type: "stdio", ...entry };
78
- }
79
-
80
- return entry;
81
- }
82
-
83
- // ─── Config Manipulation ─────────────────────────────────────────────
84
-
85
- function readJson(filePath) {
86
- try {
87
- return JSON.parse(fs.readFileSync(filePath, "utf-8"));
88
- } catch {
89
- return null;
90
- }
91
- }
92
-
93
- function writeJson(filePath, data) {
94
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
95
- fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", "utf-8");
96
- }
97
-
98
- function addToConfig(configPath, format) {
99
- let config = readJson(configPath) || {};
100
- const key = format; // "mcpServers" or "servers"
101
-
102
- if (!config[key]) config[key] = {};
103
-
104
- if (config[key].engram) {
105
- // Already exists — update the path
106
- config[key].engram.args = [ENGRAM_DIST.replace(/\\/g, "/")];
107
- writeJson(configPath, config);
108
- return "updated";
109
- }
110
-
111
- config[key].engram = makeEngramEntry(format);
112
- writeJson(configPath, config);
113
- return "added";
114
- }
115
-
116
- // ─── Main ────────────────────────────────────────────────────────────
117
-
118
- const args = process.argv.slice(2);
119
-
120
- if (args.includes("--list")) {
121
- console.log("\nEngram can be installed into these IDEs:\n");
122
- for (const [id, ide] of Object.entries(IDE_CONFIGS)) {
123
- const found = ide.paths.find(p => fs.existsSync(p) || fs.existsSync(path.dirname(p)));
124
- console.log(` ${id.padEnd(15)} ${ide.name} ${found ? "✅ detected" : "❌ not found"}`);
125
- }
126
- console.log(`\nEngram path: ${ENGRAM_DIST}`);
127
- process.exit(0);
128
- }
129
-
130
- // Specific IDE requested?
131
- const ideFlagIdx = args.indexOf("--ide");
132
- const targetIde = ideFlagIdx >= 0 ? args[ideFlagIdx + 1] : null;
133
-
134
- const idesToProcess = targetIde
135
- ? (IDE_CONFIGS[targetIde] ? { [targetIde]: IDE_CONFIGS[targetIde] } : null)
136
- : IDE_CONFIGS;
137
-
138
- if (!idesToProcess) {
139
- console.error(`Unknown IDE: "${targetIde}". Options: ${Object.keys(IDE_CONFIGS).join(", ")}`);
140
- process.exit(1);
141
- }
142
-
143
- console.log("\n🧠 Engram MCP Installer\n");
144
- console.log(` Engram path: ${ENGRAM_DIST}`);
145
- if (!fs.existsSync(ENGRAM_DIST)) {
146
- console.error(`\n❌ Engram dist not found at: ${ENGRAM_DIST}`);
147
- console.error(" Run 'npm run build' first.\n");
148
- process.exit(1);
149
- }
150
-
151
- let installed = 0;
152
-
153
- for (const [id, ide] of Object.entries(idesToProcess)) {
154
- const configPath = ide.paths.find(p => fs.existsSync(p)) || ide.paths[0];
155
-
156
- try {
157
- const result = addToConfig(configPath, ide.format);
158
- console.log(`\n ✅ ${ide.name}`);
159
- console.log(` Config: ${configPath}`);
160
- console.log(` Status: ${result === "added" ? "Engram added" : "Engram path updated"}`);
161
- installed++;
162
- } catch (e) {
163
- console.log(`\n ⚠️ ${ide.name}`);
164
- console.log(` Could not write to: ${configPath}`);
165
- console.log(` Reason: ${e.message}`);
166
- }
167
- }
168
-
169
- if (installed === 0) {
170
- console.log("\n No supported IDEs were found on this machine.");
171
- console.log(" Run 'node scripts/install-mcp.js --list' to see what was detected.\n");
172
- } else {
173
- console.log(`\n✅ Done! Engram installed into ${installed} IDE(s).`);
174
- console.log(" Restart your IDE(s) to load Engram.\n");
175
- }