/** * Staff event types and emitter interface for Iranti's internal audit log. * * Staff components (Librarian, Attendant, Archivist, Resolutionist) emit * structured events to record decisions, conflicts, and state transitions. * These events are persisted to `staff_events` when a DbStaffEventEmitter is * registered; they are silently dropped by the default NoopEventEmitter. * * Emitter contract: emit() is synchronous from the caller's perspective. * Async delivery (DB writes, network I/O) happens in fire-and-forget tasks. * Implementations MUST NOT throw — all errors are caught and logged internally. * flush() drains pending writes before process shutdown. * * Key exports: * - IStaffEventEmitter — interface all Staff components depend on * - StaffEvent — fully-stamped event (eventId + timestamp auto-added) * - StaffEventInput — what callers pass to emit() (no auto-generated fields) * - NoopEventEmitter — default zero-overhead implementation * - buildStaffEvent() — stamp eventId + timestamp onto a StaffEventInput */ export type StaffComponent = 'Librarian' | 'Attendant' | 'Archivist' | 'Resolutionist'; export type EventLevel = 'audit' | 'debug'; export interface StaffEvent { eventId: string; timestamp: string; staffComponent: StaffComponent; actionType: string; agentId: string; source: string; entityType?: string | null; entityId?: string | null; key?: string | null; reason?: string | null; level: EventLevel; metadata?: Record | null; emittedAt: string; } export type StaffEventInput = Omit; export interface IStaffEventEmitter { /** * Emit a Staff event. Implementations MUST be synchronous from the caller's * perspective: emit() returns void immediately. Async delivery (DB write, * network I/O) is handled internally. Implementations MUST NOT throw — * all errors are caught internally and logged. */ emit(event: StaffEventInput): void; flush?(): Promise; } export declare class NoopEventEmitter implements IStaffEventEmitter { emit(_event: StaffEventInput): void; flush(): Promise; } export declare function buildStaffEvent(input: StaffEventInput): StaffEvent; //# sourceMappingURL=staffEventEmitter.d.ts.map