@node9/proxy 1.12.3 → 1.12.5
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 +45 -27
- package/dist/cli.mjs +45 -27
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9426,24 +9426,30 @@ 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
|
+
const useTTY = process.stdout.isTTY === true;
|
|
9430
|
+
if (!useTTY) {
|
|
9431
|
+
process.stdout.write(
|
|
9432
|
+
" " + import_chalk2.default.dim("Scanning your history \u2014 this may take a moment...\n")
|
|
9433
|
+
);
|
|
9434
|
+
}
|
|
9429
9435
|
const totalFiles = countScanFiles();
|
|
9430
9436
|
let filesScanned = 0;
|
|
9431
9437
|
let linesScanned = 0;
|
|
9432
9438
|
let lastRender = 0;
|
|
9433
9439
|
const onProgress = (done) => {
|
|
9434
9440
|
filesScanned = done;
|
|
9435
|
-
renderProgressBar(filesScanned, totalFiles, linesScanned);
|
|
9441
|
+
if (useTTY) renderProgressBar(filesScanned, totalFiles, linesScanned);
|
|
9436
9442
|
lastRender = Date.now();
|
|
9437
9443
|
};
|
|
9438
9444
|
const onLine = () => {
|
|
9439
9445
|
linesScanned++;
|
|
9440
9446
|
const now = Date.now();
|
|
9441
|
-
if (now - lastRender >= 80) {
|
|
9447
|
+
if (useTTY && now - lastRender >= 80) {
|
|
9442
9448
|
lastRender = now;
|
|
9443
9449
|
renderProgressBar(filesScanned, totalFiles, linesScanned);
|
|
9444
9450
|
}
|
|
9445
9451
|
};
|
|
9446
|
-
renderProgressBar(0, totalFiles, 0);
|
|
9452
|
+
if (useTTY) renderProgressBar(0, totalFiles, 0);
|
|
9447
9453
|
const claudeScan = scanClaudeHistory(startDate, onProgress, onLine);
|
|
9448
9454
|
const geminiScan = scanGeminiHistory(
|
|
9449
9455
|
startDate,
|
|
@@ -9461,7 +9467,7 @@ function registerScanCommand(program2) {
|
|
|
9461
9467
|
{ id: "gemini", label: "Gemini", icon: "\u264A", scan: geminiScan },
|
|
9462
9468
|
{ id: "codex", label: "Codex", icon: "\u{1F52E}", scan: codexScan }
|
|
9463
9469
|
]);
|
|
9464
|
-
process.stdout.write("\r" + " ".repeat(60) + "\r");
|
|
9470
|
+
if (useTTY) process.stdout.write("\r" + " ".repeat(60) + "\r");
|
|
9465
9471
|
if (scan.filesScanned === 0) {
|
|
9466
9472
|
console.log(import_chalk2.default.yellow(" No session history found."));
|
|
9467
9473
|
console.log(
|
|
@@ -9649,33 +9655,45 @@ function registerScanCommand(program2) {
|
|
|
9649
9655
|
console.log(" " + import_chalk2.default.dim("\u2192 ") + import_chalk2.default.underline("https://node9.ai"));
|
|
9650
9656
|
}
|
|
9651
9657
|
console.log("");
|
|
9652
|
-
const url = `http://${DAEMON_HOST}:${DAEMON_PORT}/`;
|
|
9653
9658
|
if (!isTestingMode()) {
|
|
9654
|
-
if (
|
|
9655
|
-
const
|
|
9656
|
-
if (
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9659
|
+
if (isInstalled) {
|
|
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(
|
|
9687
|
+
" " + import_chalk2.default.dim(" run ") + import_chalk2.default.cyan("node9 daemon --background") + import_chalk2.default.dim(" to open the dashboard")
|
|
9688
|
+
);
|
|
9689
|
+
}
|
|
9690
|
+
console.log("");
|
|
9691
|
+
} else {
|
|
9692
|
+
console.log(
|
|
9693
|
+
" " + import_chalk2.default.dim("\u{1F4CA} For a full browser report, install node9:") + " " + import_chalk2.default.cyan("npm install -g node9-ai")
|
|
9694
|
+
);
|
|
9695
|
+
console.log("");
|
|
9673
9696
|
}
|
|
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
9697
|
}
|
|
9680
9698
|
});
|
|
9681
9699
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -9406,24 +9406,30 @@ 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
|
+
const useTTY = process.stdout.isTTY === true;
|
|
9410
|
+
if (!useTTY) {
|
|
9411
|
+
process.stdout.write(
|
|
9412
|
+
" " + chalk2.dim("Scanning your history \u2014 this may take a moment...\n")
|
|
9413
|
+
);
|
|
9414
|
+
}
|
|
9409
9415
|
const totalFiles = countScanFiles();
|
|
9410
9416
|
let filesScanned = 0;
|
|
9411
9417
|
let linesScanned = 0;
|
|
9412
9418
|
let lastRender = 0;
|
|
9413
9419
|
const onProgress = (done) => {
|
|
9414
9420
|
filesScanned = done;
|
|
9415
|
-
renderProgressBar(filesScanned, totalFiles, linesScanned);
|
|
9421
|
+
if (useTTY) renderProgressBar(filesScanned, totalFiles, linesScanned);
|
|
9416
9422
|
lastRender = Date.now();
|
|
9417
9423
|
};
|
|
9418
9424
|
const onLine = () => {
|
|
9419
9425
|
linesScanned++;
|
|
9420
9426
|
const now = Date.now();
|
|
9421
|
-
if (now - lastRender >= 80) {
|
|
9427
|
+
if (useTTY && now - lastRender >= 80) {
|
|
9422
9428
|
lastRender = now;
|
|
9423
9429
|
renderProgressBar(filesScanned, totalFiles, linesScanned);
|
|
9424
9430
|
}
|
|
9425
9431
|
};
|
|
9426
|
-
renderProgressBar(0, totalFiles, 0);
|
|
9432
|
+
if (useTTY) renderProgressBar(0, totalFiles, 0);
|
|
9427
9433
|
const claudeScan = scanClaudeHistory(startDate, onProgress, onLine);
|
|
9428
9434
|
const geminiScan = scanGeminiHistory(
|
|
9429
9435
|
startDate,
|
|
@@ -9441,7 +9447,7 @@ function registerScanCommand(program2) {
|
|
|
9441
9447
|
{ id: "gemini", label: "Gemini", icon: "\u264A", scan: geminiScan },
|
|
9442
9448
|
{ id: "codex", label: "Codex", icon: "\u{1F52E}", scan: codexScan }
|
|
9443
9449
|
]);
|
|
9444
|
-
process.stdout.write("\r" + " ".repeat(60) + "\r");
|
|
9450
|
+
if (useTTY) process.stdout.write("\r" + " ".repeat(60) + "\r");
|
|
9445
9451
|
if (scan.filesScanned === 0) {
|
|
9446
9452
|
console.log(chalk2.yellow(" No session history found."));
|
|
9447
9453
|
console.log(
|
|
@@ -9629,33 +9635,45 @@ function registerScanCommand(program2) {
|
|
|
9629
9635
|
console.log(" " + chalk2.dim("\u2192 ") + chalk2.underline("https://node9.ai"));
|
|
9630
9636
|
}
|
|
9631
9637
|
console.log("");
|
|
9632
|
-
const url = `http://${DAEMON_HOST}:${DAEMON_PORT}/`;
|
|
9633
9638
|
if (!isTestingMode()) {
|
|
9634
|
-
if (
|
|
9635
|
-
const
|
|
9636
|
-
if (
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9639
|
+
if (isInstalled) {
|
|
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(
|
|
9667
|
+
" " + chalk2.dim(" run ") + chalk2.cyan("node9 daemon --background") + chalk2.dim(" to open the dashboard")
|
|
9668
|
+
);
|
|
9669
|
+
}
|
|
9670
|
+
console.log("");
|
|
9671
|
+
} else {
|
|
9672
|
+
console.log(
|
|
9673
|
+
" " + chalk2.dim("\u{1F4CA} For a full browser report, install node9:") + " " + chalk2.cyan("npm install -g node9-ai")
|
|
9674
|
+
);
|
|
9675
|
+
console.log("");
|
|
9653
9676
|
}
|
|
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
9677
|
}
|
|
9660
9678
|
});
|
|
9661
9679
|
}
|