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.
- package/dist/cli.js +144 -216
- 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 = (
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
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__ */
|
|
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
|
-
|
|
1587
|
-
|
|
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(
|
|
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__ */
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
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
|
|
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
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
color
|
|
1657
|
+
sublabel,
|
|
1658
|
+
pick,
|
|
1659
|
+
items,
|
|
1660
|
+
showResets
|
|
1641
1661
|
}) {
|
|
1642
|
-
const
|
|
1643
|
-
|
|
1644
|
-
|
|
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(
|
|
1648
|
-
/* @__PURE__ */
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1666
|
+
/* @__PURE__ */ jsx(Text, { bold: true, children: label }),
|
|
1667
|
+
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
1668
|
+
" ",
|
|
1669
|
+
sublabel
|
|
1670
|
+
] })
|
|
1652
1671
|
] }),
|
|
1653
|
-
/* @__PURE__ */
|
|
1654
|
-
|
|
1655
|
-
|
|
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
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
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
|
|
1684
|
+
function AccountLimitBar({
|
|
1705
1685
|
slot,
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
maxTokens
|
|
1686
|
+
pct,
|
|
1687
|
+
resets,
|
|
1688
|
+
showName
|
|
1710
1689
|
}) {
|
|
1711
|
-
const
|
|
1712
|
-
const
|
|
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__ */
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
/* @__PURE__ */ jsx(Text, {
|
|
1754
|
-
/* @__PURE__ */ jsx(Box, { width:
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
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 };
|