juggernaut-bedrock 4.2.2 → 4.2.4

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.
Files changed (2) hide show
  1. package/index.js +9 -3
  2. package/package.json +6 -6
package/index.js CHANGED
@@ -5,8 +5,6 @@ var path = require("path");
5
5
  var child_process = require("child_process");
6
6
  var fs = require("fs");
7
7
 
8
- var PACKAGES_DIR = path.join(__dirname, "packages");
9
-
10
8
  var PLATFORM_MAP = {
11
9
  "linux-x64": "juggernaut-bedrock-linux-x64",
12
10
  "linux-arm64": "juggernaut-bedrock-linux-arm64",
@@ -46,12 +44,20 @@ function containsPackage(pkgName) {
46
44
  * @param {string} platform
47
45
  * @returns {string}
48
46
  */
47
+ function resolvePkgDir(pkgName) {
48
+ try {
49
+ return path.dirname(require.resolve(pkgName + "/package.json"));
50
+ } catch (_) {
51
+ return path.join(__dirname, "packages", pkgName); // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal
52
+ }
53
+ }
54
+
49
55
  function getBinaryPath(pkgName, platform) {
50
56
  if (!containsPackage(pkgName)) {
51
57
  throw new Error("unexpected package name: " + pkgName);
52
58
  }
53
59
  var binaryName = platform === "win32" ? "juggernaut.exe" : "juggernaut";
54
- return path.join(PACKAGES_DIR, pkgName, "bin", binaryName); // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal
60
+ return path.join(resolvePkgDir(pkgName), "bin", binaryName); // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal
55
61
  }
56
62
 
57
63
  if (require.main === module) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juggernaut-bedrock",
3
- "version": "4.2.2",
3
+ "version": "4.2.4",
4
4
  "description": "Route Claude Code through Amazon Bedrock in one command — IAM, SSO, or API key. Cross-platform CLI for GenAI developers.",
5
5
  "bin": {
6
6
  "juggernaut": "./index.js"
@@ -9,11 +9,11 @@
9
9
  "test": "node --test index.test.js"
10
10
  },
11
11
  "optionalDependencies": {
12
- "juggernaut-bedrock-linux-x64": "4.2.2",
13
- "juggernaut-bedrock-linux-arm64": "4.2.2",
14
- "juggernaut-bedrock-darwin-x64": "4.2.2",
15
- "juggernaut-bedrock-darwin-arm64": "4.2.2",
16
- "juggernaut-bedrock-win32-x64": "4.2.2"
12
+ "juggernaut-bedrock-linux-x64": "4.2.4",
13
+ "juggernaut-bedrock-linux-arm64": "4.2.4",
14
+ "juggernaut-bedrock-darwin-x64": "4.2.4",
15
+ "juggernaut-bedrock-darwin-arm64": "4.2.4",
16
+ "juggernaut-bedrock-win32-x64": "4.2.4"
17
17
  },
18
18
  "os": [
19
19
  "darwin",