wrasse-audit 0.0.0-stage → 1.0.0-beta.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/LICENSE +21 -0
- package/README.md +15 -3
- package/bin/wrasse.js +38 -0
- package/package.json +34 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jiaming Shi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# wrasse (npm launcher)
|
|
2
|
+
|
|
3
|
+
wrasse is a Python CLI. This package installs a `wrasse` command that finds your
|
|
4
|
+
installed copy of the Python tool and runs it with the same arguments.
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
pip install --pre wrasse
|
|
8
|
+
npx wrasse-audit audit . --offline
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
There is no scanner in this package. Without the Python package the launcher
|
|
12
|
+
prints the pip command and exits with 127.
|
|
13
|
+
|
|
14
|
+
The tool itself, its rules and the docs live at
|
|
15
|
+
https://github.com/JiamingShi-JsPhys/wrasse
|
package/bin/wrasse.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// wrasse is a Python program. This package finds an installed copy and forwards
|
|
3
|
+
// its arguments; it contains no scanner of its own.
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
|
|
6
|
+
const passthrough = process.argv.slice(2);
|
|
7
|
+
const pythons = process.platform === "win32" ? ["python", "py", "python3"] : ["python3", "python"];
|
|
8
|
+
const missing =
|
|
9
|
+
"wrasse: the Python package is not installed.\n\n" +
|
|
10
|
+
" pip install --pre wrasse\n\n" +
|
|
11
|
+
"The npm package is only a launcher. Source and docs:\n" +
|
|
12
|
+
" https://github.com/JiamingShi-JsPhys/wrasse";
|
|
13
|
+
|
|
14
|
+
function run(cmd, args) {
|
|
15
|
+
const result = spawnSync(cmd, args, { stdio: "inherit" });
|
|
16
|
+
if (result.error && result.error.code === "ENOENT") return null;
|
|
17
|
+
if (result.error) {
|
|
18
|
+
console.error(`wrasse: ${result.error.message}`);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
return result.status === null ? 1 : result.status;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 1. The module, through whichever interpreter already has it. Trying this first
|
|
25
|
+
// keeps a `wrasse` executable from being found when that executable is us.
|
|
26
|
+
for (const python of pythons) {
|
|
27
|
+
const probe = spawnSync(python, ["-c", "import wrasse"], { stdio: "ignore" });
|
|
28
|
+
if (probe.error || probe.status !== 0) continue;
|
|
29
|
+
const code = run(python, ["-m", "wrasse", ...passthrough]);
|
|
30
|
+
process.exit(code === null ? 127 : code);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 2. A `wrasse` script on PATH, which is what `pip install wrasse` creates.
|
|
34
|
+
const direct = run("wrasse", passthrough);
|
|
35
|
+
if (direct !== null) process.exit(direct);
|
|
36
|
+
|
|
37
|
+
console.error(missing);
|
|
38
|
+
process.exit(127);
|
package/package.json
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "wrasse-audit",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "wrasse-audit",
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"description": "Launcher for the wrasse Python CLI: deterministic security audit for AI-written code",
|
|
5
|
+
"bin": {
|
|
6
|
+
"wrasse-audit": "bin/wrasse.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/wrasse.js",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=18"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"security",
|
|
18
|
+
"sast",
|
|
19
|
+
"cli",
|
|
20
|
+
"python",
|
|
21
|
+
"secrets",
|
|
22
|
+
"static-analysis"
|
|
23
|
+
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/JiamingShi-JsPhys/wrasse.git"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/JiamingShi-JsPhys/wrasse",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/JiamingShi-JsPhys/wrasse/issues"
|
|
31
|
+
},
|
|
32
|
+
"author": "Jiaming Shi",
|
|
33
|
+
"license": "MIT"
|
|
34
|
+
}
|