[package]
name = "iicp-client"
version = "0.7.80"
edition = "2021"
rust-version = "1.86"
description = "Use the open IICP AI mesh from Rust without running a node"
license = "Apache-2.0"
keywords = ["iicp", "ai-agents", "protocol", "sdk"]
categories = ["network-programming", "api-bindings"]
repository = "https://github.com/RobLe3/iicp-client-rust"
documentation = "https://docs.rs/iicp-client"
readme = "README.md"

[lib]
name = "iicp_client"
path = "src/lib.rs"

[[example]]
name = "quickstart"
path = "examples/quickstart.rs"

[[example]]
name = "node"
path = "examples/node.rs"

[[bin]]
name = "iicp-node"
path = "src/bin/iicp_node.rs"

[features]
# nat + iicp-tcp on by default so `cargo install iicp-client` ships with UPnP support
# AND the native IICP binary transport (#457: iicp-node serve advertises iicp-native on
# the same port as HTTP). Library consumers can opt out with --no-default-features.
default = ["nat", "iicp-tcp"]
metrics = ["dep:prometheus"]
# Native IICP binary transport (port 9484, spec/iicp-framing.md). Default-on (#457);
# adds ciborium (~50KB). Pure-HTTP library consumers can drop it via --no-default-features.
iicp-tcp = ["dep:ciborium"]
# ADR-041 UPnP NAT detection — auto-discover the public endpoint on operator
# networks behind a UPnP-capable router.
nat = ["dep:igd-next"]
# ADR-050 unified client — the local OpenAI/Ollama/Anthropic-compat proxy gateway
# (`iicp-node proxy`). Kept OUT of `default` so a plain library/consumer build stays
# lean; the `iicp-node` bin enables it. axum + tokio are already deps for the node.
proxy = []

[dependencies]
reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false }
regex = "1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.0", features = ["rt-multi-thread", "macros", "time", "sync", "net", "io-util", "signal", "process"] }
uuid = { version = "1.0", features = ["v4"] }
thiserror = "1.0"
axum = "0.7"
tracing = "0.1"
prometheus = { version = "0.13", optional = true }
ciborium = { version = "0.2", optional = true }
igd-next = { version = "0.17", default-features = false, features = ["aio_tokio"], optional = true }
# ADR-019 pricing-block HMAC-SHA256. Pulled in unconditionally — operators
# who don't use pricing pay only ~30KB in binary size.
hmac = "0.12"
# Dual-stack IPv4+IPv6 server binding (set_only_v6=false on Linux).
socket2 = { version = "0.5", features = ["all"] }
sha2 = "0.10"
subtle = "2"
# IICP-CX S.16 E2E confidentiality: X25519-HKDF-SHA256 + AES-256-GCM
x25519-dalek = { version = "2", features = ["static_secrets"] }
# ADR-045 Phase A: operator→node delegation signing (Ed25519). Same dalek-cryptography
# org as x25519-dalek (curve25519-dalek already in the tree → minimal new surface);
# BSD-3; v2 is post-RUSTSEC-2022-0093. TC-11 cleared 2026-06-04.
ed25519-dalek = { version = "2", features = ["rand_core"] }
aes-gcm = "0.10"
hkdf = "0.12"
rand = "0.8"
base64 = "0.22"
# Hex decode of signed-event-log signatures for `credits --verify` (#456). Ubiquitous,
# already in the tree as a dev-dep; promoted to a runtime dep (TC-11: trivial, no new surface).
hex = "0.4"
# Local time-of-day for availability windows (ADR-006). "clock" only — no serde/format.
chrono = { version = "0.4", default-features = false, features = ["clock"] }

[dev-dependencies]
tokio = { version = "1.0", features = ["rt-multi-thread", "macros", "time", "sync"] }
mockito = "1.0"
reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false }
tracing-subscriber = "0.3"
serde_json = "1.0"
hex = "0.4"
hmac = "0.12"
sha2 = "0.10"
