@skrr-ai/cli 0.1.160 → 0.1.162

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.
@@ -226,11 +226,16 @@ function describePowerDecisionLines(decision) {
226
226
  * the decision text already carries (the server appends it while the machine is stopped) is not
227
227
  * repeated.
228
228
  */
229
- function describeLastAutoStopLines(last, decisionDetail = '', when = {}) {
229
+ function describeLastAutoStopLines(last, decisionDetail = '', when = {},
230
+ /** The summary's `workspaceVolumeMissing`: when true a false stop's fix promises no files (OSK-23526). */
231
+ facts = {}) {
230
232
  if (!last)
231
233
  return { lines: [], fix: null };
232
234
  const lines = [];
233
- const verdict = (0, data_provider_1.describeAutoStopVerdict)(last.verdict, { evidence: last.evidence });
235
+ const verdict = (0, data_provider_1.describeAutoStopVerdict)(last.verdict, {
236
+ evidence: last.evidence,
237
+ workspaceVolumeMissing: facts.workspaceVolumeMissing,
238
+ });
234
239
  const atText = last.at ? ` at ${(0, format_1.formatWhen)(last.at, when)}` : '';
235
240
  lines.push(`Auto stop: ${verdict ? `${verdict.label} (${verdict.verdict})` : 'not checked yet'}${atText}`);
236
241
  const checkpoint = (0, data_provider_1.describeMachineCheckpointOutcome)(last.checkpointOutcome, { action: 'stop' });
@@ -332,7 +337,9 @@ function describePowerSummary(summary, when = {}) {
332
337
  }
333
338
  }
334
339
  lines.push(...describePendingStopLines(summary, when));
335
- lines.push(...describeLastAutoStopLines(summary.lastAutoStop, summary.decision?.detail, when).lines);
340
+ lines.push(...describeLastAutoStopLines(summary.lastAutoStop, summary.decision?.detail, when, {
341
+ workspaceVolumeMissing: summary.workspaceVolumeMissing,
342
+ }).lines);
336
343
  lines.push(...describeLastWakeDecisionLines(summary.lastWakeDecision, when));
337
344
  if (summary.holders === null) {
338
345
  lines.push('Holders: not checked (the machine is not running)');
@@ -346,12 +353,15 @@ function describePowerSummary(summary, when = {}) {
346
353
  lines.push(` - ${formatHolder(h, when)}`);
347
354
  }
348
355
  lines.push(`This month: ${formatUsage(summary.usage)}`);
349
- if (power.policy === 'manual' && summary.nextExpectedWake) {
356
+ if ((0, data_provider_1.scheduledWorkWaitsForStart)(power.policy) && summary.nextExpectedWake) {
350
357
  // A manual machine is started only by its owner, so a scheduled firing is work that will wait for
351
- // that start, not a wake (OSK-22556). The value is the same one; only its label changes.
352
- lines.push(`Next scheduled work: ${(0, format_1.formatWhen)(summary.nextExpectedWake, when)} (waits until you start the machine)`);
358
+ // that start, not a wake (OSK-22556). The value is the same one; only its label changes. The phrase
359
+ // is the shared one, so the web card and this line cannot say it differently.
360
+ lines.push(`Next scheduled work: ${(0, format_1.formatWhen)(summary.nextExpectedWake, when)} (${data_provider_1.SCHEDULED_WORK_WAITS_FOR_START})`);
353
361
  }
354
- else {
362
+ else if (summary.workspaceVolumeMissing !== true) {
363
+ // Not for a machine whose workspace disk is recorded gone (OSK-23526): a wake is a start, and a start is
364
+ // refused there, so "Next expected wake" would promise one. False and absent (an older server) print it.
355
365
  lines.push(`Next expected wake: ${(summary.nextExpectedWake ? (0, format_1.formatWhen)(summary.nextExpectedWake, when) : null) ??
356
366
  (summary.nextExpectedWakeUnavailable ? 'unavailable' : 'none scheduled')}`);
357
367
  }
@@ -360,8 +370,14 @@ function describePowerSummary(summary, when = {}) {
360
370
  : 'none'}`);
361
371
  lines.push(...describeLastWakeTiming(summary.lastWake));
362
372
  lines.push(...describePrewarm(summary.prewarm, when));
363
- if (power.policy !== 'on_demand')
364
- lines.push(...describeOnDemandAvailability(summary.onDemand));
373
+ // "on_demand: available" invites a policy that starts the machine by itself; not for a machine whose workspace disk
374
+ // is recorded gone (OSK-23526), where a start is refused. Its ineligibility reasons still print.
375
+ if (power.policy !== 'on_demand') {
376
+ const hint = describeOnDemandAvailability(summary.onDemand);
377
+ if (!(summary.workspaceVolumeMissing === true && summary.onDemand?.eligible === true)) {
378
+ lines.push(...hint);
379
+ }
380
+ }
365
381
  return lines;
366
382
  }
367
383
  /** The lines of `power explain`; the fix is always last. */
@@ -384,7 +400,9 @@ function describePowerExplanation(summary, when = {}) {
384
400
  if (text.detail)
385
401
  lines.push(`Detail: ${text.detail}`);
386
402
  lines.push(...describePendingStopLines(summary, when));
387
- const stop = describeLastAutoStopLines(summary.lastAutoStop, d.detail, when);
403
+ const stop = describeLastAutoStopLines(summary.lastAutoStop, d.detail, when, {
404
+ workspaceVolumeMissing: summary.workspaceVolumeMissing,
405
+ });
388
406
  lines.push(...stop.lines);
389
407
  lines.push(...wakeLines);
390
408
  lines.push(...describeLastWakeTiming(summary.lastWake));
@@ -163,8 +163,8 @@ function evaluateDedicatedWaitGoal(goal, lease) {
163
163
  return {
164
164
  status: 'failed',
165
165
  reason: last.status === 'rolled_back'
166
- ? 'the current image did not come back healthy; the machine is back on its previous image, files kept'
167
- : 'the update did not complete on either image; files are kept',
166
+ ? `the current image did not come back healthy; the machine is back on its previous image${lease.workspaceVolumeMissing === true ? '' : ', files kept'}`
167
+ : `the update did not complete on either image${lease.workspaceVolumeMissing === true ? '' : '; files are kept'}`,
168
168
  };
169
169
  }
170
170
  let moving = 'update requested';