@basou/cli 0.5.0 → 0.6.0

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/dist/index.js CHANGED
@@ -2632,6 +2632,9 @@ function formatSessionWork(session, events, now) {
2632
2632
  parts.push(`${w.commandCount} cmd / ${w.fileChangedCount} files / ${w.decisionCount} dec`);
2633
2633
  const activeBasis = w.activeTimeBasis === "engaged-turns" ? "turns" : "events";
2634
2634
  parts.push(`active ${formatDurationMs(w.activeTimeMs)} (${activeBasis})`);
2635
+ if (w.availability.machineActive) {
2636
+ parts.push(`machine ${formatDurationMs(w.machineActiveTimeMs)}`);
2637
+ }
2635
2638
  parts.push(`span ${formatDurationMs(w.sessionSpanMs)}${w.open ? " (open)" : ""}`);
2636
2639
  parts.push(
2637
2640
  w.availability.commandTime ? `command ${formatDurationMs(w.commandTimeMs)}` : "command n/a (import)"
@@ -3059,6 +3062,12 @@ function printStatsText(result, bySource, byDay) {
3059
3062
  ` Summed: ${formatDurationMs(t.activeTimeMs)} (per-session sum; concurrent sessions double-counted)`
3060
3063
  );
3061
3064
  }
3065
+ if (t.machineActiveAvailable) {
3066
+ const machineSessions = result.sessions.filter((s) => s.availability.machineActive).length;
3067
+ console.log(
3068
+ ` Model working: ${formatDurationMs(t.machineActiveTimeMs)} (model compute, subset of active; Codex turn duration on ${machineSessions} of ${t.sessionCount} sessions; summed, not wall-clock-deduped)`
3069
+ );
3070
+ }
3062
3071
  const openPart = t.openSessionCount > 0 ? `; ${t.openSessionCount} open counted to now` : "";
3063
3072
  console.log(
3064
3073
  ` Span: ${formatDurationMs(t.sessionSpanMs)} (total elapsed${openPart})`
@@ -3078,8 +3087,9 @@ function printStatsText(result, bySource, byDay) {
3078
3087
  console.log("");
3079
3088
  console.log("By day (billable time x volume):");
3080
3089
  for (const d of result.byDay) {
3090
+ const machine = d.machineActiveTimeMs > 0 ? ` (model ${formatDurationMs(d.machineActiveTimeMs)})` : "";
3081
3091
  console.log(
3082
- ` ${d.date}: ${formatDurationMs(d.billableActiveTimeMs)} active, ${formatInt(d.tokens.output)} out tok, ${d.commandCount} cmd / ${d.fileChangedCount} files / ${d.decisionCount} dec`
3092
+ ` ${d.date}: ${formatDurationMs(d.billableActiveTimeMs)} active${machine}, ${formatInt(d.tokens.output)} out tok, ${d.commandCount} cmd / ${d.fileChangedCount} files / ${d.decisionCount} dec`
3083
3093
  );
3084
3094
  }
3085
3095
  }
@@ -3087,7 +3097,8 @@ function printStatsText(result, bySource, byDay) {
3087
3097
  function describeSource(s) {
3088
3098
  const cmd = s.commandTimeReliable ? formatDurationMs(s.commandTimeMs) : "n/a";
3089
3099
  const tokens = s.tokensAvailable ? `${formatInt(s.tokens.output)} out tok` : "no tokens";
3090
- return `${s.sessionCount} sessions, ${tokens}, active ${formatDurationMs(s.activeTimeMs)}, command ${cmd}`;
3100
+ const machine = s.machineActiveAvailable ? `, model ${formatDurationMs(s.machineActiveTimeMs)}` : "";
3101
+ return `${s.sessionCount} sessions, ${tokens}, active ${formatDurationMs(s.activeTimeMs)}${machine}, command ${cmd}`;
3091
3102
  }
3092
3103
  function formatInt(n) {
3093
3104
  return n.toLocaleString("en-US");
@@ -4620,6 +4631,10 @@ var VIEW_HTML = `<!doctype html>
4620
4631
  if (t.activeTimeMs !== t.billableActiveTimeMs) {
4621
4632
  timeRows.push(kvrow('summed', fmtDur(t.activeTimeMs) + ' (concurrent sessions double-counted)'));
4622
4633
  }
4634
+ if (t.machineActiveAvailable) {
4635
+ var machineSessions = sessions.filter(function (s) { return s.availability && s.availability.machineActive; }).length;
4636
+ timeRows.push(kvrow('model working', fmtDur(t.machineActiveTimeMs) + ' (model compute, subset of active; Codex turn duration on ' + machineSessions + ' of ' + t.sessionCount + ' sessions; not wall-clock-deduped)'));
4637
+ }
4623
4638
  timeRows.push(kvrow('span', fmtDur(t.sessionSpanMs) + (t.openSessionCount > 0 ? ' (' + t.openSessionCount + ' open)' : '')));
4624
4639
  timeRows.push(kvrow('command', fmtDur(t.commandTimeMs) + (t.commandTimeReliable ? '' : ' (some sessions report 0)')));
4625
4640
  detail.appendChild(el('table', { class: 'kv' }, [el('tbody', {}, timeRows)]));
@@ -4627,16 +4642,18 @@ var VIEW_HTML = `<!doctype html>
4627
4642
  detail.appendChild(el('h3', { text: 'By source' }));
4628
4643
  d.bySource.forEach(function (s) {
4629
4644
  var cmd = s.commandTimeReliable ? fmtDur(s.commandTimeMs) : 'n/a';
4645
+ var machine = s.machineActiveAvailable ? ', model ' + fmtDur(s.machineActiveTimeMs) : '';
4630
4646
  detail.appendChild(el('div', { class: 'row' }, [
4631
- el('span', { text: s.sourceKind + ': ' + s.sessionCount + ' sessions, ' + numfmt(s.tokens.output) + ' out tok, active ' + fmtDur(s.activeTimeMs) + ', command ' + cmd })
4647
+ el('span', { text: s.sourceKind + ': ' + s.sessionCount + ' sessions, ' + numfmt(s.tokens.output) + ' out tok, active ' + fmtDur(s.activeTimeMs) + machine + ', command ' + cmd })
4632
4648
  ]));
4633
4649
  });
4634
4650
  }
4635
4651
  if (d.byDay && d.byDay.length) {
4636
4652
  detail.appendChild(el('h3', { text: 'By day (billable time x volume)' }));
4637
4653
  d.byDay.forEach(function (day) {
4654
+ var dayMachine = day.machineActiveTimeMs > 0 ? ' (model ' + fmtDur(day.machineActiveTimeMs) + ')' : '';
4638
4655
  detail.appendChild(el('div', { class: 'row' }, [
4639
- el('span', { text: day.date + ': ' + fmtDur(day.billableActiveTimeMs) + ' active, ' + numfmt(day.tokens.output) + ' out tok, ' + day.commandCount + ' cmd / ' + day.fileChangedCount + ' files / ' + day.decisionCount + ' dec' })
4656
+ el('span', { text: day.date + ': ' + fmtDur(day.billableActiveTimeMs) + ' active' + dayMachine + ', ' + numfmt(day.tokens.output) + ' out tok, ' + day.commandCount + ' cmd / ' + day.fileChangedCount + ' files / ' + day.decisionCount + ' dec' })
4640
4657
  ]));
4641
4658
  });
4642
4659
  }