@sdsrs/code-graph 0.8.1 → 0.8.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.
|
@@ -13,8 +13,11 @@ const INDEX_LINE = '- [code-graph-mcp](plugin_code_graph_mcp.md) — "谁调 X /
|
|
|
13
13
|
const TEMPLATE_PATH = path.resolve(__dirname, '..', 'templates', 'plugin_code_graph_mcp.md');
|
|
14
14
|
const TARGET_NAME = 'plugin_code_graph_mcp.md';
|
|
15
15
|
|
|
16
|
+
// Claude Code slug convention: every non-alphanumeric-non-hyphen char → `-`.
|
|
17
|
+
// `/mnt/data_ssd/dev/proj` → `-mnt-data-ssd-dev-proj`
|
|
18
|
+
// `/home/sds/.claude/x` → `-home-sds--claude-x` (double-dash from `/.`)
|
|
16
19
|
function memoryDir(cwd = process.cwd(), home = os.homedir()) {
|
|
17
|
-
const slug = cwd.replace(
|
|
20
|
+
const slug = cwd.replace(/[^a-zA-Z0-9-]/g, '-');
|
|
18
21
|
return path.join(home, '.claude', 'projects', slug, 'memory');
|
|
19
22
|
}
|
|
20
23
|
|
|
@@ -26,6 +26,24 @@ test('memoryDir slugifies cwd path', () => {
|
|
|
26
26
|
assert.strictEqual(dir, '/home/alice/.claude/projects/-home-alice-proj/memory');
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
+
test('memoryDir replaces underscores and dots (Claude Code slug convention)', () => {
|
|
30
|
+
// Real-world bug: /mnt/data_ssd/... needs data-ssd slug, not data_ssd
|
|
31
|
+
assert.strictEqual(
|
|
32
|
+
memoryDir('/mnt/data_ssd/dev/projects/code-graph-mcp', '/home/u'),
|
|
33
|
+
'/home/u/.claude/projects/-mnt-data-ssd-dev-projects-code-graph-mcp/memory'
|
|
34
|
+
);
|
|
35
|
+
// Hidden dirs: /home/sds/.claude/x → -home-sds--claude-x (double-dash)
|
|
36
|
+
assert.strictEqual(
|
|
37
|
+
memoryDir('/home/sds/.claude/x', '/home/sds'),
|
|
38
|
+
'/home/sds/.claude/projects/-home-sds--claude-x/memory'
|
|
39
|
+
);
|
|
40
|
+
// Preserves case and hyphens
|
|
41
|
+
assert.strictEqual(
|
|
42
|
+
memoryDir('/Users/Alice/my-Project_v2.1', '/'),
|
|
43
|
+
'/.claude/projects/-Users-Alice-my-Project-v2-1/memory'
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
|
|
29
47
|
test('adopt writes template and appends sentinel block when index absent', () => {
|
|
30
48
|
const sb = makeSandbox();
|
|
31
49
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdsrs/code-graph",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "MCP server that indexes codebases into an AST knowledge graph with semantic search, call graph traversal, and HTTP route tracing",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"node": ">=16"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@sdsrs/code-graph-linux-x64": "0.8.
|
|
38
|
-
"@sdsrs/code-graph-linux-arm64": "0.8.
|
|
39
|
-
"@sdsrs/code-graph-darwin-x64": "0.8.
|
|
40
|
-
"@sdsrs/code-graph-darwin-arm64": "0.8.
|
|
41
|
-
"@sdsrs/code-graph-win32-x64": "0.8.
|
|
37
|
+
"@sdsrs/code-graph-linux-x64": "0.8.2",
|
|
38
|
+
"@sdsrs/code-graph-linux-arm64": "0.8.2",
|
|
39
|
+
"@sdsrs/code-graph-darwin-x64": "0.8.2",
|
|
40
|
+
"@sdsrs/code-graph-darwin-arm64": "0.8.2",
|
|
41
|
+
"@sdsrs/code-graph-win32-x64": "0.8.2"
|
|
42
42
|
}
|
|
43
43
|
}
|