fleetbo-cockpit-cli 1.0.40 → 1.0.42
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 +15 -15
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -459,12 +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
|
-
let isProcessing = false;
|
|
464
|
+
let isProcessing = false;
|
|
465
465
|
|
|
466
466
|
rl.on('line', async (line) => {
|
|
467
|
-
if (isProcessing) return; //
|
|
467
|
+
if (isProcessing) return; // Verrou pendant la forge
|
|
468
468
|
|
|
469
469
|
const trimmedLine = line.trim();
|
|
470
470
|
|
|
@@ -475,37 +475,37 @@ if (command === 'alex') {
|
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
// 2. ACCUMULATION
|
|
478
|
+
// 2. ACCUMULATION NATURELLE ET SILENCIEUSE
|
|
479
479
|
if (trimmedLine !== "") {
|
|
480
480
|
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
481
|
-
|
|
482
|
-
|
|
481
|
+
|
|
482
|
+
// 🛡️ MAGIE ICI : On ne fait RIEN visuellement.
|
|
483
|
+
// On ne change pas le prompt, on ne met pas de timer.
|
|
484
|
+
// On laisse le terminal macOS/Windows afficher le texte naturellement.
|
|
483
485
|
}
|
|
484
486
|
// 3. VALIDATION (Touche Entrée sur une ligne vide)
|
|
485
487
|
else {
|
|
486
488
|
if (inputBuffer.trim() !== "") {
|
|
487
489
|
const finalPrompt = inputBuffer.trim();
|
|
488
|
-
inputBuffer = ""; //
|
|
489
|
-
|
|
490
|
-
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
490
|
+
inputBuffer = ""; // Reset de la mémoire
|
|
491
491
|
|
|
492
|
-
// 🛑 COUPE-CIRCUIT STRICT (
|
|
492
|
+
// 🛑 COUPE-CIRCUIT STRICT (1000 caractères)
|
|
493
493
|
if (finalPrompt.length > 1000) {
|
|
494
494
|
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejetée : Taille excessive (${finalPrompt.length}/1000 caractères).\x1b[0m`);
|
|
495
495
|
console.log(`\x1b[90m Veuillez être plus concis et vous concentrer sur l'essentiel.\x1b[0m\n`);
|
|
496
|
-
rl.prompt();
|
|
497
|
-
return;
|
|
496
|
+
rl.prompt();
|
|
497
|
+
return;
|
|
498
498
|
}
|
|
499
499
|
|
|
500
|
-
// ✅
|
|
500
|
+
// ✅ ON LANCE LA FORGE
|
|
501
501
|
isProcessing = true;
|
|
502
502
|
await processAlexRequest(finalPrompt);
|
|
503
503
|
isProcessing = false;
|
|
504
504
|
|
|
505
505
|
console.log('');
|
|
506
|
-
rl.prompt();
|
|
506
|
+
rl.prompt(); // On remet le prompt du pilote pour la prochaine mission
|
|
507
507
|
} else {
|
|
508
|
-
rl.prompt(); //
|
|
508
|
+
rl.prompt(); // Si le pilote appuie sur Entrée dans le vide
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
});
|