fleetbo-cockpit-cli 1.0.145 → 1.0.146
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 -81
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -250,8 +250,8 @@ if (command === 'alex') {
|
|
|
250
250
|
const initialPrompt = args.slice(1).join(' ');
|
|
251
251
|
|
|
252
252
|
const processAlexRequest = async (prompt) => {
|
|
253
|
-
if (prompt.length >
|
|
254
|
-
console.log('\n\x1b[31m⛔ [Alex Safety] Request too long (' + prompt.length + '/
|
|
253
|
+
if (prompt.length > 1000) {
|
|
254
|
+
console.log('\n\x1b[31m⛔ [Alex Safety] Request too long (' + prompt.length + '/1000 chars).\x1b[0m');
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
257
|
|
|
@@ -309,8 +309,8 @@ if (command === 'alex') {
|
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
if (actualMetalCode) {
|
|
312
|
-
|
|
313
|
-
process.stdout.write(` \x1b[32mFOUND METAL\x1b[0m\n`);
|
|
312
|
+
const sourceText = fs.existsSync(localKtPath) ? "LOCAL" : "CACHE";
|
|
313
|
+
process.stdout.write(` \x1b[32mFOUND METAL (${sourceText})\x1b[0m\n`);
|
|
314
314
|
|
|
315
315
|
// Extraction des schémas mémoires (uniquement dispo dans le cache cloud)
|
|
316
316
|
let memoryScript = "";
|
|
@@ -587,47 +587,47 @@ if (command === 'alex') {
|
|
|
587
587
|
const modelLabel = aiModel && aiModel !== 'auto' ? aiModel : 'auto';
|
|
588
588
|
|
|
589
589
|
console.log('');
|
|
590
|
-
console.log('\x1b[90m┌─────────────────────────────────────────────────────────┐\x1b[0m');
|
|
591
|
-
console.log('\x1b[90m
|
|
592
|
-
console.log('\x1b[90m│\x1b[0m
|
|
593
|
-
console.log('\x1b[90m
|
|
594
|
-
console.log('\x1b[90m│\x1b[0m
|
|
595
|
-
console.log('\x1b[90m
|
|
596
|
-
console.log('\x1b[90m└─────────────────────────────────────────────────────────┘\x1b[0m');
|
|
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('\x1b[
|
|
605
|
-
console.log('\x1b[90m─────────────────────────────────────────────────────\x1b[0m');
|
|
606
|
-
console.log('\x1b[
|
|
607
|
-
console.log('\x1b[
|
|
608
|
-
console.log('\x1b[
|
|
609
|
-
console.log('\x1b[
|
|
610
|
-
console.log('\x1b[90m─────────────────────────────────────────────────────\x1b[0m');
|
|
604
|
+
console.log(' \x1b[36m CAPABILITIES\x1b[0m');
|
|
605
|
+
console.log(' \x1b[90m ─────────────────────────────────────────────────────\x1b[0m');
|
|
606
|
+
console.log(' \x1b[1m Hardware\x1b[0m\x1b[90m Camera · Scanner · GPS · Biometrics\x1b[0m');
|
|
607
|
+
console.log(' \x1b[1m High-Perf\x1b[0m\x1b[90m Video Feed · Swipe Deck · Audio\x1b[0m');
|
|
608
|
+
console.log(' \x1b[1m Sovereign\x1b[0m\x1b[90m Form + Photo + Save-to-Cloud\x1b[0m');
|
|
609
|
+
console.log(' \x1b[1m Fleetbo 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('\x1b[
|
|
614
|
+
console.log(' \x1b[36m TRIGGER WORDS\x1b[0m \x1b[90m(required to activate code generation)\x1b[0m');
|
|
615
615
|
console.log('');
|
|
616
|
-
console.log('\x1b[
|
|
616
|
+
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');
|
|
617
617
|
console.log('');
|
|
618
|
-
console.log('\x1b[
|
|
618
|
+
console.log(' \x1b[90m Without a trigger word, Alex answers but does not generate code.\x1b[0m');
|
|
619
619
|
|
|
620
620
|
// EXAMPLES
|
|
621
621
|
console.log('');
|
|
622
|
-
console.log('\x1b[
|
|
622
|
+
console.log(' \x1b[36m EXAMPLES\x1b[0m');
|
|
623
623
|
console.log('');
|
|
624
|
-
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mforge\x1b[90m a camera
|
|
625
|
-
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mcreate\x1b[90m a form
|
|
626
|
-
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mupdate\x1b[90m
|
|
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('\x1b[
|
|
630
|
+
console.log(' \x1b[32m Alex ❯\x1b[0m Describe your feature.');
|
|
631
631
|
console.log('');
|
|
632
632
|
|
|
633
633
|
const rl = readline.createInterface({
|
|
@@ -639,69 +639,48 @@ if (command === 'alex') {
|
|
|
639
639
|
process.stdout.write('\n\x1b[F');
|
|
640
640
|
rl.prompt();
|
|
641
641
|
|
|
642
|
-
let inputBuffer =
|
|
643
|
-
let isProcessing = false;
|
|
644
|
-
let isPasteMode = false;
|
|
642
|
+
let inputBuffer = "";
|
|
643
|
+
let isProcessing = false;
|
|
645
644
|
|
|
646
|
-
|
|
647
|
-
if (
|
|
645
|
+
rl.on('line', async (line) => {
|
|
646
|
+
if (isProcessing) return;
|
|
647
|
+
|
|
648
|
+
const trimmedLine = line.trim();
|
|
649
|
+
|
|
650
|
+
if (['exit', 'quit'].includes(trimmedLine.toLowerCase())) {
|
|
648
651
|
console.log('\n\x1b[90m Alex session closed.\x1b[0m');
|
|
649
652
|
rl.close();
|
|
650
653
|
return;
|
|
651
654
|
}
|
|
652
|
-
if (text !== "") {
|
|
653
|
-
if (text.length > 4000) {
|
|
654
|
-
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${text.length}/4000 characters).\x1b[0m`);
|
|
655
|
-
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
656
|
-
rl.prompt();
|
|
657
|
-
return;
|
|
658
|
-
}
|
|
659
|
-
isProcessing = true;
|
|
660
|
-
rl.setPrompt("");
|
|
661
|
-
await processAlexRequest(text);
|
|
662
|
-
isProcessing = false;
|
|
663
|
-
console.log('');
|
|
664
|
-
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
665
|
-
rl.prompt();
|
|
666
|
-
} else {
|
|
667
|
-
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
668
|
-
rl.prompt();
|
|
669
|
-
}
|
|
670
|
-
};
|
|
671
655
|
|
|
672
|
-
|
|
673
|
-
|
|
656
|
+
if (trimmedLine !== "") {
|
|
657
|
+
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
658
|
+
rl.setPrompt("");
|
|
659
|
+
}
|
|
660
|
+
else {
|
|
661
|
+
if (inputBuffer.trim() !== "") {
|
|
662
|
+
const finalPrompt = inputBuffer.trim();
|
|
663
|
+
inputBuffer = "";
|
|
664
|
+
|
|
665
|
+
if (finalPrompt.length > 1000) {
|
|
666
|
+
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/1000 characters).\x1b[0m`);
|
|
667
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
668
|
+
rl.prompt();
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
674
671
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
672
|
+
isProcessing = true;
|
|
673
|
+
rl.setPrompt("");
|
|
674
|
+
await processAlexRequest(finalPrompt);
|
|
675
|
+
isProcessing = false;
|
|
676
|
+
|
|
677
|
+
console.log('');
|
|
678
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
679
|
+
rl.prompt();
|
|
683
680
|
} else {
|
|
684
|
-
|
|
685
|
-
|
|
681
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
682
|
+
rl.prompt();
|
|
686
683
|
}
|
|
687
|
-
return;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
// 2. ACTIVATION DU MODE COLLAGE
|
|
691
|
-
if (line.trim().toLowerCase() === "/paste") {
|
|
692
|
-
isPasteMode = true;
|
|
693
|
-
console.log('\x1b[36m [Mode Éditeur] Collez votre long texte ici. Tapez EOF sur une nouvelle ligne pour envoyer.\x1b[0m');
|
|
694
|
-
// On efface le prompt "jojo ❯" pour que ton code collé s'affiche parfaitement !
|
|
695
|
-
rl.setPrompt("");
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
// 3. MODE CHAT CLASSIQUE (1 Entrée = 1 Envoi)
|
|
700
|
-
const finalPrompt = line.trim();
|
|
701
|
-
if (finalPrompt === "") {
|
|
702
|
-
rl.prompt(); // Touche Entrée dans le vide
|
|
703
|
-
} else {
|
|
704
|
-
await executePrompt(finalPrompt); // Envoi instantané
|
|
705
684
|
}
|
|
706
685
|
});
|
|
707
686
|
};
|