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

Merged
mvhutz merged 2 commits from feat/better-emitter into main 2026-01-14 00:30:21 +00:00

2 Commits

Author SHA1 Message Date
93cb7ccd78 fix: initialize BaseEmitter in Engine constructor
The Engine struct embeds BaseEmitter but wasn't initializing it,
causing a nil map panic when emitting events. Now properly
initializes the BaseEmitter using emitter.New[Event]().
2026-01-13 19:29:11 -05:00
6b946fb5dc 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
2026-01-13 19:27:56 -05:00