fleetbo-cockpit-cli 1.0.11 → 1.0.13
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 +16 -2
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -172,7 +172,21 @@ if (command === 'alex') {
|
|
|
172
172
|
|
|
173
173
|
if (aiData.status === 'success' || aiData.status === 'message' || aiData.status === 'complex_refusal') {
|
|
174
174
|
console.log('');
|
|
175
|
-
|
|
175
|
+
let rawMsg = aiData.message || "I'm ready.";
|
|
176
|
+
|
|
177
|
+
// 🛡️ SAFETY: Si le message est un JSON stringifié ou contient du code brut,
|
|
178
|
+
// on extrait uniquement la partie lisible pour le terminal.
|
|
179
|
+
if (typeof rawMsg === 'object') {
|
|
180
|
+
rawMsg = rawMsg.message || rawMsg.text || "Module generated.";
|
|
181
|
+
}
|
|
182
|
+
// Détection d'un JSON brut accidentellement injecté dans le message
|
|
183
|
+
try {
|
|
184
|
+
const testParse = JSON.parse(rawMsg);
|
|
185
|
+
if (testParse && typeof testParse === 'object' && testParse.status) {
|
|
186
|
+
rawMsg = testParse.message || "Module generated.";
|
|
187
|
+
}
|
|
188
|
+
} catch (_) { /* Not JSON, continue normally */ }
|
|
189
|
+
|
|
176
190
|
const formattedMsg = wrapText(rawMsg, 85);
|
|
177
191
|
console.log('\x1b[32mAlex ❯\x1b[0m ' + formattedMsg);
|
|
178
192
|
|
|
@@ -388,7 +402,7 @@ else if (command === 'android' || command === 'ios') {
|
|
|
388
402
|
}
|
|
389
403
|
|
|
390
404
|
// Étape 1: Build React
|
|
391
|
-
console.log(`\x1b[33m[1/3]\x1b[0m
|
|
405
|
+
console.log(`\x1b[33m[1/3]\x1b[0m Synthesizing Fleetbo Core Logic...`);
|
|
392
406
|
execSync('npm run build', { stdio: 'inherit' });
|
|
393
407
|
|
|
394
408
|
let buildDir = fs.existsSync(path.join(process.cwd(), 'dist')) ? 'dist' : 'build';
|