fleetbo-cockpit-cli 1.0.109 → 1.0.111
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 +70 -62
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ const axios = require('axios');
|
|
|
12
12
|
const dotenv = require('dotenv');
|
|
13
13
|
const os = require('os');
|
|
14
14
|
const archiver = require('archiver');
|
|
15
|
-
|
|
15
|
+
const readline = require('readline');
|
|
16
16
|
|
|
17
17
|
// ============================================
|
|
18
18
|
// FLEETBO CLI - Centralized Package
|
|
@@ -587,95 +587,103 @@ if (command === 'alex') {
|
|
|
587
587
|
const modelLabel = aiModel && aiModel !== 'auto' ? aiModel : 'auto';
|
|
588
588
|
|
|
589
589
|
console.log('');
|
|
590
|
-
console.log('\x1b[90m
|
|
591
|
-
console.log('\x1b[90m
|
|
592
|
-
console.log('\x1b[90m
|
|
593
|
-
console.log('\x1b[90m
|
|
594
|
-
console.log('\x1b[90m
|
|
595
|
-
console.log('\x1b[90m
|
|
596
|
-
console.log('\x1b[90m
|
|
590
|
+
console.log('\x1b[90m┌─────────────────────────────────────────────────────────┐\x1b[0m');
|
|
591
|
+
console.log('\x1b[90m│\x1b[0m \x1b[90m│\x1b[0m');
|
|
592
|
+
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');
|
|
593
|
+
console.log('\x1b[90m│\x1b[0m \x1b[90m│\x1b[0m');
|
|
594
|
+
console.log('\x1b[90m│\x1b[0m \x1b[90mYour JS stays the brain. I forge the metal.\x1b[0m \x1b[90m│\x1b[0m');
|
|
595
|
+
console.log('\x1b[90m│\x1b[0m \x1b[90m│\x1b[0m');
|
|
596
|
+
console.log('\x1b[90m└─────────────────────────────────────────────────────────┘\x1b[0m');
|
|
597
597
|
|
|
598
598
|
// AI ENGINE STATUS
|
|
599
599
|
console.log('');
|
|
600
|
-
console.log(
|
|
600
|
+
console.log(`\x1b[32m✓\x1b[0m ${providerLabel} \x1b[90m· ${modelLabel}\x1b[0m`);
|
|
601
601
|
|
|
602
602
|
// FORGE CAPABILITIES
|
|
603
603
|
console.log('');
|
|
604
|
-
console.log('
|
|
605
|
-
console.log('
|
|
606
|
-
console.log('
|
|
607
|
-
console.log('
|
|
608
|
-
console.log('
|
|
609
|
-
console.log('
|
|
610
|
-
console.log('
|
|
604
|
+
console.log('\x1b[36mCAPABILITIES\x1b[0m');
|
|
605
|
+
console.log('\x1b[90m─────────────────────────────────────────────────────\x1b[0m');
|
|
606
|
+
console.log('\x1b[1mHardware\x1b[0m\x1b[90m Camera · Scanner · GPS · Biometrics\x1b[0m');
|
|
607
|
+
console.log('\x1b[1mHigh-Perf\x1b[0m\x1b[90m Video Feed · Swipe Deck · Audio\x1b[0m');
|
|
608
|
+
console.log('\x1b[1mSovereign\x1b[0m\x1b[90m Form + Photo + Save-to-Cloud\x1b[0m');
|
|
609
|
+
console.log('\x1b[1mFleetbo View\x1b[0m\x1b[90m Full native tab (120 FPS)\x1b[0m');
|
|
610
|
+
console.log('\x1b[90m─────────────────────────────────────────────────────\x1b[0m');
|
|
611
611
|
|
|
612
612
|
// TRIGGER WORDS
|
|
613
613
|
console.log('');
|
|
614
|
-
console.log('
|
|
614
|
+
console.log('\x1b[36mTRIGGER WORDS\x1b[0m \x1b[90m(required to activate code generation)\x1b[0m');
|
|
615
615
|
console.log('');
|
|
616
|
-
console.log('
|
|
616
|
+
console.log('\x1b[33mforge\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');
|
|
617
617
|
console.log('');
|
|
618
|
-
console.log('
|
|
618
|
+
console.log('\x1b[90mWithout a trigger word, Alex answers but does not generate code.\x1b[0m');
|
|
619
619
|
|
|
620
620
|
// EXAMPLES
|
|
621
621
|
console.log('');
|
|
622
|
-
console.log('
|
|
622
|
+
console.log('\x1b[36mEXAMPLES\x1b[0m');
|
|
623
623
|
console.log('');
|
|
624
|
-
console.log('
|
|
625
|
-
console.log('
|
|
626
|
-
console.log('
|
|
624
|
+
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mforge\x1b[90m a camera to scan receipts for my expense tracker"\x1b[0m');
|
|
625
|
+
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mcreate\x1b[90m a form to add products with photos to my catalog"\x1b[0m');
|
|
626
|
+
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mupdate\x1b[90m CloudCamera to save in the collection orders"\x1b[0m');
|
|
627
627
|
|
|
628
628
|
// READY
|
|
629
629
|
console.log('');
|
|
630
|
-
console.log('
|
|
630
|
+
console.log('\x1b[32mAlex ❯\x1b[0m Describe your feature.');
|
|
631
631
|
console.log('');
|
|
632
|
-
|
|
633
|
-
// ── Boucle interactive avec @inquirer/prompts ──
|
|
634
|
-
// Soumet sur une seule Entrée, gère le paste multi-lignes correctement,
|
|
635
|
-
// curseur clignotant natif du terminal.
|
|
636
|
-
const { input } = await import('@inquirer/prompts');
|
|
637
632
|
|
|
633
|
+
const rl = readline.createInterface({
|
|
634
|
+
input: process.stdin,
|
|
635
|
+
output: process.stdout,
|
|
636
|
+
prompt: `\x1b[34m${dynamicUsername} ❯ \x1b[0m`
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
process.stdout.write('\n\x1b[F');
|
|
640
|
+
rl.prompt();
|
|
641
|
+
|
|
642
|
+
let inputBuffer = "";
|
|
638
643
|
let isProcessing = false;
|
|
639
644
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
answer = await input({
|
|
645
|
-
message: `\x1b[34m${dynamicUsername} ❯\x1b[0m`,
|
|
646
|
-
theme: {
|
|
647
|
-
prefix: '',
|
|
648
|
-
style: { answer: (t) => `\x1b[0m${t}` }
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
} catch (e) {
|
|
652
|
-
// Ctrl+C ou Ctrl+D
|
|
653
|
-
console.log('\n\x1b[90m Alex session closed.\x1b[0m');
|
|
654
|
-
process.exit(0);
|
|
655
|
-
}
|
|
645
|
+
rl.on('line', async (line) => {
|
|
646
|
+
if (isProcessing) return;
|
|
647
|
+
|
|
648
|
+
const trimmedLine = line.trim();
|
|
656
649
|
|
|
657
|
-
|
|
650
|
+
if (['exit', 'quit'].includes(trimmedLine.toLowerCase())) {
|
|
651
|
+
console.log('\n\x1b[90m Alex session closed.\x1b[0m');
|
|
652
|
+
rl.close();
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
658
655
|
|
|
659
|
-
|
|
656
|
+
if (trimmedLine !== "") {
|
|
657
|
+
// Accumule + invite à confirmer
|
|
658
|
+
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
659
|
+
rl.setPrompt(" \x1b[90m↵ to confirm · type more to add lines\x1b[0m\n ");
|
|
660
|
+
rl.prompt();
|
|
661
|
+
} else {
|
|
662
|
+
if (inputBuffer.trim() !== "") {
|
|
663
|
+
const finalPrompt = inputBuffer.trim();
|
|
664
|
+
inputBuffer = "";
|
|
665
|
+
|
|
666
|
+
if (finalPrompt.length > 1000) {
|
|
667
|
+
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/1000 characters).\x1b[0m`);
|
|
668
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
669
|
+
rl.prompt();
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
660
672
|
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
673
|
+
isProcessing = true;
|
|
674
|
+
rl.setPrompt("");
|
|
675
|
+
await processAlexRequest(finalPrompt);
|
|
676
|
+
isProcessing = false;
|
|
665
677
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
678
|
+
console.log('');
|
|
679
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
680
|
+
rl.prompt();
|
|
681
|
+
} else {
|
|
682
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
683
|
+
rl.prompt();
|
|
669
684
|
}
|
|
670
|
-
|
|
671
|
-
isProcessing = true;
|
|
672
|
-
await processAlexRequest(trimmed);
|
|
673
|
-
isProcessing = false;
|
|
674
|
-
console.log('');
|
|
675
685
|
}
|
|
676
|
-
};
|
|
677
|
-
|
|
678
|
-
runLoop();
|
|
686
|
+
});
|
|
679
687
|
};
|
|
680
688
|
|
|
681
689
|
if (!initialPrompt || initialPrompt === '?') startAlexSession();
|