@wrongstack/tools 0.291.0 → 0.291.1
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/dist/bash-kill-guard.d.ts +10 -1
- package/dist/bash-kill-guard.d.ts.map +1 -1
- package/dist/bash.js +140 -14
- package/dist/bash.js.map +2 -2
- package/dist/builtin.js +464 -90
- package/dist/builtin.js.map +4 -4
- package/dist/exec-kill-guard.d.ts +29 -0
- package/dist/exec-kill-guard.d.ts.map +1 -0
- package/dist/exec.d.ts.map +1 -1
- package/dist/exec.js +670 -10
- package/dist/exec.js.map +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +490 -113
- package/dist/index.js.map +4 -4
- package/dist/pack.js +464 -90
- package/dist/pack.js.map +4 -4
- package/package.json +3 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exec Kill Guard — Intercepts exec tool kill commands and prevents them from
|
|
3
|
+
* terminating WrongStack processes.
|
|
4
|
+
*
|
|
5
|
+
* Unlike bash-kill-guard.ts which parses a raw shell string, this module
|
|
6
|
+
* works with the exec tool's (command, args) format. It handles:
|
|
7
|
+
* - taskkill /F /IM node.exe (name-based)
|
|
8
|
+
* - taskkill /F /PID 1234 (PID-based)
|
|
9
|
+
* - Stop-Process -Name "node" -Force (PowerShell cmdlet)
|
|
10
|
+
* - kill -9 12345 / pkill node (POSIX via allowlisted commands)
|
|
11
|
+
* - wmic process where "name='node.exe'" delete
|
|
12
|
+
* - node -e "process.kill(12345)" (eval-based kill)
|
|
13
|
+
* - Any script that contains kill commands (exec'd via shell interpreters)
|
|
14
|
+
*
|
|
15
|
+
* This is one defense-in-depth layer — the primary guard is the
|
|
16
|
+
* PreToolUse hook in the process-guard plugin, and the permission
|
|
17
|
+
* policy's YOLO destructive detection.
|
|
18
|
+
*/
|
|
19
|
+
export interface ExecKillCheckResult {
|
|
20
|
+
blocked: boolean;
|
|
21
|
+
reason?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if an exec (command, args) pair is a kill operation targeting
|
|
25
|
+
* a protected WrongStack process. Returns { blocked: true, reason } when
|
|
26
|
+
* the command should be blocked, or { blocked: false } when it's safe.
|
|
27
|
+
*/
|
|
28
|
+
export declare function checkExecKillCommand(cmd: string, args: readonly string[]): Promise<ExecKillCheckResult>;
|
|
29
|
+
//# sourceMappingURL=exec-kill-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec-kill-guard.d.ts","sourceRoot":"","sources":["../src/exec-kill-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAQH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,OAAO,CAAC,mBAAmB,CAAC,CAoM9B"}
|
package/dist/exec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,IAAI,EACV,MAAM,kBAAkB,CAAC;AAU1B,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,IAAI,EACV,MAAM,kBAAkB,CAAC;AAU1B,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA+J1E;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;I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