@rhodawkai/bounty-hunter 2.0.0 → 2.0.2

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 CHANGED
@@ -1,11 +1,11 @@
1
1
  <div align="center">
2
2
 
3
- # @rhodawk-ai/bounty-hunter
3
+ # @rhodawkai/bounty-hunter
4
4
 
5
5
  **npm CLI wrapper for [RhodawkAI Bounty Hunter](https://github.com/Rhodawk-AI/rhodawk-bounty-hunter) —
6
6
  AI-powered bug bounty hunting, recon to report, in your terminal.**
7
7
 
8
- [![npm](https://img.shields.io/npm/v/@rhodawk-ai/bounty-hunter?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/@rhodawk-ai/bounty-hunter)
8
+ [![npm](https://img.shields.io/npm/v/@rhodawkai/bounty-hunter?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/@rhodawkai/bounty-hunter)
9
9
  [![PyPI](https://img.shields.io/pypi/v/rhodawk-bounty-hunter?style=for-the-badge&logo=pypi&logoColor=white&color=3775A9)](https://pypi.org/project/rhodawk-bounty-hunter/)
10
10
  [![CI](https://github.com/Rhodawk-AI/rhodawk-bounty-hunter/actions/workflows/ci.yml/badge.svg)](https://github.com/Rhodawk-AI/rhodawk-bounty-hunter/actions/workflows/ci.yml)
11
11
  [![License: MIT](https://img.shields.io/badge/License-MIT-22C55E?style=for-the-badge&logo=opensourceinitiative&logoColor=white)](https://github.com/Rhodawk-AI/rhodawk-bounty-hunter/blob/main/LICENSE)
@@ -16,7 +16,7 @@ AI-powered bug bounty hunting, recon to report, in your terminal.**
16
16
 
17
17
  ## What is this package?
18
18
 
19
- `@rhodawk-ai/bounty-hunter` is a thin, dependency-free Node.js launcher for the
19
+ `@rhodawkai/bounty-hunter` is a thin, dependency-free Node.js launcher for the
20
20
  Python package [`rhodawk-bounty-hunter`](https://pypi.org/project/rhodawk-bounty-hunter/).
21
21
  It resolves and runs the `rhodawk` engine — fail-closed, CDN-aware autonomous
22
22
  bug bounty reconnaissance and attack-surface prioritization — and falls back to
@@ -26,10 +26,10 @@ bug bounty reconnaissance and attack-surface prioritization — and falls back t
26
26
 
27
27
  ```bash
28
28
  # global install (recommended)
29
- npm install -g @rhodawk-ai/bounty-hunter
29
+ npm install -g @rhodawkai/bounty-hunter
30
30
 
31
31
  # or run without installing
32
- npx @rhodawk-ai/bounty-hunter doctor
32
+ npx @rhodawkai/bounty-hunter doctor
33
33
  ```
34
34
 
35
35
  The wrapper exposes a single binary: `rhodawk`.
package/bin/rhodawk.js CHANGED
@@ -1,38 +1,79 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
 
4
+ const fs = require("fs");
5
+ const path = require("path");
4
6
  const { spawnSync } = require("child_process");
5
7
 
6
8
  const PKG = "rhodawk-bounty-hunter";
7
9
  const args = process.argv.slice(2);
10
+ const SELF_REAL = fs.realpathSync(__filename);
8
11
 
9
- function hasCmd(cmd) {
10
- const probe = spawnSync(process.platform === "win32" ? "where" : "which", [cmd], {
11
- stdio: "ignore",
12
- });
13
- return probe.status === 0;
12
+ if (process.env.RHODAWK_NPM_WRAPPER === "1") {
13
+ console.error("[rhodawk] Aborting recursive wrapper invocation.");
14
+ process.exit(1);
14
15
  }
15
16
 
16
- function run(cmd, cmdArgs) {
17
- const res = spawnSync(cmd, cmdArgs, { stdio: "inherit" });
17
+ function isExecutable(filePath) {
18
+ try {
19
+ const stat = fs.statSync(filePath);
20
+ if (!stat.isFile()) return false;
21
+ if (process.platform === "win32") return true;
22
+ fs.accessSync(filePath, fs.constants.X_OK);
23
+ return true;
24
+ } catch {
25
+ return false;
26
+ }
27
+ }
28
+
29
+ function findExternalCmd(cmd) {
30
+ const pathDirs = (process.env.PATH || "").split(path.delimiter).filter(Boolean);
31
+ const exts = process.platform === "win32" ? [".exe", ".cmd", ".bat", ""] : [""];
32
+
33
+ for (const dir of pathDirs) {
34
+ for (const ext of exts) {
35
+ const candidate = path.join(dir, cmd + ext);
36
+ if (!isExecutable(candidate)) continue;
37
+ let real;
38
+ try {
39
+ real = fs.realpathSync(candidate);
40
+ } catch {
41
+ continue;
42
+ }
43
+ if (real === SELF_REAL) continue;
44
+ return candidate;
45
+ }
46
+ }
47
+ return null;
48
+ }
49
+
50
+ function run(cmdPath, cmdArgs) {
51
+ const res = spawnSync(cmdPath, cmdArgs, {
52
+ stdio: "inherit",
53
+ env: { ...process.env, RHODAWK_NPM_WRAPPER: "1" },
54
+ });
18
55
  if (res.error) {
19
- console.error(`[rhodawk] Failed to run ${cmd}: ${res.error.message}`);
56
+ console.error(`[rhodawk] Failed to run ${cmdPath}: ${res.error.message}`);
20
57
  process.exit(1);
21
58
  }
22
59
  process.exit(res.status ?? 0);
23
60
  }
24
61
 
25
- if (hasCmd("rhodawk")) {
26
- run("rhodawk", args);
27
- } else if (hasCmd("pipx")) {
28
- run("pipx", ["run", "--spec", PKG, "rhodawk", ...args]);
62
+ const rhodawkBin = findExternalCmd("rhodawk");
63
+ if (rhodawkBin) {
64
+ run(rhodawkBin, args);
29
65
  } else {
30
- console.error(
31
- `[rhodawk] Python CLI not found on PATH.\n` +
32
- `Install the core package first:\n` +
33
- ` pipx install ${PKG}\n` +
34
- ` # or inside a virtualenv:\n` +
35
- ` pip install ${PKG}\n`
36
- );
37
- process.exit(1);
66
+ const pipxBin = findExternalCmd("pipx");
67
+ if (pipxBin) {
68
+ run(pipxBin, ["run", "--spec", PKG, "rhodawk", ...args]);
69
+ }
38
70
  }
71
+
72
+ console.error(
73
+ `[rhodawk] Python CLI not found on PATH.\n` +
74
+ `Install the core package first:\n` +
75
+ ` pipx install ${PKG}\n` +
76
+ ` # or inside a virtualenv:\n` +
77
+ ` pip install ${PKG}\n`
78
+ );
79
+ process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhodawkai/bounty-hunter",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "RhodawkAI Bounty Hunter CLI wrapper — fail-closed, CDN-aware autonomous bug bounty reconnaissance & attack-surface prioritization.",
5
5
  "license": "MIT",
6
6
  "author": "RhodawkAI <manager@rhodawkai.com>",