[package]
name = "jacs"
version = "0.10.1"
edition = "2024"
rust-version = "1.93"
resolver = "3"

include = [
    "src/**/*",
    "schemas/agent/v1/agent.schema.json",
    "schemas/header/v1/header.schema.json",
    "schemas/components/files/v1/files.schema.json",
    "schemas/components/signature/v1/signature.schema.json",
    "schemas/components/agreement/v1/agreement.schema.json",
    "schemas/components/unit/v1/unit.schema.json",
    "schemas/components/action/v1/action.schema.json",
    "schemas/components/service/v1/service.schema.json",
    "schemas/components/tool/v1/tool.schema.json",
    "schemas/components/contact/v1/contact.schema.json",
    "schemas/components/component/v1/component.schema.json",
    "schemas/message/v1/message.schema.json",
    "schemas/node/v1/node.schema.json",
    "schemas/program/v1/program.schema.json",
    "schemas/eval/v1/eval.schema.json",
    "schemas/task/v1/task.schema.json",
    "jacs.config.schema.json",
    "examples/*.json",
    "Cargo.toml",
    "README.md",
    "LICENSE",
    "LICENSE-APACHE",
    "build.rs",
    "CHANGELOG.md",
    "basic-schemas.png",
    "benches/sign_and_check_sig.rs",
    "schemas/components/embedding/v1/embedding.schema.json",
    "schemas/agentstate/v1/agentstate.schema.json",
    "schemas/commitment/v1/commitment.schema.json",
    "schemas/todo/v1/todo.schema.json",
    "schemas/components/todoitem/v1/todoitem.schema.json",
    "schemas/attestation/v1/attestation.schema.json",
]
description = "JACS JSON AI Communication Standard"
readme = "README.md"
authors = ["HAI.AI <engineering@hai.io>"]
license = "Apache-2.0"
homepage = "https://humanassisted.github.io/JACS"
repository = "https://github.com/HumanAssisted/JACS"
keywords = ["cryptography", "json", "ai", "data", "ml-ops"]
categories = ["cryptography", "text-processing", "data-structures" ]
build = "build.rs"


[dependencies]
base64 = "0.22.1"
chrono = "0.4.40"
jsonschema = { version = "0.29", features = ["resolve-http", "resolve-file"] }
log = "0.4.27"
pem = "3.0.5"
rand = "0.9.0"
rsa = { version= "0.9.8", features= ["sha2", "pem"]}
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_json_canonicalizer = "0.3.2"
signature = "2.2.0"
moka = { version = "0.12", features = ["sync"] }
url = "2.5.4"
sha2 = "0.10.8"
phf = { version = "0.11.3", features = ["macros"] }
strum = "0.27.1"
strum_macros = "0.27.0"
secrecy = "0.10.3"
aes-gcm = "0.10.3"
regex = "1.11.1"
mime_guess = "2.0.5"
flate2 = "1.1.1"
encoding_rs = "0.8.35"
similar = "2.6"
rpassword = "7.3.1"
validator = "0.20.0"
uuid = { version = "1.16.0", features = ["v4", "v7", "js"] }
lazy_static = "1.5"
mail-parser = "0.11"
unicode-normalization = "0.1"
thiserror = "2"
dirs = "5.0"
env_logger = "0.11.8"
futures-util = "0.3.31"
referencing = "0.33.0"
futures-executor = "0.3.31"
getset = "0.1.5"
hex = "0.4"
hickory-resolver = { version = "0.24", features = ["dnssec-ring"] }
hkdf = "0.12"
zeroize = "1.8"
pbkdf2 = { version = "0.12", features = ["simple"] }
serde_yaml_ng = "0.10"
jacs-media = { version = "0.10.1", path = "../jacs-media" }
tempfile = "3"


tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
tracing-appender = "0.2"
tracing-opentelemetry = { version = "0.31", optional = true }
opentelemetry = { version = "0.30.0", optional = true }
opentelemetry-otlp = { version = "0.30.0", default-features = false, features = ["trace", "logs", "metrics", "http-proto", "reqwest-blocking-client", "reqwest-rustls"], optional = true }
opentelemetry_sdk = { version = "0.30.0", features = ["rt-tokio", "experimental_metrics_custom_reader"], optional = true }
opentelemetry-appender-tracing = { version = "0.30.1", optional = true }
tokio = { version = "1.0", features = ["rt-multi-thread"], optional = true }

# opentelemetry-prometheus = "0.29.1"

# libp2p = "0.55.0"
# [target.'cfg(target_os = "macos")'.dependencies]
# pqcrypto-mldsa = { version = "0.1", default-features = false, features = ["serialization"] }

# [target.'cfg(not(target_os = "macos"))'.dependencies]
# pqcrypto-mldsa = { version = "0.1", features = ["serialization"] }


[dev-dependencies]
jacs-binding-core = { path = "../binding-core" }
color-eyre = "0.6"
criterion = "0.6.0"
mdbook = "0.4.48"
assert_cmd = "2.0"
predicates = "3.1"
tempfile = "3.19.1"
serial_test = "3.2.0"
futures = "0.3"
tokio = { version = "1.0", features = ["rt-multi-thread", "macros", "time"] }
testcontainers = "0.27"
testcontainers-modules = { version = "0.15", features = ["minio"] }
reqwest = { version = "0.13.2", default-features = false, features = ["rustls"] }
proptest = "1.6"
image = { version = "0.25", default-features = false, features = ["png", "jpeg"] }

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

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ring = "0.17.9"
reqwest = { version = "0.13.2", default-features = false, features = ["blocking", "json", "rustls"] }
walkdir = "2.5.0"
object_store = { version ="0.12.0", features = ["serde","serde_json", "aws", "http"] }
# Post-quantum 2025 standards (ML-DSA and ML-KEM)
fips203 = "0.4.3"
fips204 = "0.4.6"
# SQLite storage via sqlx (optional). PostgreSQL has been extracted to jacs-postgresql.
sqlx = { version = "0.8.6", default-features = false, features = ["runtime-tokio-rustls"], optional = true }
# rusqlite (sync SQLite bindings, optional -- lightweight alternative to sqlx SQLite)
# Kept aligned with sqlx's libsqlite3-sys to avoid links conflicts.
rusqlite = { version = "0.32.1", features = ["bundled"], optional = true }
# SurrealDB storage has been extracted to the `jacs-surrealdb` crate.
# DuckDB storage has been extracted to the `jacs-duckdb` crate.
# Redb storage has been extracted to the `jacs-redb` crate.

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

[target.'cfg(target_os = "macos")'.dependencies]
keyring = { version = "3.6", optional = true, features = ["apple-native"] }

[target.'cfg(target_os = "linux")'.dependencies]
keyring = { version = "3.6", optional = true, features = ["sync-secret-service"] }

# Fallback for other platforms (Windows, etc.) — no platform-specific backend
[target.'cfg(not(any(target_os = "macos", target_os = "linux")))'.dependencies]
keyring = { version = "3.6", optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2.100"
web-sys = { version = "0.3", features = ["Storage", "Window"] }

[features]
default = ["sqlite"]

# Lightweight sync SQLite backend (rusqlite, no tokio needed) — the default.
sqlite = ["dep:rusqlite"]

# Async SQLite backend via sqlx (requires tokio runtime).
sqlx-sqlite = ["dep:sqlx", "dep:tokio", "sqlx/sqlite"]

# PostgreSQL storage backend has been extracted to the `jacs-postgresql` crate.
# SurrealDB storage backend has been extracted to the `jacs-surrealdb` crate.
# DuckDB storage backend has been extracted to the `jacs-duckdb` crate.
# Redb storage backend has been extracted to the `jacs-redb` crate.

# A2A protocol (zero new deps)
a2a = []

# Agreements (zero new deps)
agreements = []

# Attestation (zero new deps)
attestation = []

# Post-quantum algorithm tests (slow keygen). Omit for fast test runs.
pq-tests = []

# S3 conformance tests (require Docker/MinIO). Omit for fast test runs.
s3-tests = []

# OS keychain integration for password storage (macOS Keychain, Linux Secret Service)
keychain = ["dep:keyring"]

# OS keychain integration tests (require real keychain access). Omit for CI.
keychain-tests = ["keychain"]

# Observability backends are gated behind compile-time features.
# Default is a minimal core: stderr/file logs only, no remote backends.
# Enable these features to activate OTLP-based backends and pull in deps.
otlp-logs = [
  "dep:opentelemetry",
  "dep:opentelemetry-otlp",
  "dep:opentelemetry_sdk",
  "dep:opentelemetry-appender-tracing",
  "dep:tokio",
]
otlp-metrics = [
  "dep:opentelemetry",
  "dep:opentelemetry-otlp",
  "dep:opentelemetry_sdk",
  "dep:tokio",
]
otlp-tracing = [
  "dep:opentelemetry",
  "dep:opentelemetry-otlp",
  "dep:opentelemetry_sdk",
  "dep:tracing-opentelemetry",
  "dep:tokio",
]

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

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

[[bench]]
name = "attestation_benchmarks"
harness = false
required-features = ["attestation"]

[[example]]
name = "a2a_agent_example"
required-features = ["a2a"]

[[example]]
name = "a2a_complete_example"
required-features = ["a2a"]

[[example]]
name = "a2a_simple_example"
required-features = ["a2a"]

[package.metadata.dev-requirements]
cargo-audit = "0.22.1"
