Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
email_service_client
What it is
Part of the Email feature: a Rust HTTP client for email_service —
message/thread lookups by id, thread owner lookup, and an external
(JWT-authenticated) preview endpoint.
Start here
src/lib.rs:EmailServiceClient(internal auth header, onereqwestclient).src/external.rs:EmailServiceClientExternal, the JWT-authenticated counterpart used for external/preview calls.src/get_message_by_id.rs,src/get_messages_by_thread_id.rs,src/get_message_senders.rs,src/get_thread_owner.rs: one module per endpoint.
Scope
- Owns: typed request/response wrapping for
email_service's HTTP API. - Not here:
email_service's own domain logic →crates/email.
Boundaries
- Depends on:
email(featuresaxum,inbound),model,models_email. - Used by:
crates/memory,crates/ai_tools,services/agent_harness_service,services/agent_harness_service.
Recipes
- Add an endpoint: new module with
impl EmailServiceClient(internal auth) orimpl EmailServiceClientExternal(JWT) → wire response types fromemail/models_email.
Checks
cargo test -p email_service_client(SQLX_OFFLINEunset; no database needed).
Gotchas
- Two client types, not two modes of one struct:
EmailServiceClientis for internal service-to-service calls,EmailServiceClientExternalis for calls authenticated with a caller's JWT — pick the one matching the caller.
Related
- Rules:
.agents/rules/rust/architecture.md