tokmon 0.12.1 → 0.12.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 +144 -216
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1525,70 +1525,46 @@ function ColorField({ value, focused }) {
1525
1525
  /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: " shows on dashboard, account strip, borders" }) })
1526
1526
  ] });
1527
1527
  }
1528
- function DashboardView({ slots, stats, compact }) {
1529
- const slotKey = (s2) => s2.id ?? "__default__";
1530
- if (compact) {
1531
- const accountStats = slots.map((slot2) => ({ slot: slot2, s: stats.get(slotKey(slot2)) })).filter((x) => !!x.s?.dashboard);
1532
- return /* @__PURE__ */ jsx(ComparisonView, { accountStats });
1533
- }
1534
- const slot = slots[0];
1535
- const s = stats.get(slotKey(slot));
1536
- if (!s?.dashboard) {
1537
- return /* @__PURE__ */ jsxs(Box, { children: [
1538
- /* @__PURE__ */ jsxs(Text, { color: slot.color, bold: true, children: [
1539
- "\u25CF ",
1540
- slot.name,
1541
- " "
1542
- ] }),
1543
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: "loading..." })
1544
- ] });
1545
- }
1546
- return /* @__PURE__ */ jsx(SoloAccountCard, { slot, dashboard: s.dashboard, billing: s.billing });
1547
- }
1548
- function bar(value, max, width) {
1549
- if (max <= 0) return { filled: 0, empty: width };
1550
- const filled = Math.max(0, Math.min(width, Math.round(value / max * width)));
1551
- return { filled, empty: width - filled };
1552
- }
1553
- function SoloAccountCard({ slot, dashboard, billing }) {
1554
- const maxCost = Math.max(dashboard.today.cost, dashboard.week.cost, dashboard.month.cost, 0.01);
1555
- const maxTokens = Math.max(dashboard.today.tokens, dashboard.week.tokens, dashboard.month.tokens, 1);
1556
- const rows = [
1557
- { label: "Today", s: dashboard.today },
1558
- { label: "This Week", s: dashboard.week },
1559
- { label: "This Month", s: dashboard.month }
1560
- ];
1528
+ function DashboardView({ slots, stats, compact: _compact }) {
1529
+ const slotKey = (s) => s.id ?? "__default__";
1530
+ const items = slots.map((slot) => ({ slot, s: stats.get(slotKey(slot)) })).filter((x) => !!x.s?.dashboard);
1531
+ if (items.length === 0) return /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Loading..." });
1532
+ const agg = aggregateUsage(items.map((i) => i.s.dashboard));
1533
+ const isMulti = items.length > 1;
1561
1534
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
1562
- /* @__PURE__ */ jsxs(Box, { children: [
1563
- /* @__PURE__ */ jsxs(Text, { color: slot.color, bold: true, children: [
1564
- "\u25CF ",
1565
- slot.name
1566
- ] }),
1567
- slot.id && /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
1568
- " ",
1569
- slot.id
1570
- ] })
1571
- ] }),
1572
1535
  /* @__PURE__ */ jsxs(
1573
1536
  Box,
1574
1537
  {
1575
1538
  flexDirection: "column",
1576
- marginTop: 1,
1577
1539
  paddingLeft: 1,
1578
1540
  borderStyle: "bold",
1579
- borderColor: slot.color,
1541
+ borderColor: isMulti ? "green" : items[0].slot.color,
1580
1542
  borderRight: false,
1581
1543
  borderTop: false,
1582
1544
  borderBottom: false,
1583
1545
  children: [
1584
- /* @__PURE__ */ jsx(Text, { bold: true, children: "Usage" }),
1546
+ /* @__PURE__ */ jsxs(Box, { children: [
1547
+ /* @__PURE__ */ jsx(Text, { bold: true, children: "Claude" }),
1548
+ isMulti && /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
1549
+ " all accounts (",
1550
+ items.length,
1551
+ ")"
1552
+ ] }),
1553
+ !isMulti && items[0].slot.id && /* @__PURE__ */ jsxs(Fragment, { children: [
1554
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: " " }),
1555
+ /* @__PURE__ */ jsx(Text, { color: items[0].slot.color, children: "\u25CF " }),
1556
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: items[0].slot.name })
1557
+ ] })
1558
+ ] }),
1585
1559
  /* @__PURE__ */ jsx(Box, { height: 1 }),
1586
- rows.map((r) => /* @__PURE__ */ jsx(DualBarRow, { label: r.label, cost: r.s.cost, tokens: r.s.tokens, maxCost, maxTokens, color: slot.color }, r.label)),
1587
- dashboard.burnRate > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
1560
+ /* @__PURE__ */ jsx(SummaryRow, { label: "Today", summary: agg.today }),
1561
+ /* @__PURE__ */ jsx(SummaryRow, { label: "This Week", summary: agg.week }),
1562
+ /* @__PURE__ */ jsx(SummaryRow, { label: "This Month", summary: agg.month }),
1563
+ agg.burnRate > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
1588
1564
  /* @__PURE__ */ jsx(Box, { height: 1 }),
1589
1565
  /* @__PURE__ */ jsxs(Box, { children: [
1590
1566
  /* @__PURE__ */ jsx(Box, { width: 14, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Burn rate" }) }),
1591
- /* @__PURE__ */ jsx(Box, { width: 12, justifyContent: "flex-end", children: /* @__PURE__ */ jsx(Text, { color: "red", children: currency(dashboard.burnRate) }) }),
1567
+ /* @__PURE__ */ jsx(Box, { width: 12, justifyContent: "flex-end", children: /* @__PURE__ */ jsx(Text, { color: "red", children: currency(agg.burnRate) }) }),
1592
1568
  /* @__PURE__ */ jsx(Text, { dimColor: true, children: "/hr" })
1593
1569
  ] })
1594
1570
  ] })
@@ -1596,166 +1572,137 @@ function SoloAccountCard({ slot, dashboard, billing }) {
1596
1572
  }
1597
1573
  ),
1598
1574
  /* @__PURE__ */ jsx(Box, { height: 1 }),
1599
- /* @__PURE__ */ jsxs(
1600
- Box,
1601
- {
1602
- flexDirection: "column",
1603
- paddingLeft: 1,
1604
- borderStyle: "bold",
1605
- borderColor: billing?.error ? "red" : "yellow",
1606
- borderRight: false,
1607
- borderTop: false,
1608
- borderBottom: false,
1609
- children: [
1610
- /* @__PURE__ */ jsx(Text, { bold: true, children: "Rate Limits" }),
1611
- /* @__PURE__ */ jsx(Box, { height: 1 }),
1612
- billing?.error ? /* @__PURE__ */ jsx(Text, { color: "red", children: billing.error }) : billing?.session || billing?.weekly ? /* @__PURE__ */ jsxs(Fragment, { children: [
1613
- billing.session && /* @__PURE__ */ jsx(LimitBar, { label: "Session", pct: billing.session.utilization, resets: billing.session.resetsAt }),
1614
- billing.weekly && /* @__PURE__ */ jsx(LimitBar, { label: "Weekly", pct: billing.weekly.utilization, resets: billing.weekly.resetsAt }),
1615
- billing.sonnet && /* @__PURE__ */ jsx(LimitBar, { label: "Sonnet", pct: billing.sonnet.utilization, resets: billing.sonnet.resetsAt }),
1616
- billing.extraUsage && /* @__PURE__ */ jsxs(Box, { children: [
1617
- /* @__PURE__ */ jsx(Box, { width: 10, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Extra" }) }),
1618
- /* @__PURE__ */ jsxs(Text, { color: "yellow", children: [
1619
- "$",
1620
- billing.extraUsage.used.toFixed(2)
1621
- ] }),
1622
- /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
1623
- " / $",
1624
- billing.extraUsage.limit.toFixed(2),
1625
- " limit"
1626
- ] })
1627
- ] })
1628
- ] }) : /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Fetching..." })
1629
- ]
1630
- }
1631
- )
1575
+ /* @__PURE__ */ jsx(RateLimitsCard, { items })
1576
+ ] });
1577
+ }
1578
+ function aggregateUsage(list) {
1579
+ const z = {
1580
+ today: { cost: 0, tokens: 0 },
1581
+ week: { cost: 0, tokens: 0 },
1582
+ month: { cost: 0, tokens: 0 },
1583
+ burnRate: 0
1584
+ };
1585
+ for (const d of list) {
1586
+ z.today.cost += d.today.cost;
1587
+ z.today.tokens += d.today.tokens;
1588
+ z.week.cost += d.week.cost;
1589
+ z.week.tokens += d.week.tokens;
1590
+ z.month.cost += d.month.cost;
1591
+ z.month.tokens += d.month.tokens;
1592
+ z.burnRate += d.burnRate;
1593
+ }
1594
+ return z;
1595
+ }
1596
+ function SummaryRow({ label, summary }) {
1597
+ return /* @__PURE__ */ jsxs(Box, { children: [
1598
+ /* @__PURE__ */ jsx(Box, { width: 14, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: label }) }),
1599
+ /* @__PURE__ */ jsx(Box, { width: 12, justifyContent: "flex-end", children: /* @__PURE__ */ jsx(Text, { bold: true, color: "yellow", children: currency(summary.cost) }) }),
1600
+ /* @__PURE__ */ jsx(Box, { width: 18, justifyContent: "flex-end", children: /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
1601
+ tokens(summary.tokens),
1602
+ " tokens"
1603
+ ] }) })
1632
1604
  ] });
1633
1605
  }
1634
- function DualBarRow({
1606
+ function RateLimitsCard({ items }) {
1607
+ const anyData = items.some((i) => i.s.billing?.session || i.s.billing?.weekly || i.s.billing?.sonnet);
1608
+ const anyError = items.some((i) => i.s.billing?.error);
1609
+ const borderColor = !anyData && anyError ? "red" : "yellow";
1610
+ return /* @__PURE__ */ jsxs(
1611
+ Box,
1612
+ {
1613
+ flexDirection: "column",
1614
+ paddingLeft: 1,
1615
+ borderStyle: "bold",
1616
+ borderColor,
1617
+ borderRight: false,
1618
+ borderTop: false,
1619
+ borderBottom: false,
1620
+ children: [
1621
+ /* @__PURE__ */ jsx(Text, { bold: true, children: "Rate Limits" }),
1622
+ /* @__PURE__ */ jsx(Box, { height: 1 }),
1623
+ !anyData ? anyError ? /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: items.map(({ slot, s }) => s.billing?.error && /* @__PURE__ */ jsxs(Box, { children: [
1624
+ /* @__PURE__ */ jsx(Text, { color: slot.color, children: "\u25CF " }),
1625
+ /* @__PURE__ */ jsx(Box, { width: 12, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: slot.name }) }),
1626
+ /* @__PURE__ */ jsx(Text, { color: "red", children: s.billing.error })
1627
+ ] }, slot.id ?? "__default__")) }) : /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Fetching..." }) : /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
1628
+ /* @__PURE__ */ jsx(MetricBlock, { label: "Total Usage", sublabel: "5h session", pick: (b) => b?.session, items, showResets: true }),
1629
+ /* @__PURE__ */ jsx(MetricBlock, { label: "This Week", sublabel: "7-day", pick: (b) => b?.weekly, items, showResets: true }),
1630
+ /* @__PURE__ */ jsx(MetricBlock, { label: "Sonnet", sublabel: "7-day sonnet", pick: (b) => b?.sonnet, items }),
1631
+ items.some((i) => i.s.billing?.extraUsage) && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
1632
+ /* @__PURE__ */ jsx(Text, { bold: true, dimColor: true, children: "Extra Usage" }),
1633
+ items.map(({ slot, s }) => {
1634
+ const e = s.billing?.extraUsage;
1635
+ if (!e) return null;
1636
+ return /* @__PURE__ */ jsxs(Box, { children: [
1637
+ /* @__PURE__ */ jsx(Text, { color: slot.color, children: "\u25CF " }),
1638
+ /* @__PURE__ */ jsx(Box, { width: 12, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: slot.name }) }),
1639
+ /* @__PURE__ */ jsxs(Text, { color: "yellow", children: [
1640
+ "$",
1641
+ e.used.toFixed(2)
1642
+ ] }),
1643
+ /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
1644
+ " / $",
1645
+ e.limit.toFixed(2)
1646
+ ] })
1647
+ ] }, slot.id ?? "__default__");
1648
+ })
1649
+ ] })
1650
+ ] })
1651
+ ]
1652
+ }
1653
+ );
1654
+ }
1655
+ function MetricBlock({
1635
1656
  label,
1636
- cost,
1637
- tokens: tokens2,
1638
- maxCost,
1639
- maxTokens,
1640
- color
1657
+ sublabel,
1658
+ pick,
1659
+ items,
1660
+ showResets
1641
1661
  }) {
1642
- const W = 18;
1643
- const c = bar(cost, maxCost, W);
1644
- const t = bar(tokens2, maxTokens, W);
1645
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 0, children: [
1662
+ const rows = items.map((i) => ({ slot: i.slot, lim: pick(i.s.billing) ?? null })).filter((r) => r.lim !== null);
1663
+ if (rows.length === 0) return null;
1664
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
1646
1665
  /* @__PURE__ */ jsxs(Box, { children: [
1647
- /* @__PURE__ */ jsx(Box, { width: 12, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: label }) }),
1648
- /* @__PURE__ */ jsx(Text, { color, children: "\u2588".repeat(c.filled) }),
1649
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2591".repeat(c.empty) }),
1650
- /* @__PURE__ */ jsx(Text, { children: " " }),
1651
- /* @__PURE__ */ jsx(Box, { width: 11, justifyContent: "flex-end", children: /* @__PURE__ */ jsx(Text, { bold: true, color: "yellow", children: currency(cost) }) })
1666
+ /* @__PURE__ */ jsx(Text, { bold: true, children: label }),
1667
+ /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
1668
+ " ",
1669
+ sublabel
1670
+ ] })
1652
1671
  ] }),
1653
- /* @__PURE__ */ jsxs(Box, { children: [
1654
- /* @__PURE__ */ jsx(Box, { width: 12, children: /* @__PURE__ */ jsx(Text, { children: " " }) }),
1655
- /* @__PURE__ */ jsx(Text, { color, dimColor: true, children: "\u2593".repeat(t.filled) }),
1656
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2591".repeat(t.empty) }),
1657
- /* @__PURE__ */ jsx(Text, { children: " " }),
1658
- /* @__PURE__ */ jsx(Box, { width: 11, justifyContent: "flex-end", children: /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
1659
- tokens(tokens2),
1660
- " tk"
1661
- ] }) })
1662
- ] })
1663
- ] });
1664
- }
1665
- function ComparisonView({ accountStats }) {
1666
- if (accountStats.length === 0) {
1667
- return /* @__PURE__ */ jsx(Text, { dimColor: true, children: "No accounts loaded yet..." });
1668
- }
1669
- const periods = [
1670
- { key: "Today", pick: (d) => d.today },
1671
- { key: "This Week", pick: (d) => d.week },
1672
- { key: "This Month", pick: (d) => d.month }
1673
- ];
1674
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
1675
- periods.map((p, i) => {
1676
- const rows = accountStats.map(({ slot, s }) => ({
1672
+ rows.map(({ slot, lim }) => /* @__PURE__ */ jsx(
1673
+ AccountLimitBar,
1674
+ {
1677
1675
  slot,
1678
- summary: p.pick(s.dashboard)
1679
- }));
1680
- const maxCost = Math.max(0.01, ...rows.map((r) => r.summary.cost));
1681
- const maxTokens = Math.max(1, ...rows.map((r) => r.summary.tokens));
1682
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: i < periods.length - 1 ? 1 : 0, children: [
1683
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { bold: true, dimColor: true, children: p.key.toUpperCase() }) }),
1684
- rows.map(({ slot, summary }) => /* @__PURE__ */ jsx(
1685
- ComparisonRow,
1686
- {
1687
- slot,
1688
- cost: summary.cost,
1689
- tokens: summary.tokens,
1690
- maxCost,
1691
- maxTokens
1692
- },
1693
- slot.id ?? "__default__"
1694
- ))
1695
- ] }, p.key);
1696
- }),
1697
- /* @__PURE__ */ jsx(Box, { height: 1 }),
1698
- /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
1699
- /* @__PURE__ */ jsx(Text, { bold: true, dimColor: true, children: "RATE LIMITS" }),
1700
- accountStats.map(({ slot, s }) => /* @__PURE__ */ jsx(CompactLimitsRow, { slot, billing: s.billing }, slot.id ?? "__default__"))
1701
- ] })
1676
+ pct: lim.utilization,
1677
+ resets: showResets ? lim.resetsAt : null,
1678
+ showName: items.length > 1
1679
+ },
1680
+ slot.id ?? "__default__"
1681
+ ))
1702
1682
  ] });
1703
1683
  }
1704
- function ComparisonRow({
1684
+ function AccountLimitBar({
1705
1685
  slot,
1706
- cost,
1707
- tokens: tokens2,
1708
- maxCost,
1709
- maxTokens
1686
+ pct,
1687
+ resets,
1688
+ showName
1710
1689
  }) {
1711
- const W = 22;
1712
- const c = bar(cost, maxCost, W);
1713
- const t = bar(tokens2, maxTokens, W);
1714
- return /* @__PURE__ */ jsxs(Box, { children: [
1715
- /* @__PURE__ */ jsxs(Box, { width: 14, children: [
1716
- /* @__PURE__ */ jsx(Text, { color: slot.color, children: "\u25CF " }),
1717
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: slot.name })
1718
- ] }),
1719
- /* @__PURE__ */ jsx(Text, { color: slot.color, children: "\u2588".repeat(c.filled) }),
1720
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2591".repeat(c.empty) }),
1721
- /* @__PURE__ */ jsx(Text, { children: " " }),
1722
- /* @__PURE__ */ jsx(Box, { width: 10, justifyContent: "flex-end", children: /* @__PURE__ */ jsx(Text, { bold: true, color: "yellow", children: currency(cost) }) }),
1723
- /* @__PURE__ */ jsx(Text, { children: " " }),
1724
- /* @__PURE__ */ jsx(Text, { color: slot.color, dimColor: true, children: "\u2593".repeat(t.filled) }),
1725
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2591".repeat(t.empty) }),
1726
- /* @__PURE__ */ jsx(Text, { children: " " }),
1727
- /* @__PURE__ */ jsx(Box, { width: 10, justifyContent: "flex-end", children: /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
1728
- tokens(tokens2),
1729
- " tk"
1730
- ] }) })
1731
- ] });
1732
- }
1733
- function CompactLimitsRow({ slot, billing }) {
1734
- if (billing?.error) {
1735
- return /* @__PURE__ */ jsxs(Box, { children: [
1736
- /* @__PURE__ */ jsxs(Box, { width: 14, children: [
1737
- /* @__PURE__ */ jsx(Text, { color: slot.color, children: "\u25CF " }),
1738
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: slot.name })
1739
- ] }),
1740
- /* @__PURE__ */ jsx(Text, { color: "red", children: billing.error })
1741
- ] });
1742
- }
1743
- const fmtPct = (p) => p ? `${Math.round(p.utilization)}%` : "\u2014";
1744
- const colorFor = (p) => {
1745
- if (!p) return void 0;
1746
- return p.utilization >= 80 ? "red" : p.utilization >= 50 ? "yellow" : "green";
1747
- };
1690
+ const width = 28;
1691
+ const filled = Math.max(0, Math.min(width, Math.round(pct / 100 * width)));
1748
1692
  return /* @__PURE__ */ jsxs(Box, { children: [
1749
- /* @__PURE__ */ jsxs(Box, { width: 14, children: [
1750
- /* @__PURE__ */ jsx(Text, { color: slot.color, children: "\u25CF " }),
1751
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: slot.name })
1752
- ] }),
1753
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: "S " }),
1754
- /* @__PURE__ */ jsx(Box, { width: 6, children: /* @__PURE__ */ jsx(Text, { bold: true, color: colorFor(billing?.session), children: fmtPct(billing?.session) }) }),
1755
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: "W " }),
1756
- /* @__PURE__ */ jsx(Box, { width: 6, children: /* @__PURE__ */ jsx(Text, { bold: true, color: colorFor(billing?.weekly), children: fmtPct(billing?.weekly) }) }),
1757
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Sonnet " }),
1758
- /* @__PURE__ */ jsx(Box, { width: 6, children: /* @__PURE__ */ jsx(Text, { bold: true, color: colorFor(billing?.sonnet), children: fmtPct(billing?.sonnet) }) })
1693
+ /* @__PURE__ */ jsx(Text, { color: slot.color, children: "\u25CF " }),
1694
+ showName ? /* @__PURE__ */ jsx(Box, { width: 12, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: slot.name }) }) : /* @__PURE__ */ jsx(Box, { width: 2, children: /* @__PURE__ */ jsx(Text, { children: " " }) }),
1695
+ /* @__PURE__ */ jsx(Text, { color: slot.color, children: "\u2501".repeat(filled) }),
1696
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2500".repeat(width - filled) }),
1697
+ /* @__PURE__ */ jsx(Text, { children: " " }),
1698
+ /* @__PURE__ */ jsx(Box, { width: 5, justifyContent: "flex-end", children: /* @__PURE__ */ jsxs(Text, { bold: true, children: [
1699
+ Math.round(pct),
1700
+ "%"
1701
+ ] }) }),
1702
+ resets && /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
1703
+ " resets ",
1704
+ resets
1705
+ ] })
1759
1706
  ] });
1760
1707
  }
1761
1708
  function PeakBadge({ peak }) {
@@ -1776,25 +1723,6 @@ function fmtMinutes(mins) {
1776
1723
  const m = mins % 60;
1777
1724
  return m === 0 ? `${h}h` : `${h}h ${m}m`;
1778
1725
  }
1779
- function LimitBar({ label, pct, resets }) {
1780
- const width = 30;
1781
- const filled = Math.round(pct / 100 * width);
1782
- const color = pct >= 80 ? "red" : pct >= 50 ? "yellow" : "green";
1783
- return /* @__PURE__ */ jsxs(Box, { children: [
1784
- /* @__PURE__ */ jsx(Box, { width: 10, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: label }) }),
1785
- /* @__PURE__ */ jsx(Text, { color, children: "\u2501".repeat(filled) }),
1786
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2500".repeat(width - filled) }),
1787
- /* @__PURE__ */ jsx(Text, { children: " " }),
1788
- /* @__PURE__ */ jsxs(Text, { bold: true, children: [
1789
- Math.round(pct),
1790
- "%"
1791
- ] }),
1792
- /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
1793
- " resets ",
1794
- resets
1795
- ] })
1796
- ] });
1797
- }
1798
1726
  function TableView({ rows: allRows, cursor, expanded, maxRows, cols, onRowClick }) {
1799
1727
  const wide = cols > 90;
1800
1728
  const base = wide ? { label: 12, input: 10, output: 10, cc: 14, cr: 12, total: 11, cost: 13 } : { label: 8, input: 7, output: 7, cc: 7, cr: 8, total: 0, cost: 11 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokmon",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "Terminal dashboard for Claude Code usage and costs",
5
5
  "type": "module",
6
6
  "bin": {