Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

1.8 KB
Raw Blame
#![deny(missing_docs)]
//! Event broker that publishes events to Kafka via a ports-and-adapters design.
//!
//! The [`domain`] layer defines typed event envelopes, per-topic
//! [`TopicEvent`](domain::models::TopicEvent) enums, the
//! [`MacroEvent`](domain::models::MacroEvent) event abstraction, the inbound
//! [`MacroEventBroker`](domain::ports::MacroEventBroker) API, the outbound
//! [`EventPublisher`](domain::ports::EventPublisher) and
//! [`Spawner`](domain::ports::Spawner) ports, the producing
//! [`MacroEventBrokerService`](domain::service::MacroEventBrokerService), and the
//! typed [`MacroEventConsumerService`](domain::service::MacroEventConsumerService),
//! which receives messages through the [`EventConsumer`](domain::ports::EventConsumer) port.
//! Kafka topic definitions live in the `macro_event_topics` crate. Shared Kafka
//! producer and consumer transports live in `kafka_util`, while the [`outbound`]
//! layer provides Kafka and Tokio adapters for the domain ports.

/// Domain layer: models, ports, and service.
pub mod domain;

#[doc(hidden)]
pub use uuid::Uuid as EventUuid;

pub use domain::models::{Event, EventBrokerError, MacroEvent, MessageWrapper, TopicEvent};
pub use macro_event_topics::{
    MacroChannelsTopic, MacroDocumentsTopic, MacroEmailTopic, MacroExampleTopic,
    MacroProjectsTopic, Topic,
};

pub use domain::ports::{
    EventConsumer, EventPublisher, MacroEventBroker, MacroEventCollection, MessageParts, Spawner,
};
pub use domain::service::{
    MacroEventBrokerService, MacroEventConsumerService, NoopMacroEventBroker,
};
#[cfg(feature = "outbound")]
pub use outbound::{
    kafka_event_consumer::KafkaConsumerAdapter, kafka_event_publisher::KafkaEventPublisher,
    spawner::GlobalSpawner,
};

/// Outbound adapters for the macro event broker's required ports.
#[cfg(feature = "outbound")]
pub mod outbound;