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
sqs_client
What it is
Shared infrastructure — a thin SQS client plus one queue-specific enqueue module per consumer, gated behind Cargo features, used by any service or crate that produces or consumes an SQS queue.
Start here
src/queue.rs: theSQStransport (send_fifo_message,receive_messages, delete/visibility) every feature module calls into.src/message_attribute.rs: typed SQS message attributes shared across queues.- One module per feature (
chat,document,email,gmail,organization_retention,search,upload_extractor): each defines its own enqueue function and message shape for one downstream consumer.
Scope
- Owns: SQS send/receive plumbing and the message schema for each queue this crate produces or consumes.
- Not here: the Lambda/service handlers that drain these queues — each queue's
consuming service (e.g.
services/email_sfs_delete_handler,services/upload_extractor_lambda_handler) owns its own receive loop.
Boundaries
- Depends on:
aws-sdk-sqs; optionalmodel,models_email,models_ai_projectionbehind their matching features. Never a domain crate: ports implemented forSQSlive with their trait, such asemail'ssqsfeature, so this crate stays at the bottom of the compile chain. - Used by: most SQS-producing services (
document_storage_service,email_service,search_processing_service,authentication_service, the*_handler/*_triggerLambda services) andcrates/teams,crates/webhook,crates/documents,crates/ai_projections,crates/ai_tools,crates/projects,crates/memory.
Recipes
- Add a new queue producer: new
src/<area>.rsmodule → feature flag inCargo.toml→pub mod <area>;behind#[cfg(feature = "<area>")]insrc/lib.rs→ add it todefaultif every consumer needs it. - Add a field to an existing queue's message: the module's message struct →
its consuming service's deserialization (grep the queue name/feature across
services/).
Checks
cargo test -p sqs_client(SQLX_OFFLINEunset).cargo test -p sqs_client --no-default-features --features <area>when changing a single feature's gating.
Gotchas
- A new message type for a queue reaches workers that may not decode it yet:
producers and consumers deploy in parallel. Keep producing the old form until
every consumer is rolled out, behind a deployment switch (see
gmail_label_write_batchesand its test against the released worker format).
Related
- Rules:
.agents/rules/rust/architecture.md