fleetbo-cockpit-cli 1.0.214 → 1.0.216
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 +3 -39
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -489,51 +489,15 @@ if (command === 'alex') {
|
|
|
489
489
|
}
|
|
490
490
|
|
|
491
491
|
if (aiData.status === 'success' || aiData.status === 'message' || aiData.status === 'complex_refusal') {
|
|
492
|
-
console.log('');
|
|
493
492
|
let rawMsg = aiData.message || "I'm ready.";
|
|
494
493
|
|
|
495
494
|
if (typeof rawMsg === 'object') {
|
|
496
495
|
rawMsg = rawMsg.message || rawMsg.text || "Module generated.";
|
|
497
496
|
}
|
|
498
497
|
|
|
499
|
-
//
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
const wrapDynamic = (text, max) => {
|
|
504
|
-
return text.split('\n').map(line => {
|
|
505
|
-
// On ne casse pas l'indentation du code ou des listes
|
|
506
|
-
if (/^[\s]*[-*•\d]/.test(line) || line.startsWith(" ")) return line;
|
|
507
|
-
|
|
508
|
-
const words = line.split(' ');
|
|
509
|
-
let wrapped = [];
|
|
510
|
-
let currentLine = '';
|
|
511
|
-
|
|
512
|
-
words.forEach(word => {
|
|
513
|
-
// On vérifie si l'ajout du mot va dépasser la limite
|
|
514
|
-
// (+1 pour simuler l'espace, sauf si c'est le 1er mot de la ligne)
|
|
515
|
-
const spaceNeeded = currentLine.length > 0 ? 1 : 0;
|
|
516
|
-
|
|
517
|
-
if (currentLine.length + word.length + spaceNeeded > max) {
|
|
518
|
-
// Limite atteinte : on sauvegarde la ligne terminée et on met le mot sur la nouvelle
|
|
519
|
-
if (currentLine) wrapped.push(currentLine);
|
|
520
|
-
currentLine = word;
|
|
521
|
-
} else {
|
|
522
|
-
// Il y a de la place : on ajoute le mot à la ligne courante
|
|
523
|
-
currentLine += (spaceNeeded ? ' ' : '') + word;
|
|
524
|
-
}
|
|
525
|
-
});
|
|
526
|
-
|
|
527
|
-
// On n'oublie pas d'ajouter la toute dernière ligne
|
|
528
|
-
if (currentLine) wrapped.push(currentLine);
|
|
529
|
-
|
|
530
|
-
return wrapped.join('\n');
|
|
531
|
-
}).join('\n');
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
const formattedMsg = wrapDynamic(rawMsg, maxWidth);
|
|
535
|
-
|
|
536
|
-
console.log('\x1b[32mAlex ❯\x1b[0m \n' + formattedMsg);
|
|
498
|
+
// ON DÉLÈGUE L'AFFICHAGE AU FRONTEND (Xterm.jsx)
|
|
499
|
+
// On envoie le texte pur entouré de balises invisibles
|
|
500
|
+
console.log(`[ALEX_START]${rawMsg}[ALEX_END]`);
|
|
537
501
|
}
|
|
538
502
|
|
|
539
503
|
// --- FILE CREATION LOGIC ---
|