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
[package]
name = "agent_session"
version = "0.1.0"
edition = "2024"
publish = false
[features]
default = ["inbound", "outbound"]
# Quota contracts and helper orchestration without enabling session adapters.
admission = ["dep:ai_billing", "dep:ai_usage", "dep:jev"]
ai_tools = ["inbound", "dep:ai_toolset", "dep:async-trait", "dep:schemars"]
# The `seed_jsonl` replay binary: an argument parser, and the Postgres
# adapter it writes through.
cli = ["dep:clap", "outbound"]
# The axum router serving sessions over HTTP.
inbound = [
"admission",
"dep:axum",
"dep:entity_registry",
"dep:macro_authorization",
"entity_access/inbound",
"macro_authorization/axum",
"schema",
]
# Postgres, the connection gateway, and the model-backed name generator.
outbound = [
"admission",
"bots/outbound",
"dep:agent",
"dep:ai_usage",
"dep:connection_gateway_client",
"dep:entity_access_db_utils",
"dep:entity_registry",
"dep:entity_registry_db_utils",
"dep:model-entity",
"dep:reqwest",
"dep:macro_tower_layers",
"dep:macro_authorization",
"dep:sqlx",
"dep:share_permission_db_utils",
"macro_user_id/sqlx",
"macro_authorization/axum",
]
# OpenAPI schemas for the vocabulary that reaches an HTTP boundary: the
# router's DTOs, and the lifecycle events the webhook union carries.
schema = ["activity/schema", "dep:utoipa", "agent_runtime_protocol/utoipa", "macro_user_id/schema", "trigger_context/schema"]
# Mock and in-memory port implementations, for crates that test against this one.
test-utils = ["dep:mockall", "agent_fold/test-utils"]
[dependencies]
activity = { path = "../activity", default-features = false }
ai_billing = { path = "../ai_billing", optional = true }
lazy-regex = { workspace = true }
ai_toolset = { path = "../ai_toolset", optional = true }
async-trait = { workspace = true, optional = true }
schemars = { workspace = true, optional = true }
agent-client-protocol = { workspace = true }
harness_id = { path = "../harness_id" }
agent = { path = "../agent", optional = true }
ai_usage = { path = "../ai_usage", optional = true }
jev = { path = "../jev", optional = true }
dashmap = { workspace = true }
macro_uuid = { path = "../macro_uuid" }
messages = { path = "../messages", features = ["ports", "schema"] }
mockall = { workspace = true, optional = true }
agent_fold = { path = "../folds/agent_fold" }
# Only the domain vocabulary; `outbound` would pull rdkafka into every
# consumer of this crate.
macro_event_broker = { path = "../macro_event_broker", default-features = false }
macro_event_topics = { path = "../macro_event_topics" }
agent_runtime_protocol = { path = "../agent_runtime_protocol" }
axum = { workspace = true, optional = true }
bots = { path = "../bots", default-features = false }
connection_gateway_client = { path = "../connection_gateway_client", optional = true }
entity_access = { path = "../entity_access", default-features = false, features = [
"ports",
] }
entity_access_db_utils = { path = "../entity_access_db_utils", optional = true }
entity_registry = { path = "../entity_registry/entity_registry", default-features = false, optional = true }
entity_registry_db_utils = { path = "../entity_registry/entity_registry_db_utils", optional = true }
genai_telemetry = { path = "../genai_telemetry" }
model-entity = { path = "../model-entity", optional = true }
model_owner = { path = "../model_owner" }
models_permissions = { path = "../models_permissions" }
share_permission_db_utils = { path = "../share_permission_db_utils", optional = true }
shared_entity_registry = { path = "../entity_registry/shared_entity_registry" }
clap = { workspace = true, optional = true }
macro_authorization = { path = "../macro_authorization", default-features = false, optional = true }
macro_user_id = { path = "../macro_user_id" }
utoipa = { workspace = true, optional = true }
rootcause = { workspace = true }
futures = { workspace = true }
reqwest = { workspace = true, optional = true }
macro_tower_layers = { path = "../macro_tower_layers", optional = true }
uuid = { workspace = true }
sqlx = { workspace = true, features = ["json"], optional = true }
chrono = { workspace = true }
thiserror = { workspace = true }
anyhow = { workspace = true }
bot_id = { path = "../bot_id" }
mention_utils = { path = "../mention_utils" }
trigger_context = { path = "../trigger_context" }
serde = { workspace = true }
serde_json = { workspace = true }
strum = { workspace = true }
tokio = { workspace = true, features = ["rt", "sync"] }
tokio-util = { workspace = true, features = ["rt"] }
tracing = { workspace = true }
workspace-hack = { version = "0.1", path = "../workspace-hack" }
[[bin]]
name = "seed_jsonl"
path = "src/bin/seed_jsonl.rs"
required-features = ["cli"]
[dev-dependencies]
messages = { path = "../messages", features = ["outbound"] }
entity_access = { path = "../entity_access", features = ["outbound"] }
agent-client-protocol = { workspace = true }
bot_id = { path = "../bot_id", features = ["test-utils"] }
harness_id = { path = "../harness_id", features = ["test-utils"] }
model_user = { path = "../model_user" }
non_empty = { path = "../non_empty" }
agent_fold = { path = "../folds/agent_fold", features = ["test-utils"] }
axum = { workspace = true, features = ["ws"] }
macro_db_migrator = { path = "../macro_db_migrator" }
opentelemetry = { workspace = true, features = ["trace"] }
opentelemetry_sdk = { workspace = true, features = ["testing", "trace"] }
tracing-opentelemetry = { workspace = true }
tracing-subscriber = { workspace = true }
tokio = { workspace = true, features = ["fs", "io-std", "io-util", "macros", "net", "rt-multi-thread", "time", "test-util"] }
tokio-tungstenite = { workspace = true }
tower = { workspace = true, features = ["util"] }
[[bin]]
name = "backfill_turn_states"
path = "src/bin/backfill_turn_states.rs"
required-features = ["cli"]