[package]
name = "sail-rs"
edition.workspace = true
# Shares the workspace version: the whole suite (Python wheel, CLI, and this
# crate) releases together at one version via the release workflow.
version.workspace = true
# Override the workspace-wide `publish = false`: this is the one crate meant for
# crates.io. The CLI and PyO3 bridge stay unpublished.
publish = true
license = "Apache-2.0"
description = "Official Rust SDK for Sail: create and drive sailboxes (sandboxed cloud VMs) with lifecycle, streaming exec, file transfer, and ingress."
repository = "https://github.com/sailresearchco/sail"
documentation = "https://docs.rs/sail-rs"
readme = "README.md"
keywords = ["sail", "sailbox", "sandbox", "sdk", "vm"]
categories = ["api-bindings", "development-tools"]
# Package only what a consumer builds against: source, the build script, the
# vendored protos it compiles, and the docs/examples. Tests and the fuzz crate
# are excluded from the published archive.
include = [
    "src/**/*.rs",
    "build.rs",
    "proto/**/*.proto",
    "examples/**/*.rs",
    "README.md",
    "LICENSE",
]

# The crate is imported as `sail` (e.g. `use sail::Client`); the package keeps a
# distinct name so it can publish to crates.io without colliding with the `sail`
# name.
[lib]
name = "sail"

[target.'cfg(unix)'.dependencies]
libc = "0.2"

[dependencies]
ipnet = "2"
tonic = { version = "0.14", features = ["tls-native-roots"] }
tonic-prost = "0.14"
prost = "0.14"
tokio = { version = "1", features = [
    "rt-multi-thread",
    "time",
    "macros",
    "sync",
    "net",
    "io-util",
    "fs",
] }
tokio-stream = "0.1"
reqwest = { version = "0.12", default-features = false, features = [
    "rustls-tls-native-roots",
    "http2",
    # Streaming request bodies for local-file image uploads.
    "stream",
    # Honor HTTP(S)_PROXY / NO_PROXY; reqwest gates all proxy auto-detection
    # behind this feature.
    "system-proxy",
] }
serde = { version = "1", features = ["derive"] }
sha2 = "0.10"
ignore = "0.4"
futures = "0.3"
tokio-util = { version = "0.7", features = ["io"] }
http-body = "1"
bytes = "1"
serde_json = "1"
time = { version = "0.3", features = ["serde-well-known"] }
url = "2"
thiserror = "2"
tracing = "0.1"
uuid = { version = "1", features = ["v4"] }
rand = "0.9"
httpdate = "1"
form_urlencoded = "1"
toml = "0.8"
dirs = "5"
base64 = "0.22"
shell-words = "1"

[build-dependencies]
tonic-prost-build = "0.14"
protoc-bin-vendored = "3"

[features]
# Generate the tonic server stubs for the proto services so tests can stand up
# an in-process fake worker proxy. Off in production builds (the SDK is a pure
# client), enabled only for this crate's own test build via the self
# dev-dependency below.
test-fakes = ["tonic/server"]
# Expose the byte-stream fuzz entry point (`exec::fuzz_decode_ring`) to the
# `fuzz/` crate. Also compiled under `cfg(test)`, so the entry point is unit
# tested in the normal build without shipping it in production.
fuzzing = []

[dev-dependencies]
tempfile = "3"
# Self dev-dependency: the only way to turn on `test-fakes` for this crate's own
# test build (so the build script emits server stubs and `tonic/server` is on)
# without leaking it into production builds.
sail-rs = { path = ".", features = ["test-fakes"] }
# `net` pulls in tokio's net feature for the in-process fake server's listener;
# `#[tokio::test]` and the rest run on the base dependency's features.
tokio-stream = { version = "0.1", features = ["net"] }
proptest = "1"
wiremock = "0.6"
assert_matches = "1.5"

[lints]
workspace = true

# docs.rs renders the default-feature surface, which is exactly the curated
# public API (the binding-only internals are hidden, not feature-gated).
[package.metadata.docs.rs]
all-features = false
