[package]
name = "mesoclaw-core"
version.workspace = true
edition.workspace = true

[dependencies]
tokio = { workspace = true }
async-trait = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
toml = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
chrono = { workspace = true }
uuid = { workspace = true }
dashmap = { workspace = true }
parking_lot = { workspace = true }
arc-swap = { workspace = true }
rusqlite = { workspace = true }
directories = { workspace = true }

# Gateway (feature-gated)
axum = { workspace = true, optional = true }
tower-http = { workspace = true, optional = true }

# Credentials
keyring = { workspace = true, optional = true }
zeroize = { workspace = true }

# HTTP / TLS
reqwest = { workspace = true }
tokio-tungstenite = { workspace = true }
rustls = { version = "0.23", features = ["ring"] }

# Phase 2: Memory + Tools
sysinfo = { workspace = true }
ignore = { workspace = true }
diffy = { workspace = true }
lru = { workspace = true }
sqlite-vec = { workspace = true }
urlencoding = { workspace = true }
websearch = { workspace = true }

# Phase 3: AI Agent + Gateway
rig-core = { workspace = true, optional = true }
tokio-stream = { workspace = true }
futures = { workspace = true }

# Phase 4: Agent Intelligence
serde_yaml = { workspace = true }

# Phase 8: Channels (optional)
teloxide = { workspace = true, optional = true }
serenity = { workspace = true, optional = true }
pulldown-cmark = { version = "0.12", optional = true, default-features = false, features = ["html"] }

# Phase 8.11: Local Embeddings (optional)
fastembed = { workspace = true, optional = true }

# Phase 8: Scheduler (optional)
cron = { version = "0.15", optional = true }

# API Documentation (optional)
utoipa = { workspace = true, optional = true }
utoipa-scalar = { workspace = true, optional = true }

# Vendored OpenSSL for musl/cross-compilation
openssl = { version = "0.10", features = ["vendored"], optional = true }

[features]
default = ["gateway", "ai", "keyring"]
gateway = ["dep:axum", "dep:tower-http"]
ai = ["dep:rig-core"]
web-dashboard = ["gateway"]
channels = []
channels-telegram = ["channels", "dep:teloxide", "dep:pulldown-cmark"]
channels-slack = ["channels"]
channels-discord = ["channels", "dep:serenity"]
local-embeddings = ["dep:fastembed"]
scheduler = ["dep:cron"]
keyring = ["dep:keyring"]
api-docs = ["gateway", "dep:utoipa", "dep:utoipa-scalar"]
vendored-openssl = ["dep:openssl"]

[lints]
workspace = true

[dev-dependencies]
tempfile = "3"
tokio = { workspace = true, features = ["test-util", "macros"] }
tower = { version = "0.5", features = ["util"] }
