mixgram 1.1.0 → 1.1.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/README.md +3 -5
- package/bin/mixgram.js +4 -4
- package/package.json +1 -1
- package/spec/run-tests.js +2 -1
- package/spec/scenarios/scenarios.js +4 -0
- package/src/config.js +2 -2
- package/src/fs/paths.js +32 -3
package/README.md
CHANGED
|
@@ -70,8 +70,7 @@ Add to Cursor’s MCP config (or run `mixgram setup cursor`):
|
|
|
70
70
|
"mcpServers": {
|
|
71
71
|
"mixgram": {
|
|
72
72
|
"command": "mixgram",
|
|
73
|
-
"args": ["mcp"]
|
|
74
|
-
"cwd": "${workspaceFolder}"
|
|
73
|
+
"args": ["mcp", "--project-memory", "${workspaceFolder}/mixgram"]
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
76
|
}
|
|
@@ -82,12 +81,11 @@ With embeddings and custom paths via args:
|
|
|
82
81
|
```json
|
|
83
82
|
"mixgram": {
|
|
84
83
|
"command": "mixgram",
|
|
85
|
-
"args": ["mcp", "--embeddings", "--home", "/data/memory", "--project-memory", "
|
|
86
|
-
"cwd": "${workspaceFolder}"
|
|
84
|
+
"args": ["mcp", "--embeddings", "--home", "/data/memory", "--project-memory", "${workspaceFolder}/specs"]
|
|
87
85
|
}
|
|
88
86
|
```
|
|
89
87
|
|
|
90
|
-
Set `
|
|
88
|
+
Set `--project-memory` with `${workspaceFolder}` because Cursor supports interpolation in `args`, and that keeps project docs inside the active repo without relying on `cwd`. Or use a config file (see below) and just `"args": ["mcp"]`. Restart Cursor after changing config.
|
|
91
89
|
|
|
92
90
|
---
|
|
93
91
|
|
package/bin/mixgram.js
CHANGED
|
@@ -101,10 +101,10 @@ const MIXGRAM_ENTRY = {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
const CURSOR_MIXGRAM_ENTRY = {
|
|
104
|
-
|
|
105
|
-
// Cursor
|
|
106
|
-
//
|
|
107
|
-
|
|
104
|
+
command: 'mixgram',
|
|
105
|
+
// Cursor supports interpolation in args, so force project-scoped docs into
|
|
106
|
+
// the active workspace without relying on cwd resolution.
|
|
107
|
+
args: ['mcp', '--project-memory', '${workspaceFolder}/docs']
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
function cursorMcpPath() {
|
package/package.json
CHANGED
package/spec/run-tests.js
CHANGED
|
@@ -84,7 +84,8 @@ function runCliSetupChecks() {
|
|
|
84
84
|
const entry = cursorConfig?.mcpServers?.mixgram;
|
|
85
85
|
ok(entry?.command === 'mixgram', 'cursor entry command preserved');
|
|
86
86
|
ok(Array.isArray(entry?.args) && entry.args[0] === 'mcp', 'cursor entry args preserved');
|
|
87
|
-
ok(entry?.
|
|
87
|
+
ok(entry?.args?.[1] === '--project-memory', 'cursor entry overrides project memory');
|
|
88
|
+
ok(entry?.args?.[2] === '${workspaceFolder}/mixgram', 'cursor entry uses workspaceFolder in args');
|
|
88
89
|
} catch (err) {
|
|
89
90
|
if (reporter.VISUAL) reporter.check('CLI setup cursor config threw', false, err.message);
|
|
90
91
|
f += 1;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* ctx: { h, parse, config, fs, reporter, ok } where ok(cond, msg) counts and optionally prints check.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import path from 'path';
|
|
8
|
+
|
|
7
9
|
import {
|
|
8
10
|
decisionSqliteIndex,
|
|
9
11
|
decisionSqliteIndexRevision2,
|
|
@@ -44,6 +46,7 @@ export const scenarios = [
|
|
|
44
46
|
ok(s1.success && s1.id && s1.created === true, 'save success');
|
|
45
47
|
ok(fs.existsSync(s1.path), 'file created');
|
|
46
48
|
ok(s1.path.includes('mixgram') || s1.path.replace(/\\/g, '/').includes('mixgram'), 'project doc under mixgram');
|
|
49
|
+
ok(path.basename(s1.path) === 'architecture-sqlite-derived-index.md', 'project doc filename omits redundant prefixes');
|
|
47
50
|
|
|
48
51
|
const search1 = await h.mem_search({ query: 'derived SQLite index', project: PROJECT_NAME });
|
|
49
52
|
const search1Parsed = parseRes(search1);
|
|
@@ -74,6 +77,7 @@ export const scenarios = [
|
|
|
74
77
|
const s2 = parseRes(save2);
|
|
75
78
|
reporter.step('mem_save (home)', { scope: 'home', topic_key: patternIncrementalReindex.topic_key }, { path: s2.path, created: s2.created });
|
|
76
79
|
ok(s2.success && s2.path && s2.path.includes('home'), 'home save');
|
|
80
|
+
ok(path.basename(s2.path) === 'incremental-reindexing.md', 'home doc filename omits folder category');
|
|
77
81
|
|
|
78
82
|
const searchMerged = await h.mem_search({ query: 'reindex', scope_mode: 'merged', project: PROJECT_NAME });
|
|
79
83
|
const mergedParsed = parseRes(searchMerged);
|
package/src/config.js
CHANGED
|
@@ -10,8 +10,8 @@ function expandHome(p) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const DEFAULT_CONFIG = {
|
|
13
|
-
homeMemoryRoot: '~/.mixgram/
|
|
14
|
-
projectMemoryRoot: './
|
|
13
|
+
homeMemoryRoot: '~/.mixgram/docs',
|
|
14
|
+
projectMemoryRoot: './docs',
|
|
15
15
|
sqlitePath: '~/.mixgram/index.db',
|
|
16
16
|
watch: true,
|
|
17
17
|
indexing: {
|
package/src/fs/paths.js
CHANGED
|
@@ -32,10 +32,38 @@ function slugFromTopicKey(topicKey) {
|
|
|
32
32
|
.replace(/^-|-$/g, '') || 'note';
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
function filenameSlugFromTopicKey(topicKey, { project = null, type = null } = {}) {
|
|
36
|
+
if (!topicKey || typeof topicKey !== 'string') return 'note';
|
|
37
|
+
|
|
38
|
+
const segments = topicKey
|
|
39
|
+
.split('/')
|
|
40
|
+
.map((segment) => segment.trim())
|
|
41
|
+
.filter(Boolean);
|
|
42
|
+
|
|
43
|
+
if (segments.length === 0) return 'note';
|
|
44
|
+
|
|
45
|
+
const normalizedProject = slugFromTopicKey(project);
|
|
46
|
+
if (normalizedProject !== 'note' && slugFromTopicKey(segments[0]) === normalizedProject) {
|
|
47
|
+
segments.shift();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const typeDir = TYPE_TO_DIR[type] || 'generated';
|
|
51
|
+
const redundantPrefixes = new Set([
|
|
52
|
+
slugFromTopicKey(type),
|
|
53
|
+
slugFromTopicKey(typeDir)
|
|
54
|
+
].filter((value) => value !== 'note'));
|
|
55
|
+
|
|
56
|
+
if (segments.length > 1 && redundantPrefixes.has(slugFromTopicKey(segments[0]))) {
|
|
57
|
+
segments.shift();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return slugFromTopicKey(segments.join('-'));
|
|
61
|
+
}
|
|
62
|
+
|
|
35
63
|
function documentPath(config, { scope, project, type, topic_key, id }) {
|
|
36
64
|
const typeDir = TYPE_TO_DIR[type] || 'generated';
|
|
37
|
-
const slug =
|
|
38
|
-
const baseName = `${
|
|
65
|
+
const slug = filenameSlugFromTopicKey(topic_key, { project, type });
|
|
66
|
+
const baseName = `${slug}.md`;
|
|
39
67
|
|
|
40
68
|
if (scope === 'home') {
|
|
41
69
|
const root = config.homeMemoryRoot;
|
|
@@ -75,5 +103,6 @@ export {
|
|
|
75
103
|
mixgramDir,
|
|
76
104
|
ensureMixgramDir,
|
|
77
105
|
TYPE_TO_DIR,
|
|
78
|
-
slugFromTopicKey
|
|
106
|
+
slugFromTopicKey,
|
|
107
|
+
filenameSlugFromTopicKey
|
|
79
108
|
};
|