fleetbo-cockpit-cli 1.0.201 → 1.0.202
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 +18 -43
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -706,6 +706,8 @@ if (command === 'alex') {
|
|
|
706
706
|
const providerLabel = aiProvider === 'anthropic' ? 'Anthropic' : 'Google AI';
|
|
707
707
|
const modelLabel = aiModel && aiModel !== 'auto' ? aiModel : 'auto';
|
|
708
708
|
|
|
709
|
+
process.stdout.write(`[ALEX_ONLINE:${dynamicUsername}]\n`);
|
|
710
|
+
|
|
709
711
|
console.log('');
|
|
710
712
|
console.log('\x1b[90m┌─────────────────────────────────────────────────────────┐\x1b[0m');
|
|
711
713
|
console.log('\x1b[90m│ │\x1b[0m');
|
|
@@ -811,58 +813,31 @@ if (command === 'alex') {
|
|
|
811
813
|
}
|
|
812
814
|
};
|
|
813
815
|
|
|
814
|
-
//
|
|
816
|
+
// LE NOUVEAU RÉCEPTEUR INTELLIGENT (Sans commandes /p ni /s)
|
|
817
|
+
let pasteTimer = null;
|
|
818
|
+
|
|
815
819
|
rl.on('line', async (line) => {
|
|
816
820
|
if (isProcessing) return;
|
|
817
821
|
|
|
818
|
-
//
|
|
819
|
-
if (isPasteMode) {
|
|
820
|
-
if (['/s', '/send', 'eof'].includes(line.trim().toLowerCase())) {
|
|
821
|
-
const finalPrompt = standardBuffer.join('\n').trim();
|
|
822
|
-
standardBuffer = [];
|
|
823
|
-
isPasteMode = false;
|
|
824
|
-
await executePrompt(finalPrompt);
|
|
825
|
-
} else {
|
|
826
|
-
standardBuffer.push(line);
|
|
827
|
-
}
|
|
828
|
-
return;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
// 2. ACTIVATION DU MODE COLLAGE (/p)
|
|
832
|
-
if (['/paste', '/p'].includes(line.trim().toLowerCase())) {
|
|
833
|
-
isPasteMode = true;
|
|
834
|
-
standardBuffer = []; // Sécurité : on vide tout
|
|
835
|
-
console.log('\x1b[36m [MULTILINE MODE] Paste your content below. Type /s on a new line to submit.\x1b[0m');
|
|
836
|
-
rl.setPrompt("");
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
// 3. LE BOUCLIER ANTI-COLLAGE SAUVAGE (Mode Chat Classique)
|
|
822
|
+
// On empile toutes les lignes reçues (qu'elles viennent du clavier ou de React)
|
|
841
823
|
standardBuffer.push(line);
|
|
842
824
|
|
|
843
|
-
|
|
844
|
-
if (pasteBlockerTimer) clearTimeout(pasteBlockerTimer);
|
|
825
|
+
if (pasteTimer) clearTimeout(pasteTimer);
|
|
845
826
|
|
|
846
|
-
|
|
847
|
-
|
|
827
|
+
// Si plusieurs lignes arrivent en moins de 30ms (vitesse d'envoi de React),
|
|
828
|
+
// on les fusionne silencieusement en un seul gros prompt !
|
|
829
|
+
pasteTimer = setTimeout(async () => {
|
|
830
|
+
pasteTimer = null;
|
|
848
831
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
rl.prompt();
|
|
832
|
+
const finalPrompt = standardBuffer.join('\n').trim();
|
|
833
|
+
standardBuffer = [];
|
|
834
|
+
|
|
835
|
+
if (finalPrompt === "") {
|
|
836
|
+
rl.prompt();
|
|
854
837
|
} else {
|
|
855
|
-
|
|
856
|
-
const finalPrompt = standardBuffer[0].trim();
|
|
857
|
-
standardBuffer = [];
|
|
858
|
-
|
|
859
|
-
if (finalPrompt === "") {
|
|
860
|
-
rl.prompt();
|
|
861
|
-
} else {
|
|
862
|
-
await executePrompt(finalPrompt);
|
|
863
|
-
}
|
|
838
|
+
await executePrompt(finalPrompt);
|
|
864
839
|
}
|
|
865
|
-
},
|
|
840
|
+
}, 30);
|
|
866
841
|
});
|
|
867
842
|
};
|
|
868
843
|
|