maxpool 1.24.62 → 1.24.64

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.62",
3
+ "version": "1.24.64",
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",
@@ -3717,12 +3717,19 @@ export class AccountManager {
3717
3717
  }
3718
3718
 
3719
3719
  monthlyPriceFor(account) {
3720
+ // A cloud mirror carries no credential, so this pool cannot read its subscription;
3721
+ // the cloud pool reads it and exports it per row (remoteMonthlyPriceUSD).
3722
+ if (account?.remote && account.remoteMonthlyPriceUSD != null) return account.remoteMonthlyPriceUSD;
3720
3723
  if (account?.type === 'provider') return account.monthlyPriceUSD ?? null;
3721
3724
  const tbl = this.scheduler?.monthlyPriceUSD;
3722
3725
  if (tbl && typeof tbl === 'object') {
3723
3726
  const hit = tbl[account?.name] ?? tbl['*'];
3724
3727
  if (Number.isFinite(hit)) return hit;
3725
3728
  }
3729
+ // Owner 2026-10-31: "Claude monthly price is fixed, it's 200 dollars per month."
3730
+ // Anthropic has no per-account price API, so this is the default for every Claude
3731
+ // login; scheduler.monthlyPriceUSD (name or '*') overrides it.
3732
+ if (account?.type === 'oauth') return 200;
3726
3733
  return null;
3727
3734
  }
3728
3735
 
@@ -3988,6 +3995,19 @@ export class AccountManager {
3988
3995
  capacityTank(accountIndex, window) {
3989
3996
  const a = this.accounts[accountIndex];
3990
3997
  if (!a) return null;
3998
+ // A cloud mirror's history lives in TWO ledgers: this pool's, under the account's
3999
+ // pre-migration name (months of cycles measured locally before it moved), and the
4000
+ // cloud pool's own, exported per row as remoteTank. Mirror rows are named
4001
+ // "<name> ☁", which matched neither — so every cloud row read "--" (2026-10-31).
4002
+ if (a.remote) {
4003
+ // Prefer whichever ledger holds MORE cycles: the cloud pool only started
4004
+ // measuring at migration (2026-10-29), so for weeks its 0-2 cycles would
4005
+ // otherwise override months of history measured here.
4006
+ const cloud = a.remoteTank?.[window] || null;
4007
+ const local = this.capacity.tankStats(a.remote.remoteName || a.name, window);
4008
+ const best = (cloud && local) ? ((cloud.n || 0) >= (local.n || 0) ? cloud : local) : (cloud || local);
4009
+ return best ? { ...best, source: 'cycles' } : null;
4010
+ }
3991
4011
  const measured = this.capacity.tankStats(a.name, window);
3992
4012
  if (measured) return { ...measured, source: 'cycles' };
3993
4013
  const est = this.capacityEstimate(accountIndex, window);
@@ -4922,6 +4942,8 @@ export class AccountManager {
4922
4942
  a.addedAt = null; // H3: mirrors never count as "warming"
4923
4943
  a.resetCards = ra.resetCards || null;
4924
4944
  a.resetGrants = ra.resetGrants || null;
4945
+ a.remoteMonthlyPriceUSD = Number.isFinite(ra.monthlyPriceUSD) ? ra.monthlyPriceUSD : null;
4946
+ a.remoteTank = ra.tank || null;
4925
4947
  // Other teammates' live load on this cloud account (remote inFlight minus our
4926
4948
  // own leases) — so the balancer sees the account as busy as it really is.
4927
4949
  a._remoteOtherLoad = Math.max(0, (ra.inFlight || 0) - (a.inFlight || 0));
@@ -4975,6 +4997,15 @@ export class AccountManager {
4975
4997
  // counts and expiry only — no credentials; the redeem stays with the holder.
4976
4998
  resetCards: a.resetCards ? { fiveHour: a.resetCards.fiveHour, weekly: a.resetCards.weekly, checkedAt: a.resetCards.checkedAt } : null,
4977
4999
  resetGrants: a.resetGrants ? { grants: a.resetGrants.grants, cooldownUntil: a.resetGrants.cooldownUntil, checkedAt: a.resetGrants.checkedAt } : null,
5000
+ // Capacity-page inputs for linked pools (a mirror has no credential and no
5001
+ // local cycles): this pool's plan price and measured tanks, per window.
5002
+ monthlyPriceUSD: a.remote ? null : this.monthlyPriceFor(a),
5003
+ tank: a.remote ? null : (() => {
5004
+ const pick = w => { const t = this.capacity?.tankStats(a.name, w);
5005
+ return t ? { avg: t.avg, n: t.n, prev: t.prev, last: t.last, lowerBound: t.lowerBound } : null; };
5006
+ const ses = pick('ses'), wk = pick('wk');
5007
+ return ses || wk ? { ses, wk } : null;
5008
+ })(),
4978
5009
  // Identity for duplicate matching by linked pools (D12). The Claude account
4979
5010
  // UUID is an identifier, not a credential; provider keys export only a
4980
5011
  // fingerprint. Without these a linked pool can't see a duplicate Claude login
package/src/tui.js CHANGED
@@ -468,7 +468,7 @@ export class TUI {
468
468
  this.log = []; // completed activity entries
469
469
  this.active = new Map(); // in-flight requests
470
470
  this.mode = 'normal'; // normal | accounts | routing | capacity | select | input | confirm | providers | addtype
471
- this.capacityWindow = 'ses'; // capacity page window: 'ses' (5h) | 'wk' (weekly)
471
+ this.capacityWindow = 'wk'; // default weekly — the true tank (owner 2026-10-31); 'w' toggles to 5h
472
472
  // Hide disabled accounts from the table. With 8 dead/disabled accounts the live
473
473
  // ones scroll off the top; `h` collapses them to a one-line summary.
474
474
  // Restored from config so an auto-update/reload does not un-hide what the user hid.