genbox 1.0.86 → 1.0.88

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.
@@ -391,16 +391,29 @@ exports.statusCommand = new commander_1.Command('status')
391
391
  sshAvailable = true;
392
392
  // Check if cloud-init is still running
393
393
  if (status.includes('running')) {
394
- // Use the total wait time from CLI's perspective (includes SSH wait)
395
- const totalWaitSecs = Math.floor((Date.now() - startTime) / 1000);
396
- console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalWaitSecs)})`));
394
+ // Calculate total elapsed including local setup time (DB dump+upload)
395
+ const createdAt = target.createdAt;
396
+ const localSetupDuration = target.localSetupDuration || 0;
397
+ // Time since genbox was created in DB
398
+ const sinceCreationSecs = createdAt
399
+ ? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
400
+ : Math.floor((Date.now() - startTime) / 1000); // Fallback to CLI start time
401
+ // Total elapsed = local setup + time since creation
402
+ const totalElapsedSecs = localSetupDuration + sinceCreationSecs;
403
+ console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
397
404
  console.log('');
398
- // Show timing breakdown so far (from server's perspective)
405
+ // Show timing breakdown
399
406
  const timing = getTimingBreakdown(target.ipAddress, keyPath);
400
- if (timing.sshReady !== null || timing.total !== null) {
401
- console.log(chalk_1.default.blue('[INFO] === Server Timing ==='));
402
- if (timing.sshReady !== null) {
403
- console.log(` SSH Ready: ${formatDuration(timing.sshReady)} (from boot)`);
407
+ if (timing.total !== null || createdAt || localSetupDuration > 0) {
408
+ console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
409
+ // Local setup time (DB dump + upload)
410
+ if (localSetupDuration > 0) {
411
+ console.log(` Local Setup: ${formatDuration(localSetupDuration)} (DB dump+upload)`);
412
+ }
413
+ // Provisioning time = time since creation - server uptime
414
+ if (timing.total !== null && createdAt) {
415
+ const provisioningSecs = Math.max(0, sinceCreationSecs - timing.total);
416
+ console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
404
417
  }
405
418
  if (timing.total !== null) {
406
419
  console.log(` Server Uptime: ${formatDuration(timing.total)}`);
@@ -485,21 +498,39 @@ exports.statusCommand = new commander_1.Command('status')
485
498
  }
486
499
  // Cloud-init still running
487
500
  if (status.includes('running')) {
488
- // Get timing breakdown
501
+ // Calculate total elapsed including local setup time (DB dump+upload)
502
+ const createdAt = target.createdAt;
503
+ const localSetupDuration = target.localSetupDuration || 0;
489
504
  const timing = getTimingBreakdown(target.ipAddress, keyPath);
490
- if (timing.total !== null) {
491
- console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(timing.total)})`));
505
+ // Time since genbox was created in DB
506
+ const sinceCreationSecs = createdAt
507
+ ? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
508
+ : timing.total; // Fallback to server uptime
509
+ // Total elapsed = local setup + time since creation
510
+ const totalElapsedSecs = sinceCreationSecs !== null
511
+ ? localSetupDuration + sinceCreationSecs
512
+ : null;
513
+ if (totalElapsedSecs !== null) {
514
+ console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
492
515
  }
493
516
  else {
494
517
  console.log(chalk_1.default.yellow('[INFO] Setup in progress...'));
495
518
  }
496
519
  console.log('');
497
- // Show timing breakdown so far
498
- if (timing.sshReady !== null) {
499
- console.log(chalk_1.default.blue('[INFO] === Timing So Far ==='));
500
- console.log(` SSH Ready: ${formatDuration(timing.sshReady)}`);
520
+ // Show timing breakdown
521
+ if (timing.total !== null || createdAt || localSetupDuration > 0) {
522
+ console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
523
+ // Local setup time (DB dump + upload)
524
+ if (localSetupDuration > 0) {
525
+ console.log(` Local Setup: ${formatDuration(localSetupDuration)} (DB dump+upload)`);
526
+ }
527
+ // Provisioning time = time since creation - server uptime
528
+ if (timing.total !== null && sinceCreationSecs !== null) {
529
+ const provisioningSecs = Math.max(0, sinceCreationSecs - timing.total);
530
+ console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
531
+ }
501
532
  if (timing.total !== null) {
502
- console.log(` Elapsed: ${formatDuration(timing.total)}`);
533
+ console.log(` Server Uptime: ${formatDuration(timing.total)}`);
503
534
  }
504
535
  console.log('');
505
536
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genbox",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
4
4
  "description": "Genbox CLI - AI-Powered Development Environments",
5
5
  "main": "dist/index.js",
6
6
  "bin": {