[package]
name = "mockforge-core"
version.workspace = true
edition = "2021"
authors = ["SaaSy Solutions LLC <ray.clanan@saasysolutionsllc.com>"]
license = "MIT OR Apache-2.0"
description = "Shared logic for MockForge - routing, validation, latency, proxy"
repository = "https://github.com/SaaSy-Solutions/mockforge"
homepage = "https://mockforge.dev"
documentation = "https://docs.rs/mockforge-core"
keywords = ["mock", "api", "testing", "http", "grpc"]
categories = ["development-tools::testing", "web-programming"]

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

[lints.rust]
missing_docs = "deny"

[dependencies]
mockforge-foundation = { version = "0.3.190", path = "../mockforge-foundation", default-features = false }
# `pr_generation` lives in mockforge-intelligence (Issue #562 phase 1);
# re-exported from `crate::pr_generation` for in-crate and external callers.
mockforge-intelligence = { version = "0.3.190", path = "../mockforge-intelligence" }
mockforge-contracts = { version = "0.3.190", path = "../mockforge-contracts" }
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
dirs = "5.0"
toml = { workspace = true }
tokio = { workspace = true }
tokio-tungstenite = "0.28"
futures = "0.3"
async-trait = { workspace = true }
tracing = { workspace = true }
anyhow = { workspace = true }
thiserror = { workspace = true }
matchit = { workspace = true }
regex = { workspace = true }
url = { workspace = true }
urlencoding = { workspace = true }
reqwest = { workspace = true }
chrono = { workspace = true }
uuid = { workspace = true, features = ["serde"] }
rand = { workspace = true }
once_cell = { workspace = true }
rayon = { version = "1.12", optional = true }
base64 = { workspace = true }
base32 = "0.5"
hex = "0.4"
# Encryption dependencies
aes-gcm = { workspace = true }
chacha20poly1305 = { workspace = true }
argon2 = { workspace = true }
hmac = { workspace = true }
pbkdf2 = { workspace = true }
blake3 = { workspace = true }
jsonschema = { workspace = true }
jsonwebtoken = { workspace = true }
sha2 = { workspace = true }
openapiv3 = { workspace = true }
indexmap = "2.14"
axum = { workspace = true }
tower = { workspace = true }
json-patch = "4.2.0"
jsonptr = "0.7.1"
jsonpath = "0.1"
roxmltree = "0.21"
globwalk = "0.9.1"
tempfile = { workspace = true }
prost = "0.14"
prost-reflect = { workspace = true }
prost-types = "0.14"
bytes = { workspace = true }
notify = "8.2"
# JavaScript runtime for scripting (optional — gate behind "scripting" feature)
rquickjs = { version = "0.9", features = ["macro", "classes"], optional = true }
# Cron expression parsing for scheduled events
cron = "0.15"
# JSON Schema generation (optional, for schema crate)
schemars = { version = "0.8", features = ["derive"], optional = true }
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid"], optional = true }
# TLS support
tokio-rustls = "0.26"
rustls = { version = "0.23", features = ["ring"] }
rustls-pemfile = "2"
webpki-roots = "0.26"
mockforge-data = { version = "0.3.70", path = "../mockforge-data", optional = true }
mockforge-openapi = { version = "0.3.112", path = "../mockforge-openapi" }

[dev-dependencies]
tempfile = { workspace = true }
tokio = { workspace = true, features = ["macros", "test-util"] }
tower = { workspace = true }
criterion = { workspace = true }
proptest = "1.11.0"
mockforge-template-expansion = { version = "0.3.70", path = "../mockforge-template-expansion" }
rcgen = "0.13"
# Note: mockforge-cli dev-dependency removed to avoid circular dependency during publishing

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

# Windows Credential Manager (Windows-only)
[target.'cfg(windows)'.dependencies]
windows = { version = "0.62", features = ["Win32_Security_Credentials"] }

[features]
default = ["data", "ai", "contracts", "workspace-mgmt", "voice", "advanced", "scripting"]
scripting = ["rquickjs", "mockforge-foundation/scripting"]
parallel-routes = ["rayon"]
schema = ["schemars", "mockforge-foundation/schema", "mockforge-intelligence/schema"]
database = ["sqlx", "mockforge-intelligence/database"]
data = ["mockforge-data", "mockforge-intelligence/data"]
persona-graph = ["mockforge-intelligence/persona-graph"]
ai = []
contracts = []
workspace-mgmt = []
voice = []
advanced = ["mockforge-intelligence/advanced"]
