[package]
name = "epics-tools-rs"
version.workspace = true
edition.workspace = true
description = "Operational tooling for EPICS deployments — process supervisors, log/audit dumpers, config validators. First tenant: procserv (Rust port of epics-modules/procServ)."
license-file = "LICENSE"
authors.workspace = true
repository.workspace = true

[features]
default = ["procserv", "procserv-bin"]

# Library: PTY-based process supervisor with multi-client telnet console.
# Mirrors C epics-modules/procServ feature set: forkpty child + party-line
# fan-out + per-connection readonly flag + restart policy + putlog.
procserv = []

# Daemon binary `procserv-rs`. Enables CLI parsing + tracing subscriber.
procserv-bin = ["procserv", "dep:clap", "dep:tracing-subscriber"]

[dependencies]
epics-base-rs = { workspace = true }
tokio = { version = "1", features = ["full"] }
tracing = "0.1"
parking_lot = "0.12"
chrono = "0.4"
thiserror = "2"

# Optional bin-only deps
clap = { version = "4", features = ["derive"], optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }

# Unix-only: forkpty + signal forwarding. The whole crate is `#[cfg(unix)]`
# at the lib root; on non-Unix targets it compiles to an empty crate so
# workspace builds still succeed (matches C procServ's Unix-only posture).
[target.'cfg(unix)'.dependencies]
nix = { version = "0.29", features = ["signal", "process", "term", "fs"] }
libc = "0.2"

[dev-dependencies]
tempfile = "3"

[[bin]]
name = "procserv-rs"
path = "src/bin/procserv_rs.rs"
required-features = ["procserv-bin"]
