Commit 7a4b59b
committed
feat(tools): 10 new native performance/parallelism tools
batch_patch — Apply up to 10 edits atomically (transactional early-stop).
Replaces N serial patch calls with one batch call.
parallel_shell — Run up to 8 shell commands concurrently with bounded
goroutines. Each classified individually through the danger gate.
Structured results with stdout, stderr, exit_code, duration_ms.
http_batch — Fetch up to 10 URLs in parallel goroutines. Returns status,
content_length, error per URL. ClassifyURL gated per URL.
math_eval — Native arithmetic expression evaluator using go/parser + AST
walk. Supports +, -, *, /, parentheses, decimals. Directly replaces
bc/expr/python -c forks (hits quick_math benchmark).
diff — LCS-based structured diff between two files or file-vs-string.
Returns typed hunks (equal/added/removed) with line-by-line data.
Zero dependencies, no diff fork.
count_lines — Streaming line/byte/char counter for up to 20 files in
parallel. Zero-alloc on content (bufio.Scanner). Replaces wc fork.
multi_grep — Search for up to 10 regex patterns in parallel, each with
its own goroutine directory walk. Directly targets multi_search
benchmark — replaces N serial search_files calls.
json_query — JSON path query engine using dot-path syntax with array
indexing (key.sub[0].name). Go encoding/json decoder, no jq fork.
tree — Structured directory tree listing with file counts, sizes,
nesting. Configurable depth and hidden-file filtering.
checksum — SHA-256/SHA-1/MD5 hashing using Go crypto stdlib. Up to
10 files in parallel. Replaces sha256sum/md5sum forks.
Security: all tools gated through danger.ClassifyPath/ClassifyURL +
CheckOperation. All file opens use O_NOFOLLOW. All registered in
classifyToolCall() for batch approval gate. 25 new tests.
0 new dependencies.1 parent 7644170 commit 7a4b59b
4 files changed
Lines changed: 2126 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1400 | 1400 | | |
1401 | 1401 | | |
1402 | 1402 | | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
1403 | 1413 | | |
1404 | 1414 | | |
1405 | 1415 | | |
| |||
0 commit comments