fleetbo-cockpit-cli 1.0.219 → 1.0.220
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 +12 -3
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -36,7 +36,7 @@ process.env.DOTENV_SILENT = 'true';
|
|
|
36
36
|
const envPath = path.join(process.cwd(), '.env');
|
|
37
37
|
|
|
38
38
|
if (!fs.existsSync(envPath)) {
|
|
39
|
-
console.error('\x1b[31m%s\x1b[0m', 'Error
|
|
39
|
+
console.error('\x1b[31m%s\x1b[0m', '[Error] Configuration file (.env) not found.');
|
|
40
40
|
console.error('\x1b[90m%s\x1b[0m', 'Make sure you are in a Fleetbo project directory.\n');
|
|
41
41
|
process.exit(1);
|
|
42
42
|
}
|
|
@@ -314,7 +314,6 @@ if (command === 'alex') {
|
|
|
314
314
|
if (cacheRes.found !== false && cacheRes.modules && cacheRes.modules.length > 0) {
|
|
315
315
|
console.log(`\x1b[36m[Fleetbo OS Modules] (${cacheRes.modules.length}):\x1b[0m`);
|
|
316
316
|
cacheRes.modules.forEach(m => {
|
|
317
|
-
const metalColor = m.platform === 'android' ? '\x1b[32m' : '\x1b[34m';
|
|
318
317
|
console.log(`[${m.platform}] \x1b[1m${m.moduleName}\x1b[0m`);
|
|
319
318
|
});
|
|
320
319
|
} else {
|
|
@@ -442,6 +441,8 @@ if (command === 'alex') {
|
|
|
442
441
|
|
|
443
442
|
process.stdout.write('\x1b[A\r' + ' '.repeat(50) + '\r');
|
|
444
443
|
|
|
444
|
+
let totalTokens = 0;
|
|
445
|
+
|
|
445
446
|
// --- STEP 1: NATIVE ---
|
|
446
447
|
logStep('[1/3]', '\x1b[33mAlex is forging native foundations...\x1b[0m');
|
|
447
448
|
let aiData = await fetchStep('native_only');
|
|
@@ -451,6 +452,8 @@ if (command === 'alex') {
|
|
|
451
452
|
return;
|
|
452
453
|
}
|
|
453
454
|
|
|
455
|
+
totalTokens += aiData.tokensUsed || 0;
|
|
456
|
+
|
|
454
457
|
let mergedModuleData = aiData.moduleData || {};
|
|
455
458
|
let aiDataMessage = aiData.message;
|
|
456
459
|
|
|
@@ -467,6 +470,7 @@ if (command === 'alex') {
|
|
|
467
470
|
mergedModuleData.mockCode = aiData2.moduleData.mockCode;
|
|
468
471
|
mergedModuleData.mockFileName = aiData2.moduleData.mockFileName;
|
|
469
472
|
}
|
|
473
|
+
totalTokens += aiData2.tokensUsed || 0;
|
|
470
474
|
logStep('[2/3]', '\x1b[32mInterface Mock generated.\x1b[0m\n');
|
|
471
475
|
|
|
472
476
|
// --- STEP 3: JSON CONFIG ---
|
|
@@ -481,6 +485,7 @@ if (command === 'alex') {
|
|
|
481
485
|
mergedModuleData.dataSchema = aiData3.moduleData.dataSchema;
|
|
482
486
|
mergedModuleData.uiSchema = aiData3.moduleData.uiSchema;
|
|
483
487
|
}
|
|
488
|
+
totalTokens += aiData3.tokensUsed || 0;
|
|
484
489
|
logStep('[3/3]', '\x1b[32mConfiguration completed.\x1b[0m\n');
|
|
485
490
|
} else {
|
|
486
491
|
process.stdout.write(`\x1b[2K\r`);
|
|
@@ -557,6 +562,10 @@ if (command === 'alex') {
|
|
|
557
562
|
console.log(`\x1b[33mpatch module\x1b[0m \x1b[36m${moduleName}\x1b[0m \x1b[33mandroid\x1b[0m \x1b[90m(or ios)\x1b[0m`);
|
|
558
563
|
console.log('\x1b[90mTo eradicate this module later, open a new terminal and type:\x1b[0m');
|
|
559
564
|
console.log(`\x1b[31mnpm run fleetbo rm\x1b[0m \x1b[36m${moduleName}\x1b[0m`);
|
|
565
|
+
|
|
566
|
+
if (totalTokens > 0) {
|
|
567
|
+
console.log(`\x1b[90m[Telemetry] Total tokens consumed for this forge: ${totalTokens}\x1b[0m\n`);
|
|
568
|
+
}
|
|
560
569
|
|
|
561
570
|
} else if (aiData.status === 'success' && (!mergedModuleData || Object.keys(mergedModuleData).length === 0)) {
|
|
562
571
|
console.log('\x1b[31m[Error] Alex replied, but source code could not be extracted.\x1b[0m\n');
|
|
@@ -631,7 +640,7 @@ if (command === 'alex') {
|
|
|
631
640
|
|
|
632
641
|
console.log('\x1b[90m┌─────────────────────────────────────────────────────────┐\x1b[0m');
|
|
633
642
|
console.log('\x1b[90m│ │\x1b[0m');
|
|
634
|
-
console.log('\x1b[90m│\x1b[0m \x1b[1m\x1b[36m[ALEX]\x1b[0m \x1b[90m— System Architect · Fleetbo OS\x1b[0m
|
|
643
|
+
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');
|
|
635
644
|
console.log('\x1b[90m│ │\x1b[0m');
|
|
636
645
|
console.log('\x1b[90m│\x1b[0m \x1b[90mYour JS stays the brain. I forge the metal.\x1b[0m \x1b[90m│\x1b[0m');
|
|
637
646
|
console.log('\x1b[90m│ │\x1b[0m');
|