@node9/proxy 1.12.2 → 1.12.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 (3) hide show
  1. package/dist/cli.js +46 -28
  2. package/dist/cli.mjs +46 -28
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -9426,24 +9426,27 @@ function registerScanCommand(program2) {
9426
9426
  import_chalk2.default.cyan.bold("\u{1F50D} Scanning your AI history") + import_chalk2.default.dim(" \u2014 what would node9 have caught?")
9427
9427
  );
9428
9428
  console.log("");
9429
+ if (!isInstalled) {
9430
+ process.stdout.write(" " + import_chalk2.default.dim("Scanning... this may take a moment\n"));
9431
+ }
9429
9432
  const totalFiles = countScanFiles();
9430
9433
  let filesScanned = 0;
9431
9434
  let linesScanned = 0;
9432
9435
  let lastRender = 0;
9433
9436
  const onProgress = (done) => {
9434
9437
  filesScanned = done;
9435
- renderProgressBar(filesScanned, totalFiles, linesScanned);
9438
+ if (isInstalled) renderProgressBar(filesScanned, totalFiles, linesScanned);
9436
9439
  lastRender = Date.now();
9437
9440
  };
9438
9441
  const onLine = () => {
9439
9442
  linesScanned++;
9440
9443
  const now = Date.now();
9441
- if (now - lastRender >= 80) {
9444
+ if (isInstalled && now - lastRender >= 80) {
9442
9445
  lastRender = now;
9443
9446
  renderProgressBar(filesScanned, totalFiles, linesScanned);
9444
9447
  }
9445
9448
  };
9446
- renderProgressBar(0, totalFiles, 0);
9449
+ if (isInstalled) renderProgressBar(0, totalFiles, 0);
9447
9450
  const claudeScan = scanClaudeHistory(startDate, onProgress, onLine);
9448
9451
  const geminiScan = scanGeminiHistory(
9449
9452
  startDate,
@@ -9461,7 +9464,7 @@ function registerScanCommand(program2) {
9461
9464
  { id: "gemini", label: "Gemini", icon: "\u264A", scan: geminiScan },
9462
9465
  { id: "codex", label: "Codex", icon: "\u{1F52E}", scan: codexScan }
9463
9466
  ]);
9464
- process.stdout.write("\r" + " ".repeat(60) + "\r");
9467
+ if (isInstalled) process.stdout.write("\r" + " ".repeat(60) + "\r");
9465
9468
  if (scan.filesScanned === 0) {
9466
9469
  console.log(import_chalk2.default.yellow(" No session history found."));
9467
9470
  console.log(
@@ -9649,33 +9652,46 @@ function registerScanCommand(program2) {
9649
9652
  console.log(" " + import_chalk2.default.dim("\u2192 ") + import_chalk2.default.underline("https://node9.ai"));
9650
9653
  }
9651
9654
  console.log("");
9652
- const url = `http://${DAEMON_HOST}:${DAEMON_PORT}/`;
9653
9655
  if (!isTestingMode()) {
9654
- if (isDaemonRunning()) {
9655
- const internalToken = getInternalToken();
9656
- if (internalToken) {
9657
- try {
9658
- const summary2 = buildScanSummary([
9659
- { id: "claude", label: "Claude", icon: "\u{1F916}", scan: claudeScan },
9660
- { id: "gemini", label: "Gemini", icon: "\u264A", scan: geminiScan },
9661
- { id: "codex", label: "Codex", icon: "\u{1F52E}", scan: codexScan }
9662
- ]);
9663
- await fetch(`http://${DAEMON_HOST}:${DAEMON_PORT}/scan/push`, {
9664
- method: "POST",
9665
- headers: { "Content-Type": "application/json", "x-node9-internal": internalToken },
9666
- body: JSON.stringify({ status: "complete", summary: summary2 }),
9667
- signal: AbortSignal.timeout(3e3)
9668
- });
9669
- openBrowserLocal();
9670
- } catch {
9656
+ if (isInstalled) {
9657
+ if (!isDaemonRunning()) {
9658
+ await autoStartDaemonAndWait(false);
9659
+ }
9660
+ const url = `http://${DAEMON_HOST}:${DAEMON_PORT}/`;
9661
+ if (isDaemonRunning()) {
9662
+ const internalToken = getInternalToken();
9663
+ if (internalToken) {
9664
+ try {
9665
+ const pushSummary = buildScanSummary([
9666
+ { id: "claude", label: "Claude", icon: "\u{1F916}", scan: claudeScan },
9667
+ { id: "gemini", label: "Gemini", icon: "\u264A", scan: geminiScan },
9668
+ { id: "codex", label: "Codex", icon: "\u{1F52E}", scan: codexScan }
9669
+ ]);
9670
+ await fetch(`http://${DAEMON_HOST}:${DAEMON_PORT}/scan/push`, {
9671
+ method: "POST",
9672
+ headers: {
9673
+ "Content-Type": "application/json",
9674
+ "x-node9-internal": internalToken
9675
+ },
9676
+ body: JSON.stringify({ status: "complete", summary: pushSummary }),
9677
+ signal: AbortSignal.timeout(3e3)
9678
+ });
9679
+ openBrowserLocal();
9680
+ } catch {
9681
+ }
9671
9682
  }
9672
9683
  }
9684
+ console.log(" " + import_chalk2.default.cyan("\u{1F310} View in browser:") + " " + import_chalk2.default.underline(url));
9685
+ if (!isDaemonRunning()) {
9686
+ console.log(" " + import_chalk2.default.dim(" run node9 daemon --background to activate"));
9687
+ }
9688
+ console.log("");
9689
+ } else {
9690
+ console.log(
9691
+ " " + import_chalk2.default.dim("\u{1F4CA} For a full browser report:") + " " + import_chalk2.default.cyan("npm install -g node9-ai")
9692
+ );
9693
+ console.log("");
9673
9694
  }
9674
- console.log(" " + import_chalk2.default.cyan("\u{1F310} View in browser:") + " " + import_chalk2.default.underline(url));
9675
- if (!isDaemonRunning()) {
9676
- console.log(" " + import_chalk2.default.dim(" run node9 daemon --background to activate"));
9677
- }
9678
- console.log("");
9679
9695
  }
9680
9696
  });
9681
9697
  }
@@ -20787,4 +20803,6 @@ var firstArg = process.argv[2];
20787
20803
  if (firstArg && firstArg !== "--" && !firstArg.startsWith("-") && !knownSubcommands.has(firstArg)) {
20788
20804
  process.argv.splice(2, 0, "--");
20789
20805
  }
20790
- program.parse();
20806
+ (async () => {
20807
+ await program.parseAsync();
20808
+ })();
package/dist/cli.mjs CHANGED
@@ -9406,24 +9406,27 @@ function registerScanCommand(program2) {
9406
9406
  chalk2.cyan.bold("\u{1F50D} Scanning your AI history") + chalk2.dim(" \u2014 what would node9 have caught?")
9407
9407
  );
9408
9408
  console.log("");
9409
+ if (!isInstalled) {
9410
+ process.stdout.write(" " + chalk2.dim("Scanning... this may take a moment\n"));
9411
+ }
9409
9412
  const totalFiles = countScanFiles();
9410
9413
  let filesScanned = 0;
9411
9414
  let linesScanned = 0;
9412
9415
  let lastRender = 0;
9413
9416
  const onProgress = (done) => {
9414
9417
  filesScanned = done;
9415
- renderProgressBar(filesScanned, totalFiles, linesScanned);
9418
+ if (isInstalled) renderProgressBar(filesScanned, totalFiles, linesScanned);
9416
9419
  lastRender = Date.now();
9417
9420
  };
9418
9421
  const onLine = () => {
9419
9422
  linesScanned++;
9420
9423
  const now = Date.now();
9421
- if (now - lastRender >= 80) {
9424
+ if (isInstalled && now - lastRender >= 80) {
9422
9425
  lastRender = now;
9423
9426
  renderProgressBar(filesScanned, totalFiles, linesScanned);
9424
9427
  }
9425
9428
  };
9426
- renderProgressBar(0, totalFiles, 0);
9429
+ if (isInstalled) renderProgressBar(0, totalFiles, 0);
9427
9430
  const claudeScan = scanClaudeHistory(startDate, onProgress, onLine);
9428
9431
  const geminiScan = scanGeminiHistory(
9429
9432
  startDate,
@@ -9441,7 +9444,7 @@ function registerScanCommand(program2) {
9441
9444
  { id: "gemini", label: "Gemini", icon: "\u264A", scan: geminiScan },
9442
9445
  { id: "codex", label: "Codex", icon: "\u{1F52E}", scan: codexScan }
9443
9446
  ]);
9444
- process.stdout.write("\r" + " ".repeat(60) + "\r");
9447
+ if (isInstalled) process.stdout.write("\r" + " ".repeat(60) + "\r");
9445
9448
  if (scan.filesScanned === 0) {
9446
9449
  console.log(chalk2.yellow(" No session history found."));
9447
9450
  console.log(
@@ -9629,33 +9632,46 @@ function registerScanCommand(program2) {
9629
9632
  console.log(" " + chalk2.dim("\u2192 ") + chalk2.underline("https://node9.ai"));
9630
9633
  }
9631
9634
  console.log("");
9632
- const url = `http://${DAEMON_HOST}:${DAEMON_PORT}/`;
9633
9635
  if (!isTestingMode()) {
9634
- if (isDaemonRunning()) {
9635
- const internalToken = getInternalToken();
9636
- if (internalToken) {
9637
- try {
9638
- const summary2 = buildScanSummary([
9639
- { id: "claude", label: "Claude", icon: "\u{1F916}", scan: claudeScan },
9640
- { id: "gemini", label: "Gemini", icon: "\u264A", scan: geminiScan },
9641
- { id: "codex", label: "Codex", icon: "\u{1F52E}", scan: codexScan }
9642
- ]);
9643
- await fetch(`http://${DAEMON_HOST}:${DAEMON_PORT}/scan/push`, {
9644
- method: "POST",
9645
- headers: { "Content-Type": "application/json", "x-node9-internal": internalToken },
9646
- body: JSON.stringify({ status: "complete", summary: summary2 }),
9647
- signal: AbortSignal.timeout(3e3)
9648
- });
9649
- openBrowserLocal();
9650
- } catch {
9636
+ if (isInstalled) {
9637
+ if (!isDaemonRunning()) {
9638
+ await autoStartDaemonAndWait(false);
9639
+ }
9640
+ const url = `http://${DAEMON_HOST}:${DAEMON_PORT}/`;
9641
+ if (isDaemonRunning()) {
9642
+ const internalToken = getInternalToken();
9643
+ if (internalToken) {
9644
+ try {
9645
+ const pushSummary = buildScanSummary([
9646
+ { id: "claude", label: "Claude", icon: "\u{1F916}", scan: claudeScan },
9647
+ { id: "gemini", label: "Gemini", icon: "\u264A", scan: geminiScan },
9648
+ { id: "codex", label: "Codex", icon: "\u{1F52E}", scan: codexScan }
9649
+ ]);
9650
+ await fetch(`http://${DAEMON_HOST}:${DAEMON_PORT}/scan/push`, {
9651
+ method: "POST",
9652
+ headers: {
9653
+ "Content-Type": "application/json",
9654
+ "x-node9-internal": internalToken
9655
+ },
9656
+ body: JSON.stringify({ status: "complete", summary: pushSummary }),
9657
+ signal: AbortSignal.timeout(3e3)
9658
+ });
9659
+ openBrowserLocal();
9660
+ } catch {
9661
+ }
9651
9662
  }
9652
9663
  }
9664
+ console.log(" " + chalk2.cyan("\u{1F310} View in browser:") + " " + chalk2.underline(url));
9665
+ if (!isDaemonRunning()) {
9666
+ console.log(" " + chalk2.dim(" run node9 daemon --background to activate"));
9667
+ }
9668
+ console.log("");
9669
+ } else {
9670
+ console.log(
9671
+ " " + chalk2.dim("\u{1F4CA} For a full browser report:") + " " + chalk2.cyan("npm install -g node9-ai")
9672
+ );
9673
+ console.log("");
9653
9674
  }
9654
- console.log(" " + chalk2.cyan("\u{1F310} View in browser:") + " " + chalk2.underline(url));
9655
- if (!isDaemonRunning()) {
9656
- console.log(" " + chalk2.dim(" run node9 daemon --background to activate"));
9657
- }
9658
- console.log("");
9659
9675
  }
9660
9676
  });
9661
9677
  }
@@ -20761,4 +20777,6 @@ var firstArg = process.argv[2];
20761
20777
  if (firstArg && firstArg !== "--" && !firstArg.startsWith("-") && !knownSubcommands.has(firstArg)) {
20762
20778
  process.argv.splice(2, 0, "--");
20763
20779
  }
20764
- program.parse();
20780
+ (async () => {
20781
+ await program.parseAsync();
20782
+ })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/proxy",
3
- "version": "1.12.2",
3
+ "version": "1.12.4",
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",