[package]
name = "rainy-sdk"
version = "0.6.7"
edition = "2021"
authors = ["Enosis Labs <hello@enosislabs.com>"]
description = "Official Rust SDK for Rainy API by Enosis Labs v0.6.7 - Release validation fixes for v3 migration and legacy Cowork compatibility"
license = "Apache-2.0"
repository = "https://github.com/enosislabs/rainy-sdk"
homepage = "https://github.com/enosislabs/rainy-sdk"
documentation = "https://docs.rs/rainy-sdk"
readme = "README.md"
keywords = ["ai", "api", "openai", "anthropic", "gemini"]
categories = ["api-bindings", "asynchronous", "web-programming::http-client"]
rust-version = "1.92.0"

# Package metadata for better crates.io presentation
[package.metadata.docs.rs]
# Build docs with all features
all-features = true
# Set default target
default-target = "x86_64-unknown-linux-gnu"
# Additional targets to build docs for
targets = ["x86_64-apple-darwin", "aarch64-apple-darwin"]
# Use rustdoc-args for better documentation
rustdoc-args = ["--cfg", "docsrs"]

# Include specific files for packaging
include = [
    "src/**/*",
    "Cargo.toml",
    "README.md",
    "LICENSE",
    "CONTRIBUTING.md",
]

[dependencies]
# Core dependencies
reqwest = { version = "0.12", default-features = false, features = ["json", "stream", "rustls-tls"] }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.143"
tokio = { version = "1.47", features = ["full"] }
anyhow = "1.0.99"
thiserror = "2.0"
url = "2.5"
uuid = { version = "1.18", features = ["v4", "serde"] }
chrono = { version = "0.4.41", features = ["serde"] }
base64 = "0.22"
secrecy = { version = "0.8", features = ["serde"] }

# Optional dependencies for advanced features
governor = { version = "0.7", optional = true }
tracing = { version = "0.1.41", optional = true }
futures = "0.3.31"

# Dependencies for retry logic with jitter
rand = "0.8"

# SSE parsing (keep for backward compatibility)
eventsource-stream = "0.2"

[features]
default = ["rate-limiting", "tracing"]
rate-limiting = ["governor"]
tracing = ["dep:tracing"]
cache = []
cowork = []  # Legacy Cowork compatibility only (opt-in)

# Development dependencies
[dev-dependencies]
mockito = "1.7"
tokio-test = "0.4.4"
env_logger = "0.11"

# Production optimizations
[profile.release]
# Enable all optimizations
opt-level = 3
# Enable link-time optimization for smaller and faster code
lto = true
# Reduce number of codegen units for better optimization
codegen-units = 1
# Remove debug symbols in release builds
debug = false
# Panic = abort reduces code size and improves performance
panic = "abort"
# Enable strip symbols to reduce binary size
strip = "symbols"

# Development profile optimizations
[profile.dev]
# Faster compilation during development
opt-level = 0
debug = true
# Faster incremental compilation
incremental = true

# Test profile optimizations
[profile.test]
opt-level = 1
debug = true

# Benchmark profile
[profile.bench]
opt-level = 3
debug = false
lto = true

# Optimized dependencies
[profile.dev.package."*"]
opt-level = 1

[profile.release.package."*"]
opt-level = 3
