@misterhuydo/cairn-mcp 1.2.4 → 1.2.5
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/bin/cairn-cli.js +10 -11
- package/package.json +1 -1
package/bin/cairn-cli.js
CHANGED
|
@@ -81,12 +81,8 @@ if (subcommand === 'minify') {
|
|
|
81
81
|
try {
|
|
82
82
|
fs.mkdirSync(CAIRN_DIR, { recursive: true });
|
|
83
83
|
fs.writeFileSync(MODE_FILE, mode, 'utf8');
|
|
84
|
-
console.log(`cairn: mode set to '${mode}'`);
|
|
85
|
-
if (mode === 'edit') {
|
|
86
|
-
console.log('Next Read call will return full content (auto-resets to read after).');
|
|
87
|
-
}
|
|
88
84
|
} catch (e) {
|
|
89
|
-
|
|
85
|
+
process.stderr.write(`cairn: failed to write mode file: ${e.message}\n`);
|
|
90
86
|
process.exit(1);
|
|
91
87
|
}
|
|
92
88
|
process.exit(0);
|
|
@@ -139,8 +135,14 @@ if (subcommand === 'minify') {
|
|
|
139
135
|
);
|
|
140
136
|
if (!hasMinify) {
|
|
141
137
|
preHooks.push({ matcher: 'Read', hooks: [{ type: 'command', command: 'cairn minify' }] });
|
|
142
|
-
settings.hooks.PreToolUse = preHooks;
|
|
143
138
|
}
|
|
139
|
+
const hasEditMode = preHooks.some(h =>
|
|
140
|
+
h.matcher === 'Edit' && h.hooks?.some(hh => hh.command === 'cairn set-mode edit')
|
|
141
|
+
);
|
|
142
|
+
if (!hasEditMode) {
|
|
143
|
+
preHooks.push({ matcher: 'Edit', hooks: [{ type: 'command', command: 'cairn set-mode edit' }] });
|
|
144
|
+
}
|
|
145
|
+
settings.hooks.PreToolUse = preHooks;
|
|
144
146
|
const stopHooks = settings.hooks.Stop || [];
|
|
145
147
|
const hasCheckpoint = stopHooks.some(h =>
|
|
146
148
|
h.hooks?.some(hh => hh.command === 'cairn checkpoint --auto')
|
|
@@ -163,13 +165,10 @@ if (subcommand === 'minify') {
|
|
|
163
165
|
console.log(`Cairn hooks installed in ${scope}`);
|
|
164
166
|
console.log('');
|
|
165
167
|
console.log('Active hooks:');
|
|
166
|
-
console.log(' PreToolUse[Read] → cairn minify (compress source files)');
|
|
168
|
+
console.log(' PreToolUse[Read] → cairn minify (compress source files for reading)');
|
|
169
|
+
console.log(' PreToolUse[Edit] → cairn set-mode edit (auto-enable full content before edits)');
|
|
167
170
|
console.log(' Stop → cairn checkpoint --auto (auto-save session)');
|
|
168
171
|
console.log(' UserPromptSubmit → cairn resume-hint (remind Claude of prior session)');
|
|
169
|
-
console.log('');
|
|
170
|
-
console.log('Mode commands:');
|
|
171
|
-
console.log(' cairn set-mode edit (next Read returns full content, for Edit tool use)');
|
|
172
|
-
console.log(' cairn set-mode read (default: minified content)');
|
|
173
172
|
process.exit(0);
|
|
174
173
|
} else {
|
|
175
174
|
console.error('Usage: cairn <minify|set-mode <edit|read>|checkpoint --auto|resume-hint|install-hooks [--global]>');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@misterhuydo/cairn-mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "MCP server that gives Claude Code persistent memory across sessions. Index your codebase once, search symbols, bundle source, scan for vulnerabilities, and checkpoint/resume work — across Java, TypeScript, Vue, Python, SQL and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|