[workspace]
members = [".", "src/macros", "examples/orderbook"]
default-members = [".", "src/macros"]
resolver = "2"

[workspace.package]
edition = "2024"
rust-version = "1.93"
version = "0.2.34"
license = "MIT"
homepage = "https://github.com/flashbots/mosaik"
repository = "https://github.com/flashbots/mosaik"
authors = ["Flashbots <info@flashbots.net>", "Karim Agha <karim@flashbots.net>"]
exclude = [".github/"]
publish = ["mosaik", "mosaik-macros"]

[workspace.dependencies]
mosaik = { path = "." }
tokio = { version = "1.50", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
serde = { version = "1.0", features = ["derive"] }
futures = "0.3.32"
anyhow = "1.0"
rand = "0.9.2"
blake3 = { version = "1.8", features = ["serde"] }

[workspace.lints.rust]
type_alias_bounds = "allow"

[workspace.lints.clippy]
tabs_in_doc_comments = "allow"
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
wildcard_imports = "allow"
missing_errors_doc = "allow"
must_use_candidate = "allow"
redundant_closure_for_method_calls = "allow"
similar_names = "allow"
cast_precision_loss = "allow"
cast_possible_truncation = "allow"
unused_async = "warn"
future_not_send = "allow"

[package]
name = "mosaik"
description = "A Rust runtime for building self-organizing, leaderless distributed systems."
version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true
exclude.workspace = true
edition.workspace = true
rust-version.workspace = true

[lib]
doctest = false

[[bin]]
name = "mosaik"
path = "src/main.rs"
required-features = ["cli"]

[lints]
workspace = true

[features]
default = ["cli"]
cli = ["clap", "colored"]

[dependencies]
tokio.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
serde.workspace = true
futures.workspace = true
anyhow.workspace = true
rand.workspace = true
blake3.workspace = true

mosaik-macros = { version = "0.2.34", path = "src/macros" }

thiserror = "2.0"
postcard = "1.1.3"
bytes = "1.10"
tokio-util = "0.7"
tokio-stream = "0.1"
parking_lot = "0.12"
chrono = { version = "0.4", features = ["serde"] }
n0-error = "0.1.3"
derive_more = { version = "2.1", features = ["full"] }
hex = "0.4"
im = { version = "15.1.0", features = ["serde"] }
semver = { version = "1.0", features = ["serde"] }
dashmap = "6.1"
slotmap = "1.1"
derive_builder = "0.20.2"
backoff = { version = "0.4", features = ["futures", "tokio"] }
humansize = "2.0.0"
humantime = "2.3"
itertools = "0.14"
iroh = { version = "0.96.1", features = [
  "address-lookup-pkarr-dht",
  "address-lookup-mdns",
] }
iroh-gossip = "0.96.0"
pkarr = "5.0"
b58 = "0.1"
arrayvec = "0.7"
serde_bytes = "0.11"

# CLI-specific dependencies
colored = { version = "3.1", optional = true }
clap = { version = "4.5", features = [
  "derive",
  "env",
  "unicode",
  "wrap_help",
], optional = true }

[dev-dependencies]
anyhow.workspace = true
tracing-subscriber.workspace = true
ctor = { version = "0.6" }
rstest = "0.26"
clap = { version = "4.5", features = ["derive", "env", "unicode", "wrap_help"] }
