import { nexusEventBus } from '../../engines/event-bus.js';
import { getRelayInbox as readRelayInbox } from '../worklist/crud.js';
export function getRelayInbox(db, input) {
    const messages = readRelayInbox(db, input);
    if (input.markRead && input.operativeId) {
        messages.forEach((message) => {
            nexusEventBus.emit('architects.relay.read', {
                messageId: message.id,
                byOperativeId: input.operativeId,
            });
        });
    }
    return messages;
}
