@seanmozeik/tripwire 0.6.5 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanmozeik/tripwire",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "Opinionated hooks dispatcher for AI coding agents with configurable safety rules",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -27,21 +27,27 @@
27
27
  "format": "oxfmt --write .",
28
28
  "lint": "oxlint --tsconfig tsconfig.oxlint.json .",
29
29
  "lint:fix": "oxlint --format agent --tsconfig tsconfig.oxlint.json --fix .",
30
+ "prepare": "bunx effect-tsgo patch",
30
31
  "test": "bun test",
31
32
  "typecheck": "tsc --noEmit"
32
33
  },
33
34
  "dependencies": {
34
- "@effect/platform-bun": "^4.0.0-beta.78",
35
- "effect": "^4.0.0-beta.78",
36
35
  "shell-quote": "^1.8.4"
37
36
  },
38
37
  "devDependencies": {
38
+ "@effect/platform-bun": "^4.0.0-beta.102",
39
+ "@effect/tsgo": "^0.24.3",
39
40
  "@types/bun": "^1.3.14",
40
41
  "@types/shell-quote": "^1.7.5",
42
+ "effect": "^4.0.0-beta.102",
41
43
  "oxfmt": "^0.53.0",
42
- "oxlint": "^1.68.0",
44
+ "oxlint": "1.68.0",
43
45
  "oxlint-tsgolint": "^0.23.0",
44
- "typescript": "^6.0.3"
46
+ "typescript": "^7.0.2"
47
+ },
48
+ "peerDependencies": {
49
+ "@effect/platform-bun": "^4.0.0-beta.102",
50
+ "effect": "^4.0.0-beta.102"
45
51
  },
46
52
  "engines": {
47
53
  "bun": ">=1.0"
@@ -88,9 +88,21 @@ const POLICIES: readonly Policy[] = [
88
88
  rule: 'consider-rg',
89
89
  action: 'warn',
90
90
  message:
91
- 'Consider `rg` (ripgrep) instead of `grep`. Faster; recurses by default; respects .gitignore by default (use `-u`/`-uu` to include ignored/hidden files); searches the CWD when no path is given. NOT a clean flag-for-flag swap; some flags differ or are unneeded. Carry over fine: `-i`, `-n`, `-v`, `-l`, `-c`. WATCH OUT: `-r` is NOT recursive in rg it means `--replace` (rg already recurses), so `rg -rn "PATTERN" dir/` silently parses as `--replace=n` and rewrites every match to the literal "n" while exiting 0. Drop the `-r`: `grep -rn PATTERN .` → `rg -n PATTERN`. And `grep --include`/`--exclude` become `rg -g GLOB`/`-g !GLOB`.',
91
+ 'Consider `rg` (ripgrep) instead of `grep`. Faster; recurses by default; respects .gitignore by default (use `-u`/`-uu` to include ignored/hidden files); searches the CWD when no path is given. NOT a clean flag-for-flag swap; some flags differ or are unneeded. Carry over fine: `-i`, `-n`, `-v`, `-l`, `-c`. WATCH OUT: `-r` is NOT recursive in rg, it means `--replace` (rg already recurses), so `rg -rn "PATTERN" dir/` silently parses as `--replace=n` and rewrites every match to the literal "n" while exiting 0. Drop the `-r`: `grep -rn PATTERN .` → `rg -n PATTERN`. And `grep --include`/`--exclude` become `rg -g GLOB`/`-g !GLOB`.',
92
92
  fires: (seg) => seg.head === 'grep' || seg.head === 'egrep' || seg.head === 'fgrep',
93
93
  },
94
+ {
95
+ rule: 'rg-r-is-replace',
96
+ action: 'warn',
97
+ message:
98
+ 'STOP — your rg output is probably mangled. `-r` in rg means `--replace`, NOT recursive, so any `-r{X}` flag combo silently rewrites every match to the literal string "{X}" and exits 0 with no error. ripgrep is always recursive by default — there is no `-r` for recursion. If you want to search: drop the `-r` entirely (`rg -rn PATTERN` → `rg -n PATTERN`). If you genuinely want text substitution: use `--replace` explicitly.',
99
+ fires: (seg) => {
100
+ if (seg.head !== 'rg') {
101
+ return false;
102
+ }
103
+ return seg.flags.some((f) => f.startsWith('-') && !f.startsWith('--') && f.includes('r'));
104
+ },
105
+ },
94
106
  {
95
107
  rule: 'consider-btop',
96
108
  action: 'warn',