fleetbo-cockpit-cli 1.0.123 → 1.0.124
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 +19 -12
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -642,6 +642,7 @@ if (command === 'alex') {
|
|
|
642
642
|
let inputBuffer = "";
|
|
643
643
|
let isProcessing = false;
|
|
644
644
|
let submitTimer = null;
|
|
645
|
+
let hintShown = false;
|
|
645
646
|
|
|
646
647
|
const doSubmit = async () => {
|
|
647
648
|
if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
|
|
@@ -649,6 +650,7 @@ if (command === 'alex') {
|
|
|
649
650
|
|
|
650
651
|
const finalPrompt = inputBuffer.trim();
|
|
651
652
|
inputBuffer = "";
|
|
653
|
+
hintShown = false;
|
|
652
654
|
|
|
653
655
|
if (finalPrompt.length > 4000) {
|
|
654
656
|
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/4000 characters).\x1b[0m`);
|
|
@@ -679,22 +681,27 @@ if (command === 'alex') {
|
|
|
679
681
|
}
|
|
680
682
|
|
|
681
683
|
if (trimmedLine !== "") {
|
|
682
|
-
//
|
|
683
|
-
// (cas d'un paste avec lignes vides internes)
|
|
684
|
+
// Ligne non-vide : annule timer, réinitialise hintShown, accumule
|
|
684
685
|
if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
|
|
686
|
+
hintShown = false;
|
|
685
687
|
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
686
|
-
// Pas de hint ici — le hint s'affiche uniquement sur ligne vide explicite
|
|
687
688
|
} else {
|
|
688
689
|
if (inputBuffer.trim() !== "") {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
690
|
+
if (hintShown) {
|
|
691
|
+
// Hint déjà visible → 2ème Entrée → soumet
|
|
692
|
+
doSubmit();
|
|
693
|
+
} else {
|
|
694
|
+
// 1ère ligne vide : attend 400ms pour distinguer paste / frappe manuelle
|
|
695
|
+
// Si une ligne non-vide arrive avant → timer annulé (paste en cours)
|
|
696
|
+
// Si rien → frappe manuelle confirmée → affiche le hint
|
|
697
|
+
if (submitTimer) clearTimeout(submitTimer);
|
|
698
|
+
submitTimer = setTimeout(() => {
|
|
699
|
+
submitTimer = null;
|
|
700
|
+
hintShown = true;
|
|
701
|
+
rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
|
|
702
|
+
rl.prompt();
|
|
703
|
+
}, 400);
|
|
704
|
+
}
|
|
698
705
|
} else {
|
|
699
706
|
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
700
707
|
rl.prompt();
|