tokmon 0.11.0 → 0.11.2

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/dist/cli.js +11 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -482,6 +482,9 @@ function formatReset(iso) {
482
482
 
483
483
  // src/format.ts
484
484
  function currency(value) {
485
+ if (value >= 1e4) {
486
+ return `$${value.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
487
+ }
485
488
  return `$${value.toFixed(2)}`;
486
489
  }
487
490
  function tokens(value) {
@@ -841,7 +844,7 @@ function App({ interval: cliInterval }) {
841
844
  cursor,
842
845
  expanded,
843
846
  maxRows: rows - 12,
844
- wide: cols > 90,
847
+ cols,
845
848
  onRowClick: (idx) => {
846
849
  if (idx === cursor) setExpanded((e) => e === idx ? -1 : idx);
847
850
  else setCursor(idx);
@@ -1087,8 +1090,13 @@ function SummaryRow({ label, summary }) {
1087
1090
  ] }) })
1088
1091
  ] });
1089
1092
  }
1090
- function TableView({ rows: allRows, cursor, expanded, maxRows, wide, onRowClick }) {
1091
- const W = wide ? { label: 10, models: 18, input: 8, output: 8, cc: 8, cr: 9, total: 9, cost: 10 } : { label: 8, models: 14, input: 7, output: 7, cc: 7, cr: 8, total: 0, cost: 9 };
1093
+ function TableView({ rows: allRows, cursor, expanded, maxRows, cols, onRowClick }) {
1094
+ const wide = cols > 90;
1095
+ const base = wide ? { label: 12, input: 10, output: 10, cc: 10, cr: 11, total: 11, cost: 13 } : { label: 8, input: 7, output: 7, cc: 7, cr: 8, total: 0, cost: 11 };
1096
+ const fixed = base.label + base.input + base.output + base.cc + base.cr + base.total + base.cost;
1097
+ const minModels = wide ? 22 : 14;
1098
+ const available = cols - fixed - 6;
1099
+ const W = { ...base, models: Math.max(minModels, available) };
1092
1100
  const lineW = W.label + W.models + W.input + W.output + W.cc + W.cr + W.total + W.cost;
1093
1101
  const totals = { input: 0, output: 0, cacheCreate: 0, cacheRead: 0, cost: 0 };
1094
1102
  for (const r of allRows) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokmon",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Terminal dashboard for Claude Code usage and costs",
5
5
  "type": "module",
6
6
  "bin": {