cc-safe-setup 28.8.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 +15 -8
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -421,6 +421,10 @@ function examples() {
421
421
  'auto-approve-maven.sh': 'Auto-approve mvn compile/test/verify',
422
422
  'permission-cache.sh': 'Auto-approve previously approved commands in session',
423
423
  'auto-approve-readonly.sh': 'Auto-approve 50+ read-only commands (cat, ls, grep, find)',
424
+ 'auto-approve-compound-git.sh': 'PermissionRequest: auto-approve compound git commands (cd && git)',
425
+ 'allow-git-hooks-dir.sh': 'PermissionRequest: allow writes to .git/hooks/ directory',
426
+ 'allow-claude-settings.sh': 'PermissionRequest: allow writes to .claude/ (isolated environments)',
427
+ 'allow-protected-dirs.sh': 'PermissionRequest: allow ALL protected directory writes (containers only)',
424
428
  },
425
429
  'Quality': {
426
430
  'branch-name-check.sh': 'Warn on non-conventional branch names',
@@ -601,16 +605,19 @@ async function installExample(name) {
601
605
  let matcher = 'Bash';
602
606
 
603
607
  // Detect trigger from header comments
604
- if (content.includes('TRIGGER: PostToolUse') || content.includes('PostToolUse')) trigger = 'PostToolUse';
605
- if (content.includes('TRIGGER: Notification') || content.includes('Notification')) trigger = 'Notification';
606
- if (content.includes('TRIGGER: Stop') || content.includes('Stop')) trigger = 'Stop';
607
- if (content.includes('TRIGGER: SessionStart') || content.includes('SessionStart')) trigger = 'SessionStart';
608
- if (content.includes('TRIGGER: PreCompact') || content.includes('PreCompact')) trigger = 'PreCompact';
609
- if (content.includes('TRIGGER: SessionEnd') || content.includes('SessionEnd')) trigger = 'SessionEnd';
610
-
611
- // 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)
612
617
  const matcherMatch = content.match(/"matcher":\s*"([^"]*)"/);
613
618
  if (matcherMatch) matcher = matcherMatch[1];
619
+ const commentMatcher = content.match(/^#\s*Matcher:\s*(.+)$/m);
620
+ if (commentMatcher) matcher = commentMatcher[1].trim();
614
621
 
615
622
  // Update settings.json
616
623
  let settings = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-safe-setup",
3
- "version": "28.8.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": {