Optional hook invoked by StreamMux.addTransformer immediately
after the transformer is attached to the mux. Receives a limited
handle that exposes only StreamEmitter.push — enough for
the transformer to emit synthesized ProtocolEvents on any
namespace it chooses (e.g. a deepagents SubagentTransformer
fabricating lifecycle/messages/values events under a
["tools:<tool_call_id>"] namespace when a task tool starts).
Transformers that do not synthesize events can omit this hook.
The StreamEmitter handle is only safe to call from within
StreamTransformer.process. Emitting from an unrelated async
context (e.g. after process has returned, from a setTimeout,
etc.) races with the mux's close/fail cycle and may land events in
an already-closed log.
onRegister(emitter: StreamEmitter)| Name | Type | Description |
|---|---|---|
emitter* | StreamEmitter |