wolverine-ai 6.4.2 → 6.4.3

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/package.json +4 -4
  2. package/src/claw/setup.js +19 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wolverine-ai",
3
- "version": "6.4.2",
3
+ "version": "6.4.3",
4
4
  "description": "Self-healing Node.js server framework powered by AI. Catches crashes, diagnoses errors, generates fixes, verifies, and restarts — automatically.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -12,9 +12,9 @@
12
12
  "dev": "node bin/wolverine.js server/index.js",
13
13
  "wolverine": "node bin/wolverine.js",
14
14
  "server": "node server/index.js",
15
- "claw": "node bin/wolverine-claw.js",
16
- "claw:direct": "node bin/wolverine-claw.js --direct",
17
- "claw:info": "node bin/wolverine-claw.js --info",
15
+ "claw": "wolverine-claw",
16
+ "claw:direct": "wolverine-claw --direct",
17
+ "claw:info": "wolverine-claw --info",
18
18
  "demo": "node examples/run-demo.js",
19
19
  "demo:list": "node examples/run-demo.js --list",
20
20
  "test:pentest": "node tests/pentest-secrets.js"
package/src/claw/setup.js CHANGED
@@ -596,24 +596,25 @@ function addClawScripts(cwd) {
596
596
  if (typeof cmd !== "string") continue;
597
597
  // Skip scripts we just added
598
598
  if (name.startsWith("claw")) continue;
599
-
600
- // Find scripts that run openclaw (start, dev, gateway, etc.)
601
- const isOpenClawScript = cmd.includes("openclaw") || cmd.includes("open-claw");
602
- // Also patch plain node scripts that start a gateway/agent
603
- const isNodeScript = cmd.startsWith("node ") && !cmd.includes("wolverine");
604
-
605
- if ((isOpenClawScript || isNodeScript) && !cmd.includes("bootstrap.js")) {
606
- // Inject --require before the main script/command
607
- if (cmd.startsWith("node ")) {
608
- // node index.js → node --require ./wolverine-claw/bootstrap.js index.js
609
- pkg.scripts[name] = cmd.replace("node ", `node ${BOOTSTRAP} `);
610
- patched++;
611
- } else if (cmd.startsWith("openclaw ") || cmd.startsWith("npx openclaw")) {
612
- // For CLI commands, use NODE_OPTIONS to inject --require
613
- // npm scripts inherit env vars, so this works cross-platform
614
- pkg.scripts[name] = `NODE_OPTIONS="${BOOTSTRAP}" ${cmd}`;
615
- patched++;
616
- }
599
+ // Already patched
600
+ if (cmd.includes("bootstrap.js")) continue;
601
+
602
+ // Only patch scripts that actually run openclaw
603
+ const isOpenClawCLI = cmd.includes("openclaw") && !cmd.includes("wolverine");
604
+ // Or node scripts that start an openclaw entry point (not wolverine's own scripts)
605
+ const isOpenClawNode = cmd.startsWith("node ") &&
606
+ !cmd.includes("wolverine") &&
607
+ !cmd.includes("bin/") &&
608
+ !cmd.includes("examples/") &&
609
+ !cmd.includes("tests/") &&
610
+ (cmd.includes("gateway") || cmd.includes("openclaw") || cmd.includes("index.js"));
611
+
612
+ if (isOpenClawCLI) {
613
+ pkg.scripts[name] = `NODE_OPTIONS="${BOOTSTRAP}" ${cmd}`;
614
+ patched++;
615
+ } else if (isOpenClawNode) {
616
+ pkg.scripts[name] = cmd.replace("node ", `node ${BOOTSTRAP} `);
617
+ patched++;
617
618
  }
618
619
  }
619
620