genbox 1.0.86 → 1.0.87

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,21 @@ 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 from genbox creation time (DB timestamp)
395
+ const createdAt = target.createdAt;
396
+ const totalElapsedSecs = createdAt
397
+ ? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
398
+ : Math.floor((Date.now() - startTime) / 1000); // Fallback to CLI start time
399
+ console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
397
400
  console.log('');
398
- // Show timing breakdown so far (from server's perspective)
401
+ // Show timing breakdown
399
402
  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)`);
403
+ if (timing.total !== null || createdAt) {
404
+ console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
405
+ // Provisioning time = total elapsed - server uptime
406
+ if (timing.total !== null && createdAt) {
407
+ const provisioningSecs = Math.max(0, totalElapsedSecs - timing.total);
408
+ console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
404
409
  }
405
410
  if (timing.total !== null) {
406
411
  console.log(` Server Uptime: ${formatDuration(timing.total)}`);
@@ -485,21 +490,29 @@ exports.statusCommand = new commander_1.Command('status')
485
490
  }
486
491
  // Cloud-init still running
487
492
  if (status.includes('running')) {
488
- // Get timing breakdown
493
+ // Calculate total elapsed from genbox creation time (DB timestamp)
494
+ const createdAt = target.createdAt;
489
495
  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)})`));
496
+ const totalElapsedSecs = createdAt
497
+ ? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
498
+ : timing.total; // Fallback to server uptime
499
+ if (totalElapsedSecs !== null) {
500
+ console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
492
501
  }
493
502
  else {
494
503
  console.log(chalk_1.default.yellow('[INFO] Setup in progress...'));
495
504
  }
496
505
  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)}`);
506
+ // Show timing breakdown
507
+ if (timing.total !== null || createdAt) {
508
+ console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
509
+ // Provisioning time = total elapsed - server uptime
510
+ if (timing.total !== null && totalElapsedSecs !== null) {
511
+ const provisioningSecs = Math.max(0, totalElapsedSecs - timing.total);
512
+ console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
513
+ }
501
514
  if (timing.total !== null) {
502
- console.log(` Elapsed: ${formatDuration(timing.total)}`);
515
+ console.log(` Server Uptime: ${formatDuration(timing.total)}`);
503
516
  }
504
517
  console.log('');
505
518
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genbox",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
4
4
  "description": "Genbox CLI - AI-Powered Development Environments",
5
5
  "main": "dist/index.js",
6
6
  "bin": {