@expiren/opencode-antigravity-auth 1.6.26 → 1.6.27

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
@@ -1683,11 +1683,11 @@ function classifyOverallQuotaHealth(cachedQuota) {
1683
1683
  if (!cachedQuota) {
1684
1684
  return { health: "unknown" };
1685
1685
  }
1686
- const QUOTA_KEYS = ["claude", "gemini-pro", "gemini-flash"];
1686
+ const QUOTA_KEYS2 = ["claude", "gemini-pro", "gemini-flash"];
1687
1687
  let groupsWithData = 0;
1688
1688
  let exhaustedCount = 0;
1689
1689
  let maxResetMs;
1690
- for (const key of QUOTA_KEYS) {
1690
+ for (const key of QUOTA_KEYS2) {
1691
1691
  const value = cachedQuota[key]?.remainingFraction;
1692
1692
  if (typeof value !== "number" || !Number.isFinite(value)) continue;
1693
1693
  groupsWithData++;
@@ -1803,6 +1803,42 @@ function getHealthLabel(acc) {
1803
1803
  if (acc.status === "expired") return "expired";
1804
1804
  return "other";
1805
1805
  }
1806
+ var QUOTA_KEYS = [
1807
+ { key: "claude", label: "Claude" },
1808
+ { key: "gemini-pro", label: "Gemini Pro" },
1809
+ { key: "gemini-flash", label: "Gemini Flash" }
1810
+ ];
1811
+ function parseResetTimeToMs2(resetTime) {
1812
+ if (!resetTime) return null;
1813
+ const timestamp = Date.parse(resetTime);
1814
+ if (!Number.isFinite(timestamp)) return null;
1815
+ const ms = timestamp - Date.now();
1816
+ return ms > 0 ? ms : null;
1817
+ }
1818
+ function buildModelBreakdown(accounts) {
1819
+ const results = [];
1820
+ for (const { key, label } of QUOTA_KEYS) {
1821
+ let exhaustedCount = 0;
1822
+ let maxResetMs;
1823
+ for (const acc of accounts) {
1824
+ if (acc.enabled === false) continue;
1825
+ const group = acc.cachedQuota?.[key];
1826
+ if (!group || typeof group.remainingFraction !== "number") continue;
1827
+ if (group.remainingFraction <= 0) {
1828
+ exhaustedCount++;
1829
+ const resetMs = parseResetTimeToMs2(group.resetTime);
1830
+ if (resetMs !== null && (maxResetMs === void 0 || resetMs > maxResetMs)) {
1831
+ maxResetMs = resetMs;
1832
+ }
1833
+ }
1834
+ }
1835
+ if (exhaustedCount > 0) {
1836
+ const resetSuffix = maxResetMs !== void 0 ? ` ~${formatWaitDuration(maxResetMs)}` : "";
1837
+ results.push(`${label}: ${exhaustedCount} exhausted${resetSuffix}`);
1838
+ }
1839
+ }
1840
+ return results;
1841
+ }
1806
1842
  function buildAccountSummary(accounts) {
1807
1843
  const counts = {};
1808
1844
  for (const acc of accounts) {
@@ -1811,7 +1847,10 @@ function buildAccountSummary(accounts) {
1811
1847
  }
1812
1848
  const order = ["active", "limited", "exhausted", "rate-limited", "expired", "disabled", "other"];
1813
1849
  const parts = order.filter((label) => (counts[label] ?? 0) > 0).map((label) => `${counts[label]} ${label}`);
1814
- return parts.length > 0 ? `Accounts (${parts.join(", ")})` : "Accounts";
1850
+ const modelBreakdown = buildModelBreakdown(accounts);
1851
+ const summary = parts.length > 0 ? parts.join(", ") : "";
1852
+ const modelPart = modelBreakdown.length > 0 ? ` | ${modelBreakdown.join(", ")}` : "";
1853
+ return summary ? `Accounts (${summary}${modelPart})` : "Accounts";
1815
1854
  }
1816
1855
  function buildAccountHint(account) {
1817
1856
  if (account.quotaSummary) {
@@ -1896,7 +1935,7 @@ async function showFingerprintHistory(history, accountLabel) {
1896
1935
  { label: "", value: null, separator: true },
1897
1936
  { label: "Fingerprint history", value: null, kind: "heading" },
1898
1937
  ...history.map((entry, index) => {
1899
- const deviceShort = entry.deviceId.slice(0, 8);
1938
+ const deviceShort = entry.fingerprint.deviceId.slice(0, 8);
1900
1939
  const reasonBadge = `${ANSI.dim}[${formatFingerprintReason(entry.reason)}]${ANSI.reset}`;
1901
1940
  const label = `${index + 1}. ${deviceShort}... ${reasonBadge}`;
1902
1941
  const hint = formatRelativeTime(entry.timestamp);
@@ -12890,6 +12929,7 @@ Alternatively, you can:
12890
12929
  status = "rate-limited";
12891
12930
  }
12892
12931
  }
12932
+ const cooldownMs = acc.coolingDownUntil && acc.coolingDownUntil > now ? acc.coolingDownUntil - now : void 0;
12893
12933
  return {
12894
12934
  email: acc.email,
12895
12935
  index: idx,
@@ -12898,7 +12938,11 @@ Alternatively, you can:
12898
12938
  status,
12899
12939
  isCurrentAccount: idx === (existingStorage2.activeIndex ?? 0),
12900
12940
  enabled: acc.enabled !== false,
12901
- quotaSummary: formatCachedQuotaSummary(acc)
12941
+ quotaSummary: formatCachedQuotaSummary(acc),
12942
+ cooldownMs,
12943
+ cooldownReason: cooldownMs ? acc.cooldownReason : void 0,
12944
+ cachedQuota: acc.cachedQuota,
12945
+ fingerprintHistory: acc.fingerprintHistory
12902
12946
  };
12903
12947
  });
12904
12948
  menuResult = await promptLoginMode(existingAccounts);