[package]
name = "tonin-sdk"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
readme.workspace = true
keywords.workspace = true
categories.workspace = true
description = "tonin-sdk: Service builder, Config, Context, Error, and runtime for tonin microservices."

[dependencies]
# Core runtime
tokio       = { workspace = true }
tonic       = { workspace = true }
# Serves grpc.health.v1.Health so Kubernetes `grpc:` probes work out of the box.
tonic-health = "0.12"
tower       = { workspace = true }
hyper       = { workspace = true, features = ["server", "http1", "http2"] }
http        = { workspace = true }
async-trait = { workspace = true }
thiserror   = { workspace = true }
serde       = { workspace = true }
serde_json  = { workspace = true }
toml        = { workspace = true }
tracing     = { workspace = true }
futures-core = "0.3"
futures-util = "0.3"
pin-project  = "1"

# Sibling crates
tonin-client     = { workspace = true }
tonin-mcp-macros = { workspace = true }

# Telemetry (folded from tonin-telemetry)
tracing-subscriber                = { workspace = true }
tracing-opentelemetry             = "0.33"
opentelemetry                     = "0.32"
opentelemetry_sdk                 = { version = "0.32", features = ["rt-tokio"] }
opentelemetry-otlp                = { version = "0.32", features = ["grpc-tonic", "trace"] }
opentelemetry-semantic-conventions = "0.32"
opentelemetry-http                = "0.32"

# MCP runtime (folded from tonin-mcp)
rmcp        = { version = "1", default-features = false, features = ["server", "macros", "transport-streamable-http-server"] }
rmcp-macros = "1"
schemars    = "0.8"
hyper-util  = { version = "0.1", features = ["server-auto", "tokio", "service"] }

# Auth defaults — JWT validation + JWKS fetch.
jsonwebtoken = { version = "10.4.0", features = ["rust_crypto"] }
reqwest      = { version = "0.12", default-features = false, features = ["rustls-tls", "json"] }
base64       = "0.22"

# Pre-wired state: postgres + redis. Lazy — connections only open if
# DATABASE_URL / REDIS_URL are present at boot. See src/state.rs.
sqlx  = { version = "0.8", default-features = false, features = ["runtime-tokio-rustls", "postgres"] }
redis = { version = "0.27", default-features = false, features = ["tokio-rustls-comp"] }

[dev-dependencies]
tokio                = { workspace = true }
tokio-test           = "0.4"
tracing-subscriber   = { workspace = true }
tracing-opentelemetry = "0.33"
async-stream         = "0.3"
futures-util         = "0.3"
async-trait          = { workspace = true }
opentelemetry        = "0.32"
opentelemetry_sdk    = { version = "0.32", features = ["testing"] }
