fleetbo-cockpit-cli 1.0.133 → 1.0.134
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/cli.js +29 -25
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -639,8 +639,9 @@ if (command === 'alex') {
|
|
|
639
639
|
process.stdout.write('\n\x1b[F');
|
|
640
640
|
rl.prompt();
|
|
641
641
|
|
|
642
|
-
let inputBuffer = "";
|
|
643
|
-
let isProcessing = false;
|
|
642
|
+
let inputBuffer = "";
|
|
643
|
+
let isProcessing = false;
|
|
644
|
+
let hintShown = false;
|
|
644
645
|
|
|
645
646
|
rl.on('line', async (line) => {
|
|
646
647
|
if (isProcessing) return;
|
|
@@ -654,35 +655,38 @@ if (command === 'alex') {
|
|
|
654
655
|
}
|
|
655
656
|
|
|
656
657
|
if (trimmedLine !== "") {
|
|
657
|
-
|
|
658
|
+
// Accumule silencieusement — pas de hint pendant la frappe/paste
|
|
658
659
|
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
659
|
-
// Hint uniquement si c'était la première ligne (buffer vide avant)
|
|
660
|
-
// Pendant un paste, le buffer n'est jamais vide entre les lignes
|
|
661
|
-
if (wasEmpty) {
|
|
662
|
-
rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
|
|
663
|
-
rl.prompt();
|
|
664
|
-
}
|
|
665
660
|
}
|
|
666
661
|
else {
|
|
667
662
|
if (inputBuffer.trim() !== "") {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
663
|
+
if (!hintShown) {
|
|
664
|
+
// 1ère ligne vide → affiche le hint, attend la 2ème
|
|
665
|
+
hintShown = true;
|
|
666
|
+
rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
|
|
667
|
+
rl.prompt();
|
|
668
|
+
} else {
|
|
669
|
+
// 2ème ligne vide → soumet
|
|
670
|
+
hintShown = false;
|
|
671
|
+
const finalPrompt = inputBuffer.trim();
|
|
672
|
+
inputBuffer = "";
|
|
673
|
+
|
|
674
|
+
if (finalPrompt.length > 4000) {
|
|
675
|
+
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/4000 characters).\x1b[0m`);
|
|
676
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
677
|
+
rl.prompt();
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
isProcessing = true;
|
|
682
|
+
rl.setPrompt("");
|
|
683
|
+
await processAlexRequest(finalPrompt);
|
|
684
|
+
isProcessing = false;
|
|
685
|
+
|
|
686
|
+
console.log('');
|
|
673
687
|
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
674
|
-
rl.prompt();
|
|
675
|
-
return;
|
|
688
|
+
rl.prompt();
|
|
676
689
|
}
|
|
677
|
-
|
|
678
|
-
isProcessing = true;
|
|
679
|
-
rl.setPrompt("");
|
|
680
|
-
await processAlexRequest(finalPrompt);
|
|
681
|
-
isProcessing = false;
|
|
682
|
-
|
|
683
|
-
console.log('');
|
|
684
|
-
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
685
|
-
rl.prompt();
|
|
686
690
|
} else {
|
|
687
691
|
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
688
692
|
rl.prompt();
|