-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathCargo.toml
More file actions
203 lines (185 loc) · 6.37 KB
/
Cargo.toml
File metadata and controls
203 lines (185 loc) · 6.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
[package]
name = "destructive_command_guard"
version = "0.5.1"
edition = "2024"
resolver = "2"
authors = [
"Jeffrey Emanuel <jeff@jeffreyemanuel.dev>",
"Dowwie <dowwie@gmail.com>"
]
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 = "MIT"
keywords = ["destructive", "safety", "claude", "hook", "guard"]
categories = ["command-line-utilities", "development-tools"]
readme = "README.md"
rust-version = "1.85"
exclude = [
".github/",
".beads/",
"scripts/",
"*.md",
"!README.md",
]
# Primary binary with short alias
[[bin]]
name = "dcg"
path = "src/main.rs"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
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.7"
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
clap = { version = "4.5", features = ["derive", "env"] }
clap_complete = "4.5"
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.49", features = ["rt-multi-thread"] }
rayon = { version = "1.11", optional = true }
# AST-based pattern matching for heredoc/inline-script content
ast-grep-core = "0.42"
ast-grep-language = { version = "0.42", 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.2", features = ["fts5"] } # FrankenSQLite with concurrent writing
fsqlite-types = "0.1.2" # SqliteValue type
fsqlite-error = "0.1.2" # FrankenError type
ctrlc = "3.5.1"
flate2 = "1.0" # Gzip compression for history export
# Update checking dependencies
self_update = { version = "0.44", default-features = false, features = ["reqwest", "rustls", "archive-tar", "archive-zip", "compression-flate2"] }
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)
rich_rust = { version = "0.2.1", features = ["full"], optional = true }
[build-dependencies]
vergen-gix = { version = "10.0.0-beta.5", features = ["build", "cargo", "rustc"] }
[dev-dependencies]
assert_cmd = "2.0"
insta = { version = "1.40", features = ["yaml"] }
predicates = "3.1"
tempfile = "3.14"
proptest = "1.4"
criterion = { version = "0.8", features = ["html_reports"] }
libc = "0.2"
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 }
# Temporarily allow these to unblock CI - should be fixed properly in future
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"