fleetbo-cockpit-cli 1.0.42 → 1.0.44
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 +13 -9
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -459,7 +459,7 @@ if (command === 'alex') {
|
|
|
459
459
|
process.stdout.write('\n\x1b[F');
|
|
460
460
|
rl.prompt();
|
|
461
461
|
|
|
462
|
-
// --- NATURAL MULTI-LINE BUFFER (ZERO GLITCH) ---
|
|
462
|
+
// --- NATURAL MULTI-LINE BUFFER (ZERO GLITCH V2) ---
|
|
463
463
|
let inputBuffer = "";
|
|
464
464
|
let isProcessing = false;
|
|
465
465
|
|
|
@@ -475,37 +475,41 @@ if (command === 'alex') {
|
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
// 2. ACCUMULATION
|
|
478
|
+
// 2. ACCUMULATION (Si la ligne n'est pas vide)
|
|
479
479
|
if (trimmedLine !== "") {
|
|
480
480
|
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
481
481
|
|
|
482
|
-
// 🛡️
|
|
483
|
-
//
|
|
484
|
-
|
|
482
|
+
// 🛡️ LE SECRET EST LÀ : On vide le préfixe pour les lignes suivantes.
|
|
483
|
+
// Quand tu colles, NodeJS arrêtera de répéter "jojo ❯" partout !
|
|
484
|
+
rl.setPrompt("");
|
|
485
485
|
}
|
|
486
486
|
// 3. VALIDATION (Touche Entrée sur une ligne vide)
|
|
487
487
|
else {
|
|
488
488
|
if (inputBuffer.trim() !== "") {
|
|
489
489
|
const finalPrompt = inputBuffer.trim();
|
|
490
|
-
inputBuffer = "";
|
|
490
|
+
inputBuffer = "";
|
|
491
491
|
|
|
492
|
-
// 🛑 COUPE-CIRCUIT STRICT
|
|
492
|
+
// 🛑 COUPE-CIRCUIT STRICT
|
|
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.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
496
497
|
rl.prompt();
|
|
497
498
|
return;
|
|
498
499
|
}
|
|
499
500
|
|
|
500
501
|
// ✅ ON LANCE LA FORGE
|
|
501
502
|
isProcessing = true;
|
|
503
|
+
rl.setPrompt(""); // On masque le prompt pendant qu'Alex réfléchit
|
|
502
504
|
await processAlexRequest(finalPrompt);
|
|
503
505
|
isProcessing = false;
|
|
504
506
|
|
|
505
507
|
console.log('');
|
|
506
|
-
rl.
|
|
508
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
509
|
+
rl.prompt(); // On remet le prompt "jojo ❯" pour la mission suivante
|
|
507
510
|
} else {
|
|
508
|
-
rl.
|
|
511
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
512
|
+
rl.prompt(); // Si appui sur Entrée dans le vide
|
|
509
513
|
}
|
|
510
514
|
}
|
|
511
515
|
});
|