running-process 4.5.5

Subprocess and PTY runtime for the running-process project
Documentation
[package]
name = "running-process"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
description = "Subprocess and PTY runtime for the running-process project"

[lints]
# Phase 0 of #228: pick up the workspace-wide `disallowed_methods =
# "deny"` so bincode serialization is rejected at compile time.
workspace = true

[[bin]]
# Wave 4 of #165: PM2-style supervisor CLI absorbed from
# `running-process-client`. Requires the `client` feature for IPC deps.
name = "runpm"
path = "src/bin/runpm.rs"
required-features = ["client"]

[[bin]]
# Wave 5 of #165: daemon binary absorbed from `running-process-daemon`.
# Requires the heavy `daemon` feature (tokio, sqlite, etc.).
name = "running-process-daemon"
path = "src/bin/daemon.rs"
required-features = ["daemon"]

[[bin]]
# Wave 6 of #165: tiny launcher binary absorbed from the
# `daemon-trampoline` crate. Reads a sidecar JSON file and execs the
# target command. No required-features — uses only serde/serde_json
# (promoted to unconditional deps below) plus libc + winapi which
# the lib already pulls in.
name = "daemon-trampoline"
path = "src/bin/trampoline.rs"

[[bin]]
name = "running-process-cleanup"
path = "src/bin/running-process-cleanup.rs"
required-features = ["client"]

[[bin]]
name = "running-process-broker-v1"
path = "src/bin/running-process-broker-v1.rs"
required-features = ["daemon"]

# v2 broker binary scaffold (slice 3a of #483). Pure print-and-exit
# scaffold today; subsequent slices add the pipe acceptor and Hello
# handler. Gated on `client` (not `daemon`) — v2 is a per-program proxy
# that doesn't need the full daemon runtime.
[[bin]]
name = "running-process-broker-v2"
path = "src/bin/running-process-broker-v2.rs"
required-features = ["client"]

[[example]]
# Dev-only evidence harness for #387: deploys the real broker binary plus
# a separate backend process and measures the opt-in handle-passing
# handoff against the reconnect fallback. Never shipped; see
# docs/v1-handoff-optimization.md for the recorded numbers.
name = "handoff_rollout_evidence"
required-features = ["client"]

[features]
# Final feature scheme per #165:
# * `core`   — always-available API (spawn / pty / containment).
# * `client` — adds proto types + IPC client (prost, interprocess, dirs).
# * `telemetry` — tee sink primitives without the full daemon runtime.
# * `daemon`    — superset of client; adds the full daemon runtime
#                 (tokio, rusqlite, tracing, etc.).
# Default ships `client` so `cargo install running-process` installs
# the `runpm` binary out of the box (per Q1 resolution in #165:
# `required-features` are not auto-activated by cargo install).
default = ["client"]
core = []
telemetry = []
client = [
    "dep:prost", "dep:prost-types", "dep:interprocess", "dep:dirs",
    "dep:anyhow", "dep:clap", "dep:blake3", "dep:sha2", "dep:getrandom",
    # #445: Windows-only sidecar self-acquisition. These deps live under
    # `[target.'cfg(windows)'.dependencies]` so enabling the feature on
    # non-Windows targets is a cargo-level no-op for them.
    "dep:ureq", "dep:zstd", "dep:tar",
    # Phase 5 of #222 (#428): the `runpm` CLI parses `runpm.toml` batch
    # config files (`[[app]]` entries). The TOML parsing helpers live
    # in `src/runpm_config.rs` and are exercised by both the binary
    # and the integration tests, so `toml` is gated on `client` rather
    # than `daemon`. The `daemon` feature still composes `client`, so
    # the daemon-side `src/daemon/config.rs` autostart loader picks up
    # the same dep transitively.
    "dep:toml",
]
# Opt-in async client surface for tokio daemons (#414). Adds async
# variants of `BackendHandle::probe_with_service` and `FrameClient`
# on top of the existing blocking surface. The synchronous probe and
# frame wire is the wire-of-record; the async layer wraps each
# round-trip in `tokio::task::spawn_blocking` so the caller's task
# yields the runtime worker thread without us duplicating the v1
# wire against `AsyncRead`/`AsyncWrite`. That keeps the tokio
# footprint minimal — only `rt` + `time` are required.
client-async = [
    "client",
    "dep:tokio",
]
daemon = [
    "client",
    "client-async",
    "interprocess/tokio",
    "dep:tokio", "dep:tokio-util", "dep:bytes", "dep:futures-util",
    "tokio/full",
    "dep:tracing", "dep:tracing-subscriber",
    "dep:rusqlite",
]
originator-scan = []               # used by running-process-py for cwd-tagging
# #433 R4: opt-in test seam. Gates the `RUNNING_PROCESS_FAKE_BACKEND` backdoor
# inside `connect_to_backend`. OFF by default and never listed by production
# consumers, so the backdoor is physically absent from every shipped build.
# Enabled only by the crate's own test pass (see `ci/test.py`).
test-seams = ["client"]
# #415: consumer-consumable conformance test kit
# (`crate::test_support::conformance`). Off by default; consumers opt in
# from their `dev-dependencies`.
test-support = ["client"]

[dependencies]
libc = "0.2"
portable-pty = "0.9"
sysinfo = "0.30"
thiserror = { workspace = true }
winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "ioapiset", "jobapi2", "namedpipeapi", "processthreadsapi", "winnt", "minwindef", "windef", "winuser", "consoleapi", "processenv", "synchapi", "winbase", "wincon", "tlhelp32", "securitybaseapi", "winerror", "sysinfoapi"] }
# Wave 4 of #165: client-feature deps. All optional so the always-on
# `core` API stays a minimal-dep leaf.
prost = { version = "0.14", optional = true }
prost-types = { version = "0.14", optional = true }
interprocess = { version = "2", optional = true }
dirs = { version = "6", optional = true }
# Used by the `runpm` PM2-style supervisor CLI (src/bin/runpm.rs).
anyhow = { version = "1", optional = true }
clap = { version = "4", features = ["derive"], optional = true }
# Phase 1 of #228 (issue #230): broker user-SID hashing in
# `src/broker/lifecycle/sid.rs`. blake3 is small (no_std-capable,
# no transitive deps beyond `arrayref`/`arrayvec` and `cc`-built SIMD).
blake3 = { version = "1", optional = true }
sha2 = { version = "0.10", optional = true }
getrandom = { version = "0.4", optional = true }
# Wave 5 of #165: daemon-feature deps. All optional.
# tokio: `client-async` (#414) only needs the `rt` (spawn_blocking)
# and `time` (`tokio::time::timeout`) features; the `daemon` feature
# layers `tokio/full` on top below. Cargo unifies feature sets, so
# any consumer enabling both ends up with the daemon footprint
# exactly as before.
tokio = { version = "1", default-features = false, features = ["rt", "time"], optional = true }
tokio-util = { version = "0.7", features = ["codec"], optional = true }
bytes = { version = "1", optional = true }
futures-util = { version = "0.3", features = ["sink"], optional = true }
tracing = { version = "0.1", optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }
rusqlite = { workspace = true, optional = true }
toml = { version = "0.8", optional = true }
# Wave 6 of #165: serde / serde_json promoted from daemon-feature
# optional to unconditional so the `daemon-trampoline` binary (which
# does not need the full daemon runtime) can deserialize its sidecar
# JSON without forcing `--features daemon`. They were already pulled
# in transitively under the daemon path; this just makes them always
# present.
serde = { version = "1", features = ["derive"] }
serde_json = "1"

[build-dependencies]
# Wave 3 of #165: build.rs absorbed from `running-process-proto`.
# Compiles proto/daemon.proto into OUT_DIR.
prost-build = "0.14"
protox = "0.9"
# #447: build.rs parses `conpty-sidecar.sha256.toml` (at workspace root)
# to bake the per-arch SHA-256 verification table into the crate at
# compile time. The runtime then verifies the fetched sidecar against
# the table before decompression.
toml = "0.8"

[dev-dependencies]
# Platform-default service-definition dir tests (#386) assert against
# the same `dirs` resolution the loader uses, not hardcoded strings.
dirs = "6"
serde_json = "1"
tempfile = "3"
test-watchdog = { path = "../test-watchdog" }
# Slice 33 of #500: trybuild UI harness assertions on the
# `BrokeredBackend` trait (#497) — every documented misuse pattern
# gets its own compile-fail case under `tests/ui/`.
trybuild = "1"

# #150: ConPTY passthrough rewrite uses windows-sys directly for the
# new conpty_passthrough module. Kept alongside (not replacing) the
# existing winapi 0.3 dep because the rest of the crate's Windows
# call sites are on winapi and migrating them is out of scope.
# windows-sys 0.59 exposes CreatePseudoConsole / ResizePseudoConsole /
# ClosePseudoConsole + PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE directly.
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.59", features = [
    "Win32_Foundation",
    "Win32_Security",
    "Win32_Security_Authorization",
    "Win32_Storage_FileSystem",
    "Win32_System_Console",
    "Win32_System_IO",
    "Win32_System_LibraryLoader",
    "Win32_System_Memory",
    "Win32_System_Pipes",
    "Win32_System_Registry",
    "Win32_System_Threading",
    "Win32_System_Diagnostics_Debug",
] }
# #445: transparent Win10 ConPTY sidecar self-acquisition. The runtime
# fetches a per-arch zstd-19 compressed tarball from this crate's
# matching GitHub release on first ConPTY use, caches it, and loads
# `conpty.dll` from there. Gated optional and pulled in by the `client`
# feature (which also enables `dirs` for cache-path discovery). ureq
# uses rustls so we don't drag in a C OpenSSL build on Windows.
ureq = { version = "2", default-features = false, features = ["tls"], optional = true }
zstd = { version = "0.13", default-features = false, optional = true }
tar = { version = "0.4", default-features = false, optional = true }

# Wave 5 of #165: extra dev-deps absorbed from `running-process-daemon`
# for its windows-only and unix-only integration tests.
[target.'cfg(windows)'.dev-dependencies]
winapi = { version = "0.3", features = ["handleapi", "processthreadsapi", "winnt"] }