fleetbo-cockpit-cli 1.0.128 → 1.0.130
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 +11 -14
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -642,7 +642,6 @@ if (command === 'alex') {
|
|
|
642
642
|
let inputBuffer = "";
|
|
643
643
|
let isProcessing = false;
|
|
644
644
|
let submitTimer = null;
|
|
645
|
-
let hintShown = false;
|
|
646
645
|
|
|
647
646
|
const doSubmit = async () => {
|
|
648
647
|
if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
|
|
@@ -650,7 +649,6 @@ if (command === 'alex') {
|
|
|
650
649
|
|
|
651
650
|
const finalPrompt = inputBuffer.trim();
|
|
652
651
|
inputBuffer = "";
|
|
653
|
-
hintShown = false;
|
|
654
652
|
|
|
655
653
|
if (finalPrompt.length > 4000) {
|
|
656
654
|
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/4000 characters).\x1b[0m`);
|
|
@@ -681,22 +679,21 @@ if (command === 'alex') {
|
|
|
681
679
|
}
|
|
682
680
|
|
|
683
681
|
if (trimmedLine !== "") {
|
|
684
|
-
// Ligne non-vide : annule timer
|
|
682
|
+
// Ligne non-vide : annule le timer de soumission si une ligne vide
|
|
683
|
+
// était en attente (cas paste avec ligne vide interne)
|
|
685
684
|
if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
|
|
686
|
-
hintShown = false;
|
|
687
685
|
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
686
|
+
// Affiche le hint immédiatement — comportement original préservé
|
|
687
|
+
rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
|
|
688
|
+
rl.prompt();
|
|
688
689
|
} else {
|
|
689
690
|
if (inputBuffer.trim() !== "") {
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
// même si Xterm affiche "running" par-dessus
|
|
697
|
-
hintShown = true;
|
|
698
|
-
process.stdout.write("\x1b[90m ↵ to confirm & send\x1b[0m\n");
|
|
699
|
-
}
|
|
691
|
+
// Ligne vide reçue : attend 400ms avant de soumettre
|
|
692
|
+
// Si une ligne non-vide arrive dans ce délai (paste en cours)
|
|
693
|
+
// → le timer est annulé dans le bloc trimmedLine !== "" ci-dessus
|
|
694
|
+
// Si rien n'arrive → vraie Entrée manuelle → soumet
|
|
695
|
+
if (submitTimer) clearTimeout(submitTimer);
|
|
696
|
+
submitTimer = setTimeout(() => doSubmit(), 400);
|
|
700
697
|
} else {
|
|
701
698
|
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
702
699
|
rl.prompt();
|