mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-02-18 12:13:09 +08:00
- hooks.schema.json: add async (boolean) and timeout (number) properties to hookItem definition, matching fields used in hooks.json - validate-hooks.js: validate async and timeout types when present - hooks.test.js: add SessionEnd to required event types check
90 lines
1.9 KiB
JSON
90 lines
1.9 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"
|
|
},
|
|
"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"
|
|
}
|
|
}
|
|
]
|
|
} |