opencode-statboard 2.10.12 → 2.10.13

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tui-dashboard.js +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-statboard",
3
- "version": "2.10.12",
3
+ "version": "2.10.13",
4
4
  "description": "Real-time dashboard for opencode token usage and cost statistics",
5
5
  "main": "server.js",
6
6
  "bin": {
package/tui-dashboard.js CHANGED
@@ -555,13 +555,15 @@ class TUIServer {
555
555
 
556
556
  const height = this.getContentHeight() - 4;
557
557
  const width = this.getContentWidth();
558
- const chartHeight = Math.max(1, Math.floor(height / 3) - 2); // 3 charts, each ~1/3 height
558
+ const chartHeight = Math.max(1, Math.floor(height / 3) - 2);
559
559
 
560
560
  // Helper: render one chart with its own max
561
561
  const renderChart = (data, label, color, maxVal) => {
562
562
  if (maxVal <= 0) return '{gray}(no data){/gray}\n';
563
563
  let lines = [];
564
- lines.push('{bold}' + label + ':{/bold}');
564
+ // Show current (today = last index) value next to label
565
+ const todayVal = data[data.length - 1] || 0;
566
+ lines.push('{bold}' + label + ': ' + this.formatNumber(todayVal) + ' (today){/bold}');
565
567
  for (let row = chartHeight - 1; row >= 0; row--) {
566
568
  let line = '';
567
569
  const threshold = (row / chartHeight) * maxVal;
@@ -586,6 +588,7 @@ class TUIServer {
586
588
  out += renderChart(output, t('output') + ' (green)', 'green', maxOut) + '\n';
587
589
  out += renderChart(cost, t('cost') + ' (yellow)', 'yellow', maxCost) + '\n';
588
590
 
591
+ // X-axis: show first date, middle date, last date
589
592
  let xAxis = '';
590
593
  const labelStep = Math.max(1, Math.ceil(width / 20));
591
594
  for (let i = 0; i < width; i++) {
@@ -598,6 +601,11 @@ class TUIServer {
598
601
  }
599
602
  out += '{gray}' + xAxis + '{/gray}\n';
600
603
 
604
+ // Add date range info
605
+ const firstDate = trend.dates ? trend.dates[0] : labels[0];
606
+ const lastDate = trend.dates ? trend.dates[trend.dates.length - 1] : labels[labels.length - 1];
607
+ out += '\n{gray}Range: ' + firstDate + ' \u2192 ' + lastDate + ' (' + labels.length + ' days){/gray}\n';
608
+
601
609
  const lastIdx = labels.length - 1;
602
610
  out += '\n{bold}' + t('today') + ':{/bold} Input: ' + this.formatNumber(input[lastIdx] || 0) + ' | Output: ' + this.formatNumber(output[lastIdx] || 0) + ' | Cost: ' + this.formatCost(cost[lastIdx] || 0);
603
611