@google/gemini-cli 0.55.0-preview.2 → 0.55.0-preview.3
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/bundle/{chunk-57ZLFNIU.js → chunk-2K3N3YWJ.js} +1 -1
- package/bundle/{chunk-CYJHOZAD.js → chunk-2YAEBNH4.js} +1 -1
- package/bundle/{chunk-3OPKUUXP.js → chunk-3JEIIDY3.js} +1 -1
- package/bundle/{chunk-4SFKECJB.js → chunk-3KVUW3GS.js} +1 -1
- package/bundle/{chunk-2NTEXQZI.js → chunk-4MK4F3LQ.js} +2 -2
- package/bundle/{chunk-7IYUUE2H.js → chunk-4PVLKN7E.js} +1 -1
- package/bundle/{chunk-CBX65YIB.js → chunk-5C4IPSFG.js} +1 -1
- package/bundle/{chunk-L6Q242KC.js → chunk-6VBVRJ2T.js} +1 -1
- package/bundle/{chunk-KII3XXCP.js → chunk-7U5FKJMS.js} +3 -3
- package/bundle/{chunk-T36P7MFE.js → chunk-BXJWVB6T.js} +7 -7
- package/bundle/{chunk-J6DC57TM.js → chunk-CF6HJK4T.js} +1 -1
- package/bundle/{chunk-A4YWS44A.js → chunk-D7NKQXI3.js} +10 -6
- package/bundle/{chunk-DBPSBJMI.js → chunk-DIJFIQU5.js} +1 -1
- package/bundle/{chunk-O5GQF2L7.js → chunk-DW2J2NTU.js} +1 -1
- package/bundle/{chunk-PTZIAOG5.js → chunk-EBUEQDL4.js} +3 -3
- package/bundle/{chunk-4C7ON4TD.js → chunk-ENEDM4X3.js} +1 -1
- package/bundle/{chunk-LVOM4PEE.js → chunk-ETEDB3N6.js} +2 -2
- package/bundle/{chunk-J27NXCYL.js → chunk-FQNLDGXL.js} +1 -1
- package/bundle/{chunk-OC55SY62.js → chunk-GJBRSFPM.js} +7 -7
- package/bundle/{chunk-DSCF5EA6.js → chunk-IKOQM4YN.js} +3 -3
- package/bundle/{chunk-S3XRZJYO.js → chunk-MOTK2J3L.js} +1 -1
- package/bundle/{chunk-DRN2VYCZ.js → chunk-NQ7ACVH7.js} +2 -2
- package/bundle/{chunk-2ZWCUTMN.js → chunk-OKM3M2PX.js} +1 -1
- package/bundle/{chunk-QPGTVRXP.js → chunk-QJZS4YYR.js} +7 -7
- package/bundle/{chunk-MLTI5CK6.js → chunk-QY6VB26P.js} +9 -5
- package/bundle/{chunk-FH7GCVZY.js → chunk-S35HA76T.js} +2 -2
- package/bundle/{chunk-IHR5TZ6N.js → chunk-V6HSKTFR.js} +3 -3
- package/bundle/{chunk-HZZM77SO.js → chunk-VPMDE76T.js} +10 -6
- package/bundle/{chunk-R3S5PP5S.js → chunk-WWUS7UCO.js} +10 -6
- package/bundle/{chunk-XWGJPCDB.js → chunk-XLLOEYE5.js} +1 -1
- package/bundle/{chunk-SEHUSFSL.js → chunk-XNQ2USVV.js} +1 -1
- package/bundle/{chunk-UXD5COS4.js → chunk-YOSR3LGH.js} +7 -7
- package/bundle/{cleanup-PYHN72B4.js → cleanup-6PJC7KVH.js} +2 -2
- package/bundle/{cleanup-QOIB4MC5.js → cleanup-AA32XASX.js} +2 -2
- package/bundle/{cleanup-X7SPIVY6.js → cleanup-KJNT5CKE.js} +2 -2
- package/bundle/{cleanup-XHKLOUOX.js → cleanup-W4XFBOYU.js} +2 -2
- package/bundle/{core-TM4S2KC6.js → core-PJ4GTWLE.js} +1 -1
- package/bundle/{devtoolsService-QXH36QMO.js → devtoolsService-BPCHKSK6.js} +2 -2
- package/bundle/{devtoolsService-XNULR5OM.js → devtoolsService-DDIV43LO.js} +2 -2
- package/bundle/{devtoolsService-XP7RODGG.js → devtoolsService-SFT4J3TP.js} +2 -2
- package/bundle/{devtoolsService-YBK5NQJR.js → devtoolsService-X4SBEWHU.js} +2 -2
- package/bundle/{dist-DUXHKH4A.js → dist-6SIQ6JNU.js} +1 -1
- package/bundle/{dist-FCM7NH26.js → dist-UVDHLJPD.js} +1 -1
- package/bundle/{dist-LH5DRLX7.js → dist-VQ3F4FS5.js} +1 -1
- package/bundle/{gemini-HDAYOIW2.js → gemini-BMC63EGW.js} +13 -13
- package/bundle/{gemini-ORTIIX7J.js → gemini-EYTXXZKY.js} +14 -14
- package/bundle/{gemini-ZUILAPR6.js → gemini-MSC5T5EU.js} +14 -14
- package/bundle/{gemini-A7HOBIKY.js → gemini-PA23YMHK.js} +14 -14
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-KX3U7SFD.js → interactiveCli-5Y6AY63C.js} +67 -25
- package/bundle/{interactiveCli-O4YSZIKG.js → interactiveCli-G6PWBLT5.js} +67 -25
- package/bundle/{interactiveCli-H524RKEH.js → interactiveCli-OUPTNZ47.js} +67 -25
- package/bundle/{interactiveCli-YAAI2B6S.js → interactiveCli-T32DVN2I.js} +67 -25
- package/bundle/{liteRtServerManager-FTW42YZF.js → liteRtServerManager-3MCOW5QD.js} +4 -4
- package/bundle/{liteRtServerManager-NW33H3DY.js → liteRtServerManager-7IWRFNTW.js} +4 -4
- package/bundle/{liteRtServerManager-PRXJGWUQ.js → liteRtServerManager-IRFTOINI.js} +4 -4
- package/bundle/{liteRtServerManager-RP2Z5PSZ.js → liteRtServerManager-LVW27XGD.js} +4 -4
- package/bundle/{oauth2-provider-JZQDXWRM.js → oauth2-provider-BPEC44QP.js} +1 -1
- package/bundle/{oauth2-provider-UKW3UFLQ.js → oauth2-provider-FSAA6HVA.js} +1 -1
- package/bundle/{oauth2-provider-AXFTVNOH.js → oauth2-provider-IVUO6NTZ.js} +1 -1
- package/bundle/{oauth2-provider-X4GQTJLG.js → oauth2-provider-PH6ZPS7W.js} +1 -1
- package/bundle/{start-EIHA5TWI.js → start-3M54SR5N.js} +6 -6
- package/bundle/{start-ODF2OV65.js → start-EEVFRHCK.js} +6 -6
- package/bundle/{start-ONHNJJG7.js → start-FC7N6JMG.js} +6 -6
- package/bundle/{start-TSZCFX4W.js → start-N5PPVI4S.js} +6 -6
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
startCommand,
|
|
4
4
|
startServer
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IKOQM4YN.js";
|
|
6
6
|
import {
|
|
7
7
|
BuiltinCommandLoader,
|
|
8
8
|
CommandService,
|
|
@@ -45,11 +45,11 @@ import {
|
|
|
45
45
|
updateAllUpdatableExtensions,
|
|
46
46
|
updateExtension,
|
|
47
47
|
validateAuthMethod
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-GJBRSFPM.js";
|
|
49
49
|
import {
|
|
50
50
|
exitCli,
|
|
51
51
|
require_source
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-CF6HJK4T.js";
|
|
53
53
|
import {
|
|
54
54
|
appEvents
|
|
55
55
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -87,11 +87,11 @@ import {
|
|
|
87
87
|
resolveGemmaConfig,
|
|
88
88
|
saveModelChange,
|
|
89
89
|
stripAnsi
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-DW2J2NTU.js";
|
|
91
91
|
import {
|
|
92
92
|
RELAUNCH_EXIT_CODE
|
|
93
|
-
} from "./chunk-
|
|
94
|
-
import "./chunk-
|
|
93
|
+
} from "./chunk-ETEDB3N6.js";
|
|
94
|
+
import "./chunk-DIJFIQU5.js";
|
|
95
95
|
import {
|
|
96
96
|
cleanupCheckpoints,
|
|
97
97
|
registerCleanup,
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
runExitCleanup,
|
|
101
101
|
runSyncCleanup,
|
|
102
102
|
setupSignalHandlers
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-FQNLDGXL.js";
|
|
104
104
|
import {
|
|
105
105
|
ASK_USER_TOOL_NAME,
|
|
106
106
|
ApprovalMode,
|
|
@@ -253,7 +253,7 @@ import {
|
|
|
253
253
|
updatePolicy,
|
|
254
254
|
writeToStderr,
|
|
255
255
|
writeToStdout
|
|
256
|
-
} from "./chunk-
|
|
256
|
+
} from "./chunk-WWUS7UCO.js";
|
|
257
257
|
import "./chunk-664ZODQF.js";
|
|
258
258
|
import "./chunk-IUUIT4SU.js";
|
|
259
259
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -7847,7 +7847,7 @@ async function loadSandboxConfig(settings, argv) {
|
|
|
7847
7847
|
}
|
|
7848
7848
|
const command2 = getSandboxCommand(sandboxValue);
|
|
7849
7849
|
const packageJson = await getPackageJson(__dirname3);
|
|
7850
|
-
const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.55.0-preview.
|
|
7850
|
+
const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.55.0-preview.3" ?? customImage ?? packageJson?.config?.sandboxImageUri;
|
|
7851
7851
|
const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
|
|
7852
7852
|
return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
|
|
7853
7853
|
}
|
|
@@ -10852,7 +10852,7 @@ async function runNonInteractive({
|
|
|
10852
10852
|
}
|
|
10853
10853
|
});
|
|
10854
10854
|
if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
|
|
10855
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
10855
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-BPCHKSK6.js");
|
|
10856
10856
|
setupInitialActivityLogger(config);
|
|
10857
10857
|
}
|
|
10858
10858
|
const { stdout: workingStdout } = createWorkingStdio();
|
|
@@ -11362,7 +11362,7 @@ async function runNonInteractive2(params) {
|
|
|
11362
11362
|
}
|
|
11363
11363
|
});
|
|
11364
11364
|
if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
|
|
11365
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
11365
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-BPCHKSK6.js");
|
|
11366
11366
|
setupInitialActivityLogger(config);
|
|
11367
11367
|
}
|
|
11368
11368
|
const { stdout: workingStdout } = createWorkingStdio();
|
|
@@ -16572,7 +16572,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
|
|
|
16572
16572
|
}
|
|
16573
16573
|
}
|
|
16574
16574
|
async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
|
|
16575
|
-
const { startInteractiveUI: doStartUI } = await import("./interactiveCli-
|
|
16575
|
+
const { startInteractiveUI: doStartUI } = await import("./interactiveCli-5Y6AY63C.js");
|
|
16576
16576
|
await doStartUI(
|
|
16577
16577
|
config,
|
|
16578
16578
|
settings,
|
|
@@ -16781,7 +16781,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
16781
16781
|
await config.storage.initialize();
|
|
16782
16782
|
adminControlsListner.setConfig(config);
|
|
16783
16783
|
if (config.isInteractive() && settings.merged.general.devtools) {
|
|
16784
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
16784
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-BPCHKSK6.js");
|
|
16785
16785
|
setupInitialActivityLogger(config);
|
|
16786
16786
|
}
|
|
16787
16787
|
registerTelemetryConfig(config);
|
|
@@ -16840,7 +16840,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
16840
16840
|
const initAppHandle = startupProfiler.start("initialize_app");
|
|
16841
16841
|
const initializationResult = await initializeApp(config, settings);
|
|
16842
16842
|
initAppHandle?.end();
|
|
16843
|
-
import("./liteRtServerManager-
|
|
16843
|
+
import("./liteRtServerManager-7IWRFNTW.js").then(({ LiteRtServerManager }) => {
|
|
16844
16844
|
const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
|
|
16845
16845
|
if (!mergedGemma) return;
|
|
16846
16846
|
const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
|
package/bundle/gemini.js
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
RELAUNCH_EXIT_CODE,
|
|
5
5
|
getScriptArgs,
|
|
6
6
|
getSpawnConfig
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-ETEDB3N6.js";
|
|
8
|
+
import "./chunk-DIJFIQU5.js";
|
|
9
|
+
import "./chunk-FQNLDGXL.js";
|
|
10
|
+
import "./chunk-WWUS7UCO.js";
|
|
11
11
|
import "./chunk-664ZODQF.js";
|
|
12
12
|
import "./chunk-IUUIT4SU.js";
|
|
13
13
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -115,9 +115,9 @@ ${error instanceof Error ? error.stack ?? error.message : String(error)}
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
} else {
|
|
118
|
-
const { main } = await import("./gemini-
|
|
119
|
-
const { FatalError, writeToStderr } = await import("./dist-
|
|
120
|
-
const { runExitCleanup } = await import("./cleanup-
|
|
118
|
+
const { main } = await import("./gemini-PA23YMHK.js");
|
|
119
|
+
const { FatalError, writeToStderr } = await import("./dist-VQ3F4FS5.js");
|
|
120
|
+
const { runExitCleanup } = await import("./cleanup-AA32XASX.js");
|
|
121
121
|
main().catch(async (error) => {
|
|
122
122
|
const cleanupTimeout = setTimeout(() => {
|
|
123
123
|
writeToStderr("Cleanup timed out, forcing exit...\n");
|
|
@@ -157,10 +157,10 @@ import {
|
|
|
157
157
|
widestLineFromStyledChars,
|
|
158
158
|
wordBreakStyledChars,
|
|
159
159
|
wrapStyledChars
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-GJBRSFPM.js";
|
|
161
161
|
import {
|
|
162
162
|
require_source
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-CF6HJK4T.js";
|
|
164
164
|
import {
|
|
165
165
|
appEvents
|
|
166
166
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -214,24 +214,24 @@ import {
|
|
|
214
214
|
stripAnsi,
|
|
215
215
|
stripUnsafeCharacters,
|
|
216
216
|
toCodePoints
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-DW2J2NTU.js";
|
|
218
218
|
import {
|
|
219
219
|
handleAutoUpdate,
|
|
220
220
|
isDevelopment,
|
|
221
221
|
relaunchApp,
|
|
222
222
|
setUpdateHandler
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-ETEDB3N6.js";
|
|
224
224
|
import {
|
|
225
225
|
isTodoList,
|
|
226
226
|
mapCoreStatusToDisplayStatus,
|
|
227
227
|
require_react
|
|
228
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-DIJFIQU5.js";
|
|
229
229
|
import {
|
|
230
230
|
registerCleanup,
|
|
231
231
|
removeCleanup,
|
|
232
232
|
runExitCleanup,
|
|
233
233
|
setupTtyCheck
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-FQNLDGXL.js";
|
|
235
235
|
import {
|
|
236
236
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
237
237
|
AGENT_TOOL_NAME,
|
|
@@ -437,7 +437,7 @@ import {
|
|
|
437
437
|
validatePlanContent,
|
|
438
438
|
validatePlanPath,
|
|
439
439
|
writeToStdout
|
|
440
|
-
} from "./chunk-
|
|
440
|
+
} from "./chunk-WWUS7UCO.js";
|
|
441
441
|
import "./chunk-664ZODQF.js";
|
|
442
442
|
import "./chunk-IUUIT4SU.js";
|
|
443
443
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -15538,6 +15538,7 @@ function ProQuotaDialog({
|
|
|
15538
15538
|
message,
|
|
15539
15539
|
isTerminalQuotaError,
|
|
15540
15540
|
isModelNotFoundError,
|
|
15541
|
+
isCapacityExceeded,
|
|
15541
15542
|
authType,
|
|
15542
15543
|
tierName,
|
|
15543
15544
|
onChoice
|
|
@@ -15556,6 +15557,24 @@ function ProQuotaDialog({
|
|
|
15556
15557
|
key: "retry_later"
|
|
15557
15558
|
}
|
|
15558
15559
|
];
|
|
15560
|
+
} else if (isCapacityExceeded) {
|
|
15561
|
+
items = [
|
|
15562
|
+
{
|
|
15563
|
+
label: "Keep trying",
|
|
15564
|
+
value: "retry_once",
|
|
15565
|
+
key: "retry_once"
|
|
15566
|
+
},
|
|
15567
|
+
{
|
|
15568
|
+
label: `Switch to ${fallbackModel}`,
|
|
15569
|
+
value: "retry_always",
|
|
15570
|
+
key: "retry_always"
|
|
15571
|
+
},
|
|
15572
|
+
{
|
|
15573
|
+
label: "Stop",
|
|
15574
|
+
value: "retry_later",
|
|
15575
|
+
key: "retry_later"
|
|
15576
|
+
}
|
|
15577
|
+
];
|
|
15559
15578
|
} else if (isModelNotFoundError || isTerminalQuotaError) {
|
|
15560
15579
|
const isUltra = isUltraTier(tierName);
|
|
15561
15580
|
items = [
|
|
@@ -17694,6 +17713,7 @@ var DialogManager = ({
|
|
|
17694
17713
|
message: quotaState.proQuotaRequest.message,
|
|
17695
17714
|
isTerminalQuotaError: quotaState.proQuotaRequest.isTerminalQuotaError,
|
|
17696
17715
|
isModelNotFoundError: !!quotaState.proQuotaRequest.isModelNotFoundError,
|
|
17716
|
+
isCapacityExceeded: !!quotaState.proQuotaRequest.isCapacityExceeded,
|
|
17697
17717
|
authType: quotaState.proQuotaRequest.authType,
|
|
17698
17718
|
tierName: config?.getUserTierName(),
|
|
17699
17719
|
onChoice: uiActions.handleProQuotaChoice
|
|
@@ -25417,6 +25437,7 @@ async function openG1Url(path14, campaign) {
|
|
|
25417
25437
|
}
|
|
25418
25438
|
|
|
25419
25439
|
// packages/cli/src/ui/hooks/useQuotaAndFallback.ts
|
|
25440
|
+
var isObject = (val) => typeof val === "object" && val !== null;
|
|
25420
25441
|
function useQuotaAndFallback({
|
|
25421
25442
|
config,
|
|
25422
25443
|
historyManager,
|
|
@@ -25439,6 +25460,16 @@ function useQuotaAndFallback({
|
|
|
25439
25460
|
let message;
|
|
25440
25461
|
let isTerminalQuotaError = false;
|
|
25441
25462
|
let isModelNotFoundError = false;
|
|
25463
|
+
const errorObj = isObject(error) ? error : null;
|
|
25464
|
+
const errorReasonValue = errorObj?.["reason"];
|
|
25465
|
+
const errorReason = typeof errorReasonValue === "string" ? errorReasonValue : void 0;
|
|
25466
|
+
const errorMessageValue = errorObj?.["message"];
|
|
25467
|
+
const errorMessage = typeof errorMessageValue === "string" ? errorMessageValue : void 0;
|
|
25468
|
+
const isCapacityExceeded = errorReason === "MODEL_CAPACITY_EXHAUSTED" || errorReason === "MODEL_CAPACITY_EXCEEDED" || typeof errorMessage === "string" && /exhausted your capacity|capacity exceeded|MODEL_CAPACITY_EXHAUSTED/i.test(
|
|
25469
|
+
errorMessage
|
|
25470
|
+
) || typeof error === "string" && /exhausted your capacity|capacity exceeded|MODEL_CAPACITY_EXHAUSTED/i.test(
|
|
25471
|
+
error
|
|
25472
|
+
);
|
|
25442
25473
|
const usageLimitReachedModel = isProModel(failedModel) ? "all Pro models" : failedModel;
|
|
25443
25474
|
if (error instanceof TerminalQuotaError) {
|
|
25444
25475
|
isTerminalQuotaError = true;
|
|
@@ -25462,14 +25493,24 @@ function useQuotaAndFallback({
|
|
|
25462
25493
|
});
|
|
25463
25494
|
if (creditsResult) return creditsResult;
|
|
25464
25495
|
}
|
|
25465
|
-
|
|
25466
|
-
|
|
25467
|
-
|
|
25468
|
-
|
|
25469
|
-
|
|
25470
|
-
|
|
25471
|
-
|
|
25472
|
-
|
|
25496
|
+
if (isCapacityExceeded) {
|
|
25497
|
+
const messageLines = [
|
|
25498
|
+
`We are currently experiencing high demand for ${usageLimitReachedModel}.`,
|
|
25499
|
+
"We apologize and appreciate your patience.",
|
|
25500
|
+
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25501
|
+
`/model to switch models.`
|
|
25502
|
+
].filter(Boolean);
|
|
25503
|
+
message = messageLines.join("\n");
|
|
25504
|
+
} else {
|
|
25505
|
+
const messageLines = [
|
|
25506
|
+
`Usage limit reached for ${usageLimitReachedModel}.`,
|
|
25507
|
+
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25508
|
+
`/stats model for usage details`,
|
|
25509
|
+
`/model to switch models.`,
|
|
25510
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25511
|
+
].filter(Boolean);
|
|
25512
|
+
message = messageLines.join("\n");
|
|
25513
|
+
}
|
|
25473
25514
|
} else if (error instanceof ModelNotFoundError) {
|
|
25474
25515
|
isModelNotFoundError = true;
|
|
25475
25516
|
if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
|
|
@@ -25502,7 +25543,7 @@ function useQuotaAndFallback({
|
|
|
25502
25543
|
];
|
|
25503
25544
|
message = messageLines.join("\n");
|
|
25504
25545
|
}
|
|
25505
|
-
if (errorVerbosity === "low" && !isTerminalQuotaError && !isModelNotFoundError) {
|
|
25546
|
+
if (errorVerbosity === "low" && (!isTerminalQuotaError || isCapacityExceeded) && !isModelNotFoundError) {
|
|
25506
25547
|
return "retry_once";
|
|
25507
25548
|
}
|
|
25508
25549
|
setModelSwitchedFromQuotaError(true);
|
|
@@ -25520,6 +25561,7 @@ function useQuotaAndFallback({
|
|
|
25520
25561
|
message,
|
|
25521
25562
|
isTerminalQuotaError,
|
|
25522
25563
|
isModelNotFoundError,
|
|
25564
|
+
isCapacityExceeded,
|
|
25523
25565
|
authType: contentGeneratorConfig?.authType
|
|
25524
25566
|
});
|
|
25525
25567
|
}
|
|
@@ -30675,12 +30717,12 @@ var streamRequest = (request, onUploadProgress, originalBody) => {
|
|
|
30675
30717
|
};
|
|
30676
30718
|
|
|
30677
30719
|
// node_modules/ky/distribution/utils/is.js
|
|
30678
|
-
var
|
|
30720
|
+
var isObject2 = (value) => value !== null && typeof value === "object";
|
|
30679
30721
|
|
|
30680
30722
|
// node_modules/ky/distribution/utils/merge.js
|
|
30681
30723
|
var validateAndMerge = (...sources) => {
|
|
30682
30724
|
for (const source of sources) {
|
|
30683
|
-
if ((!
|
|
30725
|
+
if ((!isObject2(source) || Array.isArray(source)) && source !== void 0) {
|
|
30684
30726
|
throw new TypeError("The `options` argument must be an object");
|
|
30685
30727
|
}
|
|
30686
30728
|
}
|
|
@@ -30725,7 +30767,7 @@ var appendSearchParameters = (target, source) => {
|
|
|
30725
30767
|
}
|
|
30726
30768
|
result.append(String(pair[0]), String(pair[1]));
|
|
30727
30769
|
}
|
|
30728
|
-
} else if (
|
|
30770
|
+
} else if (isObject2(input)) {
|
|
30729
30771
|
for (const [key, value] of Object.entries(input)) {
|
|
30730
30772
|
if (value !== void 0) {
|
|
30731
30773
|
result.append(key, String(value));
|
|
@@ -30752,14 +30794,14 @@ var deepMerge = (...sources) => {
|
|
|
30752
30794
|
returnValue = [];
|
|
30753
30795
|
}
|
|
30754
30796
|
returnValue = [...returnValue, ...source];
|
|
30755
|
-
} else if (
|
|
30797
|
+
} else if (isObject2(source)) {
|
|
30756
30798
|
for (let [key, value] of Object.entries(source)) {
|
|
30757
30799
|
if (key === "signal" && value instanceof globalThis.AbortSignal) {
|
|
30758
30800
|
signals.push(value);
|
|
30759
30801
|
continue;
|
|
30760
30802
|
}
|
|
30761
30803
|
if (key === "context") {
|
|
30762
|
-
if (value !== void 0 && value !== null && (!
|
|
30804
|
+
if (value !== void 0 && value !== null && (!isObject2(value) || Array.isArray(value))) {
|
|
30763
30805
|
throw new TypeError("The `context` option must be an object");
|
|
30764
30806
|
}
|
|
30765
30807
|
returnValue = {
|
|
@@ -30776,16 +30818,16 @@ var deepMerge = (...sources) => {
|
|
|
30776
30818
|
}
|
|
30777
30819
|
continue;
|
|
30778
30820
|
}
|
|
30779
|
-
if (
|
|
30821
|
+
if (isObject2(value) && key in returnValue) {
|
|
30780
30822
|
value = deepMerge(returnValue[key], value);
|
|
30781
30823
|
}
|
|
30782
30824
|
returnValue = { ...returnValue, [key]: value };
|
|
30783
30825
|
}
|
|
30784
|
-
if (
|
|
30826
|
+
if (isObject2(source.hooks)) {
|
|
30785
30827
|
hooks = mergeHooks(hooks, source.hooks);
|
|
30786
30828
|
returnValue.hooks = hooks;
|
|
30787
30829
|
}
|
|
30788
|
-
if (
|
|
30830
|
+
if (isObject2(source.headers)) {
|
|
30789
30831
|
headers = mergeHeaders(headers, source.headers);
|
|
30790
30832
|
returnValue.headers = headers;
|
|
30791
30833
|
}
|
|
@@ -33893,7 +33935,7 @@ ${queuedText}` : queuedText;
|
|
|
33893
33935
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33894
33936
|
if (settings.merged.general.devtools) {
|
|
33895
33937
|
void (async () => {
|
|
33896
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33938
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-BPCHKSK6.js");
|
|
33897
33939
|
await toggleDevToolsPanel(
|
|
33898
33940
|
config,
|
|
33899
33941
|
showErrorDetails,
|
|
@@ -157,10 +157,10 @@ import {
|
|
|
157
157
|
widestLineFromStyledChars,
|
|
158
158
|
wordBreakStyledChars,
|
|
159
159
|
wrapStyledChars
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-QJZS4YYR.js";
|
|
161
161
|
import {
|
|
162
162
|
require_source
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-2YAEBNH4.js";
|
|
164
164
|
import {
|
|
165
165
|
appEvents
|
|
166
166
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -214,24 +214,24 @@ import {
|
|
|
214
214
|
stripAnsi,
|
|
215
215
|
stripUnsafeCharacters,
|
|
216
216
|
toCodePoints
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-XNQ2USVV.js";
|
|
218
218
|
import {
|
|
219
219
|
handleAutoUpdate,
|
|
220
220
|
isDevelopment,
|
|
221
221
|
relaunchApp,
|
|
222
222
|
setUpdateHandler
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-4MK4F3LQ.js";
|
|
224
224
|
import {
|
|
225
225
|
isTodoList,
|
|
226
226
|
mapCoreStatusToDisplayStatus,
|
|
227
227
|
require_react
|
|
228
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-ENEDM4X3.js";
|
|
229
229
|
import {
|
|
230
230
|
registerCleanup,
|
|
231
231
|
removeCleanup,
|
|
232
232
|
runExitCleanup,
|
|
233
233
|
setupTtyCheck
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-MOTK2J3L.js";
|
|
235
235
|
import {
|
|
236
236
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
237
237
|
AGENT_TOOL_NAME,
|
|
@@ -437,7 +437,7 @@ import {
|
|
|
437
437
|
validatePlanContent,
|
|
438
438
|
validatePlanPath,
|
|
439
439
|
writeToStdout
|
|
440
|
-
} from "./chunk-
|
|
440
|
+
} from "./chunk-D7NKQXI3.js";
|
|
441
441
|
import "./chunk-664ZODQF.js";
|
|
442
442
|
import "./chunk-IUUIT4SU.js";
|
|
443
443
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -15538,6 +15538,7 @@ function ProQuotaDialog({
|
|
|
15538
15538
|
message,
|
|
15539
15539
|
isTerminalQuotaError,
|
|
15540
15540
|
isModelNotFoundError,
|
|
15541
|
+
isCapacityExceeded,
|
|
15541
15542
|
authType,
|
|
15542
15543
|
tierName,
|
|
15543
15544
|
onChoice
|
|
@@ -15556,6 +15557,24 @@ function ProQuotaDialog({
|
|
|
15556
15557
|
key: "retry_later"
|
|
15557
15558
|
}
|
|
15558
15559
|
];
|
|
15560
|
+
} else if (isCapacityExceeded) {
|
|
15561
|
+
items = [
|
|
15562
|
+
{
|
|
15563
|
+
label: "Keep trying",
|
|
15564
|
+
value: "retry_once",
|
|
15565
|
+
key: "retry_once"
|
|
15566
|
+
},
|
|
15567
|
+
{
|
|
15568
|
+
label: `Switch to ${fallbackModel}`,
|
|
15569
|
+
value: "retry_always",
|
|
15570
|
+
key: "retry_always"
|
|
15571
|
+
},
|
|
15572
|
+
{
|
|
15573
|
+
label: "Stop",
|
|
15574
|
+
value: "retry_later",
|
|
15575
|
+
key: "retry_later"
|
|
15576
|
+
}
|
|
15577
|
+
];
|
|
15559
15578
|
} else if (isModelNotFoundError || isTerminalQuotaError) {
|
|
15560
15579
|
const isUltra = isUltraTier(tierName);
|
|
15561
15580
|
items = [
|
|
@@ -17694,6 +17713,7 @@ var DialogManager = ({
|
|
|
17694
17713
|
message: quotaState.proQuotaRequest.message,
|
|
17695
17714
|
isTerminalQuotaError: quotaState.proQuotaRequest.isTerminalQuotaError,
|
|
17696
17715
|
isModelNotFoundError: !!quotaState.proQuotaRequest.isModelNotFoundError,
|
|
17716
|
+
isCapacityExceeded: !!quotaState.proQuotaRequest.isCapacityExceeded,
|
|
17697
17717
|
authType: quotaState.proQuotaRequest.authType,
|
|
17698
17718
|
tierName: config?.getUserTierName(),
|
|
17699
17719
|
onChoice: uiActions.handleProQuotaChoice
|
|
@@ -25417,6 +25437,7 @@ async function openG1Url(path14, campaign) {
|
|
|
25417
25437
|
}
|
|
25418
25438
|
|
|
25419
25439
|
// packages/cli/src/ui/hooks/useQuotaAndFallback.ts
|
|
25440
|
+
var isObject = (val) => typeof val === "object" && val !== null;
|
|
25420
25441
|
function useQuotaAndFallback({
|
|
25421
25442
|
config,
|
|
25422
25443
|
historyManager,
|
|
@@ -25439,6 +25460,16 @@ function useQuotaAndFallback({
|
|
|
25439
25460
|
let message;
|
|
25440
25461
|
let isTerminalQuotaError = false;
|
|
25441
25462
|
let isModelNotFoundError = false;
|
|
25463
|
+
const errorObj = isObject(error) ? error : null;
|
|
25464
|
+
const errorReasonValue = errorObj?.["reason"];
|
|
25465
|
+
const errorReason = typeof errorReasonValue === "string" ? errorReasonValue : void 0;
|
|
25466
|
+
const errorMessageValue = errorObj?.["message"];
|
|
25467
|
+
const errorMessage = typeof errorMessageValue === "string" ? errorMessageValue : void 0;
|
|
25468
|
+
const isCapacityExceeded = errorReason === "MODEL_CAPACITY_EXHAUSTED" || errorReason === "MODEL_CAPACITY_EXCEEDED" || typeof errorMessage === "string" && /exhausted your capacity|capacity exceeded|MODEL_CAPACITY_EXHAUSTED/i.test(
|
|
25469
|
+
errorMessage
|
|
25470
|
+
) || typeof error === "string" && /exhausted your capacity|capacity exceeded|MODEL_CAPACITY_EXHAUSTED/i.test(
|
|
25471
|
+
error
|
|
25472
|
+
);
|
|
25442
25473
|
const usageLimitReachedModel = isProModel(failedModel) ? "all Pro models" : failedModel;
|
|
25443
25474
|
if (error instanceof TerminalQuotaError) {
|
|
25444
25475
|
isTerminalQuotaError = true;
|
|
@@ -25462,14 +25493,24 @@ function useQuotaAndFallback({
|
|
|
25462
25493
|
});
|
|
25463
25494
|
if (creditsResult) return creditsResult;
|
|
25464
25495
|
}
|
|
25465
|
-
|
|
25466
|
-
|
|
25467
|
-
|
|
25468
|
-
|
|
25469
|
-
|
|
25470
|
-
|
|
25471
|
-
|
|
25472
|
-
|
|
25496
|
+
if (isCapacityExceeded) {
|
|
25497
|
+
const messageLines = [
|
|
25498
|
+
`We are currently experiencing high demand for ${usageLimitReachedModel}.`,
|
|
25499
|
+
"We apologize and appreciate your patience.",
|
|
25500
|
+
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25501
|
+
`/model to switch models.`
|
|
25502
|
+
].filter(Boolean);
|
|
25503
|
+
message = messageLines.join("\n");
|
|
25504
|
+
} else {
|
|
25505
|
+
const messageLines = [
|
|
25506
|
+
`Usage limit reached for ${usageLimitReachedModel}.`,
|
|
25507
|
+
error.retryDelayMs ? `Access resets at ${getResetTimeMessage(error.retryDelayMs)}.` : null,
|
|
25508
|
+
`/stats model for usage details`,
|
|
25509
|
+
`/model to switch models.`,
|
|
25510
|
+
contentGeneratorConfig?.authType === AuthType.LOGIN_WITH_GOOGLE ? `/auth to switch to API key.` : null
|
|
25511
|
+
].filter(Boolean);
|
|
25512
|
+
message = messageLines.join("\n");
|
|
25513
|
+
}
|
|
25473
25514
|
} else if (error instanceof ModelNotFoundError) {
|
|
25474
25515
|
isModelNotFoundError = true;
|
|
25475
25516
|
if (contentGeneratorConfig?.authType === AuthType.USE_VERTEX_AI && VALID_GEMINI_MODELS.has(failedModel)) {
|
|
@@ -25502,7 +25543,7 @@ function useQuotaAndFallback({
|
|
|
25502
25543
|
];
|
|
25503
25544
|
message = messageLines.join("\n");
|
|
25504
25545
|
}
|
|
25505
|
-
if (errorVerbosity === "low" && !isTerminalQuotaError && !isModelNotFoundError) {
|
|
25546
|
+
if (errorVerbosity === "low" && (!isTerminalQuotaError || isCapacityExceeded) && !isModelNotFoundError) {
|
|
25506
25547
|
return "retry_once";
|
|
25507
25548
|
}
|
|
25508
25549
|
setModelSwitchedFromQuotaError(true);
|
|
@@ -25520,6 +25561,7 @@ function useQuotaAndFallback({
|
|
|
25520
25561
|
message,
|
|
25521
25562
|
isTerminalQuotaError,
|
|
25522
25563
|
isModelNotFoundError,
|
|
25564
|
+
isCapacityExceeded,
|
|
25523
25565
|
authType: contentGeneratorConfig?.authType
|
|
25524
25566
|
});
|
|
25525
25567
|
}
|
|
@@ -30675,12 +30717,12 @@ var streamRequest = (request, onUploadProgress, originalBody) => {
|
|
|
30675
30717
|
};
|
|
30676
30718
|
|
|
30677
30719
|
// node_modules/ky/distribution/utils/is.js
|
|
30678
|
-
var
|
|
30720
|
+
var isObject2 = (value) => value !== null && typeof value === "object";
|
|
30679
30721
|
|
|
30680
30722
|
// node_modules/ky/distribution/utils/merge.js
|
|
30681
30723
|
var validateAndMerge = (...sources) => {
|
|
30682
30724
|
for (const source of sources) {
|
|
30683
|
-
if ((!
|
|
30725
|
+
if ((!isObject2(source) || Array.isArray(source)) && source !== void 0) {
|
|
30684
30726
|
throw new TypeError("The `options` argument must be an object");
|
|
30685
30727
|
}
|
|
30686
30728
|
}
|
|
@@ -30725,7 +30767,7 @@ var appendSearchParameters = (target, source) => {
|
|
|
30725
30767
|
}
|
|
30726
30768
|
result.append(String(pair[0]), String(pair[1]));
|
|
30727
30769
|
}
|
|
30728
|
-
} else if (
|
|
30770
|
+
} else if (isObject2(input)) {
|
|
30729
30771
|
for (const [key, value] of Object.entries(input)) {
|
|
30730
30772
|
if (value !== void 0) {
|
|
30731
30773
|
result.append(key, String(value));
|
|
@@ -30752,14 +30794,14 @@ var deepMerge = (...sources) => {
|
|
|
30752
30794
|
returnValue = [];
|
|
30753
30795
|
}
|
|
30754
30796
|
returnValue = [...returnValue, ...source];
|
|
30755
|
-
} else if (
|
|
30797
|
+
} else if (isObject2(source)) {
|
|
30756
30798
|
for (let [key, value] of Object.entries(source)) {
|
|
30757
30799
|
if (key === "signal" && value instanceof globalThis.AbortSignal) {
|
|
30758
30800
|
signals.push(value);
|
|
30759
30801
|
continue;
|
|
30760
30802
|
}
|
|
30761
30803
|
if (key === "context") {
|
|
30762
|
-
if (value !== void 0 && value !== null && (!
|
|
30804
|
+
if (value !== void 0 && value !== null && (!isObject2(value) || Array.isArray(value))) {
|
|
30763
30805
|
throw new TypeError("The `context` option must be an object");
|
|
30764
30806
|
}
|
|
30765
30807
|
returnValue = {
|
|
@@ -30776,16 +30818,16 @@ var deepMerge = (...sources) => {
|
|
|
30776
30818
|
}
|
|
30777
30819
|
continue;
|
|
30778
30820
|
}
|
|
30779
|
-
if (
|
|
30821
|
+
if (isObject2(value) && key in returnValue) {
|
|
30780
30822
|
value = deepMerge(returnValue[key], value);
|
|
30781
30823
|
}
|
|
30782
30824
|
returnValue = { ...returnValue, [key]: value };
|
|
30783
30825
|
}
|
|
30784
|
-
if (
|
|
30826
|
+
if (isObject2(source.hooks)) {
|
|
30785
30827
|
hooks = mergeHooks(hooks, source.hooks);
|
|
30786
30828
|
returnValue.hooks = hooks;
|
|
30787
30829
|
}
|
|
30788
|
-
if (
|
|
30830
|
+
if (isObject2(source.headers)) {
|
|
30789
30831
|
headers = mergeHeaders(headers, source.headers);
|
|
30790
30832
|
returnValue.headers = headers;
|
|
30791
30833
|
}
|
|
@@ -33893,7 +33935,7 @@ ${queuedText}` : queuedText;
|
|
|
33893
33935
|
if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
|
|
33894
33936
|
if (settings.merged.general.devtools) {
|
|
33895
33937
|
void (async () => {
|
|
33896
|
-
const { toggleDevToolsPanel } = await import("./devtoolsService-
|
|
33938
|
+
const { toggleDevToolsPanel } = await import("./devtoolsService-X4SBEWHU.js");
|
|
33897
33939
|
await toggleDevToolsPanel(
|
|
33898
33940
|
config,
|
|
33899
33941
|
showErrorDetails,
|