@anthonyhaussman/opencode-agy-auth 1.0.11-alpha.1 → 1.0.11-alpha.2

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/index.js CHANGED
@@ -14161,6 +14161,9 @@ async function fetchTokenRefresh(refreshToken) {
14161
14161
 
14162
14162
  // src/plugin/quota-utils.ts
14163
14163
  function clamp(value, min, max) {
14164
+ if (Number.isNaN(value)) {
14165
+ return min;
14166
+ }
14164
14167
  if (value < min) {
14165
14168
  return min;
14166
14169
  }
@@ -14185,7 +14188,7 @@ function formatRemainingAmount(value) {
14185
14188
  if (!value) {
14186
14189
  return void 0;
14187
14190
  }
14188
- const parsed = Number.parseInt(value, 10);
14191
+ const parsed = Number(value);
14189
14192
  if (!Number.isFinite(parsed)) {
14190
14193
  return value;
14191
14194
  }
@@ -14527,7 +14530,8 @@ function windowLabel(window) {
14527
14530
  }
14528
14531
  function formatSummaryBucket(bucket, indent) {
14529
14532
  if (bucket.disabled) {
14530
- const desc = bucket.description?.trim() || "weekly limit exhausted";
14533
+ const defaultDesc = `${windowLabel(bucket.window).toLowerCase()} exhausted`;
14534
+ const desc = bucket.description?.trim() || defaultDesc;
14531
14535
  return [`${indent}Disabled: ${desc}`];
14532
14536
  }
14533
14537
  const lines = [];
@@ -14552,7 +14556,8 @@ function formatSummaryBucket(bucket, indent) {
14552
14556
  }
14553
14557
  const resetLabel = formatRelativeResetTime(bucket.resetTime);
14554
14558
  if (resetLabel) {
14555
- lines.push(`${indent}${resetLabel.replace("resets in ", "Refreshes in ")}`);
14559
+ const formattedReset = resetLabel.startsWith("resets in ") ? resetLabel.replace("resets in ", "Refreshes in ") : resetLabel.charAt(0).toUpperCase() + resetLabel.slice(1);
14560
+ lines.push(`${indent}${formattedReset}`);
14556
14561
  }
14557
14562
  return lines;
14558
14563
  }
@@ -14601,7 +14606,8 @@ function formatSummaryGroup(group) {
14601
14606
  lines.push("");
14602
14607
  }
14603
14608
  for (const bucket of windowBuckets) {
14604
- const label = windowLabel(bucket.window);
14609
+ const baseLabel = windowLabel(bucket.window);
14610
+ const label = bucket.displayName ? `${baseLabel} (${bucket.displayName})` : baseLabel;
14605
14611
  lines.push(` ${label}`);
14606
14612
  lines.push(...formatSummaryBucket(bucket, " "));
14607
14613
  firstWindow = false;
@@ -14619,7 +14625,8 @@ function formatTopLevelBuckets(buckets) {
14619
14625
  lines.push("");
14620
14626
  }
14621
14627
  for (const bucket of windowBuckets) {
14622
- const label = windowLabel(bucket.window);
14628
+ const baseLabel = windowLabel(bucket.window);
14629
+ const label = bucket.displayName ? `${baseLabel} (${bucket.displayName})` : baseLabel;
14623
14630
  lines.push(label);
14624
14631
  lines.push(...formatSummaryBucket(bucket, " "));
14625
14632
  firstWindow = false;
@@ -14641,7 +14648,6 @@ function formatAgyQuotaSummaryOutput(projectId, summary) {
14641
14648
  }
14642
14649
  if (i > 0) {
14643
14650
  lines.push("");
14644
- lines.push("");
14645
14651
  }
14646
14652
  lines.push(...formatSummaryGroup(group));
14647
14653
  }