fleetbo-cockpit-cli 1.0.87 → 1.0.89

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 +88 -18
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -462,12 +462,24 @@ if (command === 'alex') {
462
462
  }
463
463
  };
464
464
 
465
+ // ============================================================
466
+ // CLI PATCH — startAlexSession (cli.js)
467
+ //
468
+ // Remplace le bloc ENTIER de startAlexSession, depuis :
469
+ // const startAlexSession = async () => {
470
+ // Jusqu'à (NON INCLUS) :
471
+ // const rl = readline.createInterface({
472
+ // ============================================================
473
+
465
474
  const startAlexSession = async () => {
466
475
  process.stdout.write('\x1b[33m🛡️ Alex is checking runtime state...\x1b[0m\r');
467
476
  let attempts = 0;
468
477
  const maxAttempts = 5;
469
478
  let isReady = false;
470
479
  let dynamicUsername = 'Pilot';
480
+ let hasAiKey = false;
481
+ let aiProvider = null;
482
+ let aiModel = null;
471
483
 
472
484
  while (attempts < maxAttempts && !isReady) {
473
485
  try {
@@ -477,7 +489,10 @@ if (command === 'alex') {
477
489
 
478
490
  if (validation.data?.isRunning) {
479
491
  isReady = true;
480
- dynamicUsername = validation.data.username || 'Pilot';
492
+ dynamicUsername = validation.data.username || 'Pilot';
493
+ hasAiKey = validation.data.hasAiKey || false;
494
+ aiProvider = validation.data.aiProvider || null;
495
+ aiModel = validation.data.aiModel || null;
481
496
  break;
482
497
  }
483
498
  attempts++;
@@ -494,28 +509,83 @@ if (command === 'alex') {
494
509
  process.exit(1);
495
510
  }
496
511
 
497
- process.stdout.write(' '.repeat(60) + '\r');
498
-
499
- // 1. IDENTITY
500
- console.log('\n\x1b[32m🤖 Alex is online.\x1b[0m');
501
- console.log('\x1b[90m Your JS stays the brain. I forge the native muscle.\x1b[0m');
512
+ process.stdout.write(' '.repeat(60) + '\r');
513
+
514
+ // ═══════════════════════════════════════════════
515
+ // AI KEY CHECK — Block if no key configured
516
+ // ═══════════════════════════════════════════════
517
+ if (!hasAiKey) {
518
+ console.log('');
519
+ console.log('\x1b[90m ┌──────────────────────────────────────────────────────────┐\x1b[0m');
520
+ console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
521
+ console.log('\x1b[90m │\x1b[0m \x1b[1m\x1b[33m🧠 AI Configuration Required\x1b[0m \x1b[90m│\x1b[0m');
522
+ console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
523
+ console.log('\x1b[90m │\x1b[0m Alex needs a powerful AI model to forge native code. \x1b[90m│\x1b[0m');
524
+ console.log('\x1b[90m │\x1b[0m Connect your own AI key in the Workspace Settings. \x1b[90m│\x1b[0m');
525
+ console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
526
+ console.log('\x1b[90m │\x1b[0m \x1b[1mSupported providers:\x1b[0m \x1b[90m│\x1b[0m');
527
+ console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
528
+ console.log('\x1b[90m │\x1b[0m \x1b[32m●\x1b[0m Google AI \x1b[90m(Gemini Pro)\x1b[0m \x1b[90m│\x1b[0m');
529
+ console.log('\x1b[90m │\x1b[0m \x1b[36mhttps://aistudio.google.com/app/apikey\x1b[0m \x1b[90m│\x1b[0m');
530
+ console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
531
+ console.log('\x1b[90m │\x1b[0m \x1b[33m●\x1b[0m Anthropic \x1b[90m(Claude Sonnet / Opus)\x1b[0m \x1b[90m│\x1b[0m');
532
+ console.log('\x1b[90m │\x1b[0m \x1b[36mhttps://console.anthropic.com/settings/keys\x1b[0m \x1b[90m│\x1b[0m');
533
+ console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
534
+ console.log('\x1b[90m │\x1b[0m \x1b[90mPaste your key in\x1b[0m Workspace → Settings → AI \x1b[90m│\x1b[0m');
535
+ console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
536
+ console.log('\x1b[90m └──────────────────────────────────────────────────────────┘\x1b[0m');
537
+ console.log('');
538
+ process.exit(0);
539
+ }
502
540
 
503
- // 2. FORGE CAPABILITIES
504
- console.log('\n\x1b[36m⚡ WHAT I CAN FORGE:\x1b[0m');
541
+ // ═══════════════════════════════════════════════
542
+ // ALEX WELCOME Key is configured, show capabilities
543
+ // ═══════════════════════════════════════════════
544
+ const providerLabel = aiProvider === 'anthropic' ? 'Anthropic' : 'Google AI';
545
+ const modelLabel = aiModel && aiModel !== 'auto' ? aiModel : 'auto';
546
+
547
+ console.log('');
548
+ console.log('\x1b[90m ┌─────────────────────────────────────────────────────────┐\x1b[0m');
549
+ console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
550
+ console.log('\x1b[90m │\x1b[0m \x1b[1m\x1b[36m⚡ ALEX\x1b[0m \x1b[90m— System Architect · Fleetbo OS\x1b[0m \x1b[90m│\x1b[0m');
551
+ console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
552
+ console.log('\x1b[90m │\x1b[0m \x1b[90mYour JS stays the brain. I forge the metal.\x1b[0m \x1b[90m│\x1b[0m');
553
+ console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
554
+ console.log('\x1b[90m └─────────────────────────────────────────────────────────┘\x1b[0m');
555
+
556
+ // AI ENGINE STATUS
505
557
  console.log('');
506
- console.log(' \x1b[1m📷 Hardware\x1b[0m\x1b[90m Camera, Scanner, GPS, Biometrics, Sensors\x1b[0m');
507
- console.log(' \x1b[1m🎬 High-Perf\x1b[0m\x1b[90m Infinite Feeds, Video Players, Swipe Decks\x1b[0m');
508
- console.log(' \x1b[1m🏗️ Sovereign\x1b[0m\x1b[90m Full screens: form + photo + save-to-cloud\x1b[0m');
558
+ console.log(` \x1b[32m ✓\x1b[0m ${providerLabel} \x1b[90m· ${modelLabel}\x1b[0m`);
509
559
 
510
- // 3. COLLABORATION
511
- console.log('\n\x1b[36m💡 TELL ME "WHAT + WHY":\x1b[0m');
512
- console.log('\x1b[90m I will analyze your need and recommend the perfect module to forge.\x1b[0m');
560
+ // FORGE CAPABILITIES
513
561
  console.log('');
514
- console.log(' \x1b[33m"I need a camera [WHAT] to scan receipts for my expense tracker [WHY]"\x1b[0m');
515
- console.log(' \x1b[33m"I need a form [WHAT] to add products with photos to my catalog [WHY]"\x1b[0m');
562
+ console.log(' \x1b[36m CAPABILITIES\x1b[0m');
563
+ console.log(' \x1b[90m ─────────────────────────────────────────────────────\x1b[0m');
564
+ console.log(' \x1b[1m 📷 Hardware\x1b[0m\x1b[90m Camera · Scanner · GPS · Biometrics\x1b[0m');
565
+ console.log(' \x1b[1m 🎬 High-Perf\x1b[0m\x1b[90m Video Feed · Swipe Deck · Audio\x1b[0m');
566
+ console.log(' \x1b[1m 🏗️ Sovereign\x1b[0m\x1b[90m Form + Photo + Save-to-Cloud\x1b[0m');
567
+ console.log(' \x1b[1m 🖥️ Fleetbo View\x1b[0m\x1b[90m Full native tab (120 FPS)\x1b[0m');
568
+ console.log(' \x1b[90m ─────────────────────────────────────────────────────\x1b[0m');
569
+
570
+ // TRIGGER WORDS
571
+ console.log('');
572
+ console.log(' \x1b[36m TRIGGER WORDS\x1b[0m \x1b[90m(required to activate code generation)\x1b[0m');
573
+ console.log('');
574
+ console.log(' \x1b[33m forge\x1b[0m \x1b[90m·\x1b[0m \x1b[33mcreate\x1b[0m \x1b[90m·\x1b[0m \x1b[33mupdate\x1b[0m \x1b[90m·\x1b[0m \x1b[33mmodify\x1b[0m \x1b[90m·\x1b[0m \x1b[33mfix\x1b[0m \x1b[90m·\x1b[0m \x1b[33medit\x1b[0m');
575
+ console.log('');
576
+ console.log(' \x1b[90m Without a trigger word, Alex answers but does not generate code.\x1b[0m');
516
577
 
517
- // 4. READINESS
518
- console.log('\n\x1b[32mAlex ❯\x1b[0m I am ready. Describe your feature, and I will architect the solution.');
578
+ // EXAMPLES
579
+ console.log('');
580
+ console.log(' \x1b[36m EXAMPLES\x1b[0m');
581
+ console.log('');
582
+ console.log(' \x1b[33m ›\x1b[0m \x1b[90m"\x1b[33mforge\x1b[90m a camera to scan receipts for my expense tracker"\x1b[0m');
583
+ console.log(' \x1b[33m ›\x1b[0m \x1b[90m"\x1b[33mcreate\x1b[90m a form to add products with photos to my catalog"\x1b[0m');
584
+ console.log(' \x1b[33m ›\x1b[0m \x1b[90m"\x1b[33mupdate\x1b[90m CloudCamera to save in the collection orders"\x1b[0m');
585
+
586
+ // READY
587
+ console.log('');
588
+ console.log(' \x1b[32m Alex ❯\x1b[0m Describe your feature.');
519
589
  console.log('');
520
590
 
521
591
  const rl = readline.createInterface({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.87",
3
+ "version": "1.0.89",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",