[package]
name = "seq-runtime"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
description = "Runtime library for the Seq programming language"
repository = "https://github.com/navicore/patch-seq"
readme = "README.md"
keywords = ["runtime", "language", "seq"]
categories = ["compilers", "development-tools"]

[lib]
crate-type = ["staticlib", "rlib"]  # staticlib for LLVM linking, rlib for testing

[features]
default = ["full", "diagnostics", "report-json"]

# Full batteries - enable all optional modules
full = ["crypto", "http", "regex", "compression"]

# Diagnostics - strand registry + SIGQUIT handler for production debugging
diagnostics = ["signal-hook"]

# JSON report output (for SEQ_REPORT=json)
report-json = ["dep:serde_json"]

# Optional modules - enable individually for smaller binaries
crypto = [
    "dep:sha2",
    "dep:hmac",
    "dep:rand",
    "dep:uuid",
    "dep:subtle",
    "dep:aes-gcm",
    "dep:pbkdf2",
    "dep:ed25519-dalek",
]
http = ["dep:ureq", "dep:url"]
regex = ["dep:regex"]
compression = ["dep:flate2", "dep:zstd"]

[dependencies]
# Core runtime primitives (shared foundation for stack-based languages)
seq-core = { path = "../core", version = "=5.6.1" }

# May - Erlang-style green threads / coroutines for CSP concurrency
may.workspace = true

# libc - System call interface
libc.workspace = true

# Serialization (for Value persistence/exchange with external systems)
serde.workspace = true
bincode.workspace = true

# JSON serialization for report output (optional via "report-json" feature)
serde_json = { workspace = true, optional = true }

# Encoding (Base64, Hex) - always available as core utilities
base64.workspace = true
hex.workspace = true

# Crypto (optional via "crypto" feature)
sha2 = { workspace = true, optional = true }
hmac = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
uuid = { workspace = true, optional = true }
subtle = { workspace = true, optional = true }
aes-gcm = { workspace = true, optional = true }
pbkdf2 = { workspace = true, optional = true }
ed25519-dalek = { workspace = true, optional = true }

# HTTP client (optional via "http" feature)
ureq = { workspace = true, optional = true }
url = { workspace = true, optional = true }

# Regular expressions (optional via "regex" feature)
regex = { workspace = true, optional = true }

# Compression (optional via "compression" feature)
flate2 = { workspace = true, optional = true }
zstd = { workspace = true, optional = true }

# Signal handling for SIGQUIT diagnostics (Unix only, optional via diagnostics feature)
[target.'cfg(unix)'.dependencies]
signal-hook = { workspace = true, optional = true }

[dev-dependencies]
tempfile.workspace = true
serial_test.workspace = true
