Expand description
Middleware module — Hook chain management
Re-exports§
pub use bridge::build_hooks;pub use builtins::ContentFilterMiddleware;pub use builtins::LoggingMiddleware;pub use builtins::RateLimitMiddleware;pub use builtins::TokenBudgetMiddleware;pub use hook::HookMiddleware;pub use plugin::PluginLoader;pub use plugin::PluginManifest;
Modules§
- bridge
- Bridge connecting the legacy hooks API to the middleware pipeline.
- builtins
- Built-in middleware implementations
- hook
HookMiddleware— bridges theHookRunnerport into the pipeline so Pre/PostToolUse fire alongside audit/authorizer.HookMiddleware— bridgeHookRunnerinto the existingMiddlewarePipelineso Pre/PostToolUse hooks fire through the same path as audit/authorizer middlewares.- observability_
adapters - Adapters that bridge SDK observability/security types
(AuditLog, Authorizer) into the Middleware pipeline so they
compose with user middlewares instead of overwriting the
AgentHooks struct. See module docs for design rationale.
Observability adapters — bridges for SDK observability types into the
Middlewarepipeline so they cooperate with user-added middleware instead of overwriting it. - plugin
- Plugin loader for dynamic middleware loading
Structs§
- Middleware
Context - Context passed to middleware during execution.
- Middleware
Pipeline - Ordered chain of middlewares executed phase by phase.
- Middleware
Result - Result of middleware execution.
Enums§
- Middleware
Action - Middleware action — determines how the pipeline continues.
- Middleware
Data - Middleware data — context passed to middlewares per phase.
- Middleware
Phase - Middleware execution phase.
Traits§
- Middleware
- Middleware trait — implement this to add behavior to the agent pipeline.