fleetbo-cockpit-cli 1.0.88 → 1.0.90
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.
- package/cli.js +60 -14
- 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,14 +509,41 @@ if (command === 'alex') {
|
|
|
494
509
|
process.exit(1);
|
|
495
510
|
}
|
|
496
511
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
//
|
|
500
|
-
//
|
|
501
|
-
//
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
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 to continue. \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[90mClick the \x1b[32m[+]\x1b[90m button in the Terminal top-right bar \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
|
+
}
|
|
540
|
+
|
|
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
|
+
|
|
505
547
|
console.log('');
|
|
506
548
|
console.log('\x1b[90m ┌─────────────────────────────────────────────────────────┐\x1b[0m');
|
|
507
549
|
console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
|
|
@@ -510,7 +552,11 @@ if (command === 'alex') {
|
|
|
510
552
|
console.log('\x1b[90m │\x1b[0m \x1b[90mYour JS stays the brain. I forge the metal.\x1b[0m \x1b[90m│\x1b[0m');
|
|
511
553
|
console.log('\x1b[90m │\x1b[0m \x1b[90m│\x1b[0m');
|
|
512
554
|
console.log('\x1b[90m └─────────────────────────────────────────────────────────┘\x1b[0m');
|
|
513
|
-
|
|
555
|
+
|
|
556
|
+
// AI ENGINE STATUS
|
|
557
|
+
console.log('');
|
|
558
|
+
console.log(` \x1b[32m ✓\x1b[0m ${providerLabel} \x1b[90m· ${modelLabel}\x1b[0m`);
|
|
559
|
+
|
|
514
560
|
// FORGE CAPABILITIES
|
|
515
561
|
console.log('');
|
|
516
562
|
console.log(' \x1b[36m CAPABILITIES\x1b[0m');
|
|
@@ -520,15 +566,15 @@ if (command === 'alex') {
|
|
|
520
566
|
console.log(' \x1b[1m 🏗️ Sovereign\x1b[0m\x1b[90m Form + Photo + Save-to-Cloud\x1b[0m');
|
|
521
567
|
console.log(' \x1b[1m 🖥️ Fleetbo View\x1b[0m\x1b[90m Full native tab (120 FPS)\x1b[0m');
|
|
522
568
|
console.log(' \x1b[90m ─────────────────────────────────────────────────────\x1b[0m');
|
|
523
|
-
|
|
524
|
-
// TRIGGER WORDS
|
|
569
|
+
|
|
570
|
+
// TRIGGER WORDS
|
|
525
571
|
console.log('');
|
|
526
572
|
console.log(' \x1b[36m TRIGGER WORDS\x1b[0m \x1b[90m(required to activate code generation)\x1b[0m');
|
|
527
573
|
console.log('');
|
|
528
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');
|
|
529
575
|
console.log('');
|
|
530
576
|
console.log(' \x1b[90m Without a trigger word, Alex answers but does not generate code.\x1b[0m');
|
|
531
|
-
|
|
577
|
+
|
|
532
578
|
// EXAMPLES
|
|
533
579
|
console.log('');
|
|
534
580
|
console.log(' \x1b[36m EXAMPLES\x1b[0m');
|
|
@@ -536,7 +582,7 @@ if (command === 'alex') {
|
|
|
536
582
|
console.log(' \x1b[33m ›\x1b[0m \x1b[90m"\x1b[33mforge\x1b[90m a camera to scan receipts for my expense tracker"\x1b[0m');
|
|
537
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');
|
|
538
584
|
console.log(' \x1b[33m ›\x1b[0m \x1b[90m"\x1b[33mupdate\x1b[90m CloudCamera to save in the collection orders"\x1b[0m');
|
|
539
|
-
|
|
585
|
+
|
|
540
586
|
// READY
|
|
541
587
|
console.log('');
|
|
542
588
|
console.log(' \x1b[32m Alex ❯\x1b[0m Describe your feature.');
|