maxpool 1.24.85 → 1.24.87

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.85",
3
+ "version": "1.24.87",
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",
@@ -5924,7 +5924,17 @@ export class AccountManager {
5924
5924
  // Model-scoped: the probe must have MEASURED that family's bucket at the wall.
5925
5925
  const e = account.quota?.scopedWeekly?.[kind];
5926
5926
  const measured = e && e.reactive !== true && e.utilization != null && e.utilization >= CLAUDE_WALL_WEEKLY;
5927
- return measured ? (grants.find(g => appliesTo(g).includes(kind)) || null) : null;
5927
+ if (!measured) return null;
5928
+ // NARROWEST FIRST (2026-11-11, owner report): a grant that directly CLEARS the
5929
+ // general weekly (full-reset shape: clears includes 'seven_day') is the
5930
+ // account's most powerful card — never spend it at a model-only wall while a
5931
+ // model-only grant remains. gives_back_weekly does NOT make a grant broad
5932
+ // (the give-back is a side effect of the model reset, not a weekly refill —
5933
+ // the client's own rule treats it as an OR). Within one breadth, the
5934
+ // soonest-expiry sort above still wins so nothing rots.
5935
+ const clearsWeekly = g => (Array.isArray(g.clears) ? g.clears : []).includes('seven_day');
5936
+ const narrow = grants.find(g => !clearsWeekly(g) && appliesTo(g).includes(kind));
5937
+ return narrow || grants.find(g => appliesTo(g).includes(kind)) || null;
5928
5938
  }
5929
5939
 
5930
5940
  /** A claim SUCCEEDED: spend it in the stored listing at once (finding 1). Until
package/src/tui.js CHANGED
@@ -2502,18 +2502,23 @@ export class TUI {
2502
2502
  for (const g of (rg.grants || [])) {
2503
2503
  if (!g || g.usableNow === false || g.paused || g.expired) continue;
2504
2504
  if (g.endsAt != null && g.endsAt <= now) continue; // live expiry
2505
- // The ONE shared scope answer (A1) — display reads the same
2506
- // classification as claim and lift. DISPLAY nuance (owner 2026-11-10
2507
- // "distinguish model-specific vs general"): a grant that refills a
2508
- // MODEL limit (scoped) shows under its model tag even when it ALSO
2509
- // gives back to the weekly — the give-back is a side effect, not the
2510
- // grant's identity. Only an unscoped general refiller counts general.
2505
+ // Display counts GRANTS by identity, not capabilities (owner
2506
+ // 2026-11-11: the screen showed "3Fable" while Anthropic's own screen
2507
+ // says "two fable and one regular weekly"). A grant that directly
2508
+ // clears the general weekly (full-reset shape: clears includes
2509
+ // 'seven_day') IS a weekly reset however much else it also clears —
2510
+ // count it general, once. Model-only grants count scoped; the
2511
+ // give-back side effect adds no display count (B3.1 nuance, 2026-11-10).
2512
+ // Claim and lift still read appliesTo() — the full reset stays eligible
2513
+ // at a model wall, and narrow-first spending (2026-11-11) keeps it for
2514
+ // the weekly wall.
2511
2515
  const scopes = appliesTo(g);
2516
+ const clearsWeekly = (Array.isArray(g.clears) ? g.clears : []).includes('seven_day');
2512
2517
  const hasScoped = scopes.some(x => x !== 'general' && x !== 'session');
2513
- const hasGeneral = scopes.includes('general');
2514
2518
  const left = Math.max(0, Math.floor(g.resetsLeft ?? 1));
2515
- if (hasScoped) scoped += left;
2516
- else if (hasGeneral) general += left;
2519
+ if (clearsWeekly) general += left;
2520
+ else if (hasScoped) scoped += left;
2521
+ else if (scopes.includes('general')) general += left;
2517
2522
  else unknown += left;
2518
2523
  if (g.endsAt != null && g.endsAt < soonest) soonest = g.endsAt;
2519
2524
  }
@@ -2555,7 +2560,11 @@ export class TUI {
2555
2560
  let text = coreFable + suffix;
2556
2561
  if (text.length > RESETS_W) text = coreFable;
2557
2562
  if (text.length > RESETS_W) text = `${total}*`.slice(0, RESETS_W);
2558
- if (notFresh) text = (text + '?').length <= RESETS_W ? text + '?' : `${total}?`.slice(0, RESETS_W);
2563
+ // Not-fresh: append '?' only when it fits. When it does not ('1+2Fable' is
2564
+ // already 8), keep the breakdown and let the gray colour carry staleness —
2565
+ // collapsing to '3?' made the cell flip 1+2Fable → 3? → 1+2Fable across every
2566
+ // self-update (owner 2026-11-10: "the number of resets keeps changing").
2567
+ if (notFresh && (text + '?').length <= RESETS_W) text += '?';
2559
2568
  resetsCell = rpad(total > 0 && !notFresh ? green(text) : gray(text), RESETS_W);
2560
2569
  }
2561
2570