src/orchestrator/plugin-host.ts — eventSink wiring
Purpose
Section titled “Purpose”Wires each plugin’s eventSink capability onto the run bus via
wireForwarder, so sinks receive the serializable WireEvent stream.
Public surface
Section titled “Public surface”subscribeEventSinks(plugins, bus, ctx)→SubscribedEventSinks(the live sinks + a disposer).teardownPlugins(plugins, sinks, warn)— end-of-run: each sink’sflush()then each plugin’steardown(), each under try/catch and a time bound; errors warn, never throw.
Invariants
Section titled “Invariants”- Sink init failures are isolated per plugin (warn + skip).
- Dispose only unsubscribes; teardown is the flush point.