diff --git a/README.md b/README.md index 2fe72ea..0e75d30 100644 --- a/README.md +++ b/README.md @@ -374,7 +374,7 @@ Both options create: ### AgentShield — Security Auditor -> Built at the Claude Code Hackathon (Cerebral Valley x Anthropic, Feb 2026). 697 tests, 98% coverage, 63 static analysis rules. +> Built at the Claude Code Hackathon (Cerebral Valley x Anthropic, Feb 2026). 751 tests, 98% coverage, 73 static analysis rules. Scan your Claude Code configuration for vulnerabilities, misconfigurations, and injection risks. diff --git a/schemas/hooks.schema.json b/schemas/hooks.schema.json index ceb2bd9..cd58cfb 100644 --- a/schemas/hooks.schema.json +++ b/schemas/hooks.schema.json @@ -11,7 +11,18 @@ ], "properties": { "type": { - "type": "string" + "type": "string", + "enum": [ + "PreToolUse", + "PostToolUse", + "PreCompact", + "SessionStart", + "SessionEnd", + "Stop", + "Notification", + "SubagentStop" + ], + "description": "Hook event type that triggers this hook" }, "command": { "oneOf": [ diff --git a/scripts/lib/utils.js b/scripts/lib/utils.js index b675a08..a0b548c 100644 --- a/scripts/lib/utils.js +++ b/scripts/lib/utils.js @@ -418,8 +418,8 @@ function countInFile(filePath, pattern) { let regex; try { if (pattern instanceof RegExp) { - // Ensure global flag is set for correct counting - regex = pattern.global ? pattern : new RegExp(pattern.source, pattern.flags.includes('g') ? pattern.flags : pattern.flags + 'g'); + // Always create new RegExp to avoid shared lastIndex state; ensure global flag + regex = new RegExp(pattern.source, pattern.flags.includes('g') ? pattern.flags : pattern.flags + 'g'); } else if (typeof pattern === 'string') { regex = new RegExp(pattern, 'g'); } else {