fleetbo-cockpit-cli 1.0.128 → 1.0.129

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 +30 -49
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -250,8 +250,8 @@ if (command === 'alex') {
250
250
  const initialPrompt = args.slice(1).join(' ');
251
251
 
252
252
  const processAlexRequest = async (prompt) => {
253
- if (prompt.length > 4000) {
254
- console.log('\n\x1b[31m⛔ [Alex Safety] Request too long (' + prompt.length + '/4000 chars).\x1b[0m');
253
+ if (prompt.length > 1000) {
254
+ console.log('\n\x1b[31m⛔ [Alex Safety] Request too long (' + prompt.length + '/1000 chars).\x1b[0m');
255
255
  return;
256
256
  }
257
257
 
@@ -639,67 +639,48 @@ if (command === 'alex') {
639
639
  process.stdout.write('\n\x1b[F');
640
640
  rl.prompt();
641
641
 
642
- let inputBuffer = "";
643
- let isProcessing = false;
644
- let submitTimer = null;
645
- let hintShown = false;
646
-
647
- const doSubmit = async () => {
648
- if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
649
- if (isProcessing || inputBuffer.trim() === "") return;
650
-
651
- const finalPrompt = inputBuffer.trim();
652
- inputBuffer = "";
653
- hintShown = false;
654
-
655
- if (finalPrompt.length > 4000) {
656
- console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/4000 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
- };
642
+ let inputBuffer = "";
643
+ let isProcessing = false;
671
644
 
672
645
  rl.on('line', async (line) => {
673
- if (isProcessing) return;
646
+ if (isProcessing) return;
674
647
 
675
648
  const trimmedLine = line.trim();
676
649
 
677
- if (['exit', 'quit'].includes(trimmedLine.toLowerCase())) {
650
+ if (['exit', 'quit'].includes(trimmedLine.toLowerCase())) {
678
651
  console.log('\n\x1b[90m Alex session closed.\x1b[0m');
679
- rl.close();
680
- return;
652
+ rl.close();
653
+ return;
681
654
  }
682
655
 
683
656
  if (trimmedLine !== "") {
684
- // Ligne non-vide : annule timer, réinitialise hintShown, accumule
685
- if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
686
- hintShown = false;
687
657
  inputBuffer += (inputBuffer ? "\n" : "") + line;
688
- } else {
658
+ rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
659
+ rl.prompt();
660
+ }
661
+ else {
689
662
  if (inputBuffer.trim() !== "") {
690
- if (hintShown) {
691
- // Hint déjà visible → 2ème Entrée → soumet
692
- doSubmit();
693
- } else {
694
- // 1ère ligne vide : écrit le hint directement dans stdout
695
- // process.stdout.write est visible immédiatement dans le terminal
696
- // même si Xterm affiche "running" par-dessus
697
- hintShown = true;
698
- process.stdout.write("\x1b[90m ↵ to confirm & send\x1b[0m\n");
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;
699
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();
700
681
  } else {
701
682
  rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
702
- rl.prompt();
683
+ rl.prompt();
703
684
  }
704
685
  }
705
686
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.128",
3
+ "version": "1.0.129",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",