Skip to content
Developer Preview

HookDeclaration

Experimental

One declared plugin hook.

  • event — Experimental
  • hookId — Experimental
  • matcher — Experimental
  • pluginId — Experimental
  • timeoutMs — Experimental
Source

schema/msp/experimental/msp.schema.json#/types/HookDeclaration

{
"description": "One declared plugin hook.",
"properties": {
"event": {
"$ref": "#/$defs/HookEventName",
"description": "The agent's hook event for the plugin event, as `hook/list` spells it: only\n`sessionStart`, `userPromptSubmit`, `preToolUse`, `postToolUse` and\n`stop` are hook events of a plugin."
},
"hookId": {
"description": "The hook's `contributes.hooks[].id`.",
"pattern": "^[A-Za-z0-9_.-]{1,128}$",
"type": "string"
},
"matcher": {
"description": "A tool name pattern, only for `preToolUse` and `postToolUse`.",
"type": "string"
},
"pluginId": {
"description": "The plugin's ID.",
"type": "string"
},
"timeoutMs": {
"description": "The hook's deadline in milliseconds; 2,000 when absent.",
"maximum": 10000,
"minimum": 1,
"type": "integer"
}
},
"required": [
"event",
"hookId",
"pluginId"
],
"type": "object",
"x-msp-descriptor": "hook/declare",
"x-msp-stability": "experimental"
}