Documentation
¶
Overview ¶
Package subagentstream merges host delegation events into a Runner's single adaptor Event stream as SubagentUpdate values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Merge ¶
Merge returns a Stream that carries every event of stream plus one adaptor.SubagentUpdate per delegation event published for stream.RunID() on bus. Per-source ordering is preserved (parent events in stream order, delegation events in bus order); the two sources interleave as they arrive. RunID, Result, and Cancel delegate to the parent stream, and the merged Events channel closes after the parent stream ends (terminal SubagentUpdate markers are synthesized for delegations that never reported one). A nil bus returns stream unchanged.
ctx bounds the bus subscription; cancel it (or the parent run) to detach. Like the parent stream, the merged channel must be drained.
func SubagentEvent ¶
func SubagentEvent(ev a2adelegation.DelegationEvent) adaptor.SubagentUpdate
SubagentEvent projects one DelegationEvent onto the adaptor event vocabulary. The 19 DelegationEventKinds collapse onto the three SubagentUpdate kinds (started / delta / finished); the full detail — original kind, status, remote identifiers, tool payloads, errors — is preserved in Data so nothing is lost in the projection.
The canonical projection lives in a2adelegation so host-side merging and delegation service injection produce identical SubagentUpdate values.
Types ¶
type EventBus ¶
type EventBus interface {
// SubscribeRun returns delegation events associated with runID until ctx
// is canceled or the subscription closes.
SubscribeRun(ctx context.Context, runID string) <-chan a2adelegation.DelegationEvent
}
EventBus is the minimal host-side subscription contract Merge consumes.