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.0 KB
Raw Blame
use axum::extract::FromRef;
use macro_authorization::{
    MacroAuthorizationServiceImpl, MacroAuthorizationState, NoopMacroAuthJwtValidator,
};
use macro_event_broker::{KafkaEventPublisher, MacroEventBrokerService};
use std::sync::Arc;
use tokio_util::task::TaskTracker;

use crate::BackfillServiceImpl;
use crate::config::Config;
use crate::domain::jobs::BackfillJobs;

pub(crate) type AuthorizationService = MacroAuthorizationServiceImpl<NoopMacroAuthJwtValidator>;
pub(crate) type SpsEventBroker = MacroEventBrokerService<KafkaEventPublisher, TaskTracker>;

#[derive(Clone, FromRef)]
pub(crate) struct ApiContext {
    pub agent_session_indexer: Arc<crate::AgentSessionIndexer>,
    pub db: sqlx::Pool<sqlx::Postgres>,
    pub opensearch_client: Arc<opensearch_client::OpensearchClient>,
    pub authorization_state: MacroAuthorizationState<AuthorizationService>,
    pub config: Arc<Config>,
    pub backfill_service: Arc<BackfillServiceImpl>,
    pub backfill_jobs: BackfillJobs,
    pub macro_event_broker: SpsEventBroker,
}