[package]
name = "branchforge"
version = "0.3.0"
edition = "2024"
rust-version = "1.94"
license = "MIT"
description = "Graph-first Rust runtime for durable LLM agents"
repository = "https://github.com/junyeong-ai/branchforge"
documentation = "https://github.com/junyeong-ai/branchforge/tree/main/docs"
readme = "README.md"
keywords = ["ai", "agent", "llm", "graph", "runtime"]
categories = ["api-bindings", "asynchronous"]

[dependencies]
# Async runtime
tokio = { version = "^1.49", features = ["rt-multi-thread", "macros", "sync", "time", "io-util", "process", "signal"] }

# HTTP client
reqwest = { version = "0.13", default-features = false, features = [
    "json",
    "stream",
    "rustls",
    "http2",
    "multipart",
] }
mime_guess = "2"

# Serialization
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
serde_yaml_bw = "2.5"
schemars = "1.2"

# Async utilities
futures = "0.3"
async-trait = "0.1"
pin-project-lite = "0.2"

# Error handling
thiserror = "2"

# File operations
glob = "0.3"

# Regex
regex = "1"

# URL encoding
url = "2"
urlencoding = "2"

# Security sandbox - TOCTOU-safe file operations, process limits
rustix = { version = "1.1", features = ["fs", "process"] }

# Bash command analysis - AST parsing
tree-sitter = "0.26"
tree-sitter-bash = "0.25"

# Time
chrono = { version = "0.4", features = ["serde"] }
tokio-util = { version = "0.7", features = ["time"] }

# Utilities
tracing = "^0.1"
bytes = "^1.11.1"
uuid = { version = "^1.10", features = ["v4", "serde"] }
base64 = "0.22"
rand = "0.10"

# Authentication & directories
directories = "6"

# MCP support - optional
rmcp = { version = "1.3", optional = true, features = ["client", "transport-child-process", "client-side-sse", "reqwest"] }

# AWS Bedrock - optional
aws-config = { version = "^1.8", optional = true }
aws-credential-types = { version = "^1.2", optional = true }
aws-sigv4 = { version = "^1.3", optional = true }
aws-smithy-runtime-api = { version = "^1.9", optional = true }
crc32fast = { version = "1", optional = true }

# Google Cloud Vertex AI - optional
gcp_auth = { version = "0.12", optional = true }

# Azure AI Foundry - optional
azure_identity = { version = "0.33", optional = true }
azure_core = { version = "0.33", optional = true }

# Credential protection - zeroize-on-drop, redacted Debug
secrecy = { version = "0.10", features = ["serde"] }

# Decimal precision for financial calculations
rust_decimal = { version = "1", features = ["serde", "serde-with-str"] }
rust_decimal_macros = "1"

# Persistence backends - optional
sqlx = { version = "0.8", default-features = false, features = ["runtime-tokio", "postgres", "json", "chrono", "uuid", "rust_decimal"], optional = true }
redis = { version = "1", features = ["tokio-comp", "connection-manager"], optional = true }

# OpenTelemetry - optional
opentelemetry = { version = "0.31", optional = true }
opentelemetry_sdk = { version = "0.31", features = ["rt-tokio", "metrics"], optional = true }
opentelemetry-otlp = { version = "0.31", features = ["http-proto", "metrics"], optional = true }
opentelemetry-semantic-conventions = { version = "0.31", optional = true }
tracing-opentelemetry = { version = "0.32", optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }

# Multimedia support - optional
pdf-extract = { version = "0.10", optional = true }

dashmap = "^6.1"
ahash = "0.8"

[dev-dependencies]
tokio-test = "0.4"
wiremock = "0.6"
tempfile = "3"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[features]
default = []

# CLI OAuth authentication source (ClaudeCliProvider, CliCredentials)
cli-auth = []

# File-based resource loaders (DocumentLoader, FileProvider, ChainProvider)
file-resources = []

mcp = ["rmcp"]

# Plugin system with namespace-based resource management
plugins = ["file-resources"]

# Multimedia support for Read tool (PDF, images)
multimedia = ["pdf-extract"]

# Cloud provider integrations
aws = ["aws-config", "aws-credential-types", "aws-sigv4", "aws-smithy-runtime-api", "crc32fast"]
gcp = ["gcp_auth"]
azure = ["azure_identity", "azure_core"]

# OpenAI-compatible providers (GPT-4o, o3, Together, Groq, Ollama, vLLM)
openai = []

# Google Gemini API
gemini = []

# All cloud providers
cloud-all = ["aws", "gcp", "azure", "openai", "gemini"]

# Persistence backends
jsonl = []
postgres = ["sqlx"]
redis-backend = ["redis"]
persistence-all = ["jsonl", "postgres", "redis-backend"]

# OpenTelemetry observability
otel = ["opentelemetry", "opentelemetry_sdk", "opentelemetry-otlp", "opentelemetry-semantic-conventions", "tracing-opentelemetry", "tracing-subscriber"]

# Full feature set (excludes multimedia - heavy native dependency, enable separately if needed)
full = ["mcp", "cloud-all", "persistence-all", "otel", "plugins", "cli-auth"]

[[example]]
name = "advanced_test"
path = "examples/advanced_test.rs"
required-features = ["cli-auth", "file-resources"]

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

[[example]]
name = "server_tools"
path = "examples/server_tools.rs"
required-features = ["cli-auth", "file-resources"]

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

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

# Linux-specific dependencies
[target.'cfg(target_os = "linux")'.dependencies]
landlock = "0.4"
