fleetbo-cockpit-cli 1.0.62 → 1.0.63

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 +58 -16
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -276,6 +276,12 @@ if (command === 'alex') {
276
276
  try { aiData = JSON.parse(aiData); } catch (_) {}
277
277
  }
278
278
 
279
+ // 🟢 AFFICHAGE DU RAISONNEMENT DANS LE TERMINAL
280
+ if (aiData.thinking_process) {
281
+ // Affiche le début du raisonnement en gris pour info
282
+ console.log(` \x1b[90m🧠 Analyse Alex : ${aiData.thinking_process.substring(0, 150)}...\x1b[0m`);
283
+ }
284
+
279
285
  process.stdout.write('\x1b[A\r' + ' '.repeat(50) + '\r');
280
286
 
281
287
  if (aiData.status === 'quota_exceeded') {
@@ -324,9 +330,17 @@ if (command === 'alex') {
324
330
 
325
331
  // --- C'EST ICI QUE LES FICHIERS SONT CRÉÉS ---
326
332
  if (aiData.status === 'success' && aiData.moduleData) {
327
- const { fileName, code, mockFileName, mockCode, moduleName, instructions, config_offload } = aiData.moduleData;
333
+ let { fileName, code, mockFileName, mockCode, moduleName, instructions, config_offload } = aiData.moduleData;
334
+
335
+ // 🛡️ BOUCLIER ANTI-DUMP (Empêche l'explosion du terminal)
336
+ if (moduleName) {
337
+ // Si l'IA met des sauts de ligne ou un texte trop long dans le nom, on coupe.
338
+ moduleName = moduleName.split('\n')[0].replace(/["'{}]/g, '').trim();
339
+ if (moduleName.length > 40) moduleName = moduleName.substring(0, 40) + "...";
340
+ }
341
+
328
342
  console.log(` \x1b[90m Architecting: ${moduleName}\x1b[0m`);
329
-
343
+
330
344
  const writeFile = (dir, name, content) => {
331
345
  const fullPath = path.join(process.cwd(), dir);
332
346
  const filePath = path.join(fullPath, name);
@@ -481,7 +495,7 @@ if (command === 'alex') {
481
495
  inputBuffer = "";
482
496
 
483
497
  if (finalPrompt.length > 1000) {
484
- console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejetée : Taille excessive (${finalPrompt.length}/1000 caractères).\x1b[0m`);
498
+ console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/1000 characters).\x1b[0m`);
485
499
  rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
486
500
  rl.prompt();
487
501
  return;
@@ -796,13 +810,13 @@ else {
796
810
  try {
797
811
  await axios.post(UPDATE_NETWORK_URL, { keyApp, networkUrl, tester: testerEmail });
798
812
  console.log('\n\x1b[32mEngine started successfully\x1b[0m');
799
- console.log(`\x1b[32m[Fleetbo]\x1b[0m -------------------------------------------------------------`);
800
- console.log('\x1b[32m[Fleetbo] \x1b[1mGO GO GO ! FLEETBO COCKPIT IS READY\x1b[0m');
801
- console.log('\x1b[32m[Fleetbo] You can now start coding and previewing in Studio. 🚀\x1b[0m');
802
- console.log(`\x1b[32m[Fleetbo]\x1b[0m -------------------------------------------------------------`);
803
- console.log(`\x1b[34mPilot Instruction ❯\x1b[0m Switch to your Fleetbo Cockpit tab to begin.\n`);
813
+ console.log(`\x1b[32mFleetbo OS ❯\x1b[0m -------------------------------------------------------------`);
814
+ console.log('\x1b[32mFleetbo OS ❯\x1b[0m \x1b[1mGO GO GO ! OS IS READY\x1b[0m');
815
+ console.log('\x1b[32mFleetbo OS ❯\x1b[0m You can now start coding and previewing. 🚀');
816
+ console.log(`\x1b[32mFleetbo OS ❯\x1b[0m -------------------------------------------------------------`);
817
+ console.log(`\x1b[34mPilot Instruction ❯\x1b[0m Return to the Workspace. The Engine is ready for your orders.\n`);
804
818
  } catch (err) {
805
- console.error(`[Fleetbo] Sync Error: ${err.message}`);
819
+ console.error(`\x1b[31mFleetbo OS ❯\x1b[0m Sync Error: ${err.message}`);
806
820
  }
807
821
  }
808
822
 
@@ -839,7 +853,7 @@ else {
839
853
  }
840
854
  });
841
855
 
842
- devServer.stdout.pipe(process.stdout);
856
+ //devServer.stdout.pipe(process.stdout);
843
857
  devServer.stderr.pipe(process.stderr);
844
858
 
845
859
  let connectionStarted = false;
@@ -847,13 +861,39 @@ else {
847
861
  devServer.stdout.on('data', (data) => {
848
862
  const output = data.toString();
849
863
 
864
+ // 🛡️ FILTRE ANTI-PLOMBERIE FLEETBO
865
+ const lines = output.split('\n');
866
+ const forbiddenTerms = [
867
+ 'Attempting to bind to HOST',
868
+ 'If this was unintentional',
869
+ 'Learn more here:',
870
+ 'Starting the development server',
871
+ 'You can now view',
872
+ 'Local:',
873
+ 'On Your Network:',
874
+ 'Note that the development build',
875
+ 'To create a production build',
876
+ 'webpack compiled successfully'
877
+ ];
878
+
879
+ // On filtre les lignes pour ne garder que le vrai code/debug
880
+ const filteredOutput = lines.filter(line => {
881
+ return !forbiddenTerms.some(term => line.includes(term));
882
+ }).join('\n');
883
+
884
+ // S'il reste quelque chose d'utile (un console.log du dev, un warning, une vraie erreur), on l'affiche
885
+ if (filteredOutput.trim() !== '') {
886
+ process.stdout.write(filteredOutput + '\n');
887
+ }
888
+
889
+ // 🚀 DÉTECTION DU DÉMARRAGE ET LANCEMENT DE L'UPLINK
850
890
  if (!connectionStarted && (output.includes('Local:') || output.includes('Compiled successfully'))) {
851
891
  connectionStarted = true;
852
892
 
853
- console.log('\n[Fleetbo] ---------------------------------------------------');
854
- console.log(`[Fleetbo] 🔗 Establishing Secure Uplink...`);
855
- console.log(`[Fleetbo] ⏳ Please wait for the green message...`);
856
- console.log('[Fleetbo] ---------------------------------------------------');
893
+ console.log('\x1b[33mFleetbo OS ❯\x1b[0m ---------------------------------------------------');
894
+ console.log(`\x1b[33mFleetbo OS ❯\x1b[0m 🔗 Establishing Secure Uplink...`);
895
+ console.log(`\x1b[33mFleetbo OS ❯\x1b[0m ⏳ Please wait for the green message...`);
896
+ console.log('\x1b[33mFleetbo OS ❯\x1b[0m ---------------------------------------------------');
857
897
 
858
898
  // ============================================
859
899
  // UPLINK avec auto-retry (Fleetbo OS Resilience)
@@ -885,11 +925,13 @@ else {
885
925
  const match = text.match(/https:\/\/[a-zA-Z0-9-]+\.trycloudflare\.com/);
886
926
  if (match) {
887
927
  uplinkFound = true;
888
- syncFirebase(process.env.REACT_KEY_APP, match[0], process.env.REACT_APP_TESTER_EMAIL);
928
+ // Stabilisation du noyau : on attend 1.5s
929
+ setTimeout(() => {
930
+ syncFirebase(process.env.REACT_KEY_APP, match[0], process.env.REACT_APP_TESTER_EMAIL);
931
+ }, 1500);
889
932
  }
890
933
  };
891
934
 
892
- // Écoute sur les deux flux (stdout + stderr)
893
935
  uplinkProcess.stdout.on('data', handleUplinkOutput);
894
936
  uplinkProcess.stderr.on('data', handleUplinkOutput);
895
937
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",