cc-safe-setup 28.9.0 → 29.0.0

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.
Files changed (2) hide show
  1. package/index.mjs +11 -8
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -605,16 +605,19 @@ async function installExample(name) {
605
605
  let matcher = 'Bash';
606
606
 
607
607
  // Detect trigger from header comments
608
- if (content.includes('TRIGGER: PostToolUse') || content.includes('PostToolUse')) trigger = 'PostToolUse';
609
- if (content.includes('TRIGGER: Notification') || content.includes('Notification')) trigger = 'Notification';
610
- if (content.includes('TRIGGER: Stop') || content.includes('Stop')) trigger = 'Stop';
611
- if (content.includes('TRIGGER: SessionStart') || content.includes('SessionStart')) trigger = 'SessionStart';
612
- if (content.includes('TRIGGER: PreCompact') || content.includes('PreCompact')) trigger = 'PreCompact';
613
- if (content.includes('TRIGGER: SessionEnd') || content.includes('SessionEnd')) trigger = 'SessionEnd';
614
-
615
- // Detect matcher from header
608
+ if (content.includes('TRIGGER: PermissionRequest') || content.match(/^#.*PermissionRequest hook/m)) trigger = 'PermissionRequest';
609
+ else if (content.includes('TRIGGER: PostToolUse') || content.includes('PostToolUse')) trigger = 'PostToolUse';
610
+ else if (content.includes('TRIGGER: Notification') || content.includes('Notification')) trigger = 'Notification';
611
+ else if (content.includes('TRIGGER: Stop') || content.includes('Stop')) trigger = 'Stop';
612
+ else if (content.includes('TRIGGER: SessionStart') || content.includes('SessionStart')) trigger = 'SessionStart';
613
+ else if (content.includes('TRIGGER: PreCompact') || content.includes('PreCompact')) trigger = 'PreCompact';
614
+ else if (content.includes('TRIGGER: SessionEnd') || content.includes('SessionEnd')) trigger = 'SessionEnd';
615
+
616
+ // Detect matcher from header (JSON format or comment format)
616
617
  const matcherMatch = content.match(/"matcher":\s*"([^"]*)"/);
617
618
  if (matcherMatch) matcher = matcherMatch[1];
619
+ const commentMatcher = content.match(/^#\s*Matcher:\s*(.+)$/m);
620
+ if (commentMatcher) matcher = commentMatcher[1].trim();
618
621
 
619
622
  // Update settings.json
620
623
  let settings = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-safe-setup",
3
- "version": "28.9.0",
3
+ "version": "29.0.0",
4
4
  "description": "One command to make Claude Code safe. 344 hooks (8 built-in + 336 examples). 49 CLI commands. 1018 tests. 5 languages.",
5
5
  "main": "index.mjs",
6
6
  "bin": {