[package]
name = "agentic-jujutsu"
version = "2.2.0"
edition = "2021"
authors = ["Agentic Flow Team <team@ruv.io>"]
description = "AI-powered Jujutsu VCS wrapper for multi-agent collaboration - 10-100x faster than Git with MCP protocol support"
license = "MIT"
repository = "https://github.com/ruvnet/agentic-flow"
homepage = "https://ruv.io"
documentation = "https://docs.rs/agentic-jujutsu"
readme = "CRATE_README.md"
keywords = ["jujutsu", "vcs", "ai-agents", "wasm", "mcp"]
categories = ["development-tools", "wasm", "concurrency"]
exclude = ["docs/", "examples/", "benches/", ".github/", "*.sh"]

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
# Core dependencies
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
anyhow = "1.0"
chrono = { version = "0.4", features = ["serde", "clock"], default-features = false }
uuid = { version = "1.0", features = ["v4", "serde"] }
hex = "0.4"
base64 = "0.21"
sha2 = "0.10"
rand = "0.8"

# N-API dependencies
napi = { version = "2", features = ["tokio_rt", "async"] }
napi-derive = "2"

# Async runtime for native operations
tokio = { version = "1.0", features = ["rt", "rt-multi-thread", "process", "io-util", "time", "macros", "sync"] }

# Process execution for jj CLI
async-process = "2.0"

# CLI argument parsing
clap = { version = "4.0", features = ["derive"], optional = true }

# Logging
log = { version = "0.4", optional = true }
env_logger = { version = "0.11", optional = true }

# HTTP client for SSE transport (optional)
reqwest = { version = "0.11", features = ["json"], optional = true }

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

[dev-dependencies]
tokio = { version = "1.0", features = ["full", "test-util"] }
tokio-test = "0.4"
proptest = "1.0"
criterion = "0.5"
tempfile = "3.0"

[build-dependencies]
reqwest = { version = "0.11", features = ["blocking"] }
flate2 = "1.0"
tar = "0.4"
zip = "0.6"

[features]
default = ["native"]
native = []
cli = ["clap", "log", "env_logger"]
mcp = ["reqwest"]

[[bin]]
name = "jj-agent-hook"
required-features = ["native", "cli"]

[[bench]]
name = "operations"
harness = false

[profile.release]
opt-level = 3
lto = "fat"              # Fat LTO for better optimization
codegen-units = 1
strip = true
panic = 'abort'          # Smaller binaries, no unwinding
incremental = false      # Better optimization, disable for release

# Optimize all dependencies
[profile.release.package."*"]
opt-level = 3

# Size-optimized profile for WASM builds
[profile.release-size]
inherits = "release"
opt-level = "z"          # Optimize for size
lto = "fat"
codegen-units = 1
panic = 'abort'
strip = true
