mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-02-16 03:13:08 +08:00
- 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)
101 lines
2.2 KiB
JSON
101 lines
2.2 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Claude Code Hooks Configuration",
|
|
"description": "Configuration for Claude Code hooks. Event types are validated at runtime and must be one of: PreToolUse, PostToolUse, PreCompact, SessionStart, SessionEnd, Stop, Notification, SubagentStop",
|
|
"$defs": {
|
|
"hookItem": {
|
|
"type": "object",
|
|
"required": [
|
|
"type",
|
|
"command"
|
|
],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"PreToolUse",
|
|
"PostToolUse",
|
|
"PreCompact",
|
|
"SessionStart",
|
|
"SessionEnd",
|
|
"Stop",
|
|
"Notification",
|
|
"SubagentStop"
|
|
],
|
|
"description": "Hook event type that triggers this hook"
|
|
},
|
|
"command": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"async": {
|
|
"type": "boolean",
|
|
"description": "Run hook asynchronously in background without blocking"
|
|
},
|
|
"timeout": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"description": "Timeout in seconds for async hooks"
|
|
}
|
|
}
|
|
},
|
|
"matcherEntry": {
|
|
"type": "object",
|
|
"required": [
|
|
"matcher",
|
|
"hooks"
|
|
],
|
|
"properties": {
|
|
"matcher": {
|
|
"type": "string"
|
|
},
|
|
"hooks": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/$defs/hookItem"
|
|
}
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"oneOf": [
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"$schema": {
|
|
"type": "string"
|
|
},
|
|
"hooks": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/$defs/matcherEntry"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"hooks"
|
|
]
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/$defs/matcherEntry"
|
|
}
|
|
}
|
|
]
|
|
} |