fleetbo-cockpit-cli 1.0.102 → 1.0.104

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 +34 -12
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -14,6 +14,32 @@ const os = require('os');
14
14
  const archiver = require('archiver');
15
15
  const readline = require('readline');
16
16
 
17
+ // ============================================
18
+ // OS SPINNER (Terminal Animation Engine)
19
+ // ============================================
20
+ class FleetboSpinner {
21
+ constructor() {
22
+ this.frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
23
+ this.idx = 0;
24
+ this.timer = null;
25
+ }
26
+ start(message) {
27
+ if (this.timer) return;
28
+ process.stdout.write('\x1b[?25l'); // Cache le curseur natif
29
+ this.timer = setInterval(() => {
30
+ // \r revient au début, \x1b[2K efface la ligne
31
+ process.stdout.write(`\r\x1b[2K \x1b[32m${this.frames[this.idx]}\x1b[0m ${message}`);
32
+ this.idx = (this.idx + 1) % this.frames.length;
33
+ }, 80);
34
+ }
35
+ stop() {
36
+ if (this.timer) clearInterval(this.timer);
37
+ this.timer = null;
38
+ process.stdout.write('\x1b[?25h\r\x1b[2K'); // Réaffiche le curseur et nettoie la ligne
39
+ }
40
+ }
41
+ const osSpinner = new FleetboSpinner();
42
+
17
43
  // ============================================
18
44
  // FLEETBO CLI - Centralized Package
19
45
  // ============================================
@@ -273,8 +299,7 @@ if (command === 'alex') {
273
299
  return;
274
300
  }
275
301
 
276
- console.log('\x1b[33m🧠 Alex is thinking...\x1b[0m');
277
- let spinnerTimer;
302
+ osSpinner.start("\x1b[32m🧠 Alex is processing your request...\x1b[0m");
278
303
 
279
304
  try {
280
305
  // --- MEMORY SYSTEM (SMART CACHE SCANNER V3 - SOUVERAINETÉ DU MÉTAL) ---
@@ -356,21 +381,15 @@ if (command === 'alex') {
356
381
 
357
382
  const promptWithTime = prompt + `\n\n[SYSTEM INFO: The exact current timestamp is ${exactTime}. Use it STRICTLY for your signature '// ⚡ Forged by Alex on...' at the bottom of your files.]`;
358
383
 
359
- // 🟢 DÉMARRAGE DE L'ANIMATION DU CURSEUR
360
- const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
361
- let spinnerIdx = 0;
362
- spinnerTimer = setInterval(() => {
363
- process.stdout.write(`\r \x1b[36m${spinnerFrames[spinnerIdx]}\x1b[0m \x1b[90mAlex is forging...\x1b[0m`);
364
- spinnerIdx = (spinnerIdx + 1) % spinnerFrames.length;
365
- }, 80);
384
+ // On met à jour le texte du spinner existant
385
+ osSpinner.start("\x1b[32m Alex is forging...\x1b[0m");
366
386
 
367
387
  const result = await axios.post(ALEX_ENGINE_URL, { prompt: promptWithTime, projectType: 'android' }, {
368
388
  headers: { 'x-project-id': projectId }
369
389
  });
370
390
 
371
391
  // 🛑 ARRÊT DE L'ANIMATION
372
- clearInterval(spinnerTimer);
373
- process.stdout.write('\r' + ' '.repeat(80) + '\r'); // Nettoie la ligne de l'animation
392
+ osSpinner.stop();
374
393
 
375
394
  let aiData = result.data;
376
395
 
@@ -535,7 +554,7 @@ if (command === 'alex') {
535
554
  // ============================================================
536
555
 
537
556
  const startAlexSession = async () => {
538
- process.stdout.write('\x1b[33m🛡️ Alex is checking runtime state...\x1b[0m\r');
557
+ osSpinner.start("\x1b[32m🛡️ Alex is checking runtime state...\x1b[0m");
539
558
  let attempts = 0;
540
559
  const maxAttempts = 5;
541
560
  let isReady = false;
@@ -565,6 +584,9 @@ if (command === 'alex') {
565
584
  await new Promise(r => setTimeout(r, 2000));
566
585
  }
567
586
  }
587
+
588
+ // 🛑 ON ARRÊTE L'ANIMATION DE DÉMARRAGE ICI
589
+ osSpinner.stop();
568
590
 
569
591
  if (!isReady) {
570
592
  console.error('\n\x1b[31m⚠️ ENGINE OFFLINE:\x1b[0m Start Fleetbo runtime first: "npm run fleetbo" ');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.102",
3
+ "version": "1.0.104",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",