refactor: replace string-based emitter with type-safe generic event system

Refactors the event emitter system from string-based messages to a
type-safe generic implementation using typed events. Consolidates
separate tracker packages into a unified plugins architecture.

Changes:
- Replace Emitter with BaseEmitter[E comparable] using generics
- Add Event type with StartEvent, StepEvent, and StopEvent constants
- Create Listener[E] interface with BaseListener implementation
- Consolidate explanation, performance, and statistics trackers into
  internal/plugins package
- Simplify main CLI by using plugin constructors instead of manual
  event subscription
- Add Items() iterator method to Set for idiomatic range loops
This commit is contained in:
2026-01-13 19:27:56 -05:00
parent 335ce95c50
commit 6b946fb5dc
11 changed files with 164 additions and 109 deletions

View File

@@ -1,5 +1,7 @@
package set
import "iter"
type Set[T comparable] map[T]bool
func (s *Set[T]) Add(items ...T) {
@@ -34,6 +36,16 @@ func (s Set[T]) ToList() []T {
return list
}
func (s Set[T]) Items() iter.Seq[T] {
return func(yield func(T) bool) {
for item := range s {
if !yield(item) {
return
}
}
}
}
func New[T comparable](items ...T) *Set[T] {
result := &Set[T]{}