Raw-events escape hatch. Subscribes to one or more channels at a namespace and returns a bounded buffer of raw protocol events.
The buffer keeps accumulating across serial runs for the lifetime of
the thread, so this is the hook to use for an event log / stream of a
custom channel (e.g. ["custom:redaction-stats"]). When you only need
the latest payload of a single custom:<name> channel, prefer
useExtension. For the common message/tool/value cases prefer
useMessages / useToolCalls / useValues.
useChannel(
stream: AnyStream,
channels: readonly Channel[],
target: SelectorTarget,
options: ChannelProjectionOptions
): Event[]| Name | Type | Description |
|---|---|---|
stream* | AnyStream | |
channels* | readonly Channel[] | |
target | SelectorTarget | |
options | ChannelProjectionOptions |