@google/gemini-cli-a2a-server 0.45.0-preview.0 → 0.46.0-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a2a-server.mjs +151 -54
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -130327,25 +130327,30 @@ var init_types8 = __esm({
|
|
|
130327
130327
|
});
|
|
130328
130328
|
|
|
130329
130329
|
// packages/core/dist/src/config/models.js
|
|
130330
|
+
function setFlashModels(preview, defaultFlash) {
|
|
130331
|
+
PREVIEW_GEMINI_FLASH_MODEL = preview;
|
|
130332
|
+
DEFAULT_GEMINI_FLASH_MODEL = defaultFlash;
|
|
130333
|
+
}
|
|
130330
130334
|
function getAutoModelDescription(hasAccessToPreview, useGemini3_1 = false) {
|
|
130331
130335
|
const proModel = hasAccessToPreview ? useGemini3_1 ? PREVIEW_GEMINI_3_1_MODEL : PREVIEW_GEMINI_MODEL : DEFAULT_GEMINI_MODEL;
|
|
130332
130336
|
const flashModel = hasAccessToPreview ? PREVIEW_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
130333
130337
|
return `Let Gemini CLI decide the best model for the task: ${proModel}, ${flashModel}`;
|
|
130334
130338
|
}
|
|
130335
|
-
function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config3) {
|
|
130339
|
+
function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config3, useGemini3_5Flash = false) {
|
|
130336
130340
|
const normalizedModel = Array.isArray(requestedModel) ? String(requestedModel.at(-1) ?? "").trim() || "" : typeof requestedModel !== "string" ? String(requestedModel ?? "").trim() || "" : requestedModel.trim() || "";
|
|
130337
130341
|
if (config3?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
130338
130342
|
const resolved2 = config3.modelConfigService.resolveModelId(normalizedModel, {
|
|
130339
130343
|
useGemini3_1,
|
|
130340
130344
|
useCustomTools: useCustomToolModel,
|
|
130341
|
-
hasAccessToPreview
|
|
130345
|
+
hasAccessToPreview,
|
|
130346
|
+
useGemini3_5Flash
|
|
130342
130347
|
});
|
|
130343
130348
|
if (!hasAccessToPreview && isPreviewModel(resolved2, config3)) {
|
|
130344
130349
|
if (resolved2.includes("flash-lite")) {
|
|
130345
130350
|
return DEFAULT_GEMINI_FLASH_LITE_MODEL;
|
|
130346
130351
|
}
|
|
130347
130352
|
if (resolved2.includes("flash")) {
|
|
130348
|
-
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
130353
|
+
return useGemini3_5Flash ? DEFAULT_GEMINI_3_5_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
130349
130354
|
}
|
|
130350
130355
|
return DEFAULT_GEMINI_MODEL;
|
|
130351
130356
|
}
|
|
@@ -130374,7 +130379,7 @@ function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel =
|
|
|
130374
130379
|
break;
|
|
130375
130380
|
}
|
|
130376
130381
|
case GEMINI_MODEL_ALIAS_FLASH: {
|
|
130377
|
-
resolved = PREVIEW_GEMINI_FLASH_MODEL;
|
|
130382
|
+
resolved = useGemini3_5Flash ? DEFAULT_GEMINI_3_5_FLASH_MODEL : PREVIEW_GEMINI_FLASH_MODEL;
|
|
130378
130383
|
break;
|
|
130379
130384
|
}
|
|
130380
130385
|
case GEMINI_MODEL_ALIAS_FLASH_LITE: {
|
|
@@ -130389,10 +130394,13 @@ function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel =
|
|
|
130389
130394
|
if (resolved === "none") {
|
|
130390
130395
|
return DEFAULT_GEMINI_FLASH_LITE_MODEL;
|
|
130391
130396
|
}
|
|
130397
|
+
if (useGemini3_5Flash && isFlashModel(resolved)) {
|
|
130398
|
+
return DEFAULT_GEMINI_3_5_FLASH_MODEL;
|
|
130399
|
+
}
|
|
130392
130400
|
if (!hasAccessToPreview && isPreviewModel(resolved)) {
|
|
130393
130401
|
switch (resolved) {
|
|
130394
130402
|
case PREVIEW_GEMINI_FLASH_MODEL:
|
|
130395
|
-
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
130403
|
+
return useGemini3_5Flash ? DEFAULT_GEMINI_3_5_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
130396
130404
|
case PREVIEW_GEMINI_MODEL:
|
|
130397
130405
|
case PREVIEW_GEMINI_3_1_MODEL:
|
|
130398
130406
|
case PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL:
|
|
@@ -130402,31 +130410,38 @@ function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel =
|
|
|
130402
130410
|
return DEFAULT_GEMINI_FLASH_LITE_MODEL;
|
|
130403
130411
|
}
|
|
130404
130412
|
if (resolved.includes("flash")) {
|
|
130405
|
-
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
130413
|
+
return useGemini3_5Flash ? DEFAULT_GEMINI_3_5_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
130406
130414
|
}
|
|
130407
130415
|
return DEFAULT_GEMINI_MODEL;
|
|
130408
130416
|
}
|
|
130409
130417
|
}
|
|
130410
130418
|
return resolved;
|
|
130411
130419
|
}
|
|
130412
|
-
function
|
|
130420
|
+
function isFlashModel(model) {
|
|
130421
|
+
return model === DEFAULT_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === DEFAULT_GEMINI_3_5_FLASH_MODEL || model === "flash" || model.endsWith("flash");
|
|
130422
|
+
}
|
|
130423
|
+
function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config3, useGemini3_5Flash = false) {
|
|
130413
130424
|
if (config3?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
130414
130425
|
return config3.modelConfigService.resolveClassifierModelId(modelAlias, requestedModel, {
|
|
130415
130426
|
useGemini3_1,
|
|
130416
130427
|
useCustomTools: useCustomToolModel,
|
|
130417
|
-
hasAccessToPreview
|
|
130428
|
+
hasAccessToPreview,
|
|
130429
|
+
useGemini3_5Flash
|
|
130418
130430
|
});
|
|
130419
130431
|
}
|
|
130420
130432
|
if (modelAlias === GEMINI_MODEL_ALIAS_FLASH) {
|
|
130421
130433
|
if (requestedModel === DEFAULT_GEMINI_MODEL_AUTO || requestedModel === DEFAULT_GEMINI_MODEL) {
|
|
130422
|
-
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
130434
|
+
return useGemini3_5Flash ? DEFAULT_GEMINI_3_5_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
130423
130435
|
}
|
|
130424
130436
|
if (requestedModel === PREVIEW_GEMINI_MODEL_AUTO || requestedModel === PREVIEW_GEMINI_MODEL || requestedModel === GEMINI_MODEL_ALIAS_AUTO) {
|
|
130437
|
+
if (useGemini3_5Flash) {
|
|
130438
|
+
return DEFAULT_GEMINI_3_5_FLASH_MODEL;
|
|
130439
|
+
}
|
|
130425
130440
|
return hasAccessToPreview ? PREVIEW_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
130426
130441
|
}
|
|
130427
|
-
return resolveModel(GEMINI_MODEL_ALIAS_FLASH, false, false, hasAccessToPreview);
|
|
130442
|
+
return resolveModel(GEMINI_MODEL_ALIAS_FLASH, false, false, hasAccessToPreview, config3, useGemini3_5Flash);
|
|
130428
130443
|
}
|
|
130429
|
-
return resolveModel(requestedModel, useGemini3_1, useCustomToolModel, hasAccessToPreview, config3);
|
|
130444
|
+
return resolveModel(requestedModel, useGemini3_1, useCustomToolModel, hasAccessToPreview, config3, useGemini3_5Flash);
|
|
130430
130445
|
}
|
|
130431
130446
|
function getDisplayString(model, config3) {
|
|
130432
130447
|
if (config3?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
@@ -130509,7 +130524,7 @@ function supportsMultimodalFunctionResponse(model, config3) {
|
|
|
130509
130524
|
}
|
|
130510
130525
|
return model.startsWith("gemini-3-");
|
|
130511
130526
|
}
|
|
130512
|
-
var PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_3_1_MODEL, PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, PREVIEW_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_FLASH_LITE_MODEL, PREVIEW_GEMINI_FLASH_LITE_MODEL, GEMMA_4_31B_IT_MODEL, GEMMA_4_26B_A4B_IT_MODEL, PREVIEW_GEMINI_MODEL_AUTO, DEFAULT_GEMINI_MODEL_AUTO, GEMINI_MODEL_ALIAS_AUTO, GEMINI_MODEL_ALIAS_PRO, GEMINI_MODEL_ALIAS_FLASH, GEMINI_MODEL_ALIAS_FLASH_LITE, DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_THINKING_MODE;
|
|
130527
|
+
var PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_3_1_MODEL, PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, PREVIEW_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_3_5_FLASH_MODEL, DEFAULT_GEMINI_FLASH_LITE_MODEL, PREVIEW_GEMINI_FLASH_LITE_MODEL, GEMMA_4_31B_IT_MODEL, GEMMA_4_26B_A4B_IT_MODEL, PREVIEW_GEMINI_MODEL_AUTO, DEFAULT_GEMINI_MODEL_AUTO, GEMINI_MODEL_ALIAS_AUTO, GEMINI_MODEL_ALIAS_PRO, GEMINI_MODEL_ALIAS_FLASH, GEMINI_MODEL_ALIAS_FLASH_LITE, DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_THINKING_MODE;
|
|
130513
130528
|
var init_models = __esm({
|
|
130514
130529
|
"packages/core/dist/src/config/models.js"() {
|
|
130515
130530
|
"use strict";
|
|
@@ -130519,6 +130534,7 @@ var init_models = __esm({
|
|
|
130519
130534
|
PREVIEW_GEMINI_FLASH_MODEL = "gemini-3-flash-preview";
|
|
130520
130535
|
DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
|
|
130521
130536
|
DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
|
|
130537
|
+
DEFAULT_GEMINI_3_5_FLASH_MODEL = "gemini-3.5-flash";
|
|
130522
130538
|
DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-3.1-flash-lite";
|
|
130523
130539
|
PREVIEW_GEMINI_FLASH_LITE_MODEL = "none";
|
|
130524
130540
|
GEMMA_4_31B_IT_MODEL = "gemma-4-31b-it";
|
|
@@ -211638,8 +211654,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
211638
211654
|
var init_git_commit = __esm({
|
|
211639
211655
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
211640
211656
|
"use strict";
|
|
211641
|
-
GIT_COMMIT_INFO = "
|
|
211642
|
-
CLI_VERSION = "0.
|
|
211657
|
+
GIT_COMMIT_INFO = "cfcecebe8";
|
|
211658
|
+
CLI_VERSION = "0.46.0-preview.0";
|
|
211643
211659
|
}
|
|
211644
211660
|
});
|
|
211645
211661
|
|
|
@@ -332664,7 +332680,7 @@ function getVersion() {
|
|
|
332664
332680
|
}
|
|
332665
332681
|
versionPromise = (async () => {
|
|
332666
332682
|
const pkgJson = await getPackageJson(__dirname4);
|
|
332667
|
-
return "0.
|
|
332683
|
+
return "0.46.0-preview.0";
|
|
332668
332684
|
})();
|
|
332669
332685
|
return versionPromise;
|
|
332670
332686
|
}
|
|
@@ -333503,7 +333519,7 @@ var init_errorClassification = __esm({
|
|
|
333503
333519
|
function getModelPolicyChain(options) {
|
|
333504
333520
|
const isAuto = options.isAutoSelection ?? false;
|
|
333505
333521
|
if (options.previewEnabled) {
|
|
333506
|
-
const proModel = resolveModel(PREVIEW_GEMINI_MODEL, options.useGemini31, options.useCustomToolModel);
|
|
333522
|
+
const proModel = resolveModel(PREVIEW_GEMINI_MODEL, options.useGemini31, options.useCustomToolModel, true, void 0, options.useGemini3_5Flash);
|
|
333507
333523
|
return [
|
|
333508
333524
|
definePolicy({
|
|
333509
333525
|
model: proModel,
|
|
@@ -333631,15 +333647,17 @@ function resolvePolicyChain(config3, preferredModel, wrapsAround = false) {
|
|
|
333631
333647
|
const useGemini31 = config3.getGemini31LaunchedSync?.() ?? false;
|
|
333632
333648
|
const useCustomToolModel = config3.getUseCustomToolModelSync?.() ?? false;
|
|
333633
333649
|
const hasAccessToPreview = config3.getHasAccessToPreviewModel?.() ?? false;
|
|
333650
|
+
const useGemini3_5Flash = config3.hasGemini35FlashGAAccess?.() ?? false;
|
|
333634
333651
|
const isOriginallyGemini3 = isGemini3Model(modelFromConfig, config3);
|
|
333635
|
-
const resolvedModel = normalizeModelId(resolveModel(modelFromConfig, useGemini31, useCustomToolModel, hasAccessToPreview, config3));
|
|
333652
|
+
const resolvedModel = normalizeModelId(resolveModel(modelFromConfig, useGemini31, useCustomToolModel, hasAccessToPreview, config3, useGemini3_5Flash));
|
|
333636
333653
|
const isAutoPreferred = normalizedPreferredModel ? isAutoModel(normalizedPreferredModel, config3) : false;
|
|
333637
333654
|
const isAutoConfigured = isAutoModel(configuredModel, config3);
|
|
333638
333655
|
const effectiveWrapsAround = wrapsAround || isAutoPreferred || isAutoConfigured || isOriginallyGemini3;
|
|
333639
333656
|
if (config3.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
333640
333657
|
const context2 = {
|
|
333641
333658
|
useGemini3_1: useGemini31,
|
|
333642
|
-
useCustomTools: useCustomToolModel
|
|
333659
|
+
useCustomTools: useCustomToolModel,
|
|
333660
|
+
useGemini3_5Flash
|
|
333643
333661
|
};
|
|
333644
333662
|
if (resolvedModel === DEFAULT_GEMINI_FLASH_LITE_MODEL) {
|
|
333645
333663
|
chain2 = config3.modelConfigService.resolveChain("lite", context2);
|
|
@@ -333671,7 +333689,8 @@ function resolvePolicyChain(config3, preferredModel, wrapsAround = false) {
|
|
|
333671
333689
|
isAutoSelection,
|
|
333672
333690
|
userTier: config3.getUserTier(),
|
|
333673
333691
|
useGemini31,
|
|
333674
|
-
useCustomToolModel
|
|
333692
|
+
useCustomToolModel,
|
|
333693
|
+
useGemini3_5Flash
|
|
333675
333694
|
});
|
|
333676
333695
|
} else {
|
|
333677
333696
|
chain2 = getModelPolicyChain({
|
|
@@ -333679,7 +333698,8 @@ function resolvePolicyChain(config3, preferredModel, wrapsAround = false) {
|
|
|
333679
333698
|
isAutoSelection,
|
|
333680
333699
|
userTier: config3.getUserTier(),
|
|
333681
333700
|
useGemini31,
|
|
333682
|
-
useCustomToolModel
|
|
333701
|
+
useCustomToolModel,
|
|
333702
|
+
useGemini3_5Flash
|
|
333683
333703
|
});
|
|
333684
333704
|
}
|
|
333685
333705
|
} else {
|
|
@@ -337747,7 +337767,7 @@ async function createContentGenerator(config3, gcConfig, sessionId) {
|
|
|
337747
337767
|
return new LoggingContentGenerator(fakeGenerator, gcConfig);
|
|
337748
337768
|
}
|
|
337749
337769
|
const version4 = await getVersion();
|
|
337750
|
-
const model = resolveModel(gcConfig.getModel(), config3.authType === AuthType2.USE_GEMINI || config3.authType === AuthType2.USE_VERTEX_AI || (await gcConfig.getGemini31Launched?.() ?? false), false, gcConfig.getHasAccessToPreviewModel?.() ?? true, gcConfig);
|
|
337770
|
+
const model = resolveModel(gcConfig.getModel(), config3.authType === AuthType2.USE_GEMINI || config3.authType === AuthType2.USE_VERTEX_AI || (await gcConfig.getGemini31Launched?.() ?? false), false, gcConfig.getHasAccessToPreviewModel?.() ?? true, gcConfig, gcConfig.hasGemini35FlashGAAccess?.() ?? false);
|
|
337751
337771
|
const customHeadersEnv = process.env["GEMINI_CLI_CUSTOM_HEADERS"] || void 0;
|
|
337752
337772
|
const clientName = gcConfig.getClientName();
|
|
337753
337773
|
const surface = determineSurface2();
|
|
@@ -353024,6 +353044,7 @@ var init_shellExecutionService = __esm({
|
|
|
353024
353044
|
init_environmentSanitization();
|
|
353025
353045
|
init_sandboxManager();
|
|
353026
353046
|
init_process_utils2();
|
|
353047
|
+
init_errors2();
|
|
353027
353048
|
init_executionLifecycleService();
|
|
353028
353049
|
({ Terminal } = import_headless2.default);
|
|
353029
353050
|
MAX_CHILD_PROCESS_BUFFER_SIZE = 16 * 1024 * 1024;
|
|
@@ -353970,21 +353991,31 @@ ${truncated}`;
|
|
|
353970
353991
|
return;
|
|
353971
353992
|
}
|
|
353972
353993
|
const activePty = this.activePtys.get(pid);
|
|
353973
|
-
if (activePty) {
|
|
353994
|
+
if (!activePty) {
|
|
353995
|
+
return;
|
|
353996
|
+
}
|
|
353997
|
+
if (process.platform !== "win32") {
|
|
353974
353998
|
try {
|
|
353975
|
-
|
|
353976
|
-
activePty.headlessTerminal.resize(cols, rows);
|
|
353999
|
+
process.kill(pid, 0);
|
|
353977
354000
|
} catch (e3) {
|
|
353978
|
-
|
|
353979
|
-
|
|
353980
|
-
const isEbadf = err2.code === "EBADF" || err2.message?.includes("EBADF");
|
|
353981
|
-
const isWindowsPtyError = err2.message?.includes("Cannot resize a pty that has already exited");
|
|
353982
|
-
if (isEsrch || isEbadf || isWindowsPtyError) {
|
|
353983
|
-
} else {
|
|
353984
|
-
throw e3;
|
|
354001
|
+
if (isNodeError(e3) && e3.code === "ESRCH") {
|
|
354002
|
+
return;
|
|
353985
354003
|
}
|
|
353986
354004
|
}
|
|
353987
354005
|
}
|
|
354006
|
+
try {
|
|
354007
|
+
activePty.ptyProcess.resize(cols, rows);
|
|
354008
|
+
activePty.headlessTerminal.resize(cols, rows);
|
|
354009
|
+
} catch (e3) {
|
|
354010
|
+
const err2 = e3;
|
|
354011
|
+
const isEsrch = err2.code === "ESRCH";
|
|
354012
|
+
const isEbadf = err2.code === "EBADF" || err2.message?.includes("EBADF");
|
|
354013
|
+
const isWindowsPtyError = err2.message?.includes("Cannot resize a pty that has already exited");
|
|
354014
|
+
if (isEsrch || isEbadf || isWindowsPtyError) {
|
|
354015
|
+
} else {
|
|
354016
|
+
throw e3;
|
|
354017
|
+
}
|
|
354018
|
+
}
|
|
353988
354019
|
if (activePty) {
|
|
353989
354020
|
const endLine = activePty.headlessTerminal.buffer.active.length;
|
|
353990
354021
|
const startLine = Math.max(0, endLine - (activePty.maxSerializedLines ?? 2e3));
|
|
@@ -354909,16 +354940,18 @@ ${result2.output}`;
|
|
|
354909
354940
|
}
|
|
354910
354941
|
signal.removeEventListener("abort", onAbort);
|
|
354911
354942
|
timeoutController.signal.removeEventListener("abort", onAbort);
|
|
354912
|
-
if (
|
|
354913
|
-
|
|
354914
|
-
|
|
354915
|
-
|
|
354943
|
+
if (!this.params.is_background) {
|
|
354944
|
+
if (tempFilePath) {
|
|
354945
|
+
try {
|
|
354946
|
+
await fsPromises9.unlink(tempFilePath);
|
|
354947
|
+
} catch {
|
|
354948
|
+
}
|
|
354916
354949
|
}
|
|
354917
|
-
|
|
354918
|
-
|
|
354919
|
-
|
|
354920
|
-
|
|
354921
|
-
|
|
354950
|
+
if (tempDir) {
|
|
354951
|
+
try {
|
|
354952
|
+
await fsPromises9.rm(tempDir, { recursive: true, force: true });
|
|
354953
|
+
} catch {
|
|
354954
|
+
}
|
|
354922
354955
|
}
|
|
354923
354956
|
}
|
|
354924
354957
|
}
|
|
@@ -362244,9 +362277,9 @@ var init_geminiChat = __esm({
|
|
|
362244
362277
|
const apiCall = async () => {
|
|
362245
362278
|
const useGemini3_1 = await this.context.config.getGemini31Launched?.() ?? false;
|
|
362246
362279
|
const hasAccessToPreview = this.context.config.getHasAccessToPreviewModel?.() ?? true;
|
|
362247
|
-
let modelToUse = resolveModel(lastModelToUse, useGemini3_1, false, hasAccessToPreview, this.context.config);
|
|
362280
|
+
let modelToUse = resolveModel(lastModelToUse, useGemini3_1, false, hasAccessToPreview, this.context.config, this.context.config.hasGemini35FlashGAAccess?.() ?? false);
|
|
362248
362281
|
if (this.context.config.getActiveModel() !== initialActiveModel) {
|
|
362249
|
-
modelToUse = resolveModel(this.context.config.getActiveModel(), useGemini3_1, false, hasAccessToPreview, this.context.config);
|
|
362282
|
+
modelToUse = resolveModel(this.context.config.getActiveModel(), useGemini3_1, false, hasAccessToPreview, this.context.config, this.context.config.hasGemini35FlashGAAccess?.() ?? false);
|
|
362250
362283
|
}
|
|
362251
362284
|
if (modelToUse !== lastModelToUse) {
|
|
362252
362285
|
const { generateContentConfig: newConfig } = this.context.config.modelConfigService.getResolvedConfig({
|
|
@@ -362285,7 +362318,7 @@ var init_geminiChat = __esm({
|
|
|
362285
362318
|
throw new AgentExecutionBlockedError(beforeModelResult.reason || "Model call blocked by hook", syntheticResponse);
|
|
362286
362319
|
}
|
|
362287
362320
|
if (beforeModelResult.modifiedModel) {
|
|
362288
|
-
modelToUse = resolveModel(beforeModelResult.modifiedModel, useGemini3_1, false, hasAccessToPreview, this.context.config);
|
|
362321
|
+
modelToUse = resolveModel(beforeModelResult.modifiedModel, useGemini3_1, false, hasAccessToPreview, this.context.config, this.context.config.hasGemini35FlashGAAccess?.() ?? false);
|
|
362289
362322
|
lastModelToUse = modelToUse;
|
|
362290
362323
|
contentsToUse = supportsModernFeatures(modelToUse) ? [...contentsForPreviewModel] : [...requestContents];
|
|
362291
362324
|
}
|
|
@@ -364683,7 +364716,7 @@ var init_promptProvider = __esm({
|
|
|
364683
364716
|
const isTopicUpdateNarrationEnabled = topicUpdateNarrationOverride ?? context2.config.isTopicUpdateNarrationEnabled();
|
|
364684
364717
|
const enabledToolNames = new Set(toolNames);
|
|
364685
364718
|
const approvedPlanPath = context2.config.getApprovedPlanPath();
|
|
364686
|
-
const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false, false, context2.config.getHasAccessToPreviewModel?.() ?? true, context2.config);
|
|
364719
|
+
const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false, false, context2.config.getHasAccessToPreviewModel?.() ?? true, context2.config, context2.config.hasGemini35FlashGAAccess?.() ?? false);
|
|
364687
364720
|
const isModernModel = supportsModernFeatures(desiredModel);
|
|
364688
364721
|
const activeSnippets = isModernModel ? snippets_exports : snippets_legacy_exports;
|
|
364689
364722
|
const contextFilenames = getAllGeminiMdFilenames();
|
|
@@ -364801,7 +364834,7 @@ var init_promptProvider = __esm({
|
|
|
364801
364834
|
return sanitizedPrompt;
|
|
364802
364835
|
}
|
|
364803
364836
|
getCompressionPrompt(context2) {
|
|
364804
|
-
const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false, false, context2.config.getHasAccessToPreviewModel?.() ?? true, context2.config);
|
|
364837
|
+
const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false, false, context2.config.getHasAccessToPreviewModel?.() ?? true, context2.config, context2.config.hasGemini35FlashGAAccess?.() ?? false);
|
|
364805
364838
|
const isModernModel = supportsModernFeatures(desiredModel);
|
|
364806
364839
|
const activeSnippets = isModernModel ? snippets_exports : snippets_legacy_exports;
|
|
364807
364840
|
return activeSnippets.getCompressionPrompt(context2.config.getApprovedPlanPath());
|
|
@@ -374233,6 +374266,8 @@ var init_modelConfigService = __esm({
|
|
|
374233
374266
|
return value === context2.useGemini3_1;
|
|
374234
374267
|
case "useGemini3_1FlashLite":
|
|
374235
374268
|
return value === context2.useGemini3_1FlashLite;
|
|
374269
|
+
case "useGemini3_5Flash":
|
|
374270
|
+
return value === context2.useGemini3_5Flash;
|
|
374236
374271
|
case "useCustomTools":
|
|
374237
374272
|
return value === context2.useCustomTools;
|
|
374238
374273
|
case "hasAccessToPreview":
|
|
@@ -380790,7 +380825,7 @@ var init_client4 = __esm({
|
|
|
380790
380825
|
if (this.currentSequenceModel) {
|
|
380791
380826
|
return this.currentSequenceModel;
|
|
380792
380827
|
}
|
|
380793
|
-
return resolveModel(this.config.getActiveModel(), this.config.getGemini31LaunchedSync?.() ?? false, false, this.config.getHasAccessToPreviewModel?.() ?? true, this.config);
|
|
380828
|
+
return resolveModel(this.config.getActiveModel(), this.config.getGemini31LaunchedSync?.() ?? false, false, this.config.getHasAccessToPreviewModel?.() ?? true, this.config, this.config.hasGemini35FlashGAAccess?.() ?? false);
|
|
380794
380829
|
}
|
|
380795
380830
|
async *processTurn(request, signal, prompt_id, boundedTurns, displayContent) {
|
|
380796
380831
|
let turn = new Turn(this.getChat(), prompt_id);
|
|
@@ -394719,7 +394754,7 @@ var init_defaultStrategy = __esm({
|
|
|
394719
394754
|
DefaultStrategy = class {
|
|
394720
394755
|
name = "default";
|
|
394721
394756
|
async route(_context, config3, _baseLlmClient, _localLiteRtLmClient) {
|
|
394722
|
-
const defaultModel = resolveModel(config3.getModel(), config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3);
|
|
394757
|
+
const defaultModel = resolveModel(config3.getModel(), config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3, config3.hasGemini35FlashGAAccess?.() ?? false);
|
|
394723
394758
|
return {
|
|
394724
394759
|
model: defaultModel,
|
|
394725
394760
|
metadata: {
|
|
@@ -395141,7 +395176,7 @@ var init_fallbackStrategy = __esm({
|
|
|
395141
395176
|
name = "fallback";
|
|
395142
395177
|
async route(context2, config3, _baseLlmClient, _localLiteRtLmClient) {
|
|
395143
395178
|
const requestedModel = context2.requestedModel ?? config3.getModel();
|
|
395144
|
-
const resolvedModel = resolveModel(requestedModel, config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3);
|
|
395179
|
+
const resolvedModel = resolveModel(requestedModel, config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3, config3.hasGemini35FlashGAAccess?.() ?? false);
|
|
395145
395180
|
const service = config3.getModelAvailabilityService();
|
|
395146
395181
|
const snapshot = service.snapshot(resolvedModel);
|
|
395147
395182
|
if (snapshot.available) {
|
|
@@ -395178,7 +395213,7 @@ var init_overrideStrategy = __esm({
|
|
|
395178
395213
|
return null;
|
|
395179
395214
|
}
|
|
395180
395215
|
return {
|
|
395181
|
-
model: resolveModel(overrideModel, config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3),
|
|
395216
|
+
model: resolveModel(overrideModel, config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3, config3.hasGemini35FlashGAAccess?.() ?? false),
|
|
395182
395217
|
metadata: {
|
|
395183
395218
|
source: this.name,
|
|
395184
395219
|
latencyMs: 0,
|
|
@@ -395452,6 +395487,12 @@ var init_defaultModelConfigs = __esm({
|
|
|
395452
395487
|
model: "gemini-3.1-flash-lite"
|
|
395453
395488
|
}
|
|
395454
395489
|
},
|
|
395490
|
+
"gemini-3.5-flash": {
|
|
395491
|
+
extends: "chat-base-3",
|
|
395492
|
+
modelConfig: {
|
|
395493
|
+
model: "gemini-3.5-flash"
|
|
395494
|
+
}
|
|
395495
|
+
},
|
|
395455
395496
|
"gemma-4-31b-it": {
|
|
395456
395497
|
extends: "chat-base-3",
|
|
395457
395498
|
modelConfig: {
|
|
@@ -395477,6 +395518,12 @@ var init_defaultModelConfigs = __esm({
|
|
|
395477
395518
|
model: "gemini-3-flash-preview"
|
|
395478
395519
|
}
|
|
395479
395520
|
},
|
|
395521
|
+
"gemini-3.5-flash-base": {
|
|
395522
|
+
extends: "base",
|
|
395523
|
+
modelConfig: {
|
|
395524
|
+
model: "gemini-3.5-flash"
|
|
395525
|
+
}
|
|
395526
|
+
},
|
|
395480
395527
|
classifier: {
|
|
395481
395528
|
extends: "base",
|
|
395482
395529
|
modelConfig: {
|
|
@@ -395684,6 +395731,13 @@ var init_defaultModelConfigs = __esm({
|
|
|
395684
395731
|
isVisible: true,
|
|
395685
395732
|
features: { thinking: false, multimodalToolUse: true }
|
|
395686
395733
|
},
|
|
395734
|
+
"gemini-3.5-flash": {
|
|
395735
|
+
tier: "flash",
|
|
395736
|
+
family: "gemini-3",
|
|
395737
|
+
isPreview: false,
|
|
395738
|
+
isVisible: true,
|
|
395739
|
+
features: { thinking: false, multimodalToolUse: true }
|
|
395740
|
+
},
|
|
395687
395741
|
"gemini-2.5-pro": {
|
|
395688
395742
|
tier: "pro",
|
|
395689
395743
|
family: "gemini-2.5",
|
|
@@ -395786,12 +395840,32 @@ var init_defaultModelConfigs = __esm({
|
|
|
395786
395840
|
"gemini-3-flash-preview": {
|
|
395787
395841
|
default: "gemini-3-flash-preview",
|
|
395788
395842
|
contexts: [
|
|
395843
|
+
{ condition: { useGemini3_5Flash: true }, target: "gemini-3.5-flash" },
|
|
395789
395844
|
{
|
|
395790
395845
|
condition: { hasAccessToPreview: false },
|
|
395791
395846
|
target: "gemini-2.5-flash"
|
|
395792
395847
|
}
|
|
395793
395848
|
]
|
|
395794
395849
|
},
|
|
395850
|
+
"gemini-3.5-flash": {
|
|
395851
|
+
default: "gemini-3.5-flash",
|
|
395852
|
+
contexts: [
|
|
395853
|
+
{
|
|
395854
|
+
condition: { useGemini3_5Flash: false, hasAccessToPreview: false },
|
|
395855
|
+
target: "gemini-2.5-flash"
|
|
395856
|
+
},
|
|
395857
|
+
{
|
|
395858
|
+
condition: { useGemini3_5Flash: false },
|
|
395859
|
+
target: "gemini-3-flash-preview"
|
|
395860
|
+
}
|
|
395861
|
+
]
|
|
395862
|
+
},
|
|
395863
|
+
"gemini-2.5-flash": {
|
|
395864
|
+
default: "gemini-2.5-flash",
|
|
395865
|
+
contexts: [
|
|
395866
|
+
{ condition: { useGemini3_5Flash: true }, target: "gemini-3.5-flash" }
|
|
395867
|
+
]
|
|
395868
|
+
},
|
|
395795
395869
|
"gemini-3-pro-preview": {
|
|
395796
395870
|
default: "gemini-3-pro-preview",
|
|
395797
395871
|
contexts: [
|
|
@@ -395840,6 +395914,7 @@ var init_defaultModelConfigs = __esm({
|
|
|
395840
395914
|
flash: {
|
|
395841
395915
|
default: "gemini-3-flash-preview",
|
|
395842
395916
|
contexts: [
|
|
395917
|
+
{ condition: { useGemini3_5Flash: true }, target: "gemini-3.5-flash" },
|
|
395843
395918
|
{
|
|
395844
395919
|
condition: { hasAccessToPreview: false },
|
|
395845
395920
|
target: "gemini-2.5-flash"
|
|
@@ -395871,6 +395946,7 @@ var init_defaultModelConfigs = __esm({
|
|
|
395871
395946
|
flash: {
|
|
395872
395947
|
default: "gemini-3-flash-preview",
|
|
395873
395948
|
contexts: [
|
|
395949
|
+
{ condition: { useGemini3_5Flash: true }, target: "gemini-3.5-flash" },
|
|
395874
395950
|
{
|
|
395875
395951
|
condition: { hasAccessToPreview: false },
|
|
395876
395952
|
target: "gemini-2.5-flash"
|
|
@@ -399339,7 +399415,8 @@ var init_flagNames = __esm({
|
|
|
399339
399415
|
MASKING_PROTECT_LATEST_TURN: 45758819,
|
|
399340
399416
|
GEMINI_3_1_PRO_LAUNCHED: 45760185,
|
|
399341
399417
|
PRO_MODEL_NO_ACCESS: 45768879,
|
|
399342
|
-
DEFAULT_REQUEST_TIMEOUT: 45773134
|
|
399418
|
+
DEFAULT_REQUEST_TIMEOUT: 45773134,
|
|
399419
|
+
GEMINI_3_5_FLASH_GA_LAUNCHED: 45780819
|
|
399343
399420
|
};
|
|
399344
399421
|
}
|
|
399345
399422
|
});
|
|
@@ -410407,7 +410484,7 @@ var init_config4 = __esm({
|
|
|
410407
410484
|
if (!isAutoModel(model, this)) {
|
|
410408
410485
|
return {};
|
|
410409
410486
|
}
|
|
410410
|
-
const primaryModel = resolveModel(model, this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
|
|
410487
|
+
const primaryModel = resolveModel(model, this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
|
|
410411
410488
|
const isPreview = isPreviewModel(primaryModel, this);
|
|
410412
410489
|
const proModel = primaryModel;
|
|
410413
410490
|
const flashModel = isPreview ? PREVIEW_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
@@ -410428,7 +410505,7 @@ var init_config4 = __esm({
|
|
|
410428
410505
|
if (pooled.remaining !== void 0) {
|
|
410429
410506
|
return pooled.remaining;
|
|
410430
410507
|
}
|
|
410431
|
-
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
|
|
410508
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
|
|
410432
410509
|
return this.modelQuotas.get(primaryModel)?.remaining;
|
|
410433
410510
|
}
|
|
410434
410511
|
getQuotaLimit() {
|
|
@@ -410436,7 +410513,7 @@ var init_config4 = __esm({
|
|
|
410436
410513
|
if (pooled.limit !== void 0) {
|
|
410437
410514
|
return pooled.limit;
|
|
410438
410515
|
}
|
|
410439
|
-
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
|
|
410516
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
|
|
410440
410517
|
return this.modelQuotas.get(primaryModel)?.limit;
|
|
410441
410518
|
}
|
|
410442
410519
|
getQuotaResetTime() {
|
|
@@ -410444,7 +410521,7 @@ var init_config4 = __esm({
|
|
|
410444
410521
|
if (pooled.resetTime !== void 0) {
|
|
410445
410522
|
return pooled.resetTime;
|
|
410446
410523
|
}
|
|
410447
|
-
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
|
|
410524
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
|
|
410448
410525
|
return this.modelQuotas.get(primaryModel)?.resetTime;
|
|
410449
410526
|
}
|
|
410450
410527
|
getEmbeddingModel() {
|
|
@@ -411428,6 +411505,26 @@ ${sections.join("\n")}
|
|
|
411428
411505
|
isGemini31LaunchedForAuthType(authType) {
|
|
411429
411506
|
return authType === AuthType2.USE_GEMINI || authType === AuthType2.USE_VERTEX_AI || authType === AuthType2.GATEWAY;
|
|
411430
411507
|
}
|
|
411508
|
+
/**
|
|
411509
|
+
* Returns whether Gemini 3.5 Flash GA has been launched.
|
|
411510
|
+
*
|
|
411511
|
+
* Note: This method should only be called after startup, once experiments have been loaded.
|
|
411512
|
+
*/
|
|
411513
|
+
hasGemini35FlashGAAccess() {
|
|
411514
|
+
const authType = this.contentGeneratorConfig?.authType;
|
|
411515
|
+
const hasAccess = (() => {
|
|
411516
|
+
if (this.isGemini31LaunchedForAuthType(authType)) {
|
|
411517
|
+
return true;
|
|
411518
|
+
}
|
|
411519
|
+
return this.experiments?.flags[ExperimentFlags.GEMINI_3_5_FLASH_GA_LAUNCHED]?.boolValue ?? false;
|
|
411520
|
+
})();
|
|
411521
|
+
if (hasAccess) {
|
|
411522
|
+
setFlashModels("gemini-3.5-flash", "gemini-3.5-flash");
|
|
411523
|
+
} else {
|
|
411524
|
+
setFlashModels("gemini-3-flash-preview", "gemini-2.5-flash");
|
|
411525
|
+
}
|
|
411526
|
+
return hasAccess;
|
|
411527
|
+
}
|
|
411431
411528
|
/**
|
|
411432
411529
|
* Returns whether Gemini 3.1 has been launched.
|
|
411433
411530
|
*
|