delimit-cli 4.1.11 → 4.1.13
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/lib/cross-model-hooks.js +24 -1
- package/package.json +1 -1
package/lib/cross-model-hooks.js
CHANGED
|
@@ -295,10 +295,19 @@ function migrateToNestedFormat(hookGroup) {
|
|
|
295
295
|
* 3. PreToolUse (Bash) + deploy patterns -> delimit security-audit
|
|
296
296
|
*/
|
|
297
297
|
function installClaudeHooks(tool, hookConfig) {
|
|
298
|
+
// Write to global ~/.claude/settings.json
|
|
298
299
|
const configPath = tool.configPath;
|
|
299
300
|
const configDir = path.dirname(configPath);
|
|
300
301
|
fs.mkdirSync(configDir, { recursive: true });
|
|
301
302
|
|
|
303
|
+
// Also write to project .claude/settings.json if the dir exists
|
|
304
|
+
const projectConfigDir = path.join(process.cwd(), '.claude');
|
|
305
|
+
const projectConfigPath = path.join(projectConfigDir, 'settings.json');
|
|
306
|
+
const writeTargets = [configPath];
|
|
307
|
+
if (fs.existsSync(projectConfigDir)) {
|
|
308
|
+
writeTargets.push(projectConfigPath);
|
|
309
|
+
}
|
|
310
|
+
|
|
302
311
|
let config = {};
|
|
303
312
|
if (fs.existsSync(configPath)) {
|
|
304
313
|
try {
|
|
@@ -324,6 +333,7 @@ function installClaudeHooks(tool, hookConfig) {
|
|
|
324
333
|
// --- SessionStart hook ---
|
|
325
334
|
// Write a standalone bash script so it works without npm in PATH
|
|
326
335
|
if (hookConfig.session_start) {
|
|
336
|
+
const home = getHome();
|
|
327
337
|
const hooksDir = path.join(home, '.claude', 'hooks');
|
|
328
338
|
fs.mkdirSync(hooksDir, { recursive: true });
|
|
329
339
|
const hookScript = path.join(hooksDir, 'delimit');
|
|
@@ -499,7 +509,20 @@ echo "=== Delimit Ready ==="
|
|
|
499
509
|
}
|
|
500
510
|
}
|
|
501
511
|
|
|
502
|
-
|
|
512
|
+
// Write hooks to all target settings files
|
|
513
|
+
const configJson = JSON.stringify(config, null, 2);
|
|
514
|
+
for (const target of writeTargets) {
|
|
515
|
+
try {
|
|
516
|
+
// For project settings, merge hooks into existing config
|
|
517
|
+
if (target !== configPath && fs.existsSync(target)) {
|
|
518
|
+
const existing = JSON.parse(fs.readFileSync(target, 'utf-8'));
|
|
519
|
+
existing.hooks = config.hooks;
|
|
520
|
+
fs.writeFileSync(target, JSON.stringify(existing, null, 2));
|
|
521
|
+
} else {
|
|
522
|
+
fs.writeFileSync(target, configJson);
|
|
523
|
+
}
|
|
524
|
+
} catch {}
|
|
525
|
+
}
|
|
503
526
|
return changes;
|
|
504
527
|
}
|
|
505
528
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "delimit-cli",
|
|
3
3
|
"mcpName": "io.github.delimit-ai/delimit-mcp-server",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.13",
|
|
5
5
|
"description": "Unify Claude Code, Codex, Cursor, and Gemini CLI with persistent context, governance, and multi-model debate.",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|