@node9/proxy 1.12.3 → 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.
- package/dist/cli.js +43 -27
- package/dist/cli.mjs +43 -27
- 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 (
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
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
|
}
|
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 (
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
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
|
}
|