fleetbo-cockpit-cli 1.0.108 → 1.0.110

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 +27 -39
  2. package/package.json +4 -3
package/cli.js CHANGED
@@ -629,45 +629,18 @@ if (command === 'alex') {
629
629
  console.log('');
630
630
  console.log(' \x1b[32m Alex ❯\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
- // Active le curseur clignotant (séquence ANSI standard)
640
- process.stdout.write('\x1b[?12h');
641
- process.stdout.write('\n\x1b[F');
638
+
639
+ process.stdout.write('\x1b[F');
642
640
  rl.prompt();
643
641
 
644
642
  let inputBuffer = "";
645
643
  let isProcessing = false;
646
- let submitTimer = null;
647
-
648
- const submitBuffer = async () => {
649
- if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
650
- if (isProcessing || inputBuffer.trim() === "") return;
651
-
652
- const finalPrompt = inputBuffer.trim();
653
- inputBuffer = "";
654
-
655
- if (finalPrompt.length > 1000) {
656
- console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/1000 characters).\x1b[0m`);
657
- rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
658
- rl.prompt();
659
- return;
660
- }
661
-
662
- isProcessing = true;
663
- rl.setPrompt("");
664
- await processAlexRequest(finalPrompt);
665
- isProcessing = false;
666
-
667
- console.log('');
668
- rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
669
- rl.prompt();
670
- };
671
644
 
672
645
  rl.on('line', async (line) => {
673
646
  if (isProcessing) return;
@@ -681,15 +654,30 @@ if (command === 'alex') {
681
654
  }
682
655
 
683
656
  if (trimmedLine !== "") {
684
- // Ligne avec contenu accumule et arme un timer de 600ms
685
- if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
657
+ // Accumule + invite à confirmer
686
658
  inputBuffer += (inputBuffer ? "\n" : "") + line;
687
- rl.setPrompt("");
688
- submitTimer = setTimeout(() => submitBuffer(), 600);
659
+ rl.setPrompt(" \x1b[90m↵ to confirm · type more to add lines\x1b[0m\n ");
660
+ rl.prompt();
689
661
  } else {
690
- // Ligne vide → soumet immédiatement si buffer non vide, sinon prompt
691
662
  if (inputBuffer.trim() !== "") {
692
- submitBuffer();
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();
693
681
  } else {
694
682
  rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
695
683
  rl.prompt();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.108",
3
+ "version": "1.0.110",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",
@@ -26,9 +26,10 @@
26
26
  "url": "https://github.com/FleetFleetbo/fleetbo-cockpit-cli.git"
27
27
  },
28
28
  "dependencies": {
29
+ "@inquirer/prompts": "^8.3.2",
30
+ "archiver": "^7.0.0",
29
31
  "axios": "^1.6.0",
30
- "dotenv": "^16.3.0",
31
- "archiver": "^7.0.0"
32
+ "dotenv": "^16.3.0"
32
33
  },
33
34
  "engines": {
34
35
  "node": ">=16.0.0"