fleetbo-cockpit-cli 1.0.41 → 1.0.43
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 +8 -19
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -459,13 +459,12 @@ if (command === 'alex') {
|
|
|
459
459
|
process.stdout.write('\n\x1b[F');
|
|
460
460
|
rl.prompt();
|
|
461
461
|
|
|
462
|
-
// --- MULTI-LINE BUFFER (
|
|
462
|
+
// --- NATURAL MULTI-LINE BUFFER (ZERO GLITCH) ---
|
|
463
463
|
let inputBuffer = "";
|
|
464
464
|
let isProcessing = false;
|
|
465
|
-
let promptTimeout = null; // 🛡️ Le sauveur de l'affichage
|
|
466
465
|
|
|
467
466
|
rl.on('line', async (line) => {
|
|
468
|
-
if (isProcessing) return;
|
|
467
|
+
if (isProcessing) return; // Verrou pendant la forge
|
|
469
468
|
|
|
470
469
|
const trimmedLine = line.trim();
|
|
471
470
|
|
|
@@ -476,17 +475,11 @@ if (command === 'alex') {
|
|
|
476
475
|
return;
|
|
477
476
|
}
|
|
478
477
|
|
|
479
|
-
// 2. ACCUMULATION
|
|
478
|
+
// 2. ACCUMULATION NATURELLE ET SILENCIEUSE
|
|
480
479
|
if (trimmedLine !== "") {
|
|
481
480
|
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
// 🛡️ ANTI-GLITCH : On laisse le terminal afficher tout le collage d'un coup.
|
|
485
|
-
// On ne redessine le chevron qu'après 50ms de silence.
|
|
486
|
-
clearTimeout(promptTimeout);
|
|
487
|
-
promptTimeout = setTimeout(() => {
|
|
488
|
-
rl.prompt();
|
|
489
|
-
}, 50);
|
|
481
|
+
// 🛡️ MAGIE ICI : Zéro code visuel. Zéro setPrompt. Zéro prompt().
|
|
482
|
+
// On laisse ton Mac afficher le texte collé naturellement.
|
|
490
483
|
}
|
|
491
484
|
// 3. VALIDATION (Touche Entrée sur une ligne vide)
|
|
492
485
|
else {
|
|
@@ -494,10 +487,7 @@ if (command === 'alex') {
|
|
|
494
487
|
const finalPrompt = inputBuffer.trim();
|
|
495
488
|
inputBuffer = "";
|
|
496
489
|
|
|
497
|
-
|
|
498
|
-
clearTimeout(promptTimeout); // On annule tout dessin en cours
|
|
499
|
-
|
|
500
|
-
// 🛑 COUPE-CIRCUIT STRICT (1000 caractères)
|
|
490
|
+
// 🛑 COUPE-CIRCUIT STRICT
|
|
501
491
|
if (finalPrompt.length > 1000) {
|
|
502
492
|
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejetée : Taille excessive (${finalPrompt.length}/1000 caractères).\x1b[0m`);
|
|
503
493
|
console.log(`\x1b[90m Veuillez être plus concis et vous concentrer sur l'essentiel.\x1b[0m\n`);
|
|
@@ -511,10 +501,9 @@ if (command === 'alex') {
|
|
|
511
501
|
isProcessing = false;
|
|
512
502
|
|
|
513
503
|
console.log('');
|
|
514
|
-
rl.prompt();
|
|
504
|
+
rl.prompt(); // On remet le prompt "jojo ❯" pour la suite
|
|
515
505
|
} else {
|
|
516
|
-
rl.
|
|
517
|
-
rl.prompt(); // Entrée dans le vide
|
|
506
|
+
rl.prompt(); // Si appui sur Entrée dans le vide
|
|
518
507
|
}
|
|
519
508
|
}
|
|
520
509
|
});
|