[package]
name        = "quicproquo-client"
version     = "0.1.0"
edition     = "2021"
description = "CLI client for quicproquo."
license     = "MIT"

[[bin]]
name = "qpq"
path = "src/main.rs"

[dependencies]
quicproquo-core  = { path = "../quicproquo-core" }
quicproquo-proto = { path = "../quicproquo-proto" }
quicproquo-kt    = { path = "../quicproquo-kt" }
openmls_rust_crypto = { workspace = true }

# Serialisation + RPC
capnp         = { workspace = true }
capnp-rpc     = { workspace = true }

# Async
tokio         = { workspace = true }
tokio-util    = { workspace = true }
futures       = { workspace = true }
serde         = { workspace = true }
serde_json    = { workspace = true }
bincode       = { workspace = true }

# Crypto — OPAQUE PAKE
opaque-ke     = { workspace = true }
rand          = { workspace = true }

# Error handling
anyhow        = { workspace = true }
thiserror     = { workspace = true }

# Crypto — for fingerprint verification in fetch-key subcommand
sha2          = { workspace = true }
argon2        = { workspace = true }
chacha20poly1305 = { workspace = true }
ciborium      = { workspace = true }
zeroize       = { workspace = true }
quinn         = { workspace = true }
quinn-proto   = { workspace = true }
rustls        = { workspace = true }

# Logging
tracing       = { workspace = true }
tracing-subscriber = { workspace = true }

# CLI
clap          = { workspace = true }

# Local message/conversation storage
rusqlite      = { workspace = true }

# Hex encoding/decoding
hex           = { workspace = true }

# Secure password prompting (no echo)
rpassword     = "5"

# mDNS discovery for mesh mode (Freifunk). Only compiled with --features mesh.
mdns-sd = { version = "0.12", optional = true }

# Optional P2P transport for direct node-to-node messaging.
quicproquo-p2p = { path = "../quicproquo-p2p", optional = true }

# Optional TUI dependencies (Ratatui full-screen interface).
ratatui = { version = "0.29", optional = true, default-features = false, features = ["crossterm"] }
crossterm = { version = "0.28", optional = true }

[lints]
workspace = true

[features]
# Enable mesh-mode features: mDNS local peer discovery + P2P transport.
# Build: cargo build -p quicproquo-client --features mesh
mesh = ["dep:mdns-sd", "dep:quicproquo-p2p"]
# Enable full-screen Ratatui TUI: cargo build -p quicproquo-client --features tui
tui = ["dep:ratatui", "dep:crossterm"]

[dev-dependencies]
dashmap       = { workspace = true }
assert_cmd    = "2"
tempfile      = "3"
portpicker    = "0.1"
rand          = "0.8"
