tokenmaxxing 1.133.0 → 1.134.0

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": "tokenmaxxing",
3
- "version": "1.133.0",
3
+ "version": "1.134.0",
4
4
  "description": "Automatic Claude Code account switching: pool multiple accounts, start each session on its own account, and resume a session on a fresher account when quota fills.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/lib/decide.ts CHANGED
@@ -235,10 +235,11 @@ export async function evaluateAndMaybeSwap(p: Provider, now = Date.now(), canRes
235
235
  const ctx: PickCtx = { now, thresholds: bars, currentId: current?.id ?? null, families: switchFamilies, seats };
236
236
  const others = liveWaitClaims(now).filter((c) => c.sessionId !== waiterId);
237
237
  const waiters = new Map(Object.entries(countBy(others, (c) => c.accountId)));
238
- const target = pickWaitTarget(usable(fresh.accounts), ctx, waiters, MAX_WAITERS_PER_ACCOUNT, now + cfg.policy.maxWaitMs, now + 2 * cfg.policy.maxWaitMs);
238
+ const waitable = usable(fresh.accounts).filter((a) => keyId == null || !opts.refused?.includes(a.id));
239
+ const target = pickWaitTarget(waitable, ctx, waiters, MAX_WAITERS_PER_ACCOUNT, now + cfg.policy.maxWaitMs, now + 2 * cfg.policy.maxWaitMs);
239
240
 
240
241
  if (!target) {
241
- const soonest = pickWaitTarget(usable(fresh.accounts), ctx, new Map(), MAX_WAITERS_PER_ACCOUNT, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);
242
+ const soonest = pickWaitTarget(waitable, ctx, new Map(), MAX_WAITERS_PER_ACCOUNT, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);
242
243
  const waitUntil = soonest?.availableAt ?? Number.POSITIVE_INFINITY;
243
244
  log("decide.depleted", { waitUntil: Number.isFinite(waitUntil) ? waitUntil : 0 });
244
245
  return { swapped: false, account: null, reason: "all-depleted", ...(Number.isFinite(waitUntil) ? { waitUntil } : {}) };