package port // StreamEvent represents an event to be published on a stream. type StreamEvent struct { Type string Data map[string]any } // StreamPublisher defines operations for managing SSE event streams. type StreamPublisher interface { // Subscribe creates a subscription to events for the given stream ID. // Returns a channel that will receive events and a cleanup function. Subscribe(streamID string) (<-chan StreamEvent, func()) // Publish sends an event to all subscribers of a stream. Publish(streamID string, event StreamEvent) // Close closes a stream and all its subscriptions. Close(streamID string) }