Signature
eventName must be one of the supported hook events. handler receives:
event: a JSON-safe, event-specific projection;ctx: the bounded hosted context, currently{ external }.
Composition
Handlers are loaded in extension declaration order and registered in module order. They execute sequentially. Composition depends on the event:| Event family | Composition |
|---|---|
| Prompt and context transforms | Each handler receives the result accumulated so far |
| Tool call | The first blocking result stops execution; input mutations are preserved |
| Tool result | Returned fields update the result seen by later handlers |
| Provider transforms | Patches or payload replacements are applied sequentially |
| Observation events | Every registered handler is awaited |
| Before compaction | The last non-empty override wins |
| Before tree change | The first non-empty override wins |