fleetbo-cockpit-cli 1.0.137 → 1.0.138
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 +28 -21
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -621,9 +621,9 @@ if (command === 'alex') {
|
|
|
621
621
|
console.log('');
|
|
622
622
|
console.log('\x1b[36mEXAMPLES\x1b[0m');
|
|
623
623
|
console.log('');
|
|
624
|
-
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mforge\x1b[90m a camera to scan receipts for my expense tracker"\x1b[0m');
|
|
625
|
-
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mcreate\x1b[90m a form to add products with photos to my catalog"\x1b[0m');
|
|
626
|
-
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mupdate\x1b[90m CloudCamera to save in the collection orders"\x1b[0m');
|
|
624
|
+
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mforge\x1b[90m a camera module to scan receipts for my expense tracker"\x1b[0m');
|
|
625
|
+
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mcreate\x1b[90m a form module to add products with photos to my catalog"\x1b[0m');
|
|
626
|
+
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mupdate\x1b[90m the CloudCamera module to save in the collection orders"\x1b[0m');
|
|
627
627
|
|
|
628
628
|
// READY
|
|
629
629
|
console.log('');
|
|
@@ -641,7 +641,7 @@ if (command === 'alex') {
|
|
|
641
641
|
|
|
642
642
|
let inputBuffer = "";
|
|
643
643
|
let isProcessing = false;
|
|
644
|
-
|
|
644
|
+
let hintShown = false;
|
|
645
645
|
|
|
646
646
|
rl.on('line', async (line) => {
|
|
647
647
|
if (isProcessing) return;
|
|
@@ -655,31 +655,38 @@ if (command === 'alex') {
|
|
|
655
655
|
}
|
|
656
656
|
|
|
657
657
|
if (trimmedLine !== "") {
|
|
658
|
-
//
|
|
658
|
+
// Accumule silencieusement — pas de hint pendant la frappe/paste
|
|
659
659
|
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
660
660
|
}
|
|
661
661
|
else {
|
|
662
|
-
// Si la ligne est vide (L'utilisateur a fait Entrée sans écrire de texte)
|
|
663
662
|
if (inputBuffer.trim() !== "") {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
663
|
+
if (!hintShown) {
|
|
664
|
+
// 1ère ligne vide → affiche le hint, attend la 2ème
|
|
665
|
+
hintShown = true;
|
|
666
|
+
rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
|
|
667
|
+
rl.prompt();
|
|
668
|
+
} else {
|
|
669
|
+
// 2ème ligne vide → soumet
|
|
670
|
+
hintShown = false;
|
|
671
|
+
const finalPrompt = inputBuffer.trim();
|
|
672
|
+
inputBuffer = "";
|
|
673
|
+
|
|
674
|
+
if (finalPrompt.length > 4000) {
|
|
675
|
+
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/4000 characters).\x1b[0m`);
|
|
676
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
677
|
+
rl.prompt();
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
isProcessing = true;
|
|
682
|
+
rl.setPrompt("");
|
|
683
|
+
await processAlexRequest(finalPrompt);
|
|
684
|
+
isProcessing = false;
|
|
667
685
|
|
|
668
|
-
|
|
669
|
-
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/4000 characters).\x1b[0m`);
|
|
686
|
+
console.log('');
|
|
670
687
|
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
671
688
|
rl.prompt();
|
|
672
|
-
return;
|
|
673
689
|
}
|
|
674
|
-
|
|
675
|
-
isProcessing = true;
|
|
676
|
-
rl.setPrompt("");
|
|
677
|
-
await processAlexRequest(finalPrompt);
|
|
678
|
-
isProcessing = false;
|
|
679
|
-
|
|
680
|
-
console.log('');
|
|
681
|
-
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
682
|
-
rl.prompt();
|
|
683
690
|
} else {
|
|
684
691
|
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
685
692
|
rl.prompt();
|