fleetbo-cockpit-cli 1.0.113 → 1.0.114

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.
Files changed (2) hide show
  1. package/cli.js +63 -120
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -587,159 +587,102 @@ 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│\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');
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(`\x1b[32m✓\x1b[0m ${providerLabel} \x1b[90m· ${modelLabel}\x1b[0m`);
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[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');
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[36mTRIGGER WORDS\x1b[0m \x1b[90m(required to activate code generation)\x1b[0m');
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[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');
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[90mWithout a trigger word, Alex answers but does not generate code.\x1b[0m');
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[36mEXAMPLES\x1b[0m');
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 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');
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[32mAlex ❯\x1b[0m Describe your feature.');
630
+ console.log(' \x1b[32m Alex ❯\x1b[0m Describe your feature.');
631
631
  console.log('');
632
-
633
- const rl = readline.createInterface({
634
- input: process.stdin,
632
+
633
+ const rl = readline.createInterface({
634
+ input: process.stdin,
635
635
  output: process.stdout,
636
- prompt: `\x1b[34m${dynamicUsername} ❯ \x1b[0m`
636
+ prompt: `\x1b[34m${dynamicUsername} ❯ \x1b[0m`
637
637
  });
638
+
639
+ process.stdout.write('\n\x1b[F');
640
+ rl.prompt();
638
641
 
639
- // Active les events keypress sur stdin pour détecter le paste
640
- readline.emitKeypressEvents(process.stdin, rl);
641
- if (process.stdin.isTTY) process.stdin.setRawMode(true);
642
-
643
- let inputBuffer = "";
644
- let isProcessing = false;
645
- let currentLine = "";
646
- let isPasting = false;
647
- let pasteTimer = null;
648
-
649
- const resetPrompt = () => {
650
- rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
651
- rl.prompt(true);
652
- };
653
-
654
- const submit = async () => {
655
- const finalPrompt = inputBuffer.trim();
656
- inputBuffer = "";
657
- currentLine = "";
658
-
659
- if (!finalPrompt) { resetPrompt(); return; }
660
-
661
- if (finalPrompt.length > 1000) {
662
- console.log(`\n\x1b[31m⛔ [Alex Safety] Mission rejected: Excessive size (${finalPrompt.length}/1000 characters).\x1b[0m`);
663
- resetPrompt();
664
- return;
665
- }
666
-
667
- isProcessing = true;
668
- rl.setPrompt("");
669
- process.stdout.write('\n');
670
- await processAlexRequest(finalPrompt);
671
- isProcessing = false;
672
- console.log('');
673
- resetPrompt();
674
- };
642
+ let inputBuffer = "";
643
+ let isProcessing = false;
675
644
 
676
- // Keypress : détecte si c'est un paste (chunk > 1 char) ou frappe normale
677
- process.stdin.on('keypress', (char, key) => {
678
- if (isProcessing) return;
645
+ rl.on('line', async (line) => {
646
+ if (isProcessing) return;
679
647
 
680
- // Ctrl+C
681
- if (key && key.ctrl && key.name === 'c') {
682
- console.log('\n\x1b[90mAlex session closed.\x1b[0m');
683
- process.exit(0);
684
- }
648
+ const trimmedLine = line.trim();
685
649
 
686
- // Entrée : soumettre si buffer non vide
687
- if (key && (key.name === 'return' || key.name === 'enter')) {
688
- if (inputBuffer.trim() !== "") {
689
- submit();
690
- }
691
- return;
650
+ if (['exit', 'quit'].includes(trimmedLine.toLowerCase())) {
651
+ console.log('\n\x1b[90m Alex session closed.\x1b[0m');
652
+ rl.close();
653
+ return;
692
654
  }
693
655
 
694
- // Paste : char arrive avec plusieurs caractères d'un coup
695
- if (char && char.length > 1) {
696
- isPasting = true;
697
- if (pasteTimer) clearTimeout(pasteTimer);
698
- // Accumule dans inputBuffer via readline line event
699
- pasteTimer = setTimeout(() => {
700
- isPasting = false;
701
- // Affiche le hint après le paste
702
- process.stdout.write(`\n\x1b[90m↵ to send · keep typing to add more\x1b[0m`);
703
- rl.setPrompt(`\n\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
704
- rl.prompt(true);
705
- }, 50);
706
- }
707
- });
708
-
709
- // Line event : accumule les lignes dans le buffer
710
- rl.on('line', (line) => {
711
- if (isProcessing) return;
712
-
713
- if (isPasting) {
714
- // Pendant un paste : accumule sans soumettre
656
+ if (trimmedLine !== "") {
715
657
  inputBuffer += (inputBuffer ? "\n" : "") + line;
716
- return;
717
- }
718
-
719
- const trimmed = line.trim();
720
- if (['exit', 'quit'].includes(trimmed.toLowerCase())) {
721
- console.log('\n\x1b[90mAlex session closed.\x1b[0m');
722
- process.exit(0);
723
- }
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
+ }
724
671
 
725
- if (trimmed !== "") {
726
- inputBuffer += (inputBuffer ? "\n" : "") + line;
727
- // Hint de confirmation après frappe normale
728
- process.stdout.write(`\x1b[90m ↵ to send · keep typing to add more\x1b[0m\n`);
729
- rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
730
- rl.prompt(true);
731
- } else {
732
- // Ligne vide = soumettre
733
- if (inputBuffer.trim()) {
734
- submit();
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();
735
680
  } else {
736
- resetPrompt();
681
+ rl.setPrompt(`\x1b[34m${dynamicUsername} ❯ \x1b[0m`);
682
+ rl.prompt();
737
683
  }
738
684
  }
739
685
  });
740
-
741
- process.stdout.write('\n');
742
- resetPrompt();
743
686
  };
744
687
 
745
688
  if (!initialPrompt || initialPrompt === '?') startAlexSession();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.113",
3
+ "version": "1.0.114",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",