@cortexkit/opencode-antigravity-auth 3.0.8 → 3.0.9
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/cli.js +96 -15
- package/dist/cli.js.map +3 -3
- package/dist/cli.meta.json +25 -15
- package/dist/index.js +256 -69
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +43 -30
- package/dist/server.js +261 -72
- package/dist/server.js.map +4 -4
- package/dist/server.meta.json +1 -1
- package/dist/src/common-auth-embedded/auth-menu/login.d.ts +6 -10
- package/dist/src/common-auth-embedded/auth-menu/login.js +14 -11
- package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +5 -1
- package/dist/src/common-auth-embedded/claustrum/consumer.js +40 -1
- package/dist/src/common-auth-embedded/claustrum/index.d.ts +1 -1
- package/dist/src/common-auth-embedded/claustrum/insula.d.ts +23 -0
- package/dist/src/common-auth-embedded/claustrum/insula.js +64 -2
- package/dist/src/common-auth-embedded/source-output.json +27 -27
- package/dist/src/plugin/background-vault-quota-refresh.d.ts.map +1 -1
- package/dist/src/plugin/background-vault-quota-refresh.js +8 -1
- package/dist/src/plugin/background-vault-quota-refresh.js.map +1 -1
- package/dist/src/plugin/index.d.ts.map +1 -1
- package/dist/src/plugin/index.js +1 -0
- package/dist/src/plugin/index.js.map +1 -1
- package/dist/src/plugin/quota.d.ts +1 -1
- package/dist/src/plugin/quota.d.ts.map +1 -1
- package/dist/src/plugin/quota.js +17 -5
- package/dist/src/plugin/quota.js.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.d.ts +9 -6
- package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.js +9 -4
- package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -1
- package/dist/src/plugin/vault-custody.d.ts +2 -0
- package/dist/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/src/plugin/vault-custody.js +9 -0
- package/dist/src/plugin/vault-custody.js.map +1 -1
- package/dist/src/plugin/vault-insula-quota.d.ts +6 -0
- package/dist/src/plugin/vault-insula-quota.d.ts.map +1 -0
- package/dist/src/plugin/vault-insula-quota.js +50 -0
- package/dist/src/plugin/vault-insula-quota.js.map +1 -0
- package/dist/src/plugin/vault-quota-outcome.d.ts +1 -1
- package/dist/src/plugin/vault-quota-outcome.d.ts.map +1 -1
- package/dist/src/plugin/vault-quota-outcome.js.map +1 -1
- package/dist/tui-build-map.json +1 -1
- package/dist/tui-ga-build-map.json +1 -1
- package/dist/types/src/common-auth-embedded/claustrum/consumer.d.ts +5 -1
- package/dist/types/src/common-auth-embedded/claustrum/index.d.ts +1 -1
- package/dist/types/src/common-auth-embedded/claustrum/insula.d.ts +23 -0
- package/dist/types/src/plugin/background-vault-quota-refresh.d.ts.map +1 -1
- package/dist/types/src/plugin/index.d.ts.map +1 -1
- package/dist/types/src/plugin/quota.d.ts +1 -1
- package/dist/types/src/plugin/quota.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +9 -6
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/types/src/plugin/vault-custody.d.ts +2 -0
- package/dist/types/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/types/src/plugin/vault-insula-quota.d.ts +6 -0
- package/dist/types/src/plugin/vault-insula-quota.d.ts.map +1 -0
- package/dist/types/src/plugin/vault-quota-outcome.d.ts +1 -1
- package/dist/types/src/plugin/vault-quota-outcome.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/common-auth-embedded/auth-menu/login.d.ts +6 -10
- package/src/common-auth-embedded/auth-menu/login.js +14 -11
- package/src/common-auth-embedded/claustrum/consumer.d.ts +5 -1
- package/src/common-auth-embedded/claustrum/consumer.js +40 -1
- package/src/common-auth-embedded/claustrum/index.d.ts +1 -1
- package/src/common-auth-embedded/claustrum/insula.d.ts +23 -0
- package/src/common-auth-embedded/claustrum/insula.js +64 -2
- package/src/common-auth-embedded/source-output.json +27 -27
package/dist/index.js
CHANGED
|
@@ -323,8 +323,8 @@ function displayOrder(left, right) {
|
|
|
323
323
|
return left.label < right.label ? -1 : left.label > right.label ? 1 : 0;
|
|
324
324
|
}
|
|
325
325
|
function quotaWindowParts(quota, options) {
|
|
326
|
-
const { windows, age } = scopedWindowParts(quota, options);
|
|
327
|
-
const parts =
|
|
326
|
+
const { windows: windows2, age } = scopedWindowParts(quota, options);
|
|
327
|
+
const parts = windows2.map(({ part }) => part);
|
|
328
328
|
return age === void 0 ? { windows: parts } : { windows: parts, age };
|
|
329
329
|
}
|
|
330
330
|
function scopedWindowParts(quota, options) {
|
|
@@ -332,7 +332,7 @@ function scopedWindowParts(quota, options) {
|
|
|
332
332
|
return { windows: [] };
|
|
333
333
|
const { now } = options;
|
|
334
334
|
const readings = quota.limits.filter((limit) => limit.kind === "reading" && limit.remainingPercent !== void 0).sort(displayOrder);
|
|
335
|
-
const
|
|
335
|
+
const windows2 = readings.map((limit) => {
|
|
336
336
|
const remainingPercent = clampPercent(limit.remainingPercent ?? 0);
|
|
337
337
|
return {
|
|
338
338
|
scope: limit.scope,
|
|
@@ -351,7 +351,7 @@ function scopedWindowParts(quota, options) {
|
|
|
351
351
|
if (budget) {
|
|
352
352
|
const remainingPercent = budget.remainingPercent;
|
|
353
353
|
const figure = budget.reached ? "credits spent" : remainingPercent !== void 0 ? `credits ${percentLeft(remainingPercent)}` : "credits available";
|
|
354
|
-
|
|
354
|
+
windows2.push({
|
|
355
355
|
scope: ALL_SCOPE,
|
|
356
356
|
spent: budget.reached,
|
|
357
357
|
part: {
|
|
@@ -364,13 +364,13 @@ function scopedWindowParts(quota, options) {
|
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
|
-
if (
|
|
368
|
-
const age = now - Math.min(...
|
|
367
|
+
if (windows2.length > 0) {
|
|
368
|
+
const age = now - Math.min(...windows2.map(({ part }) => part.checkedAt));
|
|
369
369
|
if (age > (options.staleAfterMs ?? QUOTA_STALE_AFTER_MS)) {
|
|
370
|
-
return { windows, age: `checked ${shortSpan(age)} ago` };
|
|
370
|
+
return { windows: windows2, age: `checked ${shortSpan(age)} ago` };
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
return { windows };
|
|
373
|
+
return { windows: windows2 };
|
|
374
374
|
}
|
|
375
375
|
function isQuotaStale(quota, options) {
|
|
376
376
|
return scopedWindowParts(quota, options).age !== void 0;
|
|
@@ -410,10 +410,10 @@ function groupShortNames(groups) {
|
|
|
410
410
|
const short = scopeAbbreviations(labels);
|
|
411
411
|
return labels.map((label) => short.get(label) ?? label);
|
|
412
412
|
}
|
|
413
|
-
function groupedNarrowPieces(groups,
|
|
413
|
+
function groupedNarrowPieces(groups, windows2) {
|
|
414
414
|
if (!groups || groups.length === 0)
|
|
415
415
|
return void 0;
|
|
416
|
-
const reported =
|
|
416
|
+
const reported = windows2.filter(({ part }) => part.kind === "window");
|
|
417
417
|
if (reported.some(({ scope }) => scope === ALL_SCOPE))
|
|
418
418
|
return void 0;
|
|
419
419
|
const candidates = groups.flatMap((group, listed) => {
|
|
@@ -437,14 +437,14 @@ function groupedNarrowPieces(groups, windows) {
|
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
439
|
function narrowTextParts(quota, options) {
|
|
440
|
-
const { windows } = scopedWindowParts(quota, options);
|
|
441
|
-
const grouped = groupedNarrowPieces(quota?.groups,
|
|
440
|
+
const { windows: windows2 } = scopedWindowParts(quota, options);
|
|
441
|
+
const grouped = groupedNarrowPieces(quota?.groups, windows2);
|
|
442
442
|
if (grouped)
|
|
443
443
|
return grouped;
|
|
444
|
-
const general =
|
|
445
|
-
const scoped =
|
|
444
|
+
const general = windows2.filter(({ part, scope }) => part.kind === "window" && scope === ALL_SCOPE);
|
|
445
|
+
const scoped = windows2.filter(({ part, scope }) => part.kind === "window" && scope !== ALL_SCOPE);
|
|
446
446
|
const abbreviations = scopeAbbreviations(scoped.map(({ scope }) => scope));
|
|
447
|
-
const budget =
|
|
447
|
+
const budget = windows2.find(({ part }) => part.kind === "budget");
|
|
448
448
|
const budgetLeft = budget?.spent ? 0 : budget?.part.remainingPercent;
|
|
449
449
|
const extras = [
|
|
450
450
|
...scoped.map(({ scope, part }) => ({
|
|
@@ -459,7 +459,7 @@ function narrowTextParts(quota, options) {
|
|
|
459
459
|
pieces.push(`${tightest.label} ${wholePercent(tightest.remaining)}%`);
|
|
460
460
|
}
|
|
461
461
|
if (pieces.length === 0)
|
|
462
|
-
return
|
|
462
|
+
return windows2.map(({ part }) => part.figure);
|
|
463
463
|
return pieces.map((piece, index) => index === pieces.length - 1 ? `${piece} left` : piece);
|
|
464
464
|
}
|
|
465
465
|
function quotaTextParts(quota, options) {
|
|
@@ -7227,12 +7227,12 @@ var init_doctor = __esm({
|
|
|
7227
7227
|
});
|
|
7228
7228
|
|
|
7229
7229
|
// ../core/dist/common-auth-embedded/auth-menu/login.js
|
|
7230
|
-
import {
|
|
7231
|
-
function openBrowserForMenu(url, platform = process.platform,
|
|
7230
|
+
import { spawn as defaultSpawn } from "node:child_process";
|
|
7231
|
+
function openBrowserForMenu(url, platform = process.platform, spawn2 = defaultSpawn) {
|
|
7232
7232
|
try {
|
|
7233
7233
|
if (platform === "win32") {
|
|
7234
7234
|
const command = `Start-Process '${url.replaceAll("'", "''")}'`;
|
|
7235
|
-
const
|
|
7235
|
+
const child2 = spawn2("powershell.exe", [
|
|
7236
7236
|
"-NoProfile",
|
|
7237
7237
|
"-NonInteractive",
|
|
7238
7238
|
"-WindowStyle",
|
|
@@ -7240,17 +7240,18 @@ function openBrowserForMenu(url, platform = process.platform, execFileSync = def
|
|
|
7240
7240
|
"-EncodedCommand",
|
|
7241
7241
|
Buffer.from(command, "utf16le").toString("base64")
|
|
7242
7242
|
], { stdio: "ignore", windowsHide: true });
|
|
7243
|
-
|
|
7244
|
-
});
|
|
7245
|
-
child.unref();
|
|
7246
|
-
return child.pid !== void 0;
|
|
7247
|
-
} else {
|
|
7248
|
-
execFileSync(platform === "darwin" ? "open" : "xdg-open", [url], {
|
|
7249
|
-
stdio: "ignore",
|
|
7250
|
-
timeout: 3e3
|
|
7243
|
+
child2.on("error", () => {
|
|
7251
7244
|
});
|
|
7245
|
+
child2.unref();
|
|
7246
|
+
return child2.pid !== void 0;
|
|
7252
7247
|
}
|
|
7253
|
-
|
|
7248
|
+
const child = spawn2(platform === "darwin" ? "open" : "xdg-open", [url], {
|
|
7249
|
+
stdio: "ignore"
|
|
7250
|
+
});
|
|
7251
|
+
child.on("error", () => {
|
|
7252
|
+
});
|
|
7253
|
+
child.unref();
|
|
7254
|
+
return child.pid !== void 0;
|
|
7254
7255
|
} catch {
|
|
7255
7256
|
return false;
|
|
7256
7257
|
}
|
|
@@ -8523,7 +8524,7 @@ function acquireInsulaQuotaSource(transport, tokenPath) {
|
|
|
8523
8524
|
}
|
|
8524
8525
|
};
|
|
8525
8526
|
}
|
|
8526
|
-
var MINUTE, MAX_AGE, sources, attempts, InsulaQuotaSource;
|
|
8527
|
+
var MINUTE, MAX_AGE, COLD_WAIT, sources, attempts, InsulaQuotaSource;
|
|
8527
8528
|
var init_insula = __esm({
|
|
8528
8529
|
"../core/dist/common-auth-embedded/claustrum/insula.js"() {
|
|
8529
8530
|
"use strict";
|
|
@@ -8531,12 +8532,16 @@ var init_insula = __esm({
|
|
|
8531
8532
|
init_watch();
|
|
8532
8533
|
MINUTE = 6e4;
|
|
8533
8534
|
MAX_AGE = 4 * MINUTE;
|
|
8535
|
+
COLD_WAIT = 2 * MINUTE;
|
|
8534
8536
|
sources = /* @__PURE__ */ new Map();
|
|
8535
8537
|
attempts = /* @__PURE__ */ new Map();
|
|
8536
8538
|
InsulaQuotaSource = class {
|
|
8537
8539
|
transport;
|
|
8538
8540
|
key;
|
|
8539
8541
|
#entries = [];
|
|
8542
|
+
#available = false;
|
|
8543
|
+
#completeProviders = /* @__PURE__ */ new Set();
|
|
8544
|
+
#coldSince = /* @__PURE__ */ new Map();
|
|
8540
8545
|
/** Every usage.get, polled or watch-driven, shares this one slot. */
|
|
8541
8546
|
#reads = new CoalescedRead(async () => {
|
|
8542
8547
|
try {
|
|
@@ -8544,8 +8549,14 @@ var init_insula = __esm({
|
|
|
8544
8549
|
if (!record2(reply) || !Array.isArray(reply.result) || reply.error !== void 0)
|
|
8545
8550
|
throw new Error("unavailable insula usage");
|
|
8546
8551
|
this.#entries = reply.result.filter((entry) => record2(entry) && typeof entry.provider === "string");
|
|
8552
|
+
this.#available = this.#entries.length === reply.result.length && (reply.completeProviders === void 0 || Array.isArray(reply.completeProviders) && reply.completeProviders.every((value) => typeof value === "string"));
|
|
8553
|
+
this.#completeProviders = new Set(this.#available && Array.isArray(reply.completeProviders) ? reply.completeProviders : []);
|
|
8554
|
+
for (const provider2 of this.#completeProviders)
|
|
8555
|
+
this.#coldSince.delete(provider2);
|
|
8547
8556
|
} catch {
|
|
8548
8557
|
this.#entries = [];
|
|
8558
|
+
this.#available = false;
|
|
8559
|
+
this.#completeProviders.clear();
|
|
8549
8560
|
}
|
|
8550
8561
|
}, () => {
|
|
8551
8562
|
});
|
|
@@ -8724,6 +8735,37 @@ var init_insula = __esm({
|
|
|
8724
8735
|
}
|
|
8725
8736
|
return void 0;
|
|
8726
8737
|
}
|
|
8738
|
+
/** Cache-only background lookup; current() retains its original miss behavior. */
|
|
8739
|
+
lookup(provider2, accountId, now) {
|
|
8740
|
+
if (!this.#available)
|
|
8741
|
+
return { miss: "unreachable" };
|
|
8742
|
+
const entry = this.#entries.find((value) => value.provider === provider2 && typeof value.account === "string" && value.account.trim() === accountId);
|
|
8743
|
+
const errorClass = (entry ?? this.#entries.find((value) => value.provider === provider2 && value.account === void 0 && value.errorClass !== void 0))?.errorClass;
|
|
8744
|
+
if (errorClass === "upstream_failed")
|
|
8745
|
+
return { miss: "upstream-failed" };
|
|
8746
|
+
if (errorClass === "credential_absent" || errorClass === "credential_unusable" || errorClass === "credential_rejected")
|
|
8747
|
+
return { miss: "credential" };
|
|
8748
|
+
if (errorClass !== void 0)
|
|
8749
|
+
return { miss: "unreachable" };
|
|
8750
|
+
if (entry) {
|
|
8751
|
+
const fetchedAt = typeof entry.fetchedAt === "string" ? Date.parse(entry.fetchedAt) : Number.NaN;
|
|
8752
|
+
if (!record2(entry.usage) || !Number.isFinite(fetchedAt))
|
|
8753
|
+
return { miss: "unreachable" };
|
|
8754
|
+
const reading = {
|
|
8755
|
+
entry,
|
|
8756
|
+
context: {
|
|
8757
|
+
fetchedAt,
|
|
8758
|
+
...typeof entry.source === "string" && { source: entry.source }
|
|
8759
|
+
}
|
|
8760
|
+
};
|
|
8761
|
+
return now >= fetchedAt + MAX_AGE || entry.stale !== void 0 ? { miss: "stale", reading } : { reading };
|
|
8762
|
+
}
|
|
8763
|
+
if (this.#completeProviders.has(provider2))
|
|
8764
|
+
return { miss: "absent" };
|
|
8765
|
+
const since = this.#coldSince.get(provider2) ?? now;
|
|
8766
|
+
this.#coldSince.set(provider2, since);
|
|
8767
|
+
return { miss: now - since >= COLD_WAIT ? "unreachable" : "cold" };
|
|
8768
|
+
}
|
|
8727
8769
|
};
|
|
8728
8770
|
}
|
|
8729
8771
|
});
|
|
@@ -10501,6 +10543,7 @@ var init_consumer = __esm({
|
|
|
10501
10543
|
#insula;
|
|
10502
10544
|
#vaultWatch;
|
|
10503
10545
|
#releaseInsulaWatch;
|
|
10546
|
+
#insulaSkips = /* @__PURE__ */ new Map();
|
|
10504
10547
|
/** When this instance last completed a discovery, by `now`. */
|
|
10505
10548
|
#discoveredAt;
|
|
10506
10549
|
constructor(options) {
|
|
@@ -10794,6 +10837,41 @@ var init_consumer = __esm({
|
|
|
10794
10837
|
return void 0;
|
|
10795
10838
|
}
|
|
10796
10839
|
}
|
|
10840
|
+
/** Cache-only background lookup, preserving the reason a route has no reading. */
|
|
10841
|
+
async lookupInsulaQuotaForRoute(routeId) {
|
|
10842
|
+
const options = this.#options.insula;
|
|
10843
|
+
if (!options || this.#shutdown.signal.aborted || !await this.#active())
|
|
10844
|
+
return { miss: "unreachable" };
|
|
10845
|
+
try {
|
|
10846
|
+
await readClaustrumEnrollmentToken(this.#options.tokenPath);
|
|
10847
|
+
const roster = await readVaultRoster(this.#options.rosterPath);
|
|
10848
|
+
const account = roster?.rows.find((row) => row.routeId === routeId)?.accountIdentity;
|
|
10849
|
+
if (!account || !this.#insula)
|
|
10850
|
+
return { miss: "unreachable" };
|
|
10851
|
+
const result = this.#insula.source.lookup(options.provider, account, (this.#options.now ?? Date.now)());
|
|
10852
|
+
const reading = result.reading && options.normalize(result.reading.entry, result.reading.context);
|
|
10853
|
+
if (result.miss)
|
|
10854
|
+
return { miss: result.miss, ...reading !== void 0 && { reading } };
|
|
10855
|
+
return reading === void 0 ? { miss: "unreachable" } : { reading };
|
|
10856
|
+
} catch {
|
|
10857
|
+
return { miss: "unreachable" };
|
|
10858
|
+
}
|
|
10859
|
+
}
|
|
10860
|
+
/** Skip the fallback poll while insula is cold or its upstream fetch failed. */
|
|
10861
|
+
async pollInsulaQuotaForRoute(routeId, fallback) {
|
|
10862
|
+
const result = await this.lookupInsulaQuotaForRoute(routeId);
|
|
10863
|
+
if (result.miss === "cold" || result.miss === "upstream-failed") {
|
|
10864
|
+
if (this.#insulaSkips.get(routeId) !== result.miss) {
|
|
10865
|
+
this.#insulaSkips.set(routeId, result.miss);
|
|
10866
|
+
this.#logger.warn("skipped insula provider poll", {
|
|
10867
|
+
reason: result.miss
|
|
10868
|
+
});
|
|
10869
|
+
}
|
|
10870
|
+
return void 0;
|
|
10871
|
+
}
|
|
10872
|
+
this.#insulaSkips.delete(routeId);
|
|
10873
|
+
return result.miss ? fallback() : result.reading;
|
|
10874
|
+
}
|
|
10797
10875
|
#normalizeInsulaQuota(accountIdentity) {
|
|
10798
10876
|
if (!this.#options.insula || !accountIdentity)
|
|
10799
10877
|
return void 0;
|
|
@@ -21006,6 +21084,7 @@ var ANTIGRAVITY_SCOPES = [
|
|
|
21006
21084
|
var ANTIGRAVITY_REDIRECT_URI = "http://localhost:51121/oauth-callback";
|
|
21007
21085
|
var ANTIGRAVITY_ENDPOINT_DAILY = "https://daily-cloudcode-pa.googleapis.com";
|
|
21008
21086
|
var ANTIGRAVITY_ENDPOINT_PROD = "https://cloudcode-pa.googleapis.com";
|
|
21087
|
+
var ANTIGRAVITY_QUOTA_ENDPOINT = ANTIGRAVITY_ENDPOINT_DAILY;
|
|
21009
21088
|
var ANTIGRAVITY_ENDPOINT_FALLBACKS = [
|
|
21010
21089
|
ANTIGRAVITY_ENDPOINT_DAILY,
|
|
21011
21090
|
ANTIGRAVITY_ENDPOINT_PROD
|
|
@@ -21407,9 +21486,9 @@ function projectAntigravityQuota(quota) {
|
|
|
21407
21486
|
const model = MODEL_LABELS[scope];
|
|
21408
21487
|
if (!model)
|
|
21409
21488
|
continue;
|
|
21410
|
-
const
|
|
21411
|
-
if (
|
|
21412
|
-
for (const window of
|
|
21489
|
+
const windows2 = group.windows ?? [];
|
|
21490
|
+
if (windows2.length) {
|
|
21491
|
+
for (const window of windows2) {
|
|
21413
21492
|
if (!Number.isFinite(window.remainingFraction))
|
|
21414
21493
|
continue;
|
|
21415
21494
|
const duration = window.window === "weekly" ? "7d" : "5h";
|
|
@@ -22831,13 +22910,13 @@ function aggregateQuota(models) {
|
|
|
22831
22910
|
perModel.sort((a, b) => a.modelId.localeCompare(b.modelId));
|
|
22832
22911
|
return { groups, perModel, modelCount: totalCount };
|
|
22833
22912
|
}
|
|
22834
|
-
function mostConstrainedWindow(
|
|
22835
|
-
if (
|
|
22913
|
+
function mostConstrainedWindow(windows2) {
|
|
22914
|
+
if (windows2.length === 0)
|
|
22836
22915
|
return void 0;
|
|
22837
|
-
let best =
|
|
22838
|
-
for (let i = 1; i <
|
|
22839
|
-
if (
|
|
22840
|
-
best =
|
|
22916
|
+
let best = windows2[0];
|
|
22917
|
+
for (let i = 1; i < windows2.length; i++) {
|
|
22918
|
+
if (windows2[i].remainingFraction < best.remainingFraction) {
|
|
22919
|
+
best = windows2[i];
|
|
22841
22920
|
}
|
|
22842
22921
|
}
|
|
22843
22922
|
return {
|
|
@@ -22874,21 +22953,21 @@ function aggregateQuotaSummary(response) {
|
|
|
22874
22953
|
const groups = {};
|
|
22875
22954
|
let totalCount = 0;
|
|
22876
22955
|
for (const group of response.groups) {
|
|
22877
|
-
const
|
|
22956
|
+
const windows2 = [];
|
|
22878
22957
|
for (const bucket of group.buckets) {
|
|
22879
22958
|
const pool2 = poolForBucketId(bucket.bucketId);
|
|
22880
22959
|
if (!pool2)
|
|
22881
22960
|
continue;
|
|
22882
|
-
|
|
22961
|
+
windows2.push({
|
|
22883
22962
|
window: bucket.window,
|
|
22884
22963
|
remainingFraction: normalizeRemainingFraction(bucket.remainingFraction),
|
|
22885
22964
|
resetTime: bucket.resetTime
|
|
22886
22965
|
});
|
|
22887
22966
|
}
|
|
22888
|
-
if (
|
|
22967
|
+
if (windows2.length === 0)
|
|
22889
22968
|
continue;
|
|
22890
|
-
|
|
22891
|
-
const constrained = mostConstrainedWindow(
|
|
22969
|
+
windows2.sort((a, b) => windowDurationMs(a.window) - windowDurationMs(b.window));
|
|
22970
|
+
const constrained = mostConstrainedWindow(windows2);
|
|
22892
22971
|
const recognizedBucket = group.buckets.find((bucket) => poolForBucketId(bucket.bucketId));
|
|
22893
22972
|
if (!recognizedBucket)
|
|
22894
22973
|
continue;
|
|
@@ -22900,7 +22979,7 @@ function aggregateQuotaSummary(response) {
|
|
|
22900
22979
|
remainingFraction: constrained.remainingFraction,
|
|
22901
22980
|
resetTime: constrained.resetTime,
|
|
22902
22981
|
modelCount,
|
|
22903
|
-
windows
|
|
22982
|
+
windows: windows2
|
|
22904
22983
|
};
|
|
22905
22984
|
totalCount += modelCount;
|
|
22906
22985
|
}
|
|
@@ -24406,7 +24485,8 @@ function createAntigravityVaultAccountSource(options) {
|
|
|
24406
24485
|
pollIntervalMs: options.pollIntervalMs
|
|
24407
24486
|
},
|
|
24408
24487
|
...options.now && { now: options.now },
|
|
24409
|
-
...options.logger && { logger: options.logger }
|
|
24488
|
+
...options.logger && { logger: options.logger },
|
|
24489
|
+
...options.insula && { insula: options.insula }
|
|
24410
24490
|
});
|
|
24411
24491
|
const issued = /* @__PURE__ */ new WeakMap();
|
|
24412
24492
|
const isDeclined2 = claustrum.isDeclined.bind(claustrum);
|
|
@@ -24518,6 +24598,37 @@ function createAntigravityVaultAccountSource(options) {
|
|
|
24518
24598
|
recordVersion: admission.recordVersion
|
|
24519
24599
|
});
|
|
24520
24600
|
},
|
|
24601
|
+
pollInsulaQuotaForRoute: async (ref, fallback, signal, onSkip) => {
|
|
24602
|
+
await assertServing(signal);
|
|
24603
|
+
assertCurrentRoute(ref);
|
|
24604
|
+
if (!consumer.pollInsulaQuotaForRoute)
|
|
24605
|
+
return fallback();
|
|
24606
|
+
let usedFallback = false;
|
|
24607
|
+
const reading = await untilAborted(consumer.pollInsulaQuotaForRoute(ref.routeId, () => {
|
|
24608
|
+
usedFallback = true;
|
|
24609
|
+
return fallback();
|
|
24610
|
+
}), signal);
|
|
24611
|
+
if (reading === void 0) {
|
|
24612
|
+
const result = consumer.lookupInsulaQuotaForRoute ? await untilAborted(consumer.lookupInsulaQuotaForRoute(ref.routeId), signal) : void 0;
|
|
24613
|
+
if (result?.miss === "cold" || result?.miss === "upstream-failed")
|
|
24614
|
+
onSkip?.(result.miss);
|
|
24615
|
+
return void 0;
|
|
24616
|
+
}
|
|
24617
|
+
if (usedFallback)
|
|
24618
|
+
return reading;
|
|
24619
|
+
if (reading.accountIdentity !== ref.accountIdentity)
|
|
24620
|
+
throw new AntigravityVaultSourceError("identity-contradicted", "The background quota reading belongs to another vault account");
|
|
24621
|
+
const admission = await admit2(ref, signal);
|
|
24622
|
+
return {
|
|
24623
|
+
...reading,
|
|
24624
|
+
quotaAttribution: {
|
|
24625
|
+
routeId: admission.routeId,
|
|
24626
|
+
credentialId: admission.credentialId,
|
|
24627
|
+
accountIdentity: admission.accountIdentity,
|
|
24628
|
+
recordVersion: admission.recordVersion
|
|
24629
|
+
}
|
|
24630
|
+
};
|
|
24631
|
+
},
|
|
24521
24632
|
commitState: async (attribution, update, signal) => {
|
|
24522
24633
|
assertOpen(signal);
|
|
24523
24634
|
if (!options.state)
|
|
@@ -26760,7 +26871,7 @@ function normalizeQuota(input2) {
|
|
|
26760
26871
|
const resetAt = toFiniteNumber(record3.resetAt) ?? void 0;
|
|
26761
26872
|
const checkedAt = toFiniteNumber(record3.checkedAt) ?? void 0;
|
|
26762
26873
|
const windowsRaw = record3.windows;
|
|
26763
|
-
let
|
|
26874
|
+
let windows2;
|
|
26764
26875
|
if (Array.isArray(windowsRaw)) {
|
|
26765
26876
|
const parsed = windowsRaw.filter(isObject).map((w) => {
|
|
26766
26877
|
const win = w.window;
|
|
@@ -26779,14 +26890,14 @@ function normalizeQuota(input2) {
|
|
|
26779
26890
|
...ca !== null && ca >= 0 ? { checkedAt: ca } : {}
|
|
26780
26891
|
};
|
|
26781
26892
|
}).filter((v) => v !== null);
|
|
26782
|
-
if (parsed.length > 0)
|
|
26893
|
+
if (parsed.length > 0) windows2 = parsed;
|
|
26783
26894
|
}
|
|
26784
26895
|
return {
|
|
26785
26896
|
remainingPercent: clampNumber(remaining, 0, 100),
|
|
26786
26897
|
...fraction !== null ? { remainingFraction: clampNumber(fraction, 0, 1) } : {},
|
|
26787
26898
|
resetAt,
|
|
26788
26899
|
...checkedAt !== void 0 ? { checkedAt } : {},
|
|
26789
|
-
windows
|
|
26900
|
+
windows: windows2
|
|
26790
26901
|
};
|
|
26791
26902
|
}
|
|
26792
26903
|
function normalizeRouting(input2) {
|
|
@@ -26906,7 +27017,7 @@ function projectQuotaPoolForSidebar(source, checkedAt) {
|
|
|
26906
27017
|
const parsed = Date.parse(source.resetTime);
|
|
26907
27018
|
if (Number.isFinite(parsed)) resetAt = parsed;
|
|
26908
27019
|
}
|
|
26909
|
-
const
|
|
27020
|
+
const windows2 = source.windows?.length ? source.windows.map((w) => ({
|
|
26910
27021
|
window: w.window,
|
|
26911
27022
|
...readingAt !== void 0 ? { checkedAt: readingAt } : {},
|
|
26912
27023
|
remainingPercent: clampNumber(
|
|
@@ -26924,7 +27035,7 @@ function projectQuotaPoolForSidebar(source, checkedAt) {
|
|
|
26924
27035
|
remainingPercent,
|
|
26925
27036
|
remainingFraction: clampNumber(fraction, 0, 1),
|
|
26926
27037
|
resetAt,
|
|
26927
|
-
windows,
|
|
27038
|
+
windows: windows2,
|
|
26928
27039
|
...readingAt !== void 0 ? { checkedAt: readingAt } : {}
|
|
26929
27040
|
};
|
|
26930
27041
|
}
|
|
@@ -27595,7 +27706,7 @@ async function fetchLegacyModelsFallback(options) {
|
|
|
27595
27706
|
const modelsResponse = await fetchAvailableModels({
|
|
27596
27707
|
accessToken: options.accessToken,
|
|
27597
27708
|
projectId: options.projectId,
|
|
27598
|
-
endpoints:
|
|
27709
|
+
endpoints: [ANTIGRAVITY_QUOTA_ENDPOINT],
|
|
27599
27710
|
userAgent: buildAntigravityHarnessUserAgent(),
|
|
27600
27711
|
timeoutMs: 1e4,
|
|
27601
27712
|
...options.fetchVia ? { fetchVia: options.fetchVia } : {}
|
|
@@ -27624,7 +27735,7 @@ async function fetchQuotaPayloads(options) {
|
|
|
27624
27735
|
accessToken,
|
|
27625
27736
|
managedProjectId,
|
|
27626
27737
|
projectId,
|
|
27627
|
-
endpoints:
|
|
27738
|
+
endpoints: [ANTIGRAVITY_QUOTA_ENDPOINT],
|
|
27628
27739
|
userAgent: buildAntigravityHarnessUserAgent(),
|
|
27629
27740
|
timeoutMs: 1e4,
|
|
27630
27741
|
...fetchVia ? { fetchVia } : {}
|
|
@@ -27741,7 +27852,7 @@ async function fetchVaultAccountQuota(options) {
|
|
|
27741
27852
|
return result;
|
|
27742
27853
|
};
|
|
27743
27854
|
const fetchSummary = async () => {
|
|
27744
|
-
for (const endpoint of
|
|
27855
|
+
for (const endpoint of [ANTIGRAVITY_QUOTA_ENDPOINT]) {
|
|
27745
27856
|
const result = await attempt(
|
|
27746
27857
|
async (grant, fetchVia) => aggregateQuotaSummary(
|
|
27747
27858
|
(await fetchQuotaSummary({
|
|
@@ -27763,7 +27874,7 @@ async function fetchVaultAccountQuota(options) {
|
|
|
27763
27874
|
}
|
|
27764
27875
|
if (result.refused) break;
|
|
27765
27876
|
}
|
|
27766
|
-
for (const endpoint of
|
|
27877
|
+
for (const endpoint of [ANTIGRAVITY_QUOTA_ENDPOINT]) {
|
|
27767
27878
|
for (const withProject of [true, false]) {
|
|
27768
27879
|
const result = await attempt(
|
|
27769
27880
|
(grant, fetchVia) => fetchAvailableModels({
|
|
@@ -27906,6 +28017,14 @@ function createAuthorizedFetchAccountQuota(options) {
|
|
|
27906
28017
|
error: `quota check refused (stale grant: ${staleReason})`
|
|
27907
28018
|
};
|
|
27908
28019
|
}
|
|
28020
|
+
if (payloads.quota.error) {
|
|
28021
|
+
return {
|
|
28022
|
+
...base,
|
|
28023
|
+
status: "error",
|
|
28024
|
+
disabled: false,
|
|
28025
|
+
error: payloads.quota.error
|
|
28026
|
+
};
|
|
28027
|
+
}
|
|
27909
28028
|
return {
|
|
27910
28029
|
...base,
|
|
27911
28030
|
status: "ok",
|
|
@@ -27981,6 +28100,7 @@ function makeFetchAccountQuota(client, providerId, fetchVia) {
|
|
|
27981
28100
|
}),
|
|
27982
28101
|
signal
|
|
27983
28102
|
);
|
|
28103
|
+
if (payloads.quota.error) throw new Error(payloads.quota.error);
|
|
27984
28104
|
return {
|
|
27985
28105
|
index,
|
|
27986
28106
|
email: account.email,
|
|
@@ -28036,6 +28156,7 @@ function makeFetchAccountQuota(client, providerId, fetchVia) {
|
|
|
28036
28156
|
logger: log7
|
|
28037
28157
|
});
|
|
28038
28158
|
quotaResult = payloads.quota;
|
|
28159
|
+
if (quotaResult.error) throw new Error(quotaResult.error);
|
|
28039
28160
|
fellBackToLegacy = payloads.fellBackToLegacy;
|
|
28040
28161
|
for (const [family, groupQuota] of Object.entries(quotaResult.groups)) {
|
|
28041
28162
|
const remainingPercent = (groupQuota.remainingFraction ?? 0) * 100;
|
|
@@ -30680,9 +30801,9 @@ Please quit all OpenCode, LiteCode, and Pi processes before running setup.`);
|
|
|
30680
30801
|
}
|
|
30681
30802
|
};
|
|
30682
30803
|
async function listSetupProcesses(runner = defaultCommandRunner, options = {}) {
|
|
30683
|
-
const
|
|
30804
|
+
const windows2 = (options.platform ?? process.platform) === "win32";
|
|
30684
30805
|
let inspection = {
|
|
30685
|
-
step:
|
|
30806
|
+
step: windows2 ? "tasklist" : "ps",
|
|
30686
30807
|
exitCode: null,
|
|
30687
30808
|
signal: null,
|
|
30688
30809
|
timedOut: false,
|
|
@@ -30717,7 +30838,7 @@ async function listSetupProcesses(runner = defaultCommandRunner, options = {}) {
|
|
|
30717
30838
|
}
|
|
30718
30839
|
};
|
|
30719
30840
|
try {
|
|
30720
|
-
const result = await inspect(
|
|
30841
|
+
const result = await inspect(windows2 ? "tasklist" : "ps", windows2 ? "tasklist.exe" : "ps", windows2 ? ["/fo", "csv", "/nh"] : ["-eo", "pid,command"]);
|
|
30721
30842
|
if (result.exitCode !== 0)
|
|
30722
30843
|
throw new ProcessInspectionError(inspection);
|
|
30723
30844
|
const processes = [];
|
|
@@ -30727,7 +30848,7 @@ async function listSetupProcesses(runner = defaultCommandRunner, options = {}) {
|
|
|
30727
30848
|
continue;
|
|
30728
30849
|
let pid;
|
|
30729
30850
|
let command;
|
|
30730
|
-
if (
|
|
30851
|
+
if (windows2) {
|
|
30731
30852
|
const match = /^"([^"]+)","(\d+)"(?:,|$)/.exec(trimmed);
|
|
30732
30853
|
if (!match)
|
|
30733
30854
|
throw new ProcessInspectionError(inspection);
|
|
@@ -30750,7 +30871,7 @@ async function listSetupProcesses(runner = defaultCommandRunner, options = {}) {
|
|
|
30750
30871
|
if (!processes.length)
|
|
30751
30872
|
throw new ProcessInspectionError(inspection);
|
|
30752
30873
|
const runtimes = processes.filter((entry) => entry.pid !== process.pid && /^(?:node|bun)\.exe$/i.test(entry.command));
|
|
30753
|
-
if (
|
|
30874
|
+
if (windows2 && runtimes.length && options.inspectRuntimes !== false) {
|
|
30754
30875
|
const details = await inspect("CIM", "powershell.exe", [
|
|
30755
30876
|
"-NoProfile",
|
|
30756
30877
|
"-NonInteractive",
|
|
@@ -30793,10 +30914,10 @@ function createProcessFence(runner = defaultCommandRunner, options = {}) {
|
|
|
30793
30914
|
env: env3,
|
|
30794
30915
|
inspectRuntimes: false
|
|
30795
30916
|
});
|
|
30796
|
-
const
|
|
30917
|
+
const windows2 = (options.platform ?? process.platform) === "win32";
|
|
30797
30918
|
return {
|
|
30798
30919
|
hosts: processes.filter(isHost),
|
|
30799
|
-
uncheckedRuntimes:
|
|
30920
|
+
uncheckedRuntimes: windows2 ? processes.filter((entry) => entry.pid !== process.pid && /^(?:node|bun)\.exe$/i.test(entry.command)).length : 0
|
|
30800
30921
|
};
|
|
30801
30922
|
}
|
|
30802
30923
|
};
|
|
@@ -30907,11 +31028,11 @@ import { mkdir as mkdir13, open as open11, rename as rename10, stat as stat9, un
|
|
|
30907
31028
|
import { basename as basename5, dirname as dirname18, join as join13 } from "node:path";
|
|
30908
31029
|
import { setTimeout as delay2 } from "node:timers/promises";
|
|
30909
31030
|
async function writeHostConfigAtomic(file, content, options = {}) {
|
|
30910
|
-
const
|
|
31031
|
+
const windows2 = (options.platform ?? process.platform) === "win32";
|
|
30911
31032
|
const parent = dirname18(file);
|
|
30912
31033
|
await mkdir13(parent, { recursive: true });
|
|
30913
31034
|
let mode;
|
|
30914
|
-
if (!
|
|
31035
|
+
if (!windows2) {
|
|
30915
31036
|
try {
|
|
30916
31037
|
mode = (await stat9(file)).mode & 4095;
|
|
30917
31038
|
} catch (error) {
|
|
@@ -30942,7 +31063,7 @@ async function writeHostConfigAtomic(file, content, options = {}) {
|
|
|
30942
31063
|
} catch (error) {
|
|
30943
31064
|
const code2 = error.code;
|
|
30944
31065
|
const remaining = 2e3 - (now() - started);
|
|
30945
|
-
if (!
|
|
31066
|
+
if (!windows2 || !["EPERM", "EBUSY", "EACCES"].includes(code2 ?? "") || remaining <= 0 || attempt >= 40)
|
|
30946
31067
|
throw new Error(`Unable to replace host config ${file}. Close editors or other programs using the file, then rerun setup.`);
|
|
30947
31068
|
await (options.wait ?? delay2)(Math.min(remaining, 25 * 2 ** Math.min(attempt, 2)));
|
|
30948
31069
|
}
|
|
@@ -31706,6 +31827,10 @@ async function checkVaultQuota(input2) {
|
|
|
31706
31827
|
input2.onStage?.("fetch");
|
|
31707
31828
|
const answer = await input2.fetchReading(row.route, input2.signal);
|
|
31708
31829
|
input2.signal.throwIfAborted();
|
|
31830
|
+
if (answer === void 0) {
|
|
31831
|
+
input2.onOutcome?.("fetch-failed");
|
|
31832
|
+
continue;
|
|
31833
|
+
}
|
|
31709
31834
|
const attribution = answer.quotaAttribution;
|
|
31710
31835
|
if (answer.quota.error !== void 0) {
|
|
31711
31836
|
input2.onOutcome?.("fetch-failed");
|
|
@@ -31715,7 +31840,7 @@ async function checkVaultQuota(input2) {
|
|
|
31715
31840
|
input2.onOutcome?.("unattributed");
|
|
31716
31841
|
continue;
|
|
31717
31842
|
}
|
|
31718
|
-
const reading = vaultQuotaState(answer.quota, now());
|
|
31843
|
+
const reading = vaultQuotaState(answer.quota, answer.observedAt ?? now());
|
|
31719
31844
|
input2.onStage?.("commit");
|
|
31720
31845
|
input2.signal.throwIfAborted();
|
|
31721
31846
|
const result = await state.recordQuota(attribution, reading, input2.signal);
|
|
@@ -31746,6 +31871,48 @@ async function checkVaultQuota(input2) {
|
|
|
31746
31871
|
return { checked, notChecked: rows.length - checked };
|
|
31747
31872
|
}
|
|
31748
31873
|
|
|
31874
|
+
// src/plugin/vault-insula-quota.ts
|
|
31875
|
+
var windows = [
|
|
31876
|
+
["gemini-5h", "gemini", "5h"],
|
|
31877
|
+
["gemini-weekly", "gemini", "weekly"],
|
|
31878
|
+
["3p-5h", "non-gemini", "5h"],
|
|
31879
|
+
["3p-weekly", "non-gemini", "weekly"]
|
|
31880
|
+
];
|
|
31881
|
+
var normalizeVaultInsulaQuota = (entry, context) => {
|
|
31882
|
+
if (entry.source !== "vault") return void 0;
|
|
31883
|
+
if (entry.provider !== "antigravity" || !entry.account?.trim() || !Number.isFinite(context.fetchedAt))
|
|
31884
|
+
return void 0;
|
|
31885
|
+
const groups = {};
|
|
31886
|
+
for (const [id, group, window] of windows) {
|
|
31887
|
+
const reading = entry.usage?.extraRateWindows?.find(
|
|
31888
|
+
(extra) => extra.id === id
|
|
31889
|
+
)?.window;
|
|
31890
|
+
if (!reading || !Number.isFinite(reading.usedPercent) || reading.usedPercent < 0 || reading.usedPercent > 100)
|
|
31891
|
+
continue;
|
|
31892
|
+
const normalized = {
|
|
31893
|
+
window,
|
|
31894
|
+
remainingFraction: 1 - reading.usedPercent / 100,
|
|
31895
|
+
resetTime: reading.resetsAt ?? ""
|
|
31896
|
+
};
|
|
31897
|
+
let summary = groups[group];
|
|
31898
|
+
if (summary === void 0) {
|
|
31899
|
+
summary = { modelCount: 0, windows: [] };
|
|
31900
|
+
groups[group] = summary;
|
|
31901
|
+
}
|
|
31902
|
+
summary.windows?.push(normalized);
|
|
31903
|
+
if (summary.remainingFraction === void 0 || normalized.remainingFraction < summary.remainingFraction) {
|
|
31904
|
+
summary.remainingFraction = normalized.remainingFraction;
|
|
31905
|
+
summary.resetTime = normalized.resetTime;
|
|
31906
|
+
}
|
|
31907
|
+
}
|
|
31908
|
+
if (Object.keys(groups).length === 0) return void 0;
|
|
31909
|
+
return {
|
|
31910
|
+
quota: { groups, modelCount: 0 },
|
|
31911
|
+
accountIdentity: entry.account.trim(),
|
|
31912
|
+
observedAt: context.fetchedAt
|
|
31913
|
+
};
|
|
31914
|
+
};
|
|
31915
|
+
|
|
31749
31916
|
// src/plugin/vault-custody.ts
|
|
31750
31917
|
var OPENCODE_VAULT_PROVIDER = "google";
|
|
31751
31918
|
var OPENCODE_VAULT_HOST = "opencode";
|
|
@@ -31854,6 +32021,12 @@ function createOpenCodeVaultCustody(options) {
|
|
|
31854
32021
|
onError: () => options.onRosterChanged?.(),
|
|
31855
32022
|
reporterSource: options.reporterSource,
|
|
31856
32023
|
state: { path: paths.stateFile, fs: await loadCommonAuthFs() },
|
|
32024
|
+
...options.insulaQuota ? {
|
|
32025
|
+
insula: {
|
|
32026
|
+
provider: "antigravity",
|
|
32027
|
+
normalize: normalizeVaultInsulaQuota
|
|
32028
|
+
}
|
|
32029
|
+
} : {},
|
|
31857
32030
|
...options.logger ? { logger: options.logger } : {},
|
|
31858
32031
|
...options.now ? { now: options.now } : {},
|
|
31859
32032
|
...options.pollIntervalMs !== void 0 ? { pollIntervalMs: options.pollIntervalMs } : {}
|
|
@@ -44698,7 +44871,7 @@ var BackgroundVaultQuotaRefresh = class {
|
|
|
44698
44871
|
fetchReading: async (ref, signal) => {
|
|
44699
44872
|
rowFailure = "fetch-failed";
|
|
44700
44873
|
await this.assertActive(controller);
|
|
44701
|
-
const
|
|
44874
|
+
const fallback = () => fetchVaultAccountQuota({
|
|
44702
44875
|
source,
|
|
44703
44876
|
ref,
|
|
44704
44877
|
signal,
|
|
@@ -44708,7 +44881,10 @@ var BackgroundVaultQuotaRefresh = class {
|
|
|
44708
44881
|
if (kind !== "unknown" || outcome.errorKind === void 0)
|
|
44709
44882
|
outcome.errorKind = kind;
|
|
44710
44883
|
if (refused)
|
|
44711
|
-
rowFailure = vaultQuotaErrorReason(
|
|
44884
|
+
rowFailure = vaultQuotaErrorReason(
|
|
44885
|
+
error,
|
|
44886
|
+
"admission-refused"
|
|
44887
|
+
);
|
|
44712
44888
|
},
|
|
44713
44889
|
transport: async (url, init, extra) => {
|
|
44714
44890
|
await this.assertActive(controller);
|
|
@@ -44731,6 +44907,16 @@ var BackgroundVaultQuotaRefresh = class {
|
|
|
44731
44907
|
}
|
|
44732
44908
|
}
|
|
44733
44909
|
});
|
|
44910
|
+
const reading = source.pollInsulaQuotaForRoute ? await source.pollInsulaQuotaForRoute(
|
|
44911
|
+
ref,
|
|
44912
|
+
fallback,
|
|
44913
|
+
signal,
|
|
44914
|
+
(reason) => {
|
|
44915
|
+
rowFailure = `insula-${reason}`;
|
|
44916
|
+
}
|
|
44917
|
+
) : await fallback();
|
|
44918
|
+
if (reading === void 0 && rowFailure === "fetch-failed")
|
|
44919
|
+
rowFailure = "insula-skipped";
|
|
44734
44920
|
await this.assertActive(controller);
|
|
44735
44921
|
await lock.assertOwned();
|
|
44736
44922
|
return reading;
|
|
@@ -45391,7 +45577,7 @@ function toCommandAccountRow(entry) {
|
|
|
45391
45577
|
const parsed = Date.parse(cachedEntry.resetTime);
|
|
45392
45578
|
if (Number.isFinite(parsed)) resetAt = parsed;
|
|
45393
45579
|
}
|
|
45394
|
-
const
|
|
45580
|
+
const windows2 = cachedEntry.windows?.length ? cachedEntry.windows.map((w) => ({
|
|
45395
45581
|
window: w.window,
|
|
45396
45582
|
remainingPercent: Math.round(w.remainingFraction * 100),
|
|
45397
45583
|
resetAt: typeof w.resetTime === "string" && w.resetTime.length > 0 ? (() => {
|
|
@@ -45404,7 +45590,7 @@ function toCommandAccountRow(entry) {
|
|
|
45404
45590
|
label: QUOTA_GROUP_LABELS[key],
|
|
45405
45591
|
remainingPercent,
|
|
45406
45592
|
resetAt,
|
|
45407
|
-
windows
|
|
45593
|
+
windows: windows2
|
|
45408
45594
|
});
|
|
45409
45595
|
}
|
|
45410
45596
|
const label = `Account ${entry.index + 1}`;
|
|
@@ -48801,6 +48987,7 @@ var createAntigravityPlugin = (providerId, options = {}) => async (input2) => {
|
|
|
48801
48987
|
let vaultQuotaPoller;
|
|
48802
48988
|
const vaultCustody = createOpenCodeVaultCustody({
|
|
48803
48989
|
accountFile: resolve17(getStoragePath()),
|
|
48990
|
+
insulaQuota: true,
|
|
48804
48991
|
readHostSlot: async () => {
|
|
48805
48992
|
if (!cachedGetAuth)
|
|
48806
48993
|
throw new Error("OpenCode has not provided its sign-in yet");
|