fleetbo-cockpit-cli 1.0.147 → 1.0.148
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 +56 -46
- 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 > 4000) {
|
|
254
|
+
console.log('\n\x1b[31m⛔ [Alex Safety] Request too long (' + prompt.length + '/4000 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
|
-
const sourceText = fs.existsSync(localKtPath) ? "LOCAL" : "CACHE";
|
|
313
|
-
process.stdout.write(` \x1b[32mFOUND METAL
|
|
312
|
+
//const sourceText = fs.existsSync(localKtPath) ? "LOCAL" : "CACHE";
|
|
313
|
+
process.stdout.write(` \x1b[32mFOUND METAL\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
|
|
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');
|
|
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');
|
|
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');
|
|
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 module to scan receipts for my expense tracker"\x1b[0m');
|
|
625
|
+
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mcreate\x1b[90m a form module to add products with photos to my catalog"\x1b[0m');
|
|
626
|
+
console.log('\x1b[33m›\x1b[0m \x1b[90m"\x1b[33mupdate\x1b[90m the CloudCamera module 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
632
|
|
|
633
633
|
const rl = readline.createInterface({
|
|
@@ -639,8 +639,9 @@ if (command === 'alex') {
|
|
|
639
639
|
process.stdout.write('\n\x1b[F');
|
|
640
640
|
rl.prompt();
|
|
641
641
|
|
|
642
|
-
let inputBuffer = "";
|
|
643
|
-
let isProcessing = false;
|
|
642
|
+
let inputBuffer = "";
|
|
643
|
+
let isProcessing = false;
|
|
644
|
+
let hintShown = false;
|
|
644
645
|
|
|
645
646
|
rl.on('line', async (line) => {
|
|
646
647
|
if (isProcessing) return;
|
|
@@ -654,29 +655,38 @@ if (command === 'alex') {
|
|
|
654
655
|
}
|
|
655
656
|
|
|
656
657
|
if (trimmedLine !== "") {
|
|
658
|
+
// Accumule silencieusement — pas de hint pendant la frappe/paste
|
|
657
659
|
inputBuffer += (inputBuffer ? "\n" : "") + line;
|
|
658
|
-
rl.setPrompt("");
|
|
659
660
|
}
|
|
660
661
|
else {
|
|
661
662
|
if (inputBuffer.trim() !== "") {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
663
|
+
if (!hintShown) {
|
|
664
|
+
// 1ère ligne vide → affiche le hint, attend la 2ème
|
|
665
|
+
hintShown = true;
|
|
666
|
+
rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
|
|
667
|
+
rl.prompt();
|
|
668
|
+
} else {
|
|
669
|
+
// 2ème ligne vide → soumet
|
|
670
|
+
hintShown = false;
|
|
671
|
+
const finalPrompt = inputBuffer.trim();
|
|
672
|
+
inputBuffer = "";
|
|
673
|
+
|
|
674
|
+
if (finalPrompt.length > 4000) {
|
|
675
|
+
console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/4000 characters).\x1b[0m`);
|
|
676
|
+
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
677
|
+
rl.prompt();
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
isProcessing = true;
|
|
682
|
+
rl.setPrompt("");
|
|
683
|
+
await processAlexRequest(finalPrompt);
|
|
684
|
+
isProcessing = false;
|
|
685
|
+
|
|
686
|
+
console.log('');
|
|
667
687
|
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
668
|
-
rl.prompt();
|
|
669
|
-
return;
|
|
688
|
+
rl.prompt();
|
|
670
689
|
}
|
|
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();
|
|
680
690
|
} else {
|
|
681
691
|
rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
|
|
682
692
|
rl.prompt();
|