Generates allowlist/denylist pattern suggestions from parsed sub-commands.
Suggestions are ordered from broadest to most specific:
First-word prefix (e.g., "git *") — if all sub-commands share the first word
First-two-words prefix (e.g., "git log *") — if all share the first two words
Combined prefixes (e.g., ["find *", "head *"]) — if exactly 2 sub-commands
with different first words. Single-word sub-commands use the exact command.
Exact match — only for single sub-commands shorter than 50 characters
For allow: use suggestions as-is (combined means both patterns are needed).
For deny: flatten combined suggestions into individual patterns (either suffices).
Generates allowlist/denylist pattern suggestions from parsed sub-commands.
Suggestions are ordered from broadest to most specific:
For allow: use suggestions as-is (combined means both patterns are needed). For deny: flatten combined suggestions into individual patterns (either suffices).
Examples (with pre-parsed sub-commands):
["git log --oneline -20"]→[{["git *"]}, {["git log *"]}, {["git log --oneline -20"]}]["git rev-parse --show-toplevel", "git log -n 15 ..."]→[{["git *"]}]["npm run build", "npm run test"]→[{["npm *"]}, {["npm run *"]}]["find . -name '*.ts'", "head -5"]→[{["find *", "head *"]}]["find . -type f", "sort"]→[{["find *", "sort"]}]["git status", "npm test"]→[{["git *", "npm *"]}]["ls"]→[{["ls"]}]