toolapi 0.4.3

MRX ToolAPI - connect clients and tools running in the cloud.
Documentation
[package]

name = "toolapi"

version = "0.4.3"

edition = "2024"



license = "AGPL-3.0-only"

description = "MRX ToolAPI - connect clients and tools running in the cloud."

homepage = "https://mrx-org.github.io/mrx-book/"

repository = "https://github.com/mrx-org/toolapi"

readme = "README.md"

keywords = []

categories = []



[features]

default = ["client", "server"]

server = ["dep:axum", "dep:tokio", "dep:tokio-tungstenite", "dep:rustls"]

client = [

    # These dependencies only exist on non-wasm builds

    "dep:tungstenite",

    "dep:rustls",

    # These dependencies only exist on wasm builds

    "dep:ws_stream_wasm",

    "dep:futures"

]

pyo3 = ["dep:pyo3"]



[dependencies]

# Always needed (errors, serialization)

thiserror = "2.0.18"

num-complex = { version = "0.4.6", features = ["serde"] }

serde = { version = "1.0.228", features = ["derive"] }

rmp-serde = "1.3.1"

ruzstd = "0.8.2"



# Optional: Python bindings (From/IntoPyObject impls for Value types)

pyo3 = { version = "0.27.1", features = ["num-complex"], optional = true }





# ===============

# SERVER (native)

# ===============

axum = { version = "0.8.8", features = ["ws"], optional = true }

tokio = { version = "1.49.0", features = ["macros", "rt-multi-thread"], optional = true }

tokio-tungstenite = { version = "0.28.0", features = ["rustls-tls-webpki-roots"], optional = true }





# ===============

# CLIENT (native)

# ===============

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

tungstenite = { version = "0.28.0", features = ["rustls-tls-webpki-roots"], optional = true }



# Transient dependency - need to set features correctly for it to build on fly.io

rustls = { version = "0.23", features = ["ring"], default-features = false, optional = true }





# ===============

# CLIENT   (wasm)

# ===============

[target.'cfg(target_arch = "wasm32")'.dependencies]

ws_stream_wasm = { version = "0.7", optional = true }

futures = { version =  "0.3", optional = true }



# Transient dependency - need to set features correctly for it to build for wasm

getrandom = { version = "0.2", features = ["js"] }

getrandom_0_3 = { package = "getrandom", version = "0.3", features = ["wasm_js"] }