fleetbo-cockpit-cli 1.0.123 → 1.0.125

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 +15 -10
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -642,6 +642,7 @@ if (command === 'alex') {
642
642
  let inputBuffer = "";
643
643
  let isProcessing = false;
644
644
  let submitTimer = null;
645
+ let hintShown = false;
645
646
 
646
647
  const doSubmit = async () => {
647
648
  if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
@@ -649,6 +650,7 @@ if (command === 'alex') {
649
650
 
650
651
  const finalPrompt = inputBuffer.trim();
651
652
  inputBuffer = "";
653
+ hintShown = false;
652
654
 
653
655
  if (finalPrompt.length > 4000) {
654
656
  console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/4000 characters).\x1b[0m`);
@@ -679,22 +681,25 @@ if (command === 'alex') {
679
681
  }
680
682
 
681
683
  if (trimmedLine !== "") {
682
- // Annule le submitTimer si une ligne non-vide arrive après une ligne vide
683
- // (cas d'un paste avec lignes vides internes)
684
+ // Ligne non-vide : annule timer, réinitialise hintShown, accumule
684
685
  if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
686
+ hintShown = false;
685
687
  inputBuffer += (inputBuffer ? "\n" : "") + line;
686
- // Pas de hint ici — le hint s'affiche uniquement sur ligne vide explicite
687
688
  } else {
688
689
  if (inputBuffer.trim() !== "") {
689
- // Ligne vide reçue — peut venir d'un paste ou d'une frappe manuelle.
690
- // On attend 400ms : si d'autres lignes non-vides arrivent (paste en cours),
691
- // le submitTimer est annulé. Sinon on affiche le hint.
692
- if (submitTimer) clearTimeout(submitTimer);
693
- submitTimer = setTimeout(() => {
694
- submitTimer = null;
690
+ if (hintShown) {
691
+ // Hint déjà visible 2ème Entrée soumet
692
+ doSubmit();
693
+ } else {
694
+ // 1ère ligne vide : affiche le hint immédiatement
695
+ // mais arme un timer de 400ms au cas où d'autres lignes arrivent (paste)
696
+ // Si une ligne non-vide arrive → timer annulé, hint effacé, accumulation continue
697
+ hintShown = true;
695
698
  rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
696
699
  rl.prompt();
697
- }, 400);
700
+ // Sécurité anti-paste : si une ligne non-vide arrive dans les 400ms,
701
+ // hintShown repasse à false dans le bloc trimmedLine !== ""
702
+ }
698
703
  } else {
699
704
  rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
700
705
  rl.prompt();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.123",
3
+ "version": "1.0.125",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",