mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-05 00:33:27 +08:00
fix: add event type enum to hooks schema and avoid shared RegExp state
- hooks.schema.json: add enum constraint for hook event types (PreToolUse, PostToolUse, PreCompact, SessionStart, SessionEnd, Stop, Notification, SubagentStop) — enables IDE autocompletion and compile-time validation - utils.js countInFile: always create fresh RegExp to avoid shared lastIndex state when reusing global regex instances - README: update AgentShield stats (751 tests, 73 rules)
This commit is contained in:
@@ -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": [
|
||||
|
||||
Reference in New Issue
Block a user