fleetbo-cockpit-cli 1.0.130 → 1.0.132

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.
Files changed (2) hide show
  1. package/cli.js +18 -35
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -641,31 +641,6 @@ if (command === 'alex') {
641
641
 
642
642
  let inputBuffer = "";
643
643
  let isProcessing = false;
644
- let submitTimer = null;
645
-
646
- const doSubmit = async () => {
647
- if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
648
- if (isProcessing || inputBuffer.trim() === "") return;
649
-
650
- const finalPrompt = inputBuffer.trim();
651
- inputBuffer = "";
652
-
653
- if (finalPrompt.length > 4000) {
654
- console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/4000 characters).\x1b[0m`);
655
- rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
656
- rl.prompt();
657
- return;
658
- }
659
-
660
- isProcessing = true;
661
- rl.setPrompt("");
662
- await processAlexRequest(finalPrompt);
663
- isProcessing = false;
664
-
665
- console.log('');
666
- rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
667
- rl.prompt();
668
- };
669
644
 
670
645
  rl.on('line', async (line) => {
671
646
  if (isProcessing) return;
@@ -679,21 +654,29 @@ if (command === 'alex') {
679
654
  }
680
655
 
681
656
  if (trimmedLine !== "") {
682
- // Ligne non-vide : annule le timer de soumission si une ligne vide
683
- // était en attente (cas paste avec ligne vide interne)
684
- if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
685
657
  inputBuffer += (inputBuffer ? "\n" : "") + line;
686
- // Affiche le hint immédiatement — comportement original préservé
687
658
  rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
688
659
  rl.prompt();
689
660
  } else {
690
661
  if (inputBuffer.trim() !== "") {
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);
662
+ const finalPrompt = inputBuffer.trim();
663
+ inputBuffer = "";
664
+
665
+ if (finalPrompt.length > 4000) {
666
+ console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/4000 characters).\x1b[0m`);
667
+ rl.setPrompt(`\x1b[34m${dynamicUsername} \x1b[0m`);
668
+ rl.prompt();
669
+ return;
670
+ }
671
+
672
+ isProcessing = true;
673
+ rl.setPrompt("");
674
+ await processAlexRequest(finalPrompt);
675
+ isProcessing = false;
676
+
677
+ console.log('');
678
+ rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
679
+ rl.prompt();
697
680
  } else {
698
681
  rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
699
682
  rl.prompt();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.130",
3
+ "version": "1.0.132",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",