fleetbo-cockpit-cli 1.0.201 → 1.0.202

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 -43
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -706,6 +706,8 @@ if (command === 'alex') {
706
706
  const providerLabel = aiProvider === 'anthropic' ? 'Anthropic' : 'Google AI';
707
707
  const modelLabel = aiModel && aiModel !== 'auto' ? aiModel : 'auto';
708
708
 
709
+ process.stdout.write(`[ALEX_ONLINE:${dynamicUsername}]\n`);
710
+
709
711
  console.log('');
710
712
  console.log('\x1b[90m┌─────────────────────────────────────────────────────────┐\x1b[0m');
711
713
  console.log('\x1b[90m│ │\x1b[0m');
@@ -811,58 +813,31 @@ if (command === 'alex') {
811
813
  }
812
814
  };
813
815
 
814
- // L'ÉCOUTEUR DE TOUCHES BLINDÉ
816
+ // LE NOUVEAU RÉCEPTEUR INTELLIGENT (Sans commandes /p ni /s)
817
+ let pasteTimer = null;
818
+
815
819
  rl.on('line', async (line) => {
816
820
  if (isProcessing) return;
817
821
 
818
- // 1. SI LE MODE COLLAGE EST ACTIF
819
- if (isPasteMode) {
820
- if (['/s', '/send', 'eof'].includes(line.trim().toLowerCase())) {
821
- const finalPrompt = standardBuffer.join('\n').trim();
822
- standardBuffer = [];
823
- isPasteMode = false;
824
- await executePrompt(finalPrompt);
825
- } else {
826
- standardBuffer.push(line);
827
- }
828
- return;
829
- }
830
-
831
- // 2. ACTIVATION DU MODE COLLAGE (/p)
832
- if (['/paste', '/p'].includes(line.trim().toLowerCase())) {
833
- isPasteMode = true;
834
- standardBuffer = []; // Sécurité : on vide tout
835
- console.log('\x1b[36m [MULTILINE MODE] Paste your content below. Type /s on a new line to submit.\x1b[0m');
836
- rl.setPrompt("");
837
- return;
838
- }
839
-
840
- // 3. LE BOUCLIER ANTI-COLLAGE SAUVAGE (Mode Chat Classique)
822
+ // On empile toutes les lignes reçues (qu'elles viennent du clavier ou de React)
841
823
  standardBuffer.push(line);
842
824
 
843
- // On annule et relance le chrono de 15ms à chaque ligne ultra-rapide
844
- if (pasteBlockerTimer) clearTimeout(pasteBlockerTimer);
825
+ if (pasteTimer) clearTimeout(pasteTimer);
845
826
 
846
- pasteBlockerTimer = setTimeout(async () => {
847
- pasteBlockerTimer = null;
827
+ // Si plusieurs lignes arrivent en moins de 30ms (vitesse d'envoi de React),
828
+ // on les fusionne silencieusement en un seul gros prompt !
829
+ pasteTimer = setTimeout(async () => {
830
+ pasteTimer = null;
848
831
 
849
- if (standardBuffer.length > 1) {
850
- // 🚨 ALERTE : Plus d'une ligne reçue en 15ms = Copier-coller illégal !
851
- console.log('\n\x1b[31m⚠️ Illegal paste detected! You must type /p before pasting multiple lines of code.\x1b[0m');
852
- standardBuffer = []; // On détruit la tentative de collage
853
- rl.prompt();
832
+ const finalPrompt = standardBuffer.join('\n').trim();
833
+ standardBuffer = [];
834
+
835
+ if (finalPrompt === "") {
836
+ rl.prompt();
854
837
  } else {
855
- // CAS NORMAL : 1 seule touche Entrée humaine
856
- const finalPrompt = standardBuffer[0].trim();
857
- standardBuffer = [];
858
-
859
- if (finalPrompt === "") {
860
- rl.prompt();
861
- } else {
862
- await executePrompt(finalPrompt);
863
- }
838
+ await executePrompt(finalPrompt);
864
839
  }
865
- }, 15); // 15 millisecondes d'analyse
840
+ }, 30);
866
841
  });
867
842
  };
868
843
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.201",
3
+ "version": "1.0.202",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",