memtrace 0.1.24 → 0.1.26
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 +15 -20
- package/bin/memtrace.js +26 -1
- package/package.json +5 -3
- package/uninstall.js +183 -0
package/README.md
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
<a href="https://memtrace.dev"><img src="https://img.shields.io/badge/docs-memtrace.dev-00D4B8?style=flat-square" alt="docs" /></a>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
+
> **Early Access** — Memtrace is under active development. Core indexing and structural search are stable. Temporal features (evolution scoring, timeline replay) are functional but may have rough edges. [Report issues here.](https://github.com/syncable-dev/memtrace-public/issues)
|
|
19
|
+
|
|
18
20
|
---
|
|
19
21
|
|
|
20
22
|
Memtrace gives coding agents something they've never had: **structural memory**. Not vector similarity. Not semantic chunking. A real knowledge graph compiled from your codebase's AST — where every function, class, interface, and API endpoint exists as a node with deterministic, typed relationships.
|
|
@@ -56,35 +58,19 @@ All benchmarks run on the same machine, same codebase, same queries. No cherry-p
|
|
|
56
58
|
|
|
57
59
|
### Does it find the right thing?
|
|
58
60
|
|
|
59
|
-
<
|
|
60
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/search-accuracy.svg"/>
|
|
61
|
-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/search-accuracy.svg"/>
|
|
62
|
-
<img alt="Search accuracy: Memtrace 83.5% vs Vector RAG 25.8%" src="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/search-accuracy.svg" width="720"/>
|
|
63
|
-
</picture>
|
|
61
|
+
<img alt="Search accuracy: Memtrace 83.5% vs Vector RAG 25.8%" src="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/search-accuracy.svg" width="720"/>
|
|
64
62
|
|
|
65
63
|
### How fast?
|
|
66
64
|
|
|
67
|
-
<
|
|
68
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/search-latency.svg"/>
|
|
69
|
-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/search-latency.svg"/>
|
|
70
|
-
<img alt="Search latency: Memtrace 4.6ms vs GitNexus 220ms vs CodeGrapher 466.7ms" src="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/search-latency.svg" width="720"/>
|
|
71
|
-
</picture>
|
|
65
|
+
<img alt="Search latency: Memtrace 4.6ms vs GitNexus 220ms vs CodeGrapher 466.7ms" src="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/search-latency.svg" width="720"/>
|
|
72
66
|
|
|
73
67
|
### How much context does it save?
|
|
74
68
|
|
|
75
|
-
<
|
|
76
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/token-context.svg"/>
|
|
77
|
-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/token-context.svg"/>
|
|
78
|
-
<img alt="Token usage: Memtrace 284K vs Vector RAG 2.4M — 88.2% reduction" src="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/token-context.svg" width="720"/>
|
|
79
|
-
</picture>
|
|
69
|
+
<img alt="Token usage: Memtrace 284K vs Vector RAG 2.4M — 88.2% reduction" src="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/token-context.svg" width="720"/>
|
|
80
70
|
|
|
81
71
|
### How long to set up?
|
|
82
72
|
|
|
83
|
-
<
|
|
84
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/indexing-speed.svg"/>
|
|
85
|
-
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/indexing-speed.svg"/>
|
|
86
|
-
<img alt="Indexing: Memtrace 1.5s vs Graphiti 6h vs Mem0 31m" src="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/indexing-speed.svg" width="720"/>
|
|
87
|
-
</picture>
|
|
73
|
+
<img alt="Indexing: Memtrace 1.5s vs Graphiti 6h vs Mem0 31m" src="https://raw.githubusercontent.com/syncable-dev/memtrace-public/main/assets/benchmarks/indexing-speed.svg" width="720"/>
|
|
88
74
|
|
|
89
75
|
<details>
|
|
90
76
|
<summary><strong>Memtrace vs. general memory systems (Mem0, Graphiti)</strong></summary>
|
|
@@ -247,6 +233,15 @@ Skills and plugins are shared between Claude Code and Claude Desktop — both ac
|
|
|
247
233
|
}
|
|
248
234
|
```
|
|
249
235
|
|
|
236
|
+
### Uninstall
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
memtrace uninstall # removes skills, MCP server, and plugin from settings
|
|
240
|
+
npm uninstall -g memtrace # removes the binary
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
> **Why two commands?** npm v7+ [does not run lifecycle hooks](https://github.com/npm/cli/issues/3042) for global packages. `memtrace uninstall` handles the cleanup that npm can't.
|
|
244
|
+
|
|
250
245
|
## Languages
|
|
251
246
|
|
|
252
247
|
Rust · Go · TypeScript · JavaScript · Python · Java · C · C++ · C# · Swift · Kotlin · Ruby · PHP · Dart · Scala · Perl — and more via Tree-sitter.
|
package/bin/memtrace.js
CHANGED
|
@@ -4,6 +4,31 @@
|
|
|
4
4
|
const { spawnSync } = require("child_process");
|
|
5
5
|
const { getBinaryPath } = require("../install.js");
|
|
6
6
|
|
|
7
|
+
// ── Handle `memtrace uninstall` before delegating to the Rust binary ────────
|
|
8
|
+
// npm v7+ does NOT fire preuninstall hooks for global packages (npm/cli#3042).
|
|
9
|
+
// This command provides reliable cleanup users can run before `npm uninstall -g`.
|
|
10
|
+
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
|
|
13
|
+
if (args[0] === "uninstall" || args[0] === "cleanup") {
|
|
14
|
+
const path = require("path");
|
|
15
|
+
const uninstallPath = path.join(__dirname, "..", "uninstall.js");
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
// Load and run the uninstall script directly
|
|
19
|
+
require(uninstallPath);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.error(`memtrace: uninstall failed: ${e.message}`);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
console.log("");
|
|
26
|
+
console.log("Now run: npm uninstall -g memtrace");
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// ── Delegate everything else to the Rust binary ─────────────────────────────
|
|
31
|
+
|
|
7
32
|
let binaryPath;
|
|
8
33
|
try {
|
|
9
34
|
binaryPath = getBinaryPath();
|
|
@@ -12,7 +37,7 @@ try {
|
|
|
12
37
|
process.exit(1);
|
|
13
38
|
}
|
|
14
39
|
|
|
15
|
-
const result = spawnSync(binaryPath,
|
|
40
|
+
const result = spawnSync(binaryPath, args, {
|
|
16
41
|
stdio: "inherit",
|
|
17
42
|
env: process.env,
|
|
18
43
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memtrace",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "Code intelligence graph — MCP server + AI agent skills + visualization UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -23,10 +23,12 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"bin/",
|
|
25
25
|
"skills/",
|
|
26
|
-
"install.js"
|
|
26
|
+
"install.js",
|
|
27
|
+
"uninstall.js"
|
|
27
28
|
],
|
|
28
29
|
"scripts": {
|
|
29
|
-
"postinstall": "node install.js"
|
|
30
|
+
"postinstall": "node install.js",
|
|
31
|
+
"preuninstall": "node uninstall.js"
|
|
30
32
|
},
|
|
31
33
|
"optionalDependencies": {
|
|
32
34
|
"@memtrace/darwin-arm64": "0.1.0",
|
package/uninstall.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const os = require("os");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const { execSync } = require("child_process");
|
|
8
|
+
|
|
9
|
+
// ── Constants ─────────────────────────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
const PLUGIN_NAME = "memtrace-skills";
|
|
12
|
+
const MARKETPLACE_NAME = "memtrace";
|
|
13
|
+
const MCP_SERVER_NAME = "memtrace";
|
|
14
|
+
|
|
15
|
+
const SKILL_NAMES = [
|
|
16
|
+
// Commands
|
|
17
|
+
"memtrace-api-topology",
|
|
18
|
+
"memtrace-evolution",
|
|
19
|
+
"memtrace-graph",
|
|
20
|
+
"memtrace-impact",
|
|
21
|
+
"memtrace-index",
|
|
22
|
+
"memtrace-quality",
|
|
23
|
+
"memtrace-relationships",
|
|
24
|
+
"memtrace-search",
|
|
25
|
+
// Workflows
|
|
26
|
+
"memtrace-change-impact-analysis",
|
|
27
|
+
"memtrace-codebase-exploration",
|
|
28
|
+
"memtrace-incident-investigation",
|
|
29
|
+
"memtrace-refactoring-guide",
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
// ── Remove skills ───────────────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
function removeSkills() {
|
|
35
|
+
const claudeSkillsDir = path.join(os.homedir(), ".claude", "skills");
|
|
36
|
+
let removed = 0;
|
|
37
|
+
|
|
38
|
+
for (const name of SKILL_NAMES) {
|
|
39
|
+
const skillDir = path.join(claudeSkillsDir, name);
|
|
40
|
+
if (fs.existsSync(skillDir)) {
|
|
41
|
+
try {
|
|
42
|
+
fs.rmSync(skillDir, { recursive: true, force: true });
|
|
43
|
+
removed++;
|
|
44
|
+
} catch (e) {
|
|
45
|
+
console.warn(`memtrace: failed to remove skill ${name}: ${e.message}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (removed > 0) {
|
|
51
|
+
console.log(`memtrace: removed ${removed} skills from ${claudeSkillsDir}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ── Settings.json helpers ────────────────────────────────────────────────────
|
|
56
|
+
|
|
57
|
+
function readSettings() {
|
|
58
|
+
const settingsFile = path.join(os.homedir(), ".claude", "settings.json");
|
|
59
|
+
if (fs.existsSync(settingsFile)) {
|
|
60
|
+
try {
|
|
61
|
+
return JSON.parse(fs.readFileSync(settingsFile, "utf-8"));
|
|
62
|
+
} catch {
|
|
63
|
+
return {};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return {};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function writeSettings(settings) {
|
|
70
|
+
const settingsFile = path.join(os.homedir(), ".claude", "settings.json");
|
|
71
|
+
fs.writeFileSync(settingsFile, JSON.stringify(settings, null, 2) + "\n");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ── Remove MCP server ───────────────────────────────────────────────────────
|
|
75
|
+
|
|
76
|
+
function removeMcpServer() {
|
|
77
|
+
const settings = readSettings();
|
|
78
|
+
let changed = false;
|
|
79
|
+
|
|
80
|
+
if (settings.mcpServers && settings.mcpServers[MCP_SERVER_NAME]) {
|
|
81
|
+
delete settings.mcpServers[MCP_SERVER_NAME];
|
|
82
|
+
if (Object.keys(settings.mcpServers).length === 0) {
|
|
83
|
+
delete settings.mcpServers;
|
|
84
|
+
}
|
|
85
|
+
changed = true;
|
|
86
|
+
console.log("memtrace: removed MCP server from ~/.claude/settings.json");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (changed) writeSettings(settings);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ── Remove plugin + marketplace ─────────────────────────────────────────────
|
|
93
|
+
|
|
94
|
+
function removePlugin() {
|
|
95
|
+
const settings = readSettings();
|
|
96
|
+
let changed = false;
|
|
97
|
+
const pluginKey = `${PLUGIN_NAME}@${MARKETPLACE_NAME}`;
|
|
98
|
+
|
|
99
|
+
if (settings.enabledPlugins && settings.enabledPlugins[pluginKey] !== undefined) {
|
|
100
|
+
delete settings.enabledPlugins[pluginKey];
|
|
101
|
+
if (Object.keys(settings.enabledPlugins).length === 0) {
|
|
102
|
+
delete settings.enabledPlugins;
|
|
103
|
+
}
|
|
104
|
+
changed = true;
|
|
105
|
+
console.log(`memtrace: removed plugin ${pluginKey}`);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (settings.extraKnownMarketplaces && settings.extraKnownMarketplaces[MARKETPLACE_NAME]) {
|
|
109
|
+
delete settings.extraKnownMarketplaces[MARKETPLACE_NAME];
|
|
110
|
+
if (Object.keys(settings.extraKnownMarketplaces).length === 0) {
|
|
111
|
+
delete settings.extraKnownMarketplaces;
|
|
112
|
+
}
|
|
113
|
+
changed = true;
|
|
114
|
+
console.log(`memtrace: removed marketplace ${MARKETPLACE_NAME}`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (changed) writeSettings(settings);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ── Try Claude CLI uninstall ────────────────────────────────────────────────
|
|
121
|
+
|
|
122
|
+
function tryClaudeCliUninstall() {
|
|
123
|
+
try {
|
|
124
|
+
execSync("which claude", { stdio: "ignore" });
|
|
125
|
+
} catch {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
try {
|
|
130
|
+
execSync(`claude plugin uninstall ${PLUGIN_NAME}@${MARKETPLACE_NAME} --scope user`, {
|
|
131
|
+
stdio: "ignore",
|
|
132
|
+
timeout: 15000,
|
|
133
|
+
});
|
|
134
|
+
console.log("memtrace: uninstalled plugin via Claude CLI");
|
|
135
|
+
return true;
|
|
136
|
+
} catch {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// ── Main uninstall logic ───────────────────────────────────────────────────
|
|
142
|
+
|
|
143
|
+
function run() {
|
|
144
|
+
console.log("memtrace: cleaning up...");
|
|
145
|
+
|
|
146
|
+
// 1. Remove skills
|
|
147
|
+
try {
|
|
148
|
+
removeSkills();
|
|
149
|
+
} catch (e) {
|
|
150
|
+
console.warn(`memtrace: skill removal failed: ${e.message}`);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// 2. Try Claude CLI uninstall, then manual cleanup
|
|
154
|
+
try {
|
|
155
|
+
tryClaudeCliUninstall();
|
|
156
|
+
} catch (e) {
|
|
157
|
+
// silent
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// 3. Remove plugin + marketplace from settings
|
|
161
|
+
try {
|
|
162
|
+
removePlugin();
|
|
163
|
+
} catch (e) {
|
|
164
|
+
console.warn(`memtrace: plugin removal failed: ${e.message}`);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// 4. Remove MCP server from settings
|
|
168
|
+
try {
|
|
169
|
+
removeMcpServer();
|
|
170
|
+
} catch (e) {
|
|
171
|
+
console.warn(`memtrace: MCP server removal failed: ${e.message}`);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
console.log("memtrace: uninstall complete");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Run when called directly (npm preuninstall hook) or when require()'d
|
|
178
|
+
if (require.main === module) {
|
|
179
|
+
run();
|
|
180
|
+
} else {
|
|
181
|
+
// Called via `memtrace uninstall` — run immediately
|
|
182
|
+
run();
|
|
183
|
+
}
|