import { EventEmitter } from 'node:events'; /** * Global event bus for memory lifecycle events. * Emits SSE-compatible events for real-time integrations. * * Event types: * - memory:stored — new memory stored (includes id, namespace, surprise_score, contradictions) * - memory:updated — memory updated (dedup match, importance change) * - memory:forgotten — memory tombstoned * - memory:consolidated — consolidation cycle completed * - memory:entity_created — new entity in knowledge graph * - memory:relation_created — new relation in knowledge graph */ interface MemoryEvent { readonly type: string; readonly data: unknown; } declare class MemoryEventBus extends EventEmitter { emitEvent(type: string, data: unknown): void; stored(data: { id: string; namespace: string; category: string; surprise_score: number; contradictions: number; entities_extracted: number; }): void; updated(data: { id: string; reason: 'exact_dedup' | 'semantic_dedup'; similarity: number; }): void; forgotten(data: { count: number; ids: readonly string[]; }): void; consolidated(data: { operation_id: string; merged: number; decayed: number; pruned: number; swept: number; }): void; entityCreated(data: { id: string; name: string; entity_type: string; }): void; relationCreated(data: { id: string; relation_type: string; source: string; target: string; }): void; } /** Singleton event bus — import from anywhere to emit or listen. */ declare const eventBus: MemoryEventBus; export { type MemoryEvent, eventBus };