maxpool 1.24.101 → 1.24.102

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxpool",
3
- "version": "1.24.101",
3
+ "version": "1.24.102",
4
4
  "description": "Multi-account Claude Code proxy with adaptive, rate-aware load balancing across Claude accounts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -4937,8 +4937,15 @@ export class AccountManager {
4937
4937
  }
4938
4938
 
4939
4939
  _weeklyRawState(account, now = Date.now()) {
4940
- const q = account.quota;
4941
4940
  this._clearExpiredQuotas(account);
4941
+ return this._weeklyTier(account, now);
4942
+ }
4943
+
4944
+ /** The weekly tier from the readings AS THEY STAND — no expiry clearing, so the
4945
+ * account table can ask the router's exact question without mutating the quota
4946
+ * mid-render (the "wk full" status word must never disagree with routing). */
4947
+ _weeklyTier(account, now = Date.now()) {
4948
+ const q = account.quota;
4942
4949
  if (this._isAccountWideRejected(account)) return 'exhausted';
4943
4950
 
4944
4951
  // Provider accounts (GLM/Kimi) carry their quota in providerSes/providerWk, NOT
package/src/tui.js CHANGED
@@ -488,6 +488,18 @@ function sessionFull(am, a) {
488
488
  return false;
489
489
  }
490
490
 
491
+ /** True when the WEEKLY window is what keeps traffic off this account — the router's
492
+ * own tier (_weeklyTier, the non-clearing half of _weeklyRawState) says 'exhausted'.
493
+ * Claude weekly readings are cleared at their reset by the manager, so a passed reset
494
+ * reads as free here without clearing anything; GLM readings are kept until the next
495
+ * usage check and the router keeps refusing until then, so they are judged as they
496
+ * stand. (Max 2026-11-18: four GLM rows read "active" next to "Wk 100%".) */
497
+ function weekFull(am, a, now = Date.now()) {
498
+ if (typeof am?._weeklyTier !== 'function' || !a?.quota) return false;
499
+ if (a.type !== 'provider' && a.quota.unified7dReset != null && now >= a.quota.unified7dReset) return false;
500
+ return am._weeklyTier(a, now) === 'exhausted';
501
+ }
502
+
491
503
  /** True when the reservation is what is currently keeping traffic off this account
492
504
  * — either window at or past the cap. Reads the manager's own predicate so the
493
505
  * label can never disagree with routing. */
@@ -2992,6 +3004,8 @@ export class TUI {
2992
3004
  // manager's expiry refresh once per frame, before any row is drawn.)
2993
3005
  if (a.enabled !== false && effectiveStatus === 'active') {
2994
3006
  if (capBenched(this.am, a)) effectiveStatus = 'capped';
3007
+ // The weekly wait outlasts the 5h one, so it names the account's state first.
3008
+ else if (weekFull(this.am, a)) effectiveStatus = 'wk full';
2995
3009
  else if (sessionFull(this.am, a)) effectiveStatus = '5h full';
2996
3010
  }
2997
3011
  if (a.refreshDead) effectiveStatus = a.enabled === false ? 'disabled-reauth' : 'reauth';
@@ -3035,6 +3049,7 @@ export class TUI {
3035
3049
  case 'exhausted': status = red('exhausted'); break;
3036
3050
  case 'capped': status = yellow('capped'); break;
3037
3051
  case '5h full': status = yellow('5h full'); break;
3052
+ case 'wk full': status = yellow('wk full'); break;
3038
3053
  case 'error': status = red('error'); break;
3039
3054
  default: status = a.status || 'ready';
3040
3055
  }