[package]
name = "bamboo-server"
version.workspace = true
edition = "2021"
rust-version.workspace = true
description = "HTTP server and API layer for the Bamboo agent framework"
license = "MIT"
# Package only source + build script. The crate directory also holds two
# dev-only symlinks — `frontend_package` (-> the staged Lotus bundle) and
# `scripts` (-> the workspace scripts dir) — that point outside the crate.
# `cargo publish` must not archive them: they fail as "no such file" and
# shouldn't ship anyway (build.rs degrades gracefully when frontend_package is
# absent, emitting empty embeds).
include = ["src/**/*", "build.rs"]

[dependencies]
# Workspace crates
bamboo-engine = { path = "../../engine/bamboo-engine", version = "2026.7.13"}
bamboo-memory = { path = "../../infra/bamboo-memory", version = "2026.7.13"}
bamboo-compression = { path = "../../infra/bamboo-compression", version = "2026.7.13"}
bamboo-agent-core = { path = "../../core/bamboo-agent-core", version = "2026.7.13"}
bamboo-tools = { path = "../../engine/bamboo-tools", version = "2026.7.13"}
bamboo-server-tools = { path = "../../app/bamboo-server-tools", version = "2026.7.13"}
bamboo-metrics = { path = "../../infra/bamboo-metrics", version = "2026.7.13"}
bamboo-notification = { path = "../../infra/bamboo-notification", version = "2026.7.13"}
bamboo-mcp = { path = "../../infra/bamboo-mcp", version = "2026.7.13"}
bamboo-broker = { path = "../bamboo-broker", version = "2026.7.13"}
bamboo-skills = { path = "../../infra/bamboo-skills", version = "2026.7.13"}
bamboo-infrastructure = { path = "../../infra/bamboo-infrastructure", version = "2026.7.13"}
bamboo-llm = { path = "../../infra/bamboo-llm", version = "2026.7.13"}
bamboo-config = { path = "../../infra/bamboo-config", version = "2026.7.13"}
bamboo-storage = { path = "../../infra/bamboo-storage", version = "2026.7.13"}
bamboo-domain = { path = "../../core/bamboo-domain", version = "2026.7.13"}
# remote-actor P2a (#181): the server hosts the `/v1/agents` control-plane
# registry over `bamboo_subagent::proto::AgentRecord`. The engine already pulls
# this crate in transitively; a DIRECT dep makes the type reuse explicit (no
# server-side DTO that could drift from the wire record).
bamboo-subagent = { path = "../../infra/bamboo-subagent", version = "2026.7.13"}

# Web framework
# `rustls-0_23` enables actix-web's TLS bind/listen against rustls 0.23
# (`bind_rustls_0_23` / `listen_rustls_0_23`) for the v2 self-terminated TLS
# face (#181). Without it the `*_rustls_0_23` methods do not exist.
actix-web = { version = "4", features = ["rustls-0_23"] }
actix-cors = "0.7"
actix-files = "0.6"
# v2-P1 (#181): the `GET /v2/stream` unified WebSocket multiplex. `actix-ws`
# gives a non-actor WS upgrade (`actix_ws::handle`) returning an owned
# `Session` + `MessageStream` we drive from a spawned task. 0.3 targets the
# resolved actix-web 4 / actix-http 3 line.
actix-ws = "0.4"

# v2 TLS termination (#181): load PEM cert/key and build a rustls ServerConfig.
# Pin the `ring` crypto provider explicitly so the builder never relies on a
# process-default provider (avoids the rustls 0.23 "no process-level
# CryptoProvider" panic); `ring` is the provider already resolved in the lock.
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
rustls-pemfile = "2"

# Async runtime
tokio = { version = "1", features = ["full"] }
async-trait = "0.1"
async-stream = "0.3"
tokio-stream = "0.1"

# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
# v2-P3 (#181): MessagePack codec for the `bamboo.v2.msgpack` subprotocol. We use
# `to_vec_named` (structs-as-maps) so `ServerEnvelope`'s `#[serde(flatten)]` +
# untagged body round-trip; the default array-encoding would break them.
rmp-serde = "1"

# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# Utilities
uuid = { version = "1", features = ["v4"] }
chrono = { version = "0.4", features = ["serde"] }
chrono-tz = "0.10"
cron = "0.17"
regex = "1"
futures = "0.3"
thiserror = "2"
anyhow = "1"
parking_lot = "0.12"
dashmap = "6"
reqwest = { version = "0.13", default-features = false, features = ["json", "stream", "form", "query", "native-tls", "charset", "http2", "system-proxy"] }
reqwest-middleware = { version = "0.5", features = ["json", "form"] }
reqwest-retry = "0.9"
walkdir = "2"
globset = "0.4"
tokio-util = "0.7"
bytes = "1"
url = "2"
hex = "0.4"
sha2 = "0.11"
rand = "0.10"
zip = { version = "2", default-features = false, features = ["deflate"] }
actix-governor = "0.10.0"
notify-rust = "4.18"

[dev-dependencies]
tempfile = "3"
wiremock = "0.6"
tokio-test = "0.4"
mockall = "0.15"
http = "1"
actix-rt = "2"
# v2-P1 (#187): live WS integration harness for `GET /v2/stream`. `awc` is
# actix's own HTTP+WS client, so it composes with the actix-web 4 server already
# in-tree (one runtime, one ws codec) and drives a real loopback `ws://` upgrade.
# `actix-codec` names the `Framed` half `awc::ws connect()` returns.
awc = { version = "3", features = ["rustls-0_23"] }
actix-codec = "0.5"
bamboo-infrastructure = { path = "../../infra/bamboo-infrastructure", features = ["test-utils"], version = "2026.7.13"}
bamboo-llm = { path = "../../infra/bamboo-llm", version = "2026.7.13"}
bamboo-config = { path = "../../infra/bamboo-config", features = ["test-utils"], version = "2026.7.13"}
bamboo-storage = { path = "../../infra/bamboo-storage", version = "2026.7.13"}
