rust-expect 0.2.0

Next-generation Expect-style terminal automation library for Rust
Documentation
# rust-expect: Next-generation terminal automation library
# https://docs.rs/rust-expect

[package]
name = "rust-expect"
description = "Next-generation Expect-style terminal automation library for Rust"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
readme = "README.md"

[lints]
workspace = true

[dependencies]
# Core dependencies
rust-pty.workspace = true
rust-expect-macros.workspace = true

# Async runtime
tokio.workspace = true

# Pattern matching
regex.workspace = true

# SIMD-accelerated substring search (used by send_paste's end-marker scan
# and other byte-pattern checks); transitively required by regex anyway.
memchr = "2"

# Error handling
thiserror.workspace = true

# Logging
tracing.workspace = true

# Serialization (for transcripts)
serde_json.workspace = true

# Random number generation (for human typing simulation)
rand.workspace = true

# Futures utilities for async combinators
futures.workspace = true

# Zero-copy byte buffers
bytes.workspace = true

# libc for low-level Unix operations
libc.workspace = true

# Bitflags for terminal attributes (screen buffer)
bitflags = { workspace = true, optional = true }

# SSH support (optional) - russh 0.56+ includes keys module natively
russh = { workspace = true, optional = true }

# OpenTelemetry for distributed tracing (optional)
opentelemetry = { workspace = true, optional = true }
opentelemetry_sdk = { workspace = true, optional = true }
opentelemetry-otlp = { workspace = true, optional = true }
tracing-opentelemetry = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true }

# Prometheus metrics (optional)
prometheus = { workspace = true, optional = true }

# Windows-specific dependencies
[target.'cfg(windows)'.dependencies]
windows-sys.workspace = true

[dev-dependencies]
proptest.workspace = true
criterion.workspace = true
expectrl.workspace = true
tempfile = "3"

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

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

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

[features]
default = []

# Enable SSH backend for remote sessions
ssh = ["dep:russh"]

# Enable mock backend for testing
mock = []

# Enable screen buffer with ANSI parsing
screen = ["dep:bitflags"]

# Enable PII detection and redaction
pii-redaction = []

# Enable legacy character encodings (Latin-1, Windows-1252)
legacy-encoding = []

# Enable Prometheus/OpenTelemetry metrics
metrics = [
    "dep:opentelemetry",
    "dep:opentelemetry_sdk",
    "dep:opentelemetry-otlp",
    "dep:tracing-opentelemetry",
    "dep:tracing-subscriber",
    "dep:prometheus",
]

# Enable test utilities
test-utils = []

# DANGEROUS: Enable HostKeyVerification::AcceptAll which disables SSH host key verification.
# This is insecure and should ONLY be used in controlled testing environments.
# Enabling this in production allows MITM attacks. You have been warned.
insecure-skip-verify = []

# Enable all optional features (excludes insecure-skip-verify for safety)
full = ["ssh", "mock", "screen", "pii-redaction", "metrics"]

# Examples that depend on optional features must declare them so
# `cargo build/test --features <other>` skips them rather than failing to
# resolve `main` after the file gets cfg'd out.
[[example]]
name = "drive_htop"
required-features = ["screen"]

[[example]]
name = "drive_less"
required-features = ["screen"]