Implemented all 14 environment checks as specified in the bead description: - pdftract binary: version + git-sha + compiled features - tesseract install: version check (major >= 5 OK, == 4 WARN, <= 3 FAIL) - tesseract languages: eng + requested langs present - leptonica install: pkg-config check >= 1.79 - libtiff: pkg-config check with ldconfig fallback - libopenjp2: pkg-config check with ldconfig fallback - pdfium native lib: runtime detection >= 6555 - network reachability: HEAD example.com 5s timeout - cache directory: writable + 1 GiB free + layout version - profile search path: YAML parse + PROFILE_SECRETS_FORBIDDEN - ulimit -n: getrlimit check >= 1024 - available RAM: /proc/meminfo or sysctl - system locale: UTF-8 check - temp dir writable: TMPDIR + 100 MiB free All checks feature-gated appropriately. Panic-safe via run_check_safe(). CLI output layer integrated with --json and --features flags. Acceptance criteria: - ✅ Unit tests for OK/WARN/FAIL paths in each check - ✅ Runtime < 6s (network: 5s, others: <100ms) - ✅ Panic catching via catch_unwind - ✅ Feature-gated checks return NotApplicable - ✅ pkg-config fallback to ldconfig - ✅ Profile secret detection with PROFILE_SECRETS_FORBIDDEN Co-Authored-By: Claude Code <noreply@anthropic.com>
96 lines
2.4 KiB
TOML
96 lines
2.4 KiB
TOML
[package]
|
|
name = "pdftract-cli"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
publish = true
|
|
|
|
[[bin]]
|
|
name = "pdftract"
|
|
path = "src/main.rs"
|
|
test = true
|
|
|
|
[[bin]]
|
|
name = "generate_lzw_fixtures"
|
|
path = "../../tests/fixtures/generate_lzw_fixtures_main.rs"
|
|
|
|
[lib]
|
|
name = "pdftract_cli"
|
|
path = "src/lib.rs"
|
|
|
|
default-run = "pdftract"
|
|
|
|
[dependencies]
|
|
anyhow = { workspace = true }
|
|
atty = "0.2"
|
|
async-stream = "0.3"
|
|
axum = { version = "0.7", features = ["json", "multipart"] }
|
|
bytes = "1"
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
clap = { version = "4.5", features = ["derive"] }
|
|
dirs = "5.0"
|
|
hyper = { version = "1.0", features = ["full"] }
|
|
hyper-util = { version = "0.1", features = ["full"] }
|
|
http-body-util = "0.1"
|
|
humantime = "2.1"
|
|
libloading = { version = "0.8", optional = true }
|
|
lzw = { workspace = true }
|
|
multer = "3"
|
|
pdftract-core = { path = "../pdftract-core" }
|
|
regex = "1.10"
|
|
secrecy = { workspace = true }
|
|
semver = "1.0"
|
|
serde = { workspace = true, features = ["derive"] }
|
|
serde_json = "1.0"
|
|
serde_yaml = { version = "0.9", optional = true }
|
|
sha2 = "0.10"
|
|
termcolor = "1.4"
|
|
schemars = { version = "0.8", features = ["derive"] }
|
|
subtle = "2.6"
|
|
tempfile = "3"
|
|
tera = "1"
|
|
tokio = { version = "1", features = ["full"] }
|
|
tokio-stream = "0.1"
|
|
tower = { version = "0.5", features = ["full"] }
|
|
tower-http = { version = "0.5", features = ["cors", "trace", "limit", "compression-full"] }
|
|
tracing = { workspace = true }
|
|
ureq = { version = "2.9", optional = true }
|
|
uuid = { version = "1.0", features = ["v4", "serde"] }
|
|
walkdir = "2"
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = "0.2"
|
|
|
|
[features]
|
|
default = []
|
|
# OCR support via Tesseract
|
|
ocr = []
|
|
# Full rendering via PDFium (JBIG2, JPEG2000, CCITT decoding)
|
|
full-render = ["dep:libloading"]
|
|
# Remote HTTP source support
|
|
remote = ["dep:ureq"]
|
|
# Document profiles
|
|
profiles = ["dep:serde_yaml"]
|
|
# HTTP serve mode
|
|
serve = []
|
|
# MCP server mode
|
|
mcp = []
|
|
# Inspector web viewer
|
|
inspect = []
|
|
# Folder grep mode
|
|
grep = []
|
|
# Content-addressed cache
|
|
cache = []
|
|
# Visual citation receipts
|
|
receipts = []
|
|
# Markdown output
|
|
markdown = []
|
|
|
|
[dev-dependencies]
|
|
ureq = { version = "2.9", features = ["socks-proxy"] }
|
|
serde_yaml = "0.9"
|
|
jsonschema = "0.18"
|
|
reqwest = { version = "0.12", features = ["blocking", "json", "rustls-tls"], default-features = false }
|
|
schemars = { version = "0.8", features = ["derive"] }
|