@node9/proxy 1.24.2 → 1.24.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.
package/dist/cli.js CHANGED
@@ -6498,6 +6498,13 @@ function isStaleHookCommand(command) {
6498
6498
  }
6499
6499
  return false;
6500
6500
  }
6501
+ function isLegacyHookFormat(command) {
6502
+ if (!command) return false;
6503
+ return command.includes("\\");
6504
+ }
6505
+ function needsRewrite(command) {
6506
+ return isStaleHookCommand(command) || isLegacyHookFormat(command);
6507
+ }
6501
6508
  function readJson(filePath) {
6502
6509
  try {
6503
6510
  if (import_fs13.default.existsSync(filePath)) {
@@ -6670,7 +6677,7 @@ async function setupClaude() {
6670
6677
  for (const h of matcher.hooks) {
6671
6678
  const cmd = h.command ?? "";
6672
6679
  const isNode9 = cmd.includes("node9 check") || cmd.includes("cli.js check");
6673
- if (isNode9 && isStaleHookCommand(cmd)) {
6680
+ if (isNode9 && needsRewrite(cmd)) {
6674
6681
  h.command = fullPathCommand("check");
6675
6682
  console.log(import_chalk.default.yellow(" \u{1F527} PreToolUse hook repaired (stale path \u2192 current binary)"));
6676
6683
  hooksChanged = true;
@@ -6696,7 +6703,7 @@ async function setupClaude() {
6696
6703
  for (const h of matcher.hooks) {
6697
6704
  const cmd = h.command ?? "";
6698
6705
  const isNode9 = cmd.includes("node9 log") || cmd.includes("cli.js log");
6699
- if (isNode9 && isStaleHookCommand(cmd)) {
6706
+ if (isNode9 && needsRewrite(cmd)) {
6700
6707
  h.command = fullPathCommand("log");
6701
6708
  console.log(import_chalk.default.yellow(" \u{1F527} PostToolUse hook repaired (stale path \u2192 current binary)"));
6702
6709
  hooksChanged = true;
@@ -6721,7 +6728,7 @@ async function setupClaude() {
6721
6728
  for (const matcher of settings.hooks.UserPromptSubmit) {
6722
6729
  for (const h of matcher.hooks) {
6723
6730
  const cmd = h.command ?? "";
6724
- if (isNode9Hook(cmd) && isStaleHookCommand(cmd)) {
6731
+ if (isNode9Hook(cmd) && needsRewrite(cmd)) {
6725
6732
  h.command = fullPathCommand("check");
6726
6733
  console.log(
6727
6734
  import_chalk.default.yellow(" \u{1F527} UserPromptSubmit hook repaired (stale path \u2192 current binary)")
@@ -7040,7 +7047,7 @@ async function setupCodex() {
7040
7047
  } else {
7041
7048
  for (const h of existing.hooks) {
7042
7049
  const cmd = h.command ?? "";
7043
- if (isNode9Hook(cmd) && isStaleHookCommand(cmd)) {
7050
+ if (isNode9Hook(cmd) && needsRewrite(cmd)) {
7044
7051
  h.command = fullPathCommand("check");
7045
7052
  hooksChanged = true;
7046
7053
  }
@@ -7060,7 +7067,7 @@ async function setupCodex() {
7060
7067
  for (const m of hooksFile.hooks.UserPromptSubmit) {
7061
7068
  for (const h of m.hooks) {
7062
7069
  const cmd = h.command ?? "";
7063
- if (isNode9Hook(cmd) && isStaleHookCommand(cmd)) {
7070
+ if (isNode9Hook(cmd) && needsRewrite(cmd)) {
7064
7071
  h.command = fullPathCommand("check");
7065
7072
  hooksChanged = true;
7066
7073
  }
@@ -7081,7 +7088,7 @@ async function setupCodex() {
7081
7088
  for (const m of hooksFile.hooks.PostToolUse) {
7082
7089
  for (const h of m.hooks) {
7083
7090
  const cmd = h.command ?? "";
7084
- if (isNode9Hook(cmd) && isStaleHookCommand(cmd)) {
7091
+ if (isNode9Hook(cmd) && needsRewrite(cmd)) {
7085
7092
  h.command = fullPathCommand("log");
7086
7093
  hooksChanged = true;
7087
7094
  }
package/dist/cli.mjs CHANGED
@@ -6479,6 +6479,13 @@ function isStaleHookCommand(command) {
6479
6479
  }
6480
6480
  return false;
6481
6481
  }
6482
+ function isLegacyHookFormat(command) {
6483
+ if (!command) return false;
6484
+ return command.includes("\\");
6485
+ }
6486
+ function needsRewrite(command) {
6487
+ return isStaleHookCommand(command) || isLegacyHookFormat(command);
6488
+ }
6482
6489
  function readJson(filePath) {
6483
6490
  try {
6484
6491
  if (fs13.existsSync(filePath)) {
@@ -6651,7 +6658,7 @@ async function setupClaude() {
6651
6658
  for (const h of matcher.hooks) {
6652
6659
  const cmd = h.command ?? "";
6653
6660
  const isNode9 = cmd.includes("node9 check") || cmd.includes("cli.js check");
6654
- if (isNode9 && isStaleHookCommand(cmd)) {
6661
+ if (isNode9 && needsRewrite(cmd)) {
6655
6662
  h.command = fullPathCommand("check");
6656
6663
  console.log(chalk.yellow(" \u{1F527} PreToolUse hook repaired (stale path \u2192 current binary)"));
6657
6664
  hooksChanged = true;
@@ -6677,7 +6684,7 @@ async function setupClaude() {
6677
6684
  for (const h of matcher.hooks) {
6678
6685
  const cmd = h.command ?? "";
6679
6686
  const isNode9 = cmd.includes("node9 log") || cmd.includes("cli.js log");
6680
- if (isNode9 && isStaleHookCommand(cmd)) {
6687
+ if (isNode9 && needsRewrite(cmd)) {
6681
6688
  h.command = fullPathCommand("log");
6682
6689
  console.log(chalk.yellow(" \u{1F527} PostToolUse hook repaired (stale path \u2192 current binary)"));
6683
6690
  hooksChanged = true;
@@ -6702,7 +6709,7 @@ async function setupClaude() {
6702
6709
  for (const matcher of settings.hooks.UserPromptSubmit) {
6703
6710
  for (const h of matcher.hooks) {
6704
6711
  const cmd = h.command ?? "";
6705
- if (isNode9Hook(cmd) && isStaleHookCommand(cmd)) {
6712
+ if (isNode9Hook(cmd) && needsRewrite(cmd)) {
6706
6713
  h.command = fullPathCommand("check");
6707
6714
  console.log(
6708
6715
  chalk.yellow(" \u{1F527} UserPromptSubmit hook repaired (stale path \u2192 current binary)")
@@ -7021,7 +7028,7 @@ async function setupCodex() {
7021
7028
  } else {
7022
7029
  for (const h of existing.hooks) {
7023
7030
  const cmd = h.command ?? "";
7024
- if (isNode9Hook(cmd) && isStaleHookCommand(cmd)) {
7031
+ if (isNode9Hook(cmd) && needsRewrite(cmd)) {
7025
7032
  h.command = fullPathCommand("check");
7026
7033
  hooksChanged = true;
7027
7034
  }
@@ -7041,7 +7048,7 @@ async function setupCodex() {
7041
7048
  for (const m of hooksFile.hooks.UserPromptSubmit) {
7042
7049
  for (const h of m.hooks) {
7043
7050
  const cmd = h.command ?? "";
7044
- if (isNode9Hook(cmd) && isStaleHookCommand(cmd)) {
7051
+ if (isNode9Hook(cmd) && needsRewrite(cmd)) {
7045
7052
  h.command = fullPathCommand("check");
7046
7053
  hooksChanged = true;
7047
7054
  }
@@ -7062,7 +7069,7 @@ async function setupCodex() {
7062
7069
  for (const m of hooksFile.hooks.PostToolUse) {
7063
7070
  for (const h of m.hooks) {
7064
7071
  const cmd = h.command ?? "";
7065
- if (isNode9Hook(cmd) && isStaleHookCommand(cmd)) {
7072
+ if (isNode9Hook(cmd) && needsRewrite(cmd)) {
7066
7073
  h.command = fullPathCommand("log");
7067
7074
  hooksChanged = true;
7068
7075
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/proxy",
3
- "version": "1.24.2",
3
+ "version": "1.24.3",
4
4
  "description": "The Sudo Command for AI Agents. Execution Security for Claude Code & MCP.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",