/** * InMemoryEventBus — Synchronous, error-safe event bus implementation. * * Design decisions: * - Synchronous dispatch: correct for Phase 1-2 (single-process MCP server) * - Errors in handlers are caught and forwarded to `onError` callback — never break the emitter * - Supports wildcard '*' subscriptions * - Per-container lifecycle: `removeAllListeners()` for cleanup */ import type { DomainEvent, DomainEventType } from './types.js'; import type { IEventBus, EventHandler, Unsubscribe } from './event-bus.js'; export interface InMemoryEventBusOptions { /** Called when a handler throws — prevents error swallowing */ onError?: (error: unknown, event: DomainEvent) => void; } export declare class InMemoryEventBus implements IEventBus { private readonly handlers; private readonly onError; constructor(options?: InMemoryEventBusOptions); on(type: DomainEventType | '*', handler: EventHandler): Unsubscribe; emit(event: DomainEvent): void; removeAllListeners(): void; private safeCall; } //# sourceMappingURL=in-memory-event-bus.d.ts.map