maxpool 1.24.1 → 1.24.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/package.json +1 -1
- package/src/tui.js +22 -1
package/package.json
CHANGED
package/src/tui.js
CHANGED
|
@@ -2150,7 +2150,28 @@ export class TUI {
|
|
|
2150
2150
|
const rg = a.resetGrants;
|
|
2151
2151
|
if (rg?.eligible) n += (rg.grants || []).filter(g => g.usableNow && !g.expired).length;
|
|
2152
2152
|
}
|
|
2153
|
-
|
|
2153
|
+
// Expiry rides with the count when it's tight: "1~2d" = 1 reset, expires in ~2 days.
|
|
2154
|
+
// Claude grants end mid-Oct (weeks out) — a day-count would be noise; only the
|
|
2155
|
+
// SOONEST-expiring card under 7 days gets a suffix, so the column stays narrow
|
|
2156
|
+
// and the number it carries still answers "use it or lose it?".
|
|
2157
|
+
let suffix = '';
|
|
2158
|
+
if (n > 0) {
|
|
2159
|
+
let soonest = Infinity;
|
|
2160
|
+
const rc = a.resetCards;
|
|
2161
|
+
if (rc) for (const c of [...(rc.fiveHour || []), ...(rc.weekly || [])]) {
|
|
2162
|
+
if (!c.expired && c.expiresAt != null && c.expiresAt < soonest) soonest = c.expiresAt;
|
|
2163
|
+
}
|
|
2164
|
+
const rg = a.resetGrants;
|
|
2165
|
+
if (rg?.eligible) for (const g of (rg.grants || [])) {
|
|
2166
|
+
if (g.usableNow && !g.expired && g.endsAt != null && g.endsAt < soonest) soonest = g.endsAt;
|
|
2167
|
+
}
|
|
2168
|
+
const days = soonest === Infinity ? null : (soonest - Date.now()) / 86400_000;
|
|
2169
|
+
if (days != null && days < 7) {
|
|
2170
|
+
suffix = days < 1 ? '~' + Math.max(1, Math.round(days * 24)) + 'h'
|
|
2171
|
+
: '~' + Math.max(1, Math.round(days)) + 'd';
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
resetsCell = rpad(n > 0 ? green(String(n) + suffix) : gray('0'), RESETS_W + (suffix ? 2 : 0));
|
|
2154
2175
|
}
|
|
2155
2176
|
|
|
2156
2177
|
if (a.type === 'provider') {
|