@wrongstack/plugins 0.300.0 → 0.302.0
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.
- package/README.md +3 -1
- package/dist/config-validator.js +32 -2
- package/dist/index.js +1328 -49
- package/dist/path-guard/index.d.ts +14 -12
- package/dist/path-guard.js +1226 -38
- package/dist/plugin-audit-catalog.js +7 -0
- package/dist/pr-drafter.js +8 -2
- package/dist/shell-check.js +1 -0
- package/dist/smart-rename.js +5 -1
- package/dist/template-engine.js +51 -6
- package/dist/test-generator.js +30 -0
- package/package.json +3 -3
|
@@ -3,13 +3,21 @@
|
|
|
3
3
|
* destructive shell commands that touch protected paths.
|
|
4
4
|
*
|
|
5
5
|
* `branch-guard` protects git *branches*; this plugin protects
|
|
6
|
-
* *files and directories*. A `PreToolUse` hook
|
|
7
|
-
*
|
|
6
|
+
* *files and directories*. A `PreToolUse` hook matches the target path
|
|
7
|
+
* against a configurable glob list:
|
|
8
8
|
*
|
|
9
|
-
* -
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* - any tool that declares `fs.write` (or, absent a capability list,
|
|
10
|
+
* `mutating: true`) → the `path` / `file_path` / `output_path` / …
|
|
11
|
+
* input field
|
|
12
|
+
* - shell commands → destructive ones only (`rm`, `rmdir`, `mv`, `cp`,
|
|
13
|
+
* `install`, `tee`, `dd of=`, output redirection `>` / `>>`, `truncate`)
|
|
14
|
+
* whose arguments mention a protected path
|
|
15
|
+
*
|
|
16
|
+
* The hook is registered for `*` and decides from the tool's own
|
|
17
|
+
* declaration. It used to be registered for `write|edit|bash|exec` and to
|
|
18
|
+
* branch on those four names, which meant `patch`, `scaffold`, every
|
|
19
|
+
* plugin-registered writer and every MCP filesystem server wrote past it
|
|
20
|
+
* untouched.
|
|
13
21
|
*
|
|
14
22
|
* Default protected set: lockfiles, `.env*` secrets, `.git/`
|
|
15
23
|
* internals, and production migration folders — files an agent
|
|
@@ -40,12 +48,6 @@ import type { Plugin } from '@wrongstack/core/types';
|
|
|
40
48
|
* (`.env` matches `sub/dir/.env`).
|
|
41
49
|
*/
|
|
42
50
|
export declare function compilePathGlob(pattern: string): RegExp;
|
|
43
|
-
/**
|
|
44
|
-
* Extract candidate target paths from a shell command, but only when
|
|
45
|
-
* the command looks destructive. Non-destructive commands (cat, ls,
|
|
46
|
-
* grep …) never trigger the guard, even if they mention a protected
|
|
47
|
-
* path.
|
|
48
|
-
*/
|
|
49
51
|
export declare function destructiveTargets(command: string): string[];
|
|
50
52
|
declare const plugin: Plugin;
|
|
51
53
|
export default plugin;
|