dsh-agy-link 0.6.56 → 0.6.57

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/dist/client.js CHANGED
@@ -9870,11 +9870,16 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
9870
9870
  * `updatedAt` of the snapshot it overrode; the gate stays off only while the
9871
9871
  * cached row is no newer than that stamp, so a fresh poll always re-arms it.
9872
9872
  */
9873
- function isQuotaBenched(acc, family, now) {
9873
+ function isQuotaBenched(acc, family, now, model) {
9874
9874
  const quota = acc.quotas?.[family] ?? (family === "argon" ? acc.quotas?.google : void 0);
9875
9875
  if (!quota) return false;
9876
9876
  const clearedAt = acc.quotaGateClearedAt?.[family];
9877
- return is5hQuotaBenched(quota, clearedAt, now) || isWeeklyQuotaBenched(quota, clearedAt, now);
9877
+ if (is5hQuotaBenched(quota, clearedAt, now) || isWeeklyQuotaBenched(quota, clearedAt, now)) return true;
9878
+ if (!model || model.trim() === "" || !Array.isArray(quota.models)) return false;
9879
+ if (clearedAt !== void 0 && (quota.updatedAt ?? 0) <= clearedAt) return false;
9880
+ const matched = quota.models.filter((m) => modelMatches(model, m.modelId));
9881
+ if (matched.length === 0) return false;
9882
+ return matched.every((m) => isWindowBenched(m.remainingFraction, m.resetTime ?? quota.resetTime, LOW_QUOTA_WEEKLY, now));
9878
9883
  }
9879
9884
  /** True when any family on the account has an active local 429 cooldown timer. */
9880
9885
  function accountHasActiveCooldown(acc, now) {