fleetbo-cockpit-cli 1.0.115 → 1.0.117

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 +45 -57
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -588,11 +588,11 @@ if (command === 'alex') {
588
588
 
589
589
  console.log('');
590
590
  console.log('\x1b[90m┌─────────────────────────────────────────────────────────┐\x1b[0m');
591
- console.log('\x1b[90m│\x1b[0m \x1b[90m│\x1b[0m');
592
- console.log('\x1b[90m│\x1b[0m \x1b[1m\x1b[36m⚡ ALEX\x1b[0m \x1b[90m— System Architect · Fleetbo OS\x1b[0m \x1b[90m│\x1b[0m');
593
- console.log('\x1b[90m│\x1b[0m \x1b[90m│\x1b[0m');
594
- console.log('\x1b[90m│\x1b[0m \x1b[90mYour JS stays the brain. I forge the metal.\x1b[0m \x1b[90m│\x1b[0m');
595
- console.log('\x1b[90m│\x1b[0m \x1b[90m│\x1b[0m');
591
+ console.log('\x1b[90m│\x1b[0m \x1b[90m│\x1b[0m');
592
+ console.log('\x1b[90m│\x1b[0m \x1b[1m\x1b[36m⚡ ALEX\x1b[0m \x1b[90m— System Architect · Fleetbo OS\x1b[0m \x1b[90m│\x1b[0m');
593
+ console.log('\x1b[90m│\x1b[0m \x1b[90m│\x1b[0m');
594
+ console.log('\x1b[90m│\x1b[0m \x1b[90mYour JS stays the brain. I forge the metal.\x1b[0m \x1b[90m│\x1b[0m');
595
+ console.log('\x1b[90m│\x1b[0m \x1b[90m│\x1b[0m');
596
596
  console.log('\x1b[90m└─────────────────────────────────────────────────────────┘\x1b[0m');
597
597
 
598
598
  // AI ENGINE STATUS
@@ -629,73 +629,61 @@ if (command === 'alex') {
629
629
  console.log('');
630
630
  console.log('\x1b[32mAlex ❯\x1b[0m Describe your feature.');
631
631
  console.log('');
632
-
633
- const rl = readline.createInterface({
634
- input: process.stdin,
632
+
633
+ const rl = readline.createInterface({
634
+ input: process.stdin,
635
635
  output: process.stdout,
636
- prompt: `\x1b[34m${dynamicUsername} ❯ \x1b[0m`
636
+ prompt: `\x1b[34m${dynamicUsername} ❯ \x1b[0m`
637
637
  });
638
+
639
+ process.stdout.write('\n\x1b[F');
640
+ rl.prompt();
638
641
 
639
- let inputBuffer = "";
640
- let isProcessing = false;
641
- let submitTimer = null; // fenêtre de 80ms : ignore les lignes vides d'un paste
642
-
643
- const resetPrompt = () => {
644
- rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
645
- rl.prompt(true);
646
- };
647
-
648
- const submit = async () => {
649
- if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
650
- const finalPrompt = inputBuffer.trim();
651
- inputBuffer = "";
652
- if (!finalPrompt) { resetPrompt(); return; }
653
-
654
- if (finalPrompt.length > 1000) {
655
- console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/1000 characters).\x1b[0m`);
656
- resetPrompt();
657
- return;
658
- }
659
-
660
- isProcessing = true;
661
- rl.setPrompt("");
662
- await processAlexRequest(finalPrompt);
663
- isProcessing = false;
664
- console.log('');
665
- resetPrompt();
666
- };
642
+ let inputBuffer = "";
643
+ let isProcessing = false;
667
644
 
668
645
  rl.on('line', async (line) => {
669
- if (isProcessing) return;
646
+ if (isProcessing) return;
670
647
 
671
- const trimmed = line.trim();
648
+ const trimmedLine = line.trim();
672
649
 
673
- if (['exit', 'quit'].includes(trimmed.toLowerCase())) {
674
- console.log('\n\x1b[90mAlex session closed.\x1b[0m');
675
- rl.close();
676
- process.exit(0);
650
+ if (['exit', 'quit'].includes(trimmedLine.toLowerCase())) {
651
+ console.log('\n\x1b[90m Alex session closed.\x1b[0m');
652
+ rl.close();
653
+ return;
677
654
  }
678
655
 
679
- if (trimmed !== "") {
680
- // Nouvelle ligne avec contenu : annule le timer de soumission en cours
681
- // (cas paste : la ligne vide du paste n'aura pas eu le temps de soumettre)
682
- if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
656
+ if (trimmedLine !== "") {
683
657
  inputBuffer += (inputBuffer ? "\n" : "") + line;
684
- rl.setPrompt(`\x1b[90m ↵ to send · keep typing\x1b[0m\n\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
685
- rl.prompt(true);
686
- } else {
658
+ rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m\n\x1b[34m" + dynamicUsername + " ❯ \x1b[0m");
659
+ rl.prompt();
660
+ }
661
+ else {
687
662
  if (inputBuffer.trim() !== "") {
688
- // Ligne vide reçue : attend 80ms avant de soumettre
689
- // Si une autre ligne non-vide arrive dans ce délai (paste), on annule
690
- submitTimer = setTimeout(() => submit(), 80);
663
+ const finalPrompt = inputBuffer.trim();
664
+ inputBuffer = "";
665
+
666
+ if (finalPrompt.length > 1000) {
667
+ console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/1000 characters).\x1b[0m`);
668
+ rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
669
+ rl.prompt();
670
+ return;
671
+ }
672
+
673
+ isProcessing = true;
674
+ rl.setPrompt("");
675
+ await processAlexRequest(finalPrompt);
676
+ isProcessing = false;
677
+
678
+ console.log('');
679
+ rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
680
+ rl.prompt();
691
681
  } else {
692
- resetPrompt();
682
+ rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
683
+ rl.prompt();
693
684
  }
694
685
  }
695
686
  });
696
-
697
- process.stdout.write('\n');
698
- resetPrompt();
699
687
  };
700
688
 
701
689
  if (!initialPrompt || initialPrompt === '?') startAlexSession();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.115",
3
+ "version": "1.0.117",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",