fleetbo-cockpit-cli 1.0.144 → 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 +59 -88
- 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,78 +639,49 @@ 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 burstTimer = null;
|
|
645
|
-
let isPastingMode = false;
|
|
642
|
+
let inputBuffer = "";
|
|
643
|
+
let isProcessing = false;
|
|
646
644
|
|
|
647
|
-
|
|
648
|
-
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())) {
|
|
649
651
|
console.log('\n\x1b[90m Alex session closed.\x1b[0m');
|
|
650
652
|
rl.close();
|
|
651
653
|
return;
|
|
652
654
|
}
|
|
653
|
-
if (text !== "") {
|
|
654
|
-
if (text.length > 4000) {
|
|
655
|
-
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${text.length}/4000 characters).\x1b[0m`);
|
|
656
|
-
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
657
|
-
rl.prompt();
|
|
658
|
-
return;
|
|
659
|
-
}
|
|
660
|
-
isProcessing = true;
|
|
661
|
-
rl.setPrompt("");
|
|
662
|
-
await processAlexRequest(text);
|
|
663
|
-
isProcessing = false;
|
|
664
|
-
console.log('');
|
|
665
|
-
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
666
|
-
rl.prompt();
|
|
667
|
-
} else {
|
|
668
|
-
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
669
|
-
rl.prompt();
|
|
670
|
-
}
|
|
671
|
-
};
|
|
672
|
-
|
|
673
|
-
rl.on('line', (line) => {
|
|
674
|
-
if (isProcessing) return;
|
|
675
655
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
// 2. ACCUMULATION
|
|
686
|
-
inputBuffer.push(line);
|
|
687
|
-
|
|
688
|
-
if (burstTimer) clearTimeout(burstTimer);
|
|
689
|
-
|
|
690
|
-
// 3. ANALYSE (100ms après la dernière ligne reçue)
|
|
691
|
-
burstTimer = setTimeout(() => {
|
|
692
|
-
burstTimer = null;
|
|
693
|
-
|
|
694
|
-
// Si on a DÉJÀ basculé en mode collage, on reste silencieux !
|
|
695
|
-
if (isPastingMode) return;
|
|
696
|
-
|
|
697
|
-
if (inputBuffer.length === 1) {
|
|
698
|
-
// 👉 CAS A : Une seule ligne tapée. Envoi immédiat !
|
|
699
|
-
const finalPrompt = inputBuffer[0].trim();
|
|
700
|
-
inputBuffer = [];
|
|
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 = "";
|
|
701
664
|
|
|
702
|
-
if (finalPrompt
|
|
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`);
|
|
703
668
|
rl.prompt();
|
|
704
|
-
|
|
705
|
-
executePrompt(finalPrompt);
|
|
669
|
+
return;
|
|
706
670
|
}
|
|
671
|
+
|
|
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();
|
|
707
680
|
} else {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
// Aucun message, aucun 'rl.prompt()', on laisse le terminal respirer.
|
|
711
|
-
isPastingMode = true;
|
|
681
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
682
|
+
rl.prompt();
|
|
712
683
|
}
|
|
713
|
-
}
|
|
684
|
+
}
|
|
714
685
|
});
|
|
715
686
|
};
|
|
716
687
|
|