Skip to main content

Module hook

Module hook 

Source
Expand description

HookMiddleware — bridges the HookRunner port into the pipeline so Pre/PostToolUse fire alongside audit/authorizer. HookMiddleware — bridge HookRunner into the existing MiddlewarePipeline so Pre/PostToolUse hooks fire through the same path as audit/authorizer middlewares.

SubagentStop is fired here as a side effect: when an AfterTool call has tool_name == "subagent", we additionally invoke runner.run(SubagentStop, ctx) so users only need a single matcher rule. SessionStart / SessionEnd / Stop / Notification are NOT fired here — those are product-lifecycle events owned by the composition root.

Structs§

HookMiddleware
Middleware that routes BeforeTool / AfterTool phases through the registered HookRunner as PreToolUse / PostToolUse events.