[package] name = "destructive_command_guard" version = "0.6.8" edition = "2024" resolver = "2" authors = [ "Jeffrey Emanuel ", "Dowwie " ] description = "An AI coding agent hook that blocks destructive commands before they execute" repository = "https://github.com/Dicklesworthstone/destructive_command_guard" homepage = "https://github.com/Dicklesworthstone/destructive_command_guard" license-file = "LICENSE" keywords = ["destructive", "safety", "claude", "hook", "guard"] categories = ["command-line-utilities", "development-tools"] readme = "README.md" rust-version = "1.95" exclude = [ ".beads/", "scripts/", "*.md", "!/README.md", "!/AGENTS.md", ".ntm/", "*.png", "*.webp", "agent_baseline/", "action/", ] # Primary binary with short alias [[bin]] name = "dcg" path = "src/main.rs" [dependencies] serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" schemars = "1.0" # JSON Schema generation for config.toml (editor autocomplete/validation) serde_yaml = "0.9" # External pack YAML parsing toml = "1.0" toml_edit = "0.25" # Preserves formatting when editing TOML files chrono = { version = "0.4", default-features = false, features = ["std", "clock", "serde"] } # RFC 3339 timestamps fancy-regex = "0.18" regex = "1.10" # For RegexSet in heredoc detection memchr = "2.8" aho-corasick = "1.1" # Multi-pattern string matching for keyword quick-reject smallvec = "1.15.1" colored = "3.1" dirs = "6.0" glob = "0.3" # Glob pattern expansion for custom pack paths shell-words = "1.1" # Quote-aware tokenization for static stdin data-flow analysis libc = "0.2" # Nonblocking, no-follow opens for inspected stdin files on Unix clap = { version = "4.5", features = ["derive", "env"] } clap_complete = "4.6" once_cell = "1.19" base64 = "0.22" # For decision log format parsing in simulate async-trait = "0.1.89" rust-mcp-sdk = { version = "0.9.0", default-features = false, features = ["server", "stdio", "macros"] } tokio = { version = "1.52", features = ["rt-multi-thread"] } rayon = { version = "1.11", optional = true } # AST-based pattern matching for heredoc/inline-script content ast-grep-core = "0.44" ast-grep-language = { version = "0.44", default-features = false, features = [ "tree-sitter-bash", "tree-sitter-python", "tree-sitter-javascript", "tree-sitter-typescript", "tree-sitter-ruby", "tree-sitter-go", "tree-sitter-php", ] } # Tracing/logging for heredoc detection debugging tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } sha2 = "0.11" hmac = "0.13" # HMAC for optional short-code hardening (ksk.1.10) fs2 = "0.4" fsqlite = { version = "0.1.16", features = ["fts5"] } # FrankenSQLite (atomic commit-marker recovery hardening in 0.1.16) fsqlite-types = "0.1.16" # SqliteValue type fsqlite-error = "0.1.16" # FrankenError type ctrlc = "3.5.1" flate2 = "1.0" # Gzip compression for history export # Update checking dependencies self_update = { version = "1.0.0-rc.5", default-features = false, features = ["reqwest", "rustls", "github"] } semver = "1.0" # Semantic version comparison for update checks # TUI/CLI visual polish dependencies (advk epic) ratatui = { version = "0.30", default-features = false, features = ["crossterm"] } indicatif = "0.18" console = "0.16" inquire = "0.9" rand = { version = "0.10", default-features = false, features = ["std", "thread_rng"] } tru = "0.2.2" # rich_rust for premium terminal output (rich_rust epic). Keep only the # Markdown renderer used by dcg; the syntax feature pulls in an obsolete parser # stack and the regex renderer below already has a purpose-built highlighter. rich_rust = { version = "0.2.2", features = ["markdown"], optional = true } [build-dependencies] vergen-gix = { version = "10.0.0-beta.8", features = ["build", "cargo", "rustc"] } [dev-dependencies] assert_cmd = "2.2" insta = { version = "1.40", features = ["yaml"] } predicates = "3.1" tempfile = "3.14" proptest = "1.4" criterion = { version = "0.8", features = ["html_reports"] } regex-automata = "0.4" # For ksk.8.1 prototype comparison which = "8.0" # For finding dcg binary in E2E tests walkdir = "2.5" # For golden file directory traversal [[bench]] name = "heredoc_perf" harness = false [[bench]] name = "regex_automata_comparison" harness = false [[bench]] name = "codex_deny" harness = false [[bench]] name = "hook_latency" harness = false [profile.release] opt-level = "z" # Optimize for size (lean binary for distribution) lto = true # Link-time optimization across crates codegen-units = 1 # Single codegen unit for better optimization panic = "abort" # Smaller binary, no unwinding overhead strip = true # Remove debug symbols [profile.dev] opt-level = 1 # Faster compile times during development [features] default = ["rich-output"] rayon = ["dep:rayon"] rich-output = ["dep:rich_rust"] # Enable rich_rust for premium terminal output [lints.rust] # unsafe_code = "forbid" # Moved to src/lib.rs and src/main.rs to allow unsafe in tests [lints.clippy] all = { level = "warn", priority = -1 } pedantic = { level = "warn", priority = -1 } nursery = { level = "warn", priority = -1 } # The pinned release nightly promotes two purely stylistic lints across the # entire mature codebase. Keep `-D warnings` meaningful for correctness lints # without forcing a behavior-neutral rewrite of hundreds of control-flow sites. collapsible_if = "allow" duration_suboptimal_units = "allow" # Established project-wide style exceptions. return_self_not_must_use = "allow" suboptimal_flops = "allow" too_many_lines = "allow" manual_string_new = "allow" field_reassign_with_default = "allow" missing_const_for_fn = "allow" redundant_pub_crate = "allow" cognitive_complexity = "allow" option_if_let_else = "allow" significant_drop_tightening = "allow" iter_without_into_iter = "allow" map_unwrap_or = "allow" unused_self = "allow" must_use_candidate = "allow" single_match_else = "allow" unnested_or_patterns = "allow" match_same_arms = "allow" needless_pass_by_value = "allow" similar_names = "allow" match_wildcard_for_single_variants = "allow" trivially_copy_pass_by_ref = "allow" uninlined_format_args = "allow" if_not_else = "allow" use_self = "allow" struct_excessive_bools = "allow" struct_field_names = "allow" doc_markdown = "allow" module_name_repetitions = "allow" fn_params_excessive_bools = "allow" needless_for_each = "allow" items_after_statements = "allow" cast_possible_truncation = "allow" cast_sign_loss = "allow" cast_precision_loss = "allow" cast_lossless = "allow" cast_possible_wrap = "allow" implicit_hasher = "allow" default_trait_access = "allow" missing_errors_doc = "allow" missing_panics_doc = "allow" wildcard_imports = "allow" manual_let_else = "allow" too_many_arguments = "allow" write_literal = "allow" print_literal = "allow" many_single_char_names = "allow" string_add = "allow" string_add_assign = "allow" ref_option_ref = "allow" unused_async = "allow" redundant_clone = "allow" derivable_impls = "allow" single_match = "allow" len_zero = "allow" len_without_is_empty = "allow" doc_link_with_quotes = "allow"