@cortexkit/opencode-antigravity-auth 3.0.0 → 3.0.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/README.md +5 -3
- package/dist/cli.js +38 -33
- package/dist/cli.js.map +2 -2
- package/dist/cli.meta.json +35 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1916 -1436
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +154 -43
- package/dist/server.js +606 -104
- package/dist/server.js.map +4 -4
- package/dist/server.meta.json +1 -7284
- package/dist/src/cli.d.ts +1 -1
- package/dist/src/constants.d.ts +1 -1
- package/dist/src/ga/rpc/protocol.d.ts +1 -1
- package/dist/src/ga/server/index.d.ts +6 -6
- package/dist/src/ga/server/index.d.ts.map +1 -1
- package/dist/src/ga/server/index.js +29 -1
- package/dist/src/ga/server/index.js.map +1 -1
- package/dist/src/ga/tui/host-ga.d.ts +2 -2
- package/dist/src/hooks/auto-update-checker/checker.d.ts +1 -1
- package/dist/src/hooks/auto-update-checker/index.d.ts +4 -4
- package/dist/src/plugin/account-access.d.ts +6 -6
- package/dist/src/plugin/account-command-oauth.d.ts +2 -2
- package/dist/src/plugin/accounts.d.ts +3 -3
- package/dist/src/plugin/auth-doctor.d.ts +2 -2
- package/dist/src/plugin/auth-drift.d.ts +2 -2
- package/dist/src/plugin/auth-loader.d.ts +8 -8
- package/dist/src/plugin/auth-loader.d.ts.map +1 -1
- package/dist/src/plugin/auth-loader.js +1 -0
- package/dist/src/plugin/auth-loader.js.map +1 -1
- package/dist/src/plugin/background-quota-refresh.d.ts +3 -3
- package/dist/src/plugin/background-vault-quota-refresh.d.ts +43 -0
- package/dist/src/plugin/background-vault-quota-refresh.d.ts.map +1 -0
- package/dist/src/plugin/background-vault-quota-refresh.js +155 -0
- package/dist/src/plugin/background-vault-quota-refresh.js.map +1 -0
- package/dist/src/plugin/cache/index.d.ts +1 -1
- package/dist/src/plugin/cache/signature-cache.d.ts +2 -2
- package/dist/src/plugin/cache.d.ts +6 -6
- package/dist/src/plugin/cli.d.ts +6 -6
- package/dist/src/plugin/command-apply.d.ts +1 -1
- package/dist/src/plugin/command-data.d.ts +6 -4
- package/dist/src/plugin/command-data.d.ts.map +1 -1
- package/dist/src/plugin/command-data.js +13 -34
- package/dist/src/plugin/command-data.js.map +1 -1
- package/dist/src/plugin/commands.d.ts +4 -4
- package/dist/src/plugin/config/index.d.ts +2 -2
- package/dist/src/plugin/config/loader.d.ts +2 -2
- package/dist/src/plugin/config/models.d.ts +2 -2
- package/dist/src/plugin/config/writer.d.ts +2 -2
- package/dist/src/plugin/core/streaming/index.d.ts +2 -2
- package/dist/src/plugin/core/streaming/transformer.d.ts +1 -1
- package/dist/src/plugin/debug.d.ts +1 -1
- package/dist/src/plugin/dependencies.d.ts +3 -3
- package/dist/src/plugin/event-handler.d.ts +3 -3
- package/dist/src/plugin/fetch-interceptor.d.ts +10 -10
- package/dist/src/plugin/fetch-routing.d.ts +3 -3
- package/dist/src/plugin/ga-location-services.d.ts +10 -10
- package/dist/src/plugin/google-search-tool.d.ts +1 -1
- package/dist/src/plugin/index.d.ts +8 -6
- package/dist/src/plugin/index.d.ts.map +1 -1
- package/dist/src/plugin/index.js +41 -18
- package/dist/src/plugin/index.js.map +1 -1
- package/dist/src/plugin/killswitch.d.ts +1 -1
- package/dist/src/plugin/lifecycle.d.ts +2 -2
- package/dist/src/plugin/logger.d.ts +2 -2
- package/dist/src/plugin/oauth-login.d.ts +1 -1
- package/dist/src/plugin/oauth-methods.d.ts +9 -9
- package/dist/src/plugin/operator-settings.d.ts +3 -3
- package/dist/src/plugin/persist-account-pool.d.ts +1 -1
- package/dist/src/plugin/quota.d.ts +5 -4
- package/dist/src/plugin/quota.d.ts.map +1 -1
- package/dist/src/plugin/quota.js +1 -0
- package/dist/src/plugin/quota.js.map +1 -1
- package/dist/src/plugin/recovery/index.d.ts +3 -3
- package/dist/src/plugin/recovery/storage.d.ts +1 -1
- package/dist/src/plugin/recovery.d.ts +3 -3
- package/dist/src/plugin/refresh-queue.d.ts +3 -3
- package/dist/src/plugin/request-helpers.d.ts +1 -1
- package/dist/src/plugin/request.d.ts +9 -9
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +39 -5
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/session-context.d.ts +1 -1
- package/dist/src/plugin/shared/request-services.d.ts +9 -9
- package/dist/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/src/plugin/shared/request-services.js +13 -4
- package/dist/src/plugin/shared/request-services.js.map +1 -1
- package/dist/src/plugin/shared/runtime.d.ts +11 -11
- package/dist/src/plugin/shared/source-sidebar.d.ts +1 -1
- package/dist/src/plugin/shared/vault-menu.d.ts +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.d.ts +3 -1
- package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.js +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -1
- package/dist/src/plugin/stores/signature-store.d.ts +1 -1
- package/dist/src/plugin/token.d.ts +1 -1
- package/dist/src/plugin/ui/auth-menu.d.ts +4 -4
- package/dist/src/plugin/ui/model-status.d.ts +3 -3
- package/dist/src/plugin/ui/quota-status.d.ts +2 -2
- package/dist/src/plugin/vault-activation.d.ts +1 -1
- package/dist/src/plugin/vault-quota-refresh.d.ts +7 -0
- package/dist/src/plugin/vault-quota-refresh.d.ts.map +1 -0
- package/dist/src/plugin/vault-quota-refresh.js +12 -0
- package/dist/src/plugin/vault-quota-refresh.js.map +1 -0
- package/dist/src/plugin/vault-sidebar-projection.d.ts +27 -0
- package/dist/src/plugin/vault-sidebar-projection.d.ts.map +1 -0
- package/dist/src/plugin/vault-sidebar-projection.js +34 -0
- package/dist/src/plugin/vault-sidebar-projection.js.map +1 -0
- package/dist/src/rpc/notifications.d.ts +1 -1
- package/dist/src/rpc/rpc-server.d.ts +1 -1
- package/dist/src/server.d.ts +3 -3
- package/dist/src/sidebar-state.d.ts +20 -13
- package/dist/src/sidebar-state.d.ts.map +1 -1
- package/dist/src/sidebar-state.js +20 -10
- package/dist/src/sidebar-state.js.map +1 -1
- package/dist/src/tui/command-dialogs.d.ts +1 -1
- package/dist/src/tui/host-v1.d.ts +3 -3
- package/dist/src/tui.d.ts +3 -3
- package/dist/src/tui.js +1 -1
- package/dist/tui-build-map.json +6 -6
- package/dist/types/src/ga/server/index.d.ts.map +1 -1
- package/dist/types/src/plugin/auth-loader.d.ts.map +1 -1
- package/dist/types/src/plugin/background-vault-quota-refresh.d.ts +43 -0
- package/dist/types/src/plugin/background-vault-quota-refresh.d.ts.map +1 -0
- package/dist/types/src/plugin/command-data.d.ts +6 -4
- package/dist/types/src/plugin/command-data.d.ts.map +1 -1
- package/dist/types/src/plugin/index.d.ts +2 -0
- package/dist/types/src/plugin/index.d.ts.map +1 -1
- package/dist/types/src/plugin/quota.d.ts +1 -0
- package/dist/types/src/plugin/quota.d.ts.map +1 -1
- package/dist/types/src/plugin/request.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +2 -0
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/types/src/plugin/vault-quota-refresh.d.ts +7 -0
- package/dist/types/src/plugin/vault-quota-refresh.d.ts.map +1 -0
- package/dist/types/src/plugin/vault-sidebar-projection.d.ts +27 -0
- package/dist/types/src/plugin/vault-sidebar-projection.d.ts.map +1 -0
- package/dist/types/src/sidebar-state.d.ts +20 -13
- package/dist/types/src/sidebar-state.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/plugin/command-data.ts +19 -47
- package/src/sidebar-state.ts +34 -15
- package/src/tui-compiled/sidebar-state.js +12 -5
- package/src/tui-compiled/tui.js +1 -1
- package/src/tui-raw/sidebar-state.js +12 -5
- package/src/tui-raw/tui.tsx +1 -1
- package/src/tui.tsx +1 -1
package/dist/server.js
CHANGED
|
@@ -14084,7 +14084,8 @@ function jsonBytes(bytes) {
|
|
|
14084
14084
|
}
|
|
14085
14085
|
async function syncFile(path5) {
|
|
14086
14086
|
await secureRead(path5);
|
|
14087
|
-
const
|
|
14087
|
+
const access = process.platform === "win32" ? constants.O_RDWR : constants.O_RDONLY;
|
|
14088
|
+
const handle = await open(path5, access | constants.O_NOFOLLOW);
|
|
14088
14089
|
try {
|
|
14089
14090
|
await handle.sync();
|
|
14090
14091
|
} finally {
|
|
@@ -17199,8 +17200,8 @@ function createAccountRepositoryFactory(modules, factoryOptions = {}) {
|
|
|
17199
17200
|
|
|
17200
17201
|
// ../core/dist/fingerprint.js
|
|
17201
17202
|
import * as crypto from "node:crypto";
|
|
17202
|
-
var AGY_CLI_VERSION = "1.
|
|
17203
|
-
var AGY_CLI_CHANGE_LIST = "
|
|
17203
|
+
var AGY_CLI_VERSION = "1.3.3";
|
|
17204
|
+
var AGY_CLI_CHANGE_LIST = "996823801";
|
|
17204
17205
|
var ANTIGRAVITY_API_CLIENT = "antigravity-cli";
|
|
17205
17206
|
var MAX_FINGERPRINT_HISTORY = 5;
|
|
17206
17207
|
function normalizeHarnessPlatform(platform = process.platform) {
|
|
@@ -17272,7 +17273,7 @@ function buildFingerprintHeaders(fingerprint) {
|
|
|
17272
17273
|
return {};
|
|
17273
17274
|
}
|
|
17274
17275
|
return {
|
|
17275
|
-
"User-Agent":
|
|
17276
|
+
"User-Agent": buildAntigravityHarnessUserAgent()
|
|
17276
17277
|
};
|
|
17277
17278
|
}
|
|
17278
17279
|
var sessionFingerprint = null;
|
|
@@ -17303,7 +17304,227 @@ function defineModel(id, model) {
|
|
|
17303
17304
|
...model
|
|
17304
17305
|
};
|
|
17305
17306
|
}
|
|
17307
|
+
var AGY_NATIVE_MODEL_DEFINITIONS = {
|
|
17308
|
+
"gemini-3.8-flash-high": {
|
|
17309
|
+
displayName: "Gemini 3.8 Flash (High)",
|
|
17310
|
+
maxTokens: 1048576,
|
|
17311
|
+
maxOutputTokens: 65536,
|
|
17312
|
+
model: "MODEL_PLACEHOLDER_M318",
|
|
17313
|
+
thinkingBudget: -1,
|
|
17314
|
+
supportsThinking: true
|
|
17315
|
+
},
|
|
17316
|
+
"gemini-3.8-flash-medium": {
|
|
17317
|
+
displayName: "Gemini 3.8 Flash (Medium)",
|
|
17318
|
+
maxTokens: 1048576,
|
|
17319
|
+
maxOutputTokens: 65536,
|
|
17320
|
+
model: "MODEL_PLACEHOLDER_M319",
|
|
17321
|
+
thinkingBudget: 4e3,
|
|
17322
|
+
supportsThinking: true
|
|
17323
|
+
},
|
|
17324
|
+
"gemini-3.8-flash-low": {
|
|
17325
|
+
displayName: "Gemini 3.8 Flash (Low)",
|
|
17326
|
+
maxTokens: 1048576,
|
|
17327
|
+
maxOutputTokens: 65536,
|
|
17328
|
+
model: "MODEL_PLACEHOLDER_M320",
|
|
17329
|
+
thinkingBudget: 1e3,
|
|
17330
|
+
supportsThinking: true
|
|
17331
|
+
},
|
|
17332
|
+
"gemini-3.7-flash-high": {
|
|
17333
|
+
displayName: "Gemini 3.7 Flash (High)",
|
|
17334
|
+
maxTokens: 1048576,
|
|
17335
|
+
maxOutputTokens: 65536,
|
|
17336
|
+
model: "MODEL_PLACEHOLDER_M298",
|
|
17337
|
+
thinkingBudget: -1,
|
|
17338
|
+
supportsThinking: true
|
|
17339
|
+
},
|
|
17340
|
+
"gemini-3.7-flash-medium": {
|
|
17341
|
+
displayName: "Gemini 3.7 Flash (Medium)",
|
|
17342
|
+
maxTokens: 1048576,
|
|
17343
|
+
maxOutputTokens: 65536,
|
|
17344
|
+
model: "MODEL_PLACEHOLDER_M299",
|
|
17345
|
+
thinkingBudget: 4e3,
|
|
17346
|
+
supportsThinking: true
|
|
17347
|
+
},
|
|
17348
|
+
"gemini-3.7-flash-low": {
|
|
17349
|
+
displayName: "Gemini 3.7 Flash (Low)",
|
|
17350
|
+
maxTokens: 1048576,
|
|
17351
|
+
maxOutputTokens: 65536,
|
|
17352
|
+
model: "MODEL_PLACEHOLDER_M300",
|
|
17353
|
+
thinkingBudget: 1e3,
|
|
17354
|
+
supportsThinking: true
|
|
17355
|
+
},
|
|
17356
|
+
"gemini-3.6-flash-high": {
|
|
17357
|
+
displayName: "Gemini 3.6 Flash (High)",
|
|
17358
|
+
maxTokens: 1048576,
|
|
17359
|
+
maxOutputTokens: 65536,
|
|
17360
|
+
model: "MODEL_PLACEHOLDER_M71",
|
|
17361
|
+
thinkingBudget: -1,
|
|
17362
|
+
supportsThinking: true
|
|
17363
|
+
},
|
|
17364
|
+
"gemini-3.6-flash-medium": {
|
|
17365
|
+
displayName: "Gemini 3.6 Flash (Medium)",
|
|
17366
|
+
maxTokens: 1048576,
|
|
17367
|
+
maxOutputTokens: 65536,
|
|
17368
|
+
model: "MODEL_PLACEHOLDER_M72",
|
|
17369
|
+
thinkingBudget: 4e3,
|
|
17370
|
+
supportsThinking: true
|
|
17371
|
+
},
|
|
17372
|
+
"gemini-3.6-flash-low": {
|
|
17373
|
+
displayName: "Gemini 3.6 Flash (Low)",
|
|
17374
|
+
maxTokens: 1048576,
|
|
17375
|
+
maxOutputTokens: 65536,
|
|
17376
|
+
model: "MODEL_PLACEHOLDER_M73",
|
|
17377
|
+
thinkingBudget: 1e3,
|
|
17378
|
+
supportsThinking: true
|
|
17379
|
+
},
|
|
17380
|
+
"gemini-3.1-pro-high": {
|
|
17381
|
+
displayName: "Gemini 3.1 Pro (High)",
|
|
17382
|
+
maxTokens: 1048576,
|
|
17383
|
+
maxOutputTokens: 65535,
|
|
17384
|
+
model: "MODEL_PLACEHOLDER_M37",
|
|
17385
|
+
thinkingBudget: 10001,
|
|
17386
|
+
supportsThinking: true
|
|
17387
|
+
},
|
|
17388
|
+
"gemini-3.1-pro-low": {
|
|
17389
|
+
displayName: "Gemini 3.1 Pro (Low)",
|
|
17390
|
+
maxTokens: 1048576,
|
|
17391
|
+
maxOutputTokens: 65535,
|
|
17392
|
+
model: "MODEL_PLACEHOLDER_M36",
|
|
17393
|
+
thinkingBudget: 1001,
|
|
17394
|
+
supportsThinking: true
|
|
17395
|
+
},
|
|
17396
|
+
"claude-opus-5-5-low": {
|
|
17397
|
+
displayName: "Claude Opus 5.5 (Low)",
|
|
17398
|
+
maxTokens: 1e6,
|
|
17399
|
+
maxOutputTokens: 128e3,
|
|
17400
|
+
model: "MODEL_PLACEHOLDER_M400",
|
|
17401
|
+
thinkingLevel: 1,
|
|
17402
|
+
supportsThinking: true,
|
|
17403
|
+
supportsAdaptiveThinking: true,
|
|
17404
|
+
vertexModelId: "claude-opus-5-5@default"
|
|
17405
|
+
},
|
|
17406
|
+
"claude-opus-5-5-medium": {
|
|
17407
|
+
displayName: "Claude Opus 5.5 (Medium)",
|
|
17408
|
+
maxTokens: 1e6,
|
|
17409
|
+
maxOutputTokens: 128e3,
|
|
17410
|
+
model: "MODEL_PLACEHOLDER_M401",
|
|
17411
|
+
thinkingLevel: 2,
|
|
17412
|
+
supportsThinking: true,
|
|
17413
|
+
supportsAdaptiveThinking: true,
|
|
17414
|
+
vertexModelId: "claude-opus-5-5@default"
|
|
17415
|
+
},
|
|
17416
|
+
"claude-opus-5-5-high": {
|
|
17417
|
+
displayName: "Claude Opus 5.5 (High)",
|
|
17418
|
+
maxTokens: 1e6,
|
|
17419
|
+
maxOutputTokens: 128e3,
|
|
17420
|
+
model: "MODEL_PLACEHOLDER_M402",
|
|
17421
|
+
thinkingLevel: 3,
|
|
17422
|
+
supportsThinking: true,
|
|
17423
|
+
supportsAdaptiveThinking: true,
|
|
17424
|
+
vertexModelId: "claude-opus-5-5@default"
|
|
17425
|
+
},
|
|
17426
|
+
"claude-sonnet-5-5-low": {
|
|
17427
|
+
displayName: "Claude Sonnet 5.5 (Low)",
|
|
17428
|
+
maxTokens: 1e6,
|
|
17429
|
+
maxOutputTokens: 128e3,
|
|
17430
|
+
model: "MODEL_PLACEHOLDER_M403",
|
|
17431
|
+
thinkingLevel: 1,
|
|
17432
|
+
supportsThinking: true,
|
|
17433
|
+
supportsAdaptiveThinking: true,
|
|
17434
|
+
vertexModelId: "claude-sonnet-5-5@default"
|
|
17435
|
+
},
|
|
17436
|
+
"claude-sonnet-5-5-medium": {
|
|
17437
|
+
displayName: "Claude Sonnet 5.5 (Medium)",
|
|
17438
|
+
maxTokens: 1e6,
|
|
17439
|
+
maxOutputTokens: 128e3,
|
|
17440
|
+
model: "MODEL_PLACEHOLDER_M404",
|
|
17441
|
+
thinkingLevel: 2,
|
|
17442
|
+
supportsThinking: true,
|
|
17443
|
+
supportsAdaptiveThinking: true,
|
|
17444
|
+
vertexModelId: "claude-sonnet-5-5@default"
|
|
17445
|
+
},
|
|
17446
|
+
"claude-sonnet-5-5-high": {
|
|
17447
|
+
displayName: "Claude Sonnet 5.5 (High)",
|
|
17448
|
+
maxTokens: 1e6,
|
|
17449
|
+
maxOutputTokens: 128e3,
|
|
17450
|
+
model: "MODEL_PLACEHOLDER_M405",
|
|
17451
|
+
thinkingLevel: 3,
|
|
17452
|
+
supportsThinking: true,
|
|
17453
|
+
supportsAdaptiveThinking: true,
|
|
17454
|
+
vertexModelId: "claude-sonnet-5-5@default"
|
|
17455
|
+
},
|
|
17456
|
+
"gpt-oss-120b-medium": {
|
|
17457
|
+
displayName: "GPT-OSS 120B (Medium)",
|
|
17458
|
+
maxTokens: 131072,
|
|
17459
|
+
maxOutputTokens: 32768,
|
|
17460
|
+
model: "MODEL_OPENAI_GPT_OSS_120B_MEDIUM",
|
|
17461
|
+
thinkingBudget: 8192,
|
|
17462
|
+
supportsThinking: true,
|
|
17463
|
+
vertexModelId: "openai/gpt-oss-120b-maas"
|
|
17464
|
+
},
|
|
17465
|
+
"gemini-3.5-flash-extra-low": {
|
|
17466
|
+
displayName: "Gemini 3.5 Flash (Low)",
|
|
17467
|
+
maxTokens: 1048576,
|
|
17468
|
+
maxOutputTokens: 65536,
|
|
17469
|
+
model: "MODEL_PLACEHOLDER_M187",
|
|
17470
|
+
thinkingBudget: 1e3,
|
|
17471
|
+
supportsThinking: true
|
|
17472
|
+
},
|
|
17473
|
+
"gemini-3.5-flash-low": {
|
|
17474
|
+
displayName: "Gemini 3.5 Flash (Medium)",
|
|
17475
|
+
maxTokens: 1048576,
|
|
17476
|
+
maxOutputTokens: 65536,
|
|
17477
|
+
model: "MODEL_PLACEHOLDER_M20",
|
|
17478
|
+
thinkingBudget: 4e3,
|
|
17479
|
+
supportsThinking: true
|
|
17480
|
+
},
|
|
17481
|
+
"gemini-3-flash-agent": {
|
|
17482
|
+
displayName: "Gemini 3.5 Flash (High)",
|
|
17483
|
+
maxTokens: 1048576,
|
|
17484
|
+
maxOutputTokens: 65536,
|
|
17485
|
+
model: "MODEL_PLACEHOLDER_M84",
|
|
17486
|
+
thinkingBudget: -1,
|
|
17487
|
+
supportsThinking: true
|
|
17488
|
+
},
|
|
17489
|
+
"gemini-3.1-flash-image": {
|
|
17490
|
+
displayName: "Gemini 3.1 Flash Image",
|
|
17491
|
+
model: "MODEL_PLACEHOLDER_M21"
|
|
17492
|
+
},
|
|
17493
|
+
"gemini-pro-agent": {
|
|
17494
|
+
displayName: "Gemini 3.1 Pro (High)",
|
|
17495
|
+
maxTokens: 1048576,
|
|
17496
|
+
maxOutputTokens: 65535,
|
|
17497
|
+
model: "MODEL_PLACEHOLDER_M16",
|
|
17498
|
+
thinkingBudget: 10001,
|
|
17499
|
+
supportsThinking: true
|
|
17500
|
+
}
|
|
17501
|
+
};
|
|
17502
|
+
function getAgyNativeModel(model) {
|
|
17503
|
+
return AGY_NATIVE_MODEL_DEFINITIONS[model.toLowerCase()];
|
|
17504
|
+
}
|
|
17505
|
+
var RETIRED_AGY_MODEL_MESSAGE = "This Antigravity model is no longer offered. Choose another model.";
|
|
17506
|
+
function isRetiredAgyModel(model) {
|
|
17507
|
+
const route = model.toLowerCase().replace(/^antigravity-/, "").replace(/^gemini-(?=claude-)/, "");
|
|
17508
|
+
return /^claude-(opus|sonnet)-4-6(?:-thinking)?(?:-(?:minimal|low|medium|high))?$/.test(route) && getAgyNativeModel(route) === void 0;
|
|
17509
|
+
}
|
|
17306
17510
|
var ALL_MODEL_DEFINITIONS = {
|
|
17511
|
+
"antigravity-gemini-3.5-flash": defineModel("antigravity-gemini-3.5-flash", {
|
|
17512
|
+
name: "Gemini 3.5 Flash (Antigravity)",
|
|
17513
|
+
reasoning: true,
|
|
17514
|
+
limit: { context: 1048576, output: 65536 },
|
|
17515
|
+
modalities: DEFAULT_MODALITIES,
|
|
17516
|
+
variants: {
|
|
17517
|
+
low: { thinkingLevel: "low" },
|
|
17518
|
+
medium: { thinkingLevel: "medium" },
|
|
17519
|
+
high: { thinkingLevel: "high" }
|
|
17520
|
+
}
|
|
17521
|
+
}),
|
|
17522
|
+
"antigravity-gemini-3.1-flash-image": defineModel("antigravity-gemini-3.1-flash-image", {
|
|
17523
|
+
name: "Gemini 3.1 Flash Image (Antigravity)",
|
|
17524
|
+
reasoning: false,
|
|
17525
|
+
limit: { context: 66e3, output: 33e3 },
|
|
17526
|
+
modalities: { input: ["text", "image"], output: ["text", "image"] }
|
|
17527
|
+
}),
|
|
17307
17528
|
"antigravity-gemini-3.1-pro": defineModel("antigravity-gemini-3.1-pro", {
|
|
17308
17529
|
name: "Gemini 3.1 Pro (Antigravity)",
|
|
17309
17530
|
reasoning: true,
|
|
@@ -17321,6 +17542,7 @@ var ALL_MODEL_DEFINITIONS = {
|
|
|
17321
17542
|
modalities: DEFAULT_MODALITIES,
|
|
17322
17543
|
variants: {
|
|
17323
17544
|
low: { thinkingLevel: "low" },
|
|
17545
|
+
medium: { thinkingLevel: "medium" },
|
|
17324
17546
|
high: { thinkingLevel: "high" }
|
|
17325
17547
|
}
|
|
17326
17548
|
}),
|
|
@@ -17331,6 +17553,7 @@ var ALL_MODEL_DEFINITIONS = {
|
|
|
17331
17553
|
modalities: DEFAULT_MODALITIES,
|
|
17332
17554
|
variants: {
|
|
17333
17555
|
low: { thinkingLevel: "low" },
|
|
17556
|
+
medium: { thinkingLevel: "medium" },
|
|
17334
17557
|
high: { thinkingLevel: "high" }
|
|
17335
17558
|
}
|
|
17336
17559
|
}),
|
|
@@ -17341,46 +17564,30 @@ var ALL_MODEL_DEFINITIONS = {
|
|
|
17341
17564
|
modalities: DEFAULT_MODALITIES,
|
|
17342
17565
|
variants: {
|
|
17343
17566
|
low: { thinkingLevel: "low" },
|
|
17567
|
+
medium: { thinkingLevel: "medium" },
|
|
17344
17568
|
high: { thinkingLevel: "high" }
|
|
17345
17569
|
}
|
|
17346
17570
|
}),
|
|
17347
|
-
"antigravity-
|
|
17348
|
-
name: "
|
|
17571
|
+
"antigravity-claude-sonnet-5-5": defineModel("antigravity-claude-sonnet-5-5", {
|
|
17572
|
+
name: "Claude Sonnet 5.5 (Antigravity)",
|
|
17349
17573
|
reasoning: true,
|
|
17350
|
-
limit: { context:
|
|
17574
|
+
limit: { context: 1e6, output: 128e3 },
|
|
17351
17575
|
modalities: DEFAULT_MODALITIES,
|
|
17352
17576
|
variants: {
|
|
17353
17577
|
low: { thinkingLevel: "low" },
|
|
17578
|
+
medium: { thinkingLevel: "medium" },
|
|
17354
17579
|
high: { thinkingLevel: "high" }
|
|
17355
17580
|
}
|
|
17356
17581
|
}),
|
|
17357
|
-
"antigravity-claude-
|
|
17358
|
-
name: "Claude
|
|
17359
|
-
reasoning: true,
|
|
17360
|
-
limit: { context: 25e4, output: 64e3 },
|
|
17361
|
-
modalities: DEFAULT_MODALITIES,
|
|
17362
|
-
variants: {
|
|
17363
|
-
low: { disabled: true },
|
|
17364
|
-
high: { disabled: true }
|
|
17365
|
-
}
|
|
17366
|
-
}),
|
|
17367
|
-
"antigravity-claude-opus-4-6-thinking": defineModel("antigravity-claude-opus-4-6-thinking", {
|
|
17368
|
-
name: "Claude Opus 4.6 Thinking (Antigravity)",
|
|
17582
|
+
"antigravity-claude-opus-5-5": defineModel("antigravity-claude-opus-5-5", {
|
|
17583
|
+
name: "Claude Opus 5.5 (Antigravity)",
|
|
17369
17584
|
reasoning: true,
|
|
17370
|
-
limit: { context:
|
|
17585
|
+
limit: { context: 1e6, output: 128e3 },
|
|
17371
17586
|
modalities: DEFAULT_MODALITIES,
|
|
17372
17587
|
variants: {
|
|
17373
|
-
low: {
|
|
17374
|
-
|
|
17375
|
-
|
|
17376
|
-
}),
|
|
17377
|
-
"antigravity-gemini-3.1-flash-image": defineModel("antigravity-gemini-3.1-flash-image", {
|
|
17378
|
-
name: "Gemini 3.1 Flash Image (Antigravity)",
|
|
17379
|
-
reasoning: false,
|
|
17380
|
-
limit: { context: 66e3, output: 33e3 },
|
|
17381
|
-
modalities: {
|
|
17382
|
-
input: ["text", "image"],
|
|
17383
|
-
output: ["text", "image"]
|
|
17588
|
+
low: { thinkingLevel: "low" },
|
|
17589
|
+
medium: { thinkingLevel: "medium" },
|
|
17590
|
+
high: { thinkingLevel: "high" }
|
|
17384
17591
|
}
|
|
17385
17592
|
}),
|
|
17386
17593
|
"antigravity-gpt-oss-120b-medium": defineModel("antigravity-gpt-oss-120b-medium", {
|
|
@@ -17462,6 +17669,7 @@ var RESOLVER_ALIASES = {
|
|
|
17462
17669
|
"gemini-3.8-flash-low": "gemini-3.8-flash",
|
|
17463
17670
|
"gemini-3.8-flash-medium": "gemini-3.8-flash",
|
|
17464
17671
|
"gemini-3.8-flash-high": "gemini-3.8-flash",
|
|
17672
|
+
// Historical parsing does not authorize serving: admission rejects retired routes.
|
|
17465
17673
|
"gemini-claude-opus-4-6-thinking-low": "claude-opus-4-6-thinking",
|
|
17466
17674
|
"gemini-claude-opus-4-6-thinking-medium": "claude-opus-4-6-thinking",
|
|
17467
17675
|
"gemini-claude-opus-4-6-thinking-high": "claude-opus-4-6-thinking",
|
|
@@ -17544,10 +17752,10 @@ var ANTIGRAVITY_OPENCODE_MODEL_IDS = [
|
|
|
17544
17752
|
"antigravity-gemini-3.7-flash",
|
|
17545
17753
|
"antigravity-gemini-3.6-flash",
|
|
17546
17754
|
"antigravity-gemini-3.5-flash",
|
|
17547
|
-
"antigravity-gemini-3.1-pro",
|
|
17548
|
-
"antigravity-claude-sonnet-4-6-thinking",
|
|
17549
|
-
"antigravity-claude-opus-4-6-thinking",
|
|
17550
17755
|
"antigravity-gemini-3.1-flash-image",
|
|
17756
|
+
"antigravity-gemini-3.1-pro",
|
|
17757
|
+
"antigravity-claude-sonnet-5-5",
|
|
17758
|
+
"antigravity-claude-opus-5-5",
|
|
17551
17759
|
"antigravity-gpt-oss-120b-medium"
|
|
17552
17760
|
];
|
|
17553
17761
|
function pickModelDefinitions(ids) {
|
|
@@ -21442,26 +21650,6 @@ var AGY_REQUEST_FIELD_ORDER = [
|
|
|
21442
21650
|
"generationConfig",
|
|
21443
21651
|
"sessionId"
|
|
21444
21652
|
];
|
|
21445
|
-
var AGY_MODEL_ENUM_BY_WIRE_MODEL = {
|
|
21446
|
-
"gemini-3.5-flash-extra-low": "MODEL_PLACEHOLDER_M187",
|
|
21447
|
-
"gemini-3.5-flash-low": "MODEL_PLACEHOLDER_M20",
|
|
21448
|
-
"gemini-3-flash-agent": "MODEL_PLACEHOLDER_M84",
|
|
21449
|
-
"gemini-3.6-flash-low": "MODEL_PLACEHOLDER_M73",
|
|
21450
|
-
"gemini-3.6-flash-medium": "MODEL_PLACEHOLDER_M72",
|
|
21451
|
-
"gemini-3.6-flash-high": "MODEL_PLACEHOLDER_M71",
|
|
21452
|
-
"gemini-3.7-flash-low": "MODEL_PLACEHOLDER_M300",
|
|
21453
|
-
"gemini-3.7-flash-medium": "MODEL_PLACEHOLDER_M299",
|
|
21454
|
-
"gemini-3.7-flash-high": "MODEL_PLACEHOLDER_M298",
|
|
21455
|
-
"gemini-3.8-flash-low": "MODEL_PLACEHOLDER_M320",
|
|
21456
|
-
"gemini-3.8-flash-medium": "MODEL_PLACEHOLDER_M319",
|
|
21457
|
-
"gemini-3.8-flash-high": "MODEL_PLACEHOLDER_M318",
|
|
21458
|
-
"gemini-3.1-pro-low": "MODEL_PLACEHOLDER_M36",
|
|
21459
|
-
"gemini-pro-agent": "MODEL_PLACEHOLDER_M16",
|
|
21460
|
-
"claude-sonnet-4-6": "MODEL_PLACEHOLDER_M35",
|
|
21461
|
-
"claude-opus-4-6-thinking": "MODEL_PLACEHOLDER_M26",
|
|
21462
|
-
"gemini-3.1-flash-image": "MODEL_PLACEHOLDER_M21",
|
|
21463
|
-
"gpt-oss-120b-medium": "MODEL_OPENAI_GPT_OSS_120B_MEDIUM"
|
|
21464
|
-
};
|
|
21465
21653
|
function fnv1a64Signed(input2) {
|
|
21466
21654
|
let hash2 = FNV1A_64_OFFSET_BASIS;
|
|
21467
21655
|
for (const byte of Buffer2.from(input2, "utf8")) {
|
|
@@ -21553,8 +21741,13 @@ var AgyRequestSessionStore = class {
|
|
|
21553
21741
|
}
|
|
21554
21742
|
}
|
|
21555
21743
|
};
|
|
21744
|
+
var HISTORICAL_AGY_MODEL_ENUMS = {
|
|
21745
|
+
"claude-sonnet-4-6": "MODEL_PLACEHOLDER_M35",
|
|
21746
|
+
"claude-opus-4-6-thinking": "MODEL_PLACEHOLDER_M26"
|
|
21747
|
+
};
|
|
21556
21748
|
function getAgyModelEnum(model) {
|
|
21557
|
-
|
|
21749
|
+
const lower = model.toLowerCase();
|
|
21750
|
+
return getAgyNativeModel(lower)?.model ?? HISTORICAL_AGY_MODEL_ENUMS[lower];
|
|
21558
21751
|
}
|
|
21559
21752
|
function orderAgyRequestPayloadInPlace(payload) {
|
|
21560
21753
|
const ordered = {};
|
|
@@ -23974,6 +24167,30 @@ async function defaultTransport(url, init, options) {
|
|
|
23974
24167
|
return fetchWithActiveTimeout(url, init, { timeoutMs: options.timeoutMs });
|
|
23975
24168
|
}
|
|
23976
24169
|
|
|
24170
|
+
// ../core/dist/transform/agy-generation.js
|
|
24171
|
+
var ADAPTIVE_LEVELS = {
|
|
24172
|
+
1: "LOW",
|
|
24173
|
+
2: "MEDIUM",
|
|
24174
|
+
3: "HIGH"
|
|
24175
|
+
};
|
|
24176
|
+
function applyAgyNativeGenerationConfig(wireModel, generationConfig) {
|
|
24177
|
+
const native = getAgyNativeModel(wireModel);
|
|
24178
|
+
if (!native)
|
|
24179
|
+
return;
|
|
24180
|
+
const output2 = generationConfig.max_output_tokens ?? native.maxOutputTokens;
|
|
24181
|
+
if (generationConfig.maxOutputTokens === void 0 && output2 !== void 0) {
|
|
24182
|
+
generationConfig.maxOutputTokens = output2;
|
|
24183
|
+
}
|
|
24184
|
+
delete generationConfig.max_output_tokens;
|
|
24185
|
+
if (native.supportsAdaptiveThinking && native.thinkingLevel !== void 0) {
|
|
24186
|
+
generationConfig.thinkingConfig = {
|
|
24187
|
+
includeThoughts: true,
|
|
24188
|
+
thinkingBudget: 0,
|
|
24189
|
+
thinkingLevel: ADAPTIVE_LEVELS[native.thinkingLevel]
|
|
24190
|
+
};
|
|
24191
|
+
}
|
|
24192
|
+
}
|
|
24193
|
+
|
|
23977
24194
|
// ../core/dist/transform/claude.js
|
|
23978
24195
|
var CLAUDE_THINKING_MAX_OUTPUT_TOKENS = 64e3;
|
|
23979
24196
|
function computeClaudeMaxOutputTokens(thinkingBudget) {
|
|
@@ -23988,7 +24205,7 @@ function isClaudeModel(model) {
|
|
|
23988
24205
|
}
|
|
23989
24206
|
function isClaudeThinkingModel(model) {
|
|
23990
24207
|
const lower = model.toLowerCase();
|
|
23991
|
-
return lower.includes("claude") && (lower.includes("thinking") || lower.endsWith("claude-sonnet-4-6"));
|
|
24208
|
+
return lower.includes("claude") && (lower.includes("thinking") || lower.endsWith("claude-sonnet-4-6") || /claude-(opus|sonnet)-5-5(?:-(low|medium|high))?$/.test(lower));
|
|
23992
24209
|
}
|
|
23993
24210
|
function appendClaudeThinkingHint(payload, hint = CLAUDE_INTERLEAVED_THINKING_HINT) {
|
|
23994
24211
|
const existing = payload.systemInstruction;
|
|
@@ -24489,7 +24706,7 @@ var GEMINI_3_FLASH_REGEX = /^gemini-3(?:\.\d+)?-flash/i;
|
|
|
24489
24706
|
var IMAGE_GENERATION_MODELS = /image|imagen/i;
|
|
24490
24707
|
function supportsThinkingTiers(model) {
|
|
24491
24708
|
const lower = model.toLowerCase();
|
|
24492
|
-
return lower.includes("gemini-3") || lower.includes("gemini-2.5") || lower.includes("claude") && lower.includes("thinking");
|
|
24709
|
+
return lower.includes("gemini-3") || lower.includes("gemini-2.5") || lower.includes("claude") && (lower.includes("thinking") || /^claude-(opus|sonnet)-5-5/.test(lower));
|
|
24493
24710
|
}
|
|
24494
24711
|
function extractThinkingTierFromModel(model) {
|
|
24495
24712
|
if (!supportsThinkingTiers(model)) {
|
|
@@ -24526,7 +24743,7 @@ function isGemini35FlashModel(model) {
|
|
|
24526
24743
|
function resolveGemini35FlashAntigravityModel(tier) {
|
|
24527
24744
|
return getGemini35FlashAntigravityModel(tier);
|
|
24528
24745
|
}
|
|
24529
|
-
function getAgyGeminiFlashThinkingBudget(tier, highBudget =
|
|
24746
|
+
function getAgyGeminiFlashThinkingBudget(tier, highBudget = -1) {
|
|
24530
24747
|
switch (tier) {
|
|
24531
24748
|
case "low":
|
|
24532
24749
|
return 1e3;
|
|
@@ -24537,7 +24754,7 @@ function getAgyGeminiFlashThinkingBudget(tier, highBudget = 1e4) {
|
|
|
24537
24754
|
}
|
|
24538
24755
|
}
|
|
24539
24756
|
function getAgyGemini31ProModel(tier) {
|
|
24540
|
-
return tier === "high" ? "gemini-pro-
|
|
24757
|
+
return tier === "high" ? "gemini-3.1-pro-high" : "gemini-3.1-pro-low";
|
|
24541
24758
|
}
|
|
24542
24759
|
function getAgyGemini31ProThinkingBudget(tier) {
|
|
24543
24760
|
return tier === "high" ? 10001 : 1001;
|
|
@@ -24552,6 +24769,29 @@ function resolveModelWithTier(requestedModel, options = {}) {
|
|
|
24552
24769
|
const preferGeminiCli = options.cli_first === true && !isAntigravity && !isImageModel && !isClaudeModel2;
|
|
24553
24770
|
const quotaPreference = preferGeminiCli ? "gemini-cli" : "antigravity";
|
|
24554
24771
|
const explicitQuota = isAntigravity || isImageModel;
|
|
24772
|
+
const native = getAgyNativeModel(modelWithoutQuota);
|
|
24773
|
+
const groupedGemini35Tier = isAntigravity && /^gemini-3\.5-flash-(low|medium|high)$/i.test(modelWithoutQuota);
|
|
24774
|
+
if (native && quotaPreference === "antigravity" && !groupedGemini35Tier) {
|
|
24775
|
+
return {
|
|
24776
|
+
actualModel: modelWithoutQuota,
|
|
24777
|
+
thinkingBudget: native.supportsAdaptiveThinking ? 0 : native.thinkingBudget,
|
|
24778
|
+
isThinkingModel: native.supportsThinking ?? false,
|
|
24779
|
+
...isImageModel ? { isImageModel: true } : {},
|
|
24780
|
+
tier,
|
|
24781
|
+
quotaPreference,
|
|
24782
|
+
explicitQuota
|
|
24783
|
+
};
|
|
24784
|
+
}
|
|
24785
|
+
if (/^claude-(opus|sonnet)-5-5$/i.test(modelWithoutQuota)) {
|
|
24786
|
+
return {
|
|
24787
|
+
actualModel: `${modelWithoutQuota}-low`,
|
|
24788
|
+
thinkingBudget: 0,
|
|
24789
|
+
isThinkingModel: true,
|
|
24790
|
+
tier: "low",
|
|
24791
|
+
quotaPreference,
|
|
24792
|
+
explicitQuota
|
|
24793
|
+
};
|
|
24794
|
+
}
|
|
24555
24795
|
const isGemini3 = modelWithoutQuota.toLowerCase().startsWith("gemini-3");
|
|
24556
24796
|
const skipAlias = isAntigravity && isGemini3;
|
|
24557
24797
|
const isGemini3Pro = isGemini3ProModel(modelWithoutQuota);
|
|
@@ -24585,7 +24825,7 @@ function resolveModelWithTier(requestedModel, options = {}) {
|
|
|
24585
24825
|
if (isGemini36Flash && quotaPreference === "antigravity") {
|
|
24586
24826
|
return {
|
|
24587
24827
|
actualModel: getGemini36FlashAntigravityModel(tier ?? "medium"),
|
|
24588
|
-
thinkingBudget: getAgyGeminiFlashThinkingBudget(tier),
|
|
24828
|
+
thinkingBudget: getAgyGeminiFlashThinkingBudget(tier, -1),
|
|
24589
24829
|
tier: tier ?? "medium",
|
|
24590
24830
|
isThinkingModel: true,
|
|
24591
24831
|
quotaPreference,
|
|
@@ -28744,7 +28984,7 @@ function createStoreAccountLimits(input2) {
|
|
|
28744
28984
|
}
|
|
28745
28985
|
|
|
28746
28986
|
// src/sidebar-state.ts
|
|
28747
|
-
import { mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "node:fs";
|
|
28987
|
+
import { chmodSync as chmodSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "node:fs";
|
|
28748
28988
|
import { homedir as homedir4 } from "node:os";
|
|
28749
28989
|
import { dirname as dirname15, join as join13 } from "node:path";
|
|
28750
28990
|
|
|
@@ -28768,7 +29008,7 @@ if (xdgConfig) {
|
|
|
28768
29008
|
}
|
|
28769
29009
|
|
|
28770
29010
|
// src/sidebar-state.ts
|
|
28771
|
-
var SIDEBAR_STATE_VERSION =
|
|
29011
|
+
var SIDEBAR_STATE_VERSION = 2;
|
|
28772
29012
|
var DEFAULT_SIDEBAR_STATE = {
|
|
28773
29013
|
version: SIDEBAR_STATE_VERSION,
|
|
28774
29014
|
checkedAt: 0,
|
|
@@ -28829,7 +29069,7 @@ function normalizeSidebarState(input2) {
|
|
|
28829
29069
|
}
|
|
28830
29070
|
const record2 = input2;
|
|
28831
29071
|
const version = record2.version;
|
|
28832
|
-
if (version !== SIDEBAR_STATE_VERSION) {
|
|
29072
|
+
if (version !== 1 && version !== SIDEBAR_STATE_VERSION) {
|
|
28833
29073
|
return {
|
|
28834
29074
|
...DEFAULT_SIDEBAR_STATE,
|
|
28835
29075
|
lastError: `unsupported-version:${stringifySafe(version)}`
|
|
@@ -28884,6 +29124,7 @@ function normalizeAccount(input2) {
|
|
|
28884
29124
|
return {
|
|
28885
29125
|
id,
|
|
28886
29126
|
label,
|
|
29127
|
+
...typeof record2.email === "string" ? { email: record2.email } : {},
|
|
28887
29128
|
enabled,
|
|
28888
29129
|
health,
|
|
28889
29130
|
current,
|
|
@@ -28905,6 +29146,7 @@ function normalizeQuota(input2) {
|
|
|
28905
29146
|
if (!isObject(input2)) return null;
|
|
28906
29147
|
const record2 = input2;
|
|
28907
29148
|
const remaining = toFiniteNumber(record2.remainingPercent);
|
|
29149
|
+
const fraction = toFiniteNumber(record2.remainingFraction);
|
|
28908
29150
|
if (remaining === null) return null;
|
|
28909
29151
|
const resetAt = toFiniteNumber(record2.resetAt) ?? void 0;
|
|
28910
29152
|
const checkedAt = toFiniteNumber(record2.checkedAt) ?? void 0;
|
|
@@ -28918,10 +29160,12 @@ function normalizeQuota(input2) {
|
|
|
28918
29160
|
);
|
|
28919
29161
|
const ra = toFiniteNumber(w.resetAt);
|
|
28920
29162
|
const ca = toFiniteNumber(w.checkedAt);
|
|
29163
|
+
const rf = toFiniteNumber(w.remainingFraction);
|
|
28921
29164
|
if (win !== "weekly" && win !== "5h" || rp === null) return null;
|
|
28922
29165
|
return {
|
|
28923
29166
|
window: win,
|
|
28924
29167
|
remainingPercent: clampNumber(rp, 0, 100),
|
|
29168
|
+
...rf !== null ? { remainingFraction: clampNumber(rf, 0, 1) } : {},
|
|
28925
29169
|
resetAt: ra ?? void 0,
|
|
28926
29170
|
...ca !== null && ca >= 0 ? { checkedAt: ca } : {}
|
|
28927
29171
|
};
|
|
@@ -28930,6 +29174,7 @@ function normalizeQuota(input2) {
|
|
|
28930
29174
|
}
|
|
28931
29175
|
return {
|
|
28932
29176
|
remainingPercent: clampNumber(remaining, 0, 100),
|
|
29177
|
+
...fraction !== null ? { remainingFraction: clampNumber(fraction, 0, 1) } : {},
|
|
28933
29178
|
resetAt,
|
|
28934
29179
|
...checkedAt !== void 0 ? { checkedAt } : {},
|
|
28935
29180
|
windows
|
|
@@ -28981,6 +29226,7 @@ function stringifySafe(value) {
|
|
|
28981
29226
|
}
|
|
28982
29227
|
function ensureSidebarStateDir(path5 = getSidebarStateFile()) {
|
|
28983
29228
|
mkdirSync3(dirname15(path5), { recursive: true, mode: SIDEBAR_STATE_DIR_MODE });
|
|
29229
|
+
chmodSync3(dirname15(path5), SIDEBAR_STATE_DIR_MODE);
|
|
28984
29230
|
}
|
|
28985
29231
|
function pruneActiveRouting(map, now) {
|
|
28986
29232
|
const cutoff = now - ACTIVE_ROUTING_MAX_AGE_MS;
|
|
@@ -29059,6 +29305,7 @@ function projectQuotaPoolForSidebar(source, checkedAt) {
|
|
|
29059
29305
|
0,
|
|
29060
29306
|
100
|
|
29061
29307
|
),
|
|
29308
|
+
remainingFraction: clampNumber(w.remainingFraction, 0, 1),
|
|
29062
29309
|
resetAt: typeof w.resetTime === "string" && w.resetTime.length > 0 ? (() => {
|
|
29063
29310
|
const parsed = Date.parse(w.resetTime);
|
|
29064
29311
|
return Number.isFinite(parsed) ? parsed : void 0;
|
|
@@ -29066,6 +29313,7 @@ function projectQuotaPoolForSidebar(source, checkedAt) {
|
|
|
29066
29313
|
})) : void 0;
|
|
29067
29314
|
return {
|
|
29068
29315
|
remainingPercent,
|
|
29316
|
+
remainingFraction: clampNumber(fraction, 0, 1),
|
|
29069
29317
|
resetAt,
|
|
29070
29318
|
windows,
|
|
29071
29319
|
...readingAt !== void 0 ? { checkedAt: readingAt } : {}
|
|
@@ -29102,6 +29350,7 @@ function redactAccountForSidebar(source) {
|
|
|
29102
29350
|
return {
|
|
29103
29351
|
id,
|
|
29104
29352
|
label,
|
|
29353
|
+
...typeof source.email === "string" ? { email: source.email } : {},
|
|
29105
29354
|
enabled,
|
|
29106
29355
|
health,
|
|
29107
29356
|
current,
|
|
@@ -29424,6 +29673,7 @@ async function pushSidebarQuotaSnapshot(getAccounts, backoffUntil = 0, getActive
|
|
|
29424
29673
|
accounts.map((entry) => ({
|
|
29425
29674
|
index: entry.index,
|
|
29426
29675
|
label: entry.label,
|
|
29676
|
+
email: entry.email,
|
|
29427
29677
|
enabled: entry.enabled,
|
|
29428
29678
|
current: activeByFamily ? isAccountCurrent(entry.index, activeByFamily) : false,
|
|
29429
29679
|
coolingDownUntil: entry.coolingDownUntil,
|
|
@@ -30855,7 +31105,7 @@ function clearSignatureCache(sessionId) {
|
|
|
30855
31105
|
}
|
|
30856
31106
|
|
|
30857
31107
|
// src/plugin/image-saver.ts
|
|
30858
|
-
import { chmodSync as
|
|
31108
|
+
import { chmodSync as chmodSync4, existsSync as existsSync9, mkdirSync as mkdirSync5, writeFileSync as writeFileSync3 } from "node:fs";
|
|
30859
31109
|
import { homedir as homedir6 } from "node:os";
|
|
30860
31110
|
import { join as join15 } from "node:path";
|
|
30861
31111
|
function getImageOutputDir(outputDir) {
|
|
@@ -30863,7 +31113,7 @@ function getImageOutputDir(outputDir) {
|
|
|
30863
31113
|
if (!existsSync9(resolved)) {
|
|
30864
31114
|
mkdirSync5(resolved, { recursive: true, mode: 448 });
|
|
30865
31115
|
}
|
|
30866
|
-
|
|
31116
|
+
chmodSync4(resolved, 448);
|
|
30867
31117
|
return resolved;
|
|
30868
31118
|
}
|
|
30869
31119
|
function generateImageFilename(mimeType) {
|
|
@@ -30884,7 +31134,7 @@ function saveImageToDisk(base64Data, mimeType, outputDir) {
|
|
|
30884
31134
|
const resolvedOutputDir = getImageOutputDir(outputDir);
|
|
30885
31135
|
const filePath = join15(resolvedOutputDir, generateImageFilename(mimeType));
|
|
30886
31136
|
writeFileSync3(filePath, Buffer.from(base64Data, "base64"), { mode: 384 });
|
|
30887
|
-
|
|
31137
|
+
chmodSync4(filePath, 384);
|
|
30888
31138
|
return filePath;
|
|
30889
31139
|
} catch (error) {
|
|
30890
31140
|
console.error("[image-saver] Failed to save image:", error);
|
|
@@ -34062,6 +34312,8 @@ function getImageModelLocalTitle(input2, init) {
|
|
|
34062
34312
|
}
|
|
34063
34313
|
}
|
|
34064
34314
|
function getAgyMaxOutputTokens(model) {
|
|
34315
|
+
const native = getAgyNativeModel(model);
|
|
34316
|
+
if (native) return native.maxOutputTokens;
|
|
34065
34317
|
const lower = model.toLowerCase();
|
|
34066
34318
|
if (lower === "gemini-3.5-flash-low" || lower === "gemini-3.5-flash-extra-low" || lower === "gemini-3-flash-agent" || lower === "gemini-3.6-flash-low" || lower === "gemini-3.6-flash-medium" || lower === "gemini-3.6-flash-high" || lower === "gemini-3.7-flash-low" || lower === "gemini-3.7-flash-medium" || lower === "gemini-3.7-flash-high" || lower === "gemini-3.8-flash-low" || lower === "gemini-3.8-flash-medium" || lower === "gemini-3.8-flash-high") {
|
|
34067
34319
|
return 65536;
|
|
@@ -34081,6 +34333,10 @@ function applyAgyGenerationDefaults(model, generationConfig, headerStyle) {
|
|
|
34081
34333
|
if (headerStyle !== "antigravity") {
|
|
34082
34334
|
return;
|
|
34083
34335
|
}
|
|
34336
|
+
if (getAgyNativeModel(model)) {
|
|
34337
|
+
applyAgyNativeGenerationConfig(model, generationConfig);
|
|
34338
|
+
return;
|
|
34339
|
+
}
|
|
34084
34340
|
const maxOutputTokens = getAgyMaxOutputTokens(model);
|
|
34085
34341
|
if (maxOutputTokens !== void 0) {
|
|
34086
34342
|
generationConfig.maxOutputTokens = maxOutputTokens;
|
|
@@ -34986,6 +35242,11 @@ function prepareAntigravityRequestIn(wire, input2, init, accessToken, projectId,
|
|
|
34986
35242
|
const wireRequest = requestObjects.at(-1);
|
|
34987
35243
|
if (wireRequest) {
|
|
34988
35244
|
if (headerStyle === "antigravity") {
|
|
35245
|
+
const generationConfig = wireRequest.generationConfig;
|
|
35246
|
+
const config = generationConfig && typeof generationConfig === "object" && !Array.isArray(generationConfig) ? generationConfig : {};
|
|
35247
|
+
applyAgyNativeGenerationConfig(effectiveModel, config);
|
|
35248
|
+
if (Object.keys(config).length > 0)
|
|
35249
|
+
wireRequest.generationConfig = config;
|
|
34989
35250
|
const metadata = buildAgyAgentRequestMetadata(
|
|
34990
35251
|
options?.agySession ?? DEFAULT_AGY_REQUEST_SESSION,
|
|
34991
35252
|
wireRequest,
|
|
@@ -35021,7 +35282,7 @@ function prepareAntigravityRequestIn(wire, input2, init, accessToken, projectId,
|
|
|
35021
35282
|
`[ThinkingResolution] rawModel=${rawModel} resolvedModel=${effectiveModel} resolvedTier=${tierThinkingLevel ?? "none"} variantLevel=${variantConfig?.thinkingLevel ?? "none"} variantBudget=${variantConfig?.thinkingBudget ?? "none"} providerOptions.google=${JSON.stringify(requestPayload.providerOptions?.google ?? null)} generationConfig.thinkingConfig=${JSON.stringify(rawGenerationConfig?.thinkingConfig ?? null)}`
|
|
35022
35283
|
);
|
|
35023
35284
|
delete requestPayload.providerOptions;
|
|
35024
|
-
if (variantConfig?.thinkingLevel && isGemini3) {
|
|
35285
|
+
if (variantConfig?.thinkingLevel && (isGemini3 || getAgyNativeModel(effectiveModel)?.supportsAdaptiveThinking)) {
|
|
35025
35286
|
const variantModelBase = rawModel.replace(/-preview-customtools$/i, "").replace(/-preview$/i, "").replace(/-(minimal|low|medium|high)$/i, "");
|
|
35026
35287
|
const variantResolved = resolveModelForHeaderStyle(
|
|
35027
35288
|
`${variantModelBase}-${variantConfig.thinkingLevel}`,
|
|
@@ -35448,6 +35709,11 @@ function prepareAntigravityRequestIn(wire, input2, init, accessToken, projectId,
|
|
|
35448
35709
|
stripInjectedDebugFromRequestPayload(requestPayload);
|
|
35449
35710
|
sanitizeRequestPayloadForAntigravity(requestPayload);
|
|
35450
35711
|
if (headerStyle === "antigravity") {
|
|
35712
|
+
const generationConfig = requestPayload.generationConfig;
|
|
35713
|
+
const config = generationConfig && typeof generationConfig === "object" && !Array.isArray(generationConfig) ? generationConfig : {};
|
|
35714
|
+
applyAgyNativeGenerationConfig(effectiveModel, config);
|
|
35715
|
+
if (Object.keys(config).length > 0)
|
|
35716
|
+
requestPayload.generationConfig = config;
|
|
35451
35717
|
stripUnsupportedAntigravityFields(requestPayload);
|
|
35452
35718
|
configureAntigravityToolCalling(requestPayload);
|
|
35453
35719
|
normalizeNativeFunctionResponseRoles(requestPayload);
|
|
@@ -35558,7 +35824,10 @@ function buildThinkingWarmupBody(bodyText, isClaudeThinking) {
|
|
|
35558
35824
|
return null;
|
|
35559
35825
|
}
|
|
35560
35826
|
const warmupPrompt = "Warmup request for thinking signature.";
|
|
35561
|
-
const
|
|
35827
|
+
const candidate = typeof parsed.model === "string" ? parsed.model : "";
|
|
35828
|
+
if (candidate && isRetiredAgyModel(candidate)) return null;
|
|
35829
|
+
const wireModel = candidate || "claude-sonnet-5-5-low";
|
|
35830
|
+
parsed.model = wireModel;
|
|
35562
35831
|
const requestObjects = [];
|
|
35563
35832
|
const updateRequest = (req) => {
|
|
35564
35833
|
req.contents = [{ role: "user", parts: [{ text: warmupPrompt }] }];
|
|
@@ -35569,7 +35838,8 @@ function buildThinkingWarmupBody(bodyText, isClaudeThinking) {
|
|
|
35569
35838
|
includeThoughts: true,
|
|
35570
35839
|
thinkingBudget: AGY_CLAUDE_THINKING_BUDGET
|
|
35571
35840
|
};
|
|
35572
|
-
generationConfig.maxOutputTokens
|
|
35841
|
+
generationConfig.maxOutputTokens ??= generationConfig.max_output_tokens ?? getAgyMaxOutputTokens(wireModel) ?? computeClaudeMaxOutputTokens(AGY_CLAUDE_THINKING_BUDGET);
|
|
35842
|
+
applyAgyNativeGenerationConfig(wireModel, generationConfig);
|
|
35573
35843
|
req.generationConfig = generationConfig;
|
|
35574
35844
|
requestObjects.push(req);
|
|
35575
35845
|
};
|
|
@@ -36802,7 +37072,8 @@ function routeTitleModel(url) {
|
|
|
36802
37072
|
const model = extractModelFromUrl(url);
|
|
36803
37073
|
if (model === null) return url;
|
|
36804
37074
|
const registered = Object.hasOwn(getPublicModelDefinitions(), model) || Object.hasOwn(getResolverAliasMap(), model);
|
|
36805
|
-
if (registered && !isImageGenerationModel(model)
|
|
37075
|
+
if (registered && !isImageGenerationModel(model) && !isRetiredAgyModel(model))
|
|
37076
|
+
return url;
|
|
36806
37077
|
return url.replace(`/models/${model}`, `/models/${TITLE_FALLBACK_MODEL}`);
|
|
36807
37078
|
}
|
|
36808
37079
|
function agyMetadataIdentity(identity, kind) {
|
|
@@ -37004,6 +37275,19 @@ function createRequestExecutor(deps) {
|
|
|
37004
37275
|
if (kind === "title") {
|
|
37005
37276
|
input2 = routeTitleModel(input2);
|
|
37006
37277
|
}
|
|
37278
|
+
const selectedModel = extractModelFromUrl(input2);
|
|
37279
|
+
if (selectedModel && isRetiredAgyModel(selectedModel)) {
|
|
37280
|
+
return new Response(
|
|
37281
|
+
JSON.stringify({
|
|
37282
|
+
error: {
|
|
37283
|
+
code: 412,
|
|
37284
|
+
status: "FAILED_PRECONDITION",
|
|
37285
|
+
message: RETIRED_AGY_MODEL_MESSAGE
|
|
37286
|
+
}
|
|
37287
|
+
}),
|
|
37288
|
+
{ status: 412, headers: { "Content-Type": "application/json" } }
|
|
37289
|
+
);
|
|
37290
|
+
}
|
|
37007
37291
|
const transport = options.transport ?? defaultTransport2;
|
|
37008
37292
|
const requestSessionIdentity = options.session ?? extractOpenCodeSessionIdentity(init?.headers);
|
|
37009
37293
|
const agyRequestScope = agySessionRegistry.beginRequest(
|
|
@@ -37543,9 +37827,7 @@ function createRequestExecutor(deps) {
|
|
|
37543
37827
|
if (!warmupState.trackAttempt(prepared.sessionId)) return;
|
|
37544
37828
|
const warmupBody = wire.buildThinkingWarmupBody(
|
|
37545
37829
|
typeof prepared.init.body === "string" ? prepared.init.body : void 0,
|
|
37546
|
-
|
|
37547
|
-
prepared.effectiveModel?.toLowerCase().includes("claude") && prepared.effectiveModel?.toLowerCase().includes("thinking")
|
|
37548
|
-
)
|
|
37830
|
+
isClaudeThinkingModel(prepared.effectiveModel ?? "")
|
|
37549
37831
|
);
|
|
37550
37832
|
if (!warmupBody) return;
|
|
37551
37833
|
const warmupUrl = toWarmupStreamUrl(prepared.request);
|
|
@@ -43586,10 +43868,32 @@ function createGaRpcActivation(options) {
|
|
|
43586
43868
|
accountsStatus: { kind: "complete" },
|
|
43587
43869
|
accounts: accounts.rows.map(({ selector, row }) => ({
|
|
43588
43870
|
selector,
|
|
43589
|
-
...redactAccountForSidebar(row)
|
|
43871
|
+
...gaAccountFields(redactAccountForSidebar(row))
|
|
43590
43872
|
}))
|
|
43591
43873
|
};
|
|
43592
43874
|
};
|
|
43875
|
+
const gaAccountFields = (account) => {
|
|
43876
|
+
const { email: _email, quota, ...rest } = account;
|
|
43877
|
+
const entry = (value) => {
|
|
43878
|
+
if (value === void 0) return void 0;
|
|
43879
|
+
const { remainingFraction: _fraction, windows, ...fields } = value;
|
|
43880
|
+
return windows === void 0 ? fields : {
|
|
43881
|
+
...fields,
|
|
43882
|
+
windows: windows.map(
|
|
43883
|
+
({ remainingFraction: _windowFraction, ...window }) => window
|
|
43884
|
+
)
|
|
43885
|
+
};
|
|
43886
|
+
};
|
|
43887
|
+
const gemini = entry(quota.gemini);
|
|
43888
|
+
const nonGemini = entry(quota["non-gemini"]);
|
|
43889
|
+
return {
|
|
43890
|
+
...rest,
|
|
43891
|
+
quota: {
|
|
43892
|
+
...gemini ? { gemini } : {},
|
|
43893
|
+
...nonGemini ? { "non-gemini": nonGemini } : {}
|
|
43894
|
+
}
|
|
43895
|
+
};
|
|
43896
|
+
};
|
|
43593
43897
|
const state = async (input2, signal) => {
|
|
43594
43898
|
const parsed = AntigravityStateInputSchema.parse(input2);
|
|
43595
43899
|
if (!parsed.ok) throw new GaRpcInputError(parsed.issues);
|
|
@@ -48773,6 +49077,7 @@ function createAuthLoader({
|
|
|
48773
49077
|
return {
|
|
48774
49078
|
index: entry.index,
|
|
48775
49079
|
label: entry.label,
|
|
49080
|
+
email: entry.email,
|
|
48776
49081
|
enabled: entry.enabled,
|
|
48777
49082
|
current: isAccountCurrent(entry.index, activeByFamily),
|
|
48778
49083
|
coolingDownUntil: entry.coolingDownUntil,
|
|
@@ -49026,6 +49331,185 @@ function createAuthLoader({
|
|
|
49026
49331
|
return authLoader;
|
|
49027
49332
|
}
|
|
49028
49333
|
|
|
49334
|
+
// src/plugin/vault-quota-refresh.ts
|
|
49335
|
+
async function checkAndPublishVaultQuota(input2, publishSidebar) {
|
|
49336
|
+
const report = await checkVaultQuota(input2);
|
|
49337
|
+
if (report.checked > 0 && !input2.signal.aborted) await publishSidebar();
|
|
49338
|
+
return report;
|
|
49339
|
+
}
|
|
49340
|
+
|
|
49341
|
+
// src/plugin/vault-sidebar-projection.ts
|
|
49342
|
+
function quotaReadingForVaultRoute(route, state) {
|
|
49343
|
+
const stored = state.accounts[route.accountIdentity];
|
|
49344
|
+
return stored?.observed.routeId === route.routeId && stored.observed.credentialId === route.credentialId ? stored.quota : void 0;
|
|
49345
|
+
}
|
|
49346
|
+
function buildVaultSidebarProjection(pool, state, checkedAt = Date.now()) {
|
|
49347
|
+
const projection = buildSidebarMachineStateFromAccounts(
|
|
49348
|
+
pool.selector.rows.map((row) => {
|
|
49349
|
+
const quota = quotaReadingForVaultRoute(row.route, state);
|
|
49350
|
+
return {
|
|
49351
|
+
index: row.index,
|
|
49352
|
+
email: row.route.email,
|
|
49353
|
+
enabled: row.enabled,
|
|
49354
|
+
current: false,
|
|
49355
|
+
coolingDownUntil: row.coolingDownUntil,
|
|
49356
|
+
healthScore: pool.selector.healthTracker.getScore(row.index),
|
|
49357
|
+
cachedQuota: quota ? cachedQuotaOf(quota) : void 0,
|
|
49358
|
+
cachedQuotaUpdatedAt: quota?.cachedQuotaUpdatedAt ?? void 0
|
|
49359
|
+
};
|
|
49360
|
+
}),
|
|
49361
|
+
{ checkedAt }
|
|
49362
|
+
);
|
|
49363
|
+
return {
|
|
49364
|
+
...projection,
|
|
49365
|
+
accounts: projection.accounts.map((account) => ({
|
|
49366
|
+
...account,
|
|
49367
|
+
id: `vault-${account.id}`
|
|
49368
|
+
}))
|
|
49369
|
+
};
|
|
49370
|
+
}
|
|
49371
|
+
|
|
49372
|
+
// src/plugin/background-vault-quota-refresh.ts
|
|
49373
|
+
var BackgroundVaultQuotaRefresh = class {
|
|
49374
|
+
constructor(options) {
|
|
49375
|
+
this.options = options;
|
|
49376
|
+
this.now = options.now ?? Date.now;
|
|
49377
|
+
this.random = options.random ?? Math.random;
|
|
49378
|
+
this.acquireLock = options.acquireLock ?? acquireFencedFileLock;
|
|
49379
|
+
}
|
|
49380
|
+
options;
|
|
49381
|
+
timer = null;
|
|
49382
|
+
inFlight = null;
|
|
49383
|
+
controller = null;
|
|
49384
|
+
disposed = false;
|
|
49385
|
+
started = false;
|
|
49386
|
+
now;
|
|
49387
|
+
random;
|
|
49388
|
+
acquireLock;
|
|
49389
|
+
start() {
|
|
49390
|
+
if (this.disposed || this.started) return;
|
|
49391
|
+
this.started = true;
|
|
49392
|
+
this.schedule(Math.floor(this.random() * 3e4));
|
|
49393
|
+
}
|
|
49394
|
+
/** Custody notifications cancel admitted work as soon as authority changes. */
|
|
49395
|
+
abortTick() {
|
|
49396
|
+
this.controller?.abort();
|
|
49397
|
+
}
|
|
49398
|
+
async dispose() {
|
|
49399
|
+
this.disposed = true;
|
|
49400
|
+
if (this.timer !== null) clearTimeout(this.timer);
|
|
49401
|
+
this.timer = null;
|
|
49402
|
+
this.abortTick();
|
|
49403
|
+
await this.inFlight;
|
|
49404
|
+
}
|
|
49405
|
+
schedule(delay) {
|
|
49406
|
+
if (this.disposed || !this.started) return;
|
|
49407
|
+
this.timer = setTimeout(() => {
|
|
49408
|
+
this.timer = null;
|
|
49409
|
+
void this.tick();
|
|
49410
|
+
}, delay);
|
|
49411
|
+
this.timer.unref?.();
|
|
49412
|
+
}
|
|
49413
|
+
/** One serialized tick; also used by deterministic composition tests. */
|
|
49414
|
+
tick() {
|
|
49415
|
+
if (this.disposed) return Promise.resolve();
|
|
49416
|
+
if (this.inFlight) return this.inFlight;
|
|
49417
|
+
const controller = new AbortController();
|
|
49418
|
+
this.controller = controller;
|
|
49419
|
+
let extraJitter = 0;
|
|
49420
|
+
this.inFlight = this.runTick(controller).catch(() => {
|
|
49421
|
+
extraJitter = 15e3;
|
|
49422
|
+
}).finally(() => {
|
|
49423
|
+
this.inFlight = null;
|
|
49424
|
+
this.controller = null;
|
|
49425
|
+
this.schedule(
|
|
49426
|
+
this.options.intervalMs + Math.floor(this.random() * this.options.intervalMs * 0.1) + extraJitter
|
|
49427
|
+
);
|
|
49428
|
+
});
|
|
49429
|
+
return this.inFlight;
|
|
49430
|
+
}
|
|
49431
|
+
async assertActive(controller) {
|
|
49432
|
+
if (this.disposed || await this.options.readAuthority() !== "vault")
|
|
49433
|
+
controller.abort();
|
|
49434
|
+
controller.signal.throwIfAborted();
|
|
49435
|
+
}
|
|
49436
|
+
async runTick(controller) {
|
|
49437
|
+
await this.assertActive(controller);
|
|
49438
|
+
ensureSidebarStateDir(this.options.sidebarStateFile);
|
|
49439
|
+
const lock = await this.acquireLock({
|
|
49440
|
+
path: this.options.sidebarStateFile,
|
|
49441
|
+
name: "bg-vault-quota-poll",
|
|
49442
|
+
ttlMs: 6e4,
|
|
49443
|
+
renew: true
|
|
49444
|
+
});
|
|
49445
|
+
if (!lock) return;
|
|
49446
|
+
let released = false;
|
|
49447
|
+
void lock.whenLost().then(() => {
|
|
49448
|
+
if (!released) controller.abort();
|
|
49449
|
+
});
|
|
49450
|
+
try {
|
|
49451
|
+
await this.assertActive(controller);
|
|
49452
|
+
await lock.assertOwned();
|
|
49453
|
+
const { source, pool } = await this.options.currentVaultPool();
|
|
49454
|
+
await this.assertActive(controller);
|
|
49455
|
+
await pool.sync();
|
|
49456
|
+
await this.assertActive(controller);
|
|
49457
|
+
const state = await this.options.readProviderState();
|
|
49458
|
+
await this.assertActive(controller);
|
|
49459
|
+
await lock.assertOwned();
|
|
49460
|
+
const threshold = Math.max(
|
|
49461
|
+
this.options.intervalMs - 6e4,
|
|
49462
|
+
Math.floor(this.options.intervalMs / 2)
|
|
49463
|
+
);
|
|
49464
|
+
const now = this.now();
|
|
49465
|
+
const due = pool.selector.rows.some((row) => {
|
|
49466
|
+
const quota = quotaReadingForVaultRoute(row.route, state);
|
|
49467
|
+
const at = quota?.cachedQuotaUpdatedAt;
|
|
49468
|
+
return quota?.cachedQuota == null || typeof at !== "number" || !Number.isFinite(at) || at < 0 || now - at >= threshold;
|
|
49469
|
+
});
|
|
49470
|
+
if (!due) return;
|
|
49471
|
+
await checkAndPublishVaultQuota(
|
|
49472
|
+
{
|
|
49473
|
+
pool,
|
|
49474
|
+
signal: controller.signal,
|
|
49475
|
+
now: this.now,
|
|
49476
|
+
fetchReading: async (ref, signal) => {
|
|
49477
|
+
await this.assertActive(controller);
|
|
49478
|
+
const reading = await fetchVaultAccountQuota({
|
|
49479
|
+
source,
|
|
49480
|
+
ref,
|
|
49481
|
+
signal,
|
|
49482
|
+
logger: this.options.logger,
|
|
49483
|
+
transport: async (url, init, extra) => {
|
|
49484
|
+
await this.assertActive(controller);
|
|
49485
|
+
await lock.assertOwned();
|
|
49486
|
+
controller.signal.throwIfAborted();
|
|
49487
|
+
return this.options.transport(
|
|
49488
|
+
url,
|
|
49489
|
+
{ ...init, signal: extra.signal ?? controller.signal },
|
|
49490
|
+
extra
|
|
49491
|
+
);
|
|
49492
|
+
}
|
|
49493
|
+
});
|
|
49494
|
+
await this.assertActive(controller);
|
|
49495
|
+
await lock.assertOwned();
|
|
49496
|
+
return reading;
|
|
49497
|
+
}
|
|
49498
|
+
},
|
|
49499
|
+
async () => {
|
|
49500
|
+
await this.assertActive(controller);
|
|
49501
|
+
await lock.assertOwned();
|
|
49502
|
+
await this.options.publishSidebar();
|
|
49503
|
+
}
|
|
49504
|
+
);
|
|
49505
|
+
} finally {
|
|
49506
|
+
released = true;
|
|
49507
|
+
await lock.release().catch(() => {
|
|
49508
|
+
});
|
|
49509
|
+
}
|
|
49510
|
+
}
|
|
49511
|
+
};
|
|
49512
|
+
|
|
49029
49513
|
// src/plugin/prompt-context.ts
|
|
49030
49514
|
function isRecord15(value) {
|
|
49031
49515
|
return typeof value === "object" && value !== null;
|
|
@@ -50296,6 +50780,7 @@ var createAntigravityPlugin = (providerId, options = {}) => async (input2) => {
|
|
|
50296
50780
|
await drainSidebarWrites();
|
|
50297
50781
|
}
|
|
50298
50782
|
});
|
|
50783
|
+
let vaultQuotaPoller;
|
|
50299
50784
|
const vaultCustody = createOpenCodeVaultCustody({
|
|
50300
50785
|
accountFile: resolve11(getStoragePath()),
|
|
50301
50786
|
readHostSlot: async () => {
|
|
@@ -50306,7 +50791,10 @@ var createAntigravityPlugin = (providerId, options = {}) => async (input2) => {
|
|
|
50306
50791
|
// The request executor reports failed bearer authorization to Claustrum,
|
|
50307
50792
|
// which decides whether its served credential needs replacement.
|
|
50308
50793
|
reporterSource: "direct",
|
|
50309
|
-
onAuthorityChanged: () =>
|
|
50794
|
+
onAuthorityChanged: (authority) => {
|
|
50795
|
+
if (authority !== "vault") vaultQuotaPoller?.abortTick();
|
|
50796
|
+
scheduleSidebarPublication();
|
|
50797
|
+
},
|
|
50310
50798
|
onRosterChanged: () => scheduleSidebarPublication()
|
|
50311
50799
|
});
|
|
50312
50800
|
let vaultPool;
|
|
@@ -50353,6 +50841,7 @@ var createAntigravityPlugin = (providerId, options = {}) => async (input2) => {
|
|
|
50353
50841
|
return manager.getAccounts().map((entry) => ({
|
|
50354
50842
|
index: entry.index,
|
|
50355
50843
|
label: entry.label,
|
|
50844
|
+
email: entry.email,
|
|
50356
50845
|
enabled: entry.enabled,
|
|
50357
50846
|
current: isAccountCurrent(entry.index, activeByFamily),
|
|
50358
50847
|
coolingDownUntil: entry.coolingDownUntil,
|
|
@@ -50380,6 +50869,7 @@ var createAntigravityPlugin = (providerId, options = {}) => async (input2) => {
|
|
|
50380
50869
|
return buildSidebarMachineStateFromAccounts(
|
|
50381
50870
|
manager?.getAccounts().map((entry) => ({
|
|
50382
50871
|
index: entry.index,
|
|
50872
|
+
email: entry.email,
|
|
50383
50873
|
enabled: entry.enabled,
|
|
50384
50874
|
current: active2 ? isAccountCurrent(entry.index, active2) : false,
|
|
50385
50875
|
coolingDownUntil: entry.coolingDownUntil,
|
|
@@ -50397,23 +50887,13 @@ var createAntigravityPlugin = (providerId, options = {}) => async (input2) => {
|
|
|
50397
50887
|
vault: async () => {
|
|
50398
50888
|
const { pool } = await currentVaultPool();
|
|
50399
50889
|
await pool.sync();
|
|
50400
|
-
const projection =
|
|
50401
|
-
pool
|
|
50402
|
-
|
|
50403
|
-
|
|
50404
|
-
current: false,
|
|
50405
|
-
coolingDownUntil: entry.coolingDownUntil,
|
|
50406
|
-
healthScore: pool.selector.healthTracker.getScore(entry.index),
|
|
50407
|
-
cachedQuota: entry.cachedQuota,
|
|
50408
|
-
cachedQuotaUpdatedAt: entry.cachedQuotaUpdatedAt
|
|
50409
|
-
}))
|
|
50890
|
+
const projection = buildVaultSidebarProjection(
|
|
50891
|
+
pool,
|
|
50892
|
+
await vaultCustody.readState(),
|
|
50893
|
+
dependencies.clock.now()
|
|
50410
50894
|
);
|
|
50411
50895
|
return {
|
|
50412
50896
|
...projection,
|
|
50413
|
-
accounts: projection.accounts.map((account) => ({
|
|
50414
|
-
...account,
|
|
50415
|
-
id: `vault-${account.id}`
|
|
50416
|
-
})),
|
|
50417
50897
|
...projection.accounts.length === 0 ? { lastError: VAULT_ACCOUNT_REMEDY } : {}
|
|
50418
50898
|
};
|
|
50419
50899
|
},
|
|
@@ -50492,6 +50972,21 @@ var createAntigravityPlugin = (providerId, options = {}) => async (input2) => {
|
|
|
50492
50972
|
options._onPollerCreated?.(poller);
|
|
50493
50973
|
poller.start();
|
|
50494
50974
|
lifecycle.register({ dispose: () => poller.dispose() }, "producer");
|
|
50975
|
+
vaultQuotaPoller = new BackgroundVaultQuotaRefresh({
|
|
50976
|
+
intervalMs: config.background_quota_refresh_interval_minutes * 6e4,
|
|
50977
|
+
sidebarStateFile: getSidebarStateFile(),
|
|
50978
|
+
readAuthority: readAuthority2,
|
|
50979
|
+
currentVaultPool,
|
|
50980
|
+
readProviderState: () => vaultCustody.readState(),
|
|
50981
|
+
publishSidebar: () => sidebarPublisher.publish(),
|
|
50982
|
+
transport: dependencies.fetchImpl,
|
|
50983
|
+
logger,
|
|
50984
|
+
now: dependencies.clock.now,
|
|
50985
|
+
random: dependencies.clock.random
|
|
50986
|
+
});
|
|
50987
|
+
options._onVaultPollerCreated?.(vaultQuotaPoller);
|
|
50988
|
+
vaultQuotaPoller.start();
|
|
50989
|
+
lifecycle.register(vaultQuotaPoller, "producer");
|
|
50495
50990
|
}
|
|
50496
50991
|
const operatorSettings = createOperatorSettingsController({
|
|
50497
50992
|
projectConfigPath: join29(directory, ".opencode", "antigravity.json"),
|
|
@@ -50615,17 +51110,21 @@ var createAntigravityPlugin = (providerId, options = {}) => async (input2) => {
|
|
|
50615
51110
|
vaultSelectors2.set(key, selector);
|
|
50616
51111
|
return selector;
|
|
50617
51112
|
},
|
|
50618
|
-
(signal) =>
|
|
50619
|
-
|
|
50620
|
-
|
|
50621
|
-
|
|
50622
|
-
|
|
50623
|
-
ref,
|
|
50624
|
-
|
|
50625
|
-
|
|
50626
|
-
|
|
50627
|
-
|
|
50628
|
-
|
|
51113
|
+
(signal) => checkAndPublishVaultQuota(
|
|
51114
|
+
{
|
|
51115
|
+
pool,
|
|
51116
|
+
signal,
|
|
51117
|
+
now: dependencies.clock.now,
|
|
51118
|
+
fetchReading: (ref, check) => fetchVaultAccountQuota({
|
|
51119
|
+
source,
|
|
51120
|
+
ref,
|
|
51121
|
+
signal: check,
|
|
51122
|
+
logger,
|
|
51123
|
+
transport: dependencies.fetchImpl
|
|
51124
|
+
})
|
|
51125
|
+
},
|
|
51126
|
+
() => sidebarPublisher.publish()
|
|
51127
|
+
)
|
|
50629
51128
|
)
|
|
50630
51129
|
})
|
|
50631
51130
|
};
|
|
@@ -50873,10 +51372,8 @@ var createAntigravityPlugin = (providerId, options = {}) => async (input2) => {
|
|
|
50873
51372
|
apply: async (request) => {
|
|
50874
51373
|
const current = await currentMenu();
|
|
50875
51374
|
if (current.kind === "unavailable") throw new Error(current.message);
|
|
50876
|
-
const
|
|
50877
|
-
|
|
50878
|
-
menuInvocation(pushNotification, request.sessionId)
|
|
50879
|
-
);
|
|
51375
|
+
const invocation = menuInvocation(pushNotification, request.sessionId);
|
|
51376
|
+
const result = await current.menu.apply(request, invocation);
|
|
50880
51377
|
try {
|
|
50881
51378
|
if (await readAuthority2() === "local")
|
|
50882
51379
|
await lifecycle.getAccountManager()?.refreshFromRepository();
|
|
@@ -50893,6 +51390,11 @@ var createAntigravityPlugin = (providerId, options = {}) => async (input2) => {
|
|
|
50893
51390
|
request.sessionId
|
|
50894
51391
|
);
|
|
50895
51392
|
}
|
|
51393
|
+
const refreshed = await currentMenu();
|
|
51394
|
+
if (refreshed.kind === "menu" && refreshed.menu !== current.menu) {
|
|
51395
|
+
const payload = await refreshed.menu.open(invocation);
|
|
51396
|
+
return { ...result, menu: payload.menu };
|
|
51397
|
+
}
|
|
50896
51398
|
return result;
|
|
50897
51399
|
},
|
|
50898
51400
|
drain: drainNotifications
|