@node9/proxy 1.24.0 → 1.24.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/dist/cli.js CHANGED
@@ -6478,16 +6478,22 @@ function printDaemonTip() {
6478
6478
  }
6479
6479
  function fullPathCommand(subcommand) {
6480
6480
  if (process.env.NODE9_TESTING === "1") return `node9 ${subcommand}`;
6481
- const nodeExec = process.execPath;
6482
- const cliScript = process.argv[1];
6483
- if (!cliScript.endsWith(".js")) return `${cliScript} ${subcommand}`;
6484
- return `${nodeExec} ${cliScript} ${subcommand}`;
6481
+ const nodeExec = toForwardSlashes(process.execPath);
6482
+ const cliScript = toForwardSlashes(process.argv[1]);
6483
+ if (!cliScript.endsWith(".js")) return `"${cliScript}" ${subcommand}`;
6484
+ return `"${nodeExec}" "${cliScript}" ${subcommand}`;
6485
+ }
6486
+ function toForwardSlashes(p) {
6487
+ return p.replace(/\\/g, "/");
6485
6488
  }
6486
6489
  function isStaleHookCommand(command) {
6487
6490
  if (!command) return false;
6488
- const tokens = command.split(/\s+/);
6491
+ const tokens = [];
6492
+ const re = /"([^"]*)"|(\S+)/g;
6493
+ let m;
6494
+ while ((m = re.exec(command)) !== null) tokens.push(m[1] ?? m[2] ?? "");
6489
6495
  for (const tok of tokens) {
6490
- if (!tok.startsWith("/")) continue;
6496
+ if (!tok.startsWith("/") && !/^[A-Za-z]:\//.test(tok)) continue;
6491
6497
  if (!import_fs13.default.existsSync(tok)) return true;
6492
6498
  }
6493
6499
  return false;
@@ -6508,7 +6514,7 @@ function writeJson(filePath, data) {
6508
6514
  }
6509
6515
  function isNode9Hook(cmd) {
6510
6516
  if (!cmd) return false;
6511
- return /(?:^|[\s/\\])node9 (?:check|log)/.test(cmd) || /(?:^|[\s/\\])cli\.js (?:check|log)/.test(cmd);
6517
+ return /(?:^|[\s/\\"])node9 (?:check|log)/.test(cmd) || /(?:^|[\s/\\"])cli\.js" (?:check|log)/.test(cmd) || /(?:^|[\s/\\])cli\.js (?:check|log)/.test(cmd);
6512
6518
  }
6513
6519
  function teardownClaude() {
6514
6520
  const homeDir2 = import_os12.default.homedir();
package/dist/cli.mjs CHANGED
@@ -6459,16 +6459,22 @@ function printDaemonTip() {
6459
6459
  }
6460
6460
  function fullPathCommand(subcommand) {
6461
6461
  if (process.env.NODE9_TESTING === "1") return `node9 ${subcommand}`;
6462
- const nodeExec = process.execPath;
6463
- const cliScript = process.argv[1];
6464
- if (!cliScript.endsWith(".js")) return `${cliScript} ${subcommand}`;
6465
- return `${nodeExec} ${cliScript} ${subcommand}`;
6462
+ const nodeExec = toForwardSlashes(process.execPath);
6463
+ const cliScript = toForwardSlashes(process.argv[1]);
6464
+ if (!cliScript.endsWith(".js")) return `"${cliScript}" ${subcommand}`;
6465
+ return `"${nodeExec}" "${cliScript}" ${subcommand}`;
6466
+ }
6467
+ function toForwardSlashes(p) {
6468
+ return p.replace(/\\/g, "/");
6466
6469
  }
6467
6470
  function isStaleHookCommand(command) {
6468
6471
  if (!command) return false;
6469
- const tokens = command.split(/\s+/);
6472
+ const tokens = [];
6473
+ const re = /"([^"]*)"|(\S+)/g;
6474
+ let m;
6475
+ while ((m = re.exec(command)) !== null) tokens.push(m[1] ?? m[2] ?? "");
6470
6476
  for (const tok of tokens) {
6471
- if (!tok.startsWith("/")) continue;
6477
+ if (!tok.startsWith("/") && !/^[A-Za-z]:\//.test(tok)) continue;
6472
6478
  if (!fs13.existsSync(tok)) return true;
6473
6479
  }
6474
6480
  return false;
@@ -6489,7 +6495,7 @@ function writeJson(filePath, data) {
6489
6495
  }
6490
6496
  function isNode9Hook(cmd) {
6491
6497
  if (!cmd) return false;
6492
- return /(?:^|[\s/\\])node9 (?:check|log)/.test(cmd) || /(?:^|[\s/\\])cli\.js (?:check|log)/.test(cmd);
6498
+ return /(?:^|[\s/\\"])node9 (?:check|log)/.test(cmd) || /(?:^|[\s/\\"])cli\.js" (?:check|log)/.test(cmd) || /(?:^|[\s/\\])cli\.js (?:check|log)/.test(cmd);
6493
6499
  }
6494
6500
  function teardownClaude() {
6495
6501
  const homeDir2 = os12.homedir();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/proxy",
3
- "version": "1.24.0",
3
+ "version": "1.24.2",
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",