@google/gemini-cli 0.44.0 → 0.45.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/bundle/{chunk-BOYNQXWU.js → chunk-2O7YSVPU.js} +2 -2
- package/bundle/{chunk-CBT4PN4R.js → chunk-2RRZM3IR.js} +8 -8
- package/bundle/{chunk-BE42OOYM.js → chunk-4FNXKOEB.js} +377 -297
- package/bundle/{chunk-FOOWNGAB.js → chunk-4M3TG6ZU.js} +1 -1
- package/bundle/{chunk-XTG4JBIR.js → chunk-APSDEHHA.js} +1 -1
- package/bundle/{chunk-SIXPHUVZ.js → chunk-CWAXEILN.js} +423 -330
- package/bundle/{chunk-LM6XTSWQ.js → chunk-DMCSPKNM.js} +56 -2
- package/bundle/{chunk-M3EDSAPV.js → chunk-EZCW6IDX.js} +1 -1
- package/bundle/{chunk-3K52543M.js → chunk-GIXFMPPJ.js} +56 -2
- package/bundle/{chunk-TN4WXWFM.js → chunk-I7UI7NB6.js} +3 -3
- package/bundle/{chunk-OTLI6LZ3.js → chunk-IPQLMJS5.js} +1 -1
- package/bundle/{chunk-VUERI7WB.js → chunk-J4QUIOHJ.js} +8 -8
- package/bundle/{chunk-TW47A6FW.js → chunk-J7SEBVDD.js} +423 -330
- package/bundle/{chunk-QUZ62PY7.js → chunk-LUQGJPIY.js} +2 -2
- package/bundle/{chunk-N4SGO3W6.js → chunk-N4X4WHSW.js} +2 -2
- package/bundle/{chunk-EKUU3KNX.js → chunk-NOJPXYUJ.js} +1 -1
- package/bundle/{chunk-DALZZYPQ.js → chunk-OY6QYVTR.js} +1 -1
- package/bundle/{chunk-6W2Z7FTE.js → chunk-Q3UZDZZV.js} +3 -3
- package/bundle/{chunk-5CABHQOE.js → chunk-R5OZKB4U.js} +1 -1
- package/bundle/{chunk-7KIX5G5D.js → chunk-S4CJ6KAO.js} +3 -3
- package/bundle/{chunk-OLBOCZ5F.js → chunk-TH3OOWK4.js} +8 -8
- package/bundle/{chunk-7ZH745HC.js → chunk-VS2OY6HJ.js} +56 -2
- package/bundle/{chunk-G2L4VCSN.js → chunk-WPCNMQ6J.js} +1 -1
- package/bundle/{chunk-ONQVFEHS.js → chunk-Y5REX36P.js} +1 -1
- package/bundle/{cleanup-PDT5ATZB.js → cleanup-2WCUS5XU.js} +2 -2
- package/bundle/{cleanup-SF7XW2P3.js → cleanup-7FHLTEXT.js} +2 -2
- package/bundle/{cleanup-UW3DZLXP.js → cleanup-WGOZFAQJ.js} +2 -2
- package/bundle/{core-LN2S4IOX.js → core-LD6MHGD6.js} +3 -7
- package/bundle/{dist-J4RONYVV.js → core-SIRU2VWJ.js} +3 -7
- package/bundle/{devtoolsService-DUEWJW52.js → devtoolsService-4Y2RGEUE.js} +2 -2
- package/bundle/{devtoolsService-ZC7E4R2A.js → devtoolsService-F5XFL4BF.js} +2 -2
- package/bundle/{devtoolsService-64QE2V7E.js → devtoolsService-IANYOK3R.js} +2 -2
- package/bundle/{core-GW6VAL53.js → dist-67ZORME5.js} +3 -7
- package/bundle/docs/changelogs/index.md +15 -0
- package/bundle/docs/changelogs/latest.md +198 -262
- package/bundle/docs/changelogs/preview.md +202 -181
- package/bundle/docs/reference/configuration.md +24 -29
- package/bundle/{gemini-SSQIKHR2.js → gemini-24ENZ343.js} +41 -30
- package/bundle/{gemini-CMBH5YG6.js → gemini-5ZI322FJ.js} +41 -30
- package/bundle/{gemini-CSPRLMWN.js → gemini-74UML3PJ.js} +41 -30
- package/bundle/gemini.js +15 -10
- package/bundle/{interactiveCli-RDMZS6KL.js → interactiveCli-7GM3U7SA.js} +34 -58
- package/bundle/{interactiveCli-TOEU7LIO.js → interactiveCli-BVZLMTVC.js} +34 -58
- package/bundle/{interactiveCli-Q2A2JFLA.js → interactiveCli-XM5HDVD7.js} +34 -58
- package/bundle/{liteRtServerManager-ASKAVAO7.js → liteRtServerManager-3HS3VUPU.js} +4 -4
- package/bundle/{liteRtServerManager-6BWTXMUI.js → liteRtServerManager-6N5DYDEQ.js} +4 -4
- package/bundle/{liteRtServerManager-ZS3BCW53.js → liteRtServerManager-JVMDH3TN.js} +4 -4
- package/bundle/{oauth2-provider-SYRZDGL5.js → oauth2-provider-RUFABDNL.js} +1 -1
- package/bundle/{oauth2-provider-FGI6QDEM.js → oauth2-provider-U72EWZHQ.js} +1 -1
- package/bundle/{oauth2-provider-7JOVY727.js → oauth2-provider-WS7LUQ5V.js} +1 -1
- package/bundle/{start-KJCIH3GX.js → start-DJ6EBFEA.js} +6 -6
- package/bundle/{start-TU5WNP77.js → start-KOAGXRA2.js} +6 -6
- package/bundle/{start-47OYCVVA.js → start-XLIGOOW3.js} +6 -6
- package/package.json +1 -1
|
@@ -250813,24 +250813,12 @@ async function saveTruncatedToolOutput(content, toolName, id, projectTempDir, se
|
|
|
250813
250813
|
}
|
|
250814
250814
|
|
|
250815
250815
|
// packages/core/dist/src/utils/shell-utils.js
|
|
250816
|
-
var BASH_HUP_GUARD = `trap '' HUP;`;
|
|
250817
|
-
function stripHupGuard(command) {
|
|
250818
|
-
const trimmed2 = command.trimStart();
|
|
250819
|
-
const prefix = `${BASH_HUP_GUARD} `;
|
|
250820
|
-
if (trimmed2.startsWith(prefix)) {
|
|
250821
|
-
return trimmed2.slice(prefix.length);
|
|
250822
|
-
}
|
|
250823
|
-
if (trimmed2 === BASH_HUP_GUARD) {
|
|
250824
|
-
return "";
|
|
250825
|
-
}
|
|
250826
|
-
return command;
|
|
250827
|
-
}
|
|
250828
250816
|
async function getCommandName(command, args2) {
|
|
250829
250817
|
await initializeShellParsers();
|
|
250830
250818
|
const fullCmd = [command, ...args2].join(" ");
|
|
250831
250819
|
const stripped = stripShellWrapper(fullCmd);
|
|
250832
250820
|
const roots = getCommandRoots(stripped).filter((r3) => r3 !== "shopt" && r3 !== "set");
|
|
250833
|
-
if (roots.length
|
|
250821
|
+
if (roots.length > 0) {
|
|
250834
250822
|
return roots[0];
|
|
250835
250823
|
}
|
|
250836
250824
|
return path8.basename(command);
|
|
@@ -251367,17 +251355,14 @@ function getCommandRoots(command) {
|
|
|
251367
251355
|
function stripShellWrapper(command) {
|
|
251368
251356
|
const pattern = /^\s*(?:(?:(?:\S+\/)?(?:sh|bash|zsh))\s+-c|cmd\.exe\s+\/c|powershell(?:\.exe)?\s+(?:-NoProfile\s+)?-Command|pwsh(?:\.exe)?\s+(?:-NoProfile\s+)?-Command)\s+/i;
|
|
251369
251357
|
const match2 = command.match(pattern);
|
|
251370
|
-
let result2;
|
|
251371
251358
|
if (match2) {
|
|
251372
251359
|
let newCommand = command.substring(match2[0].length).trim();
|
|
251373
251360
|
if (newCommand.startsWith('"') && newCommand.endsWith('"') || newCommand.startsWith("'") && newCommand.endsWith("'")) {
|
|
251374
251361
|
newCommand = newCommand.substring(1, newCommand.length - 1);
|
|
251375
251362
|
}
|
|
251376
|
-
|
|
251377
|
-
} else {
|
|
251378
|
-
result2 = command.trim();
|
|
251363
|
+
return newCommand;
|
|
251379
251364
|
}
|
|
251380
|
-
return
|
|
251365
|
+
return command.trim();
|
|
251381
251366
|
}
|
|
251382
251367
|
var spawnAsync = async (command, args2, options) => {
|
|
251383
251368
|
const sandboxManager = options?.sandboxManager ?? new NoopSandboxManager();
|
|
@@ -252279,7 +252264,7 @@ async function getCommandName2(req) {
|
|
|
252279
252264
|
const fullCmd = [req.command, ...req.args].join(" ");
|
|
252280
252265
|
const stripped = stripShellWrapper(fullCmd);
|
|
252281
252266
|
const roots = getCommandRoots(stripped).filter((r3) => r3 !== "shopt" && r3 !== "set");
|
|
252282
|
-
if (roots.length
|
|
252267
|
+
if (roots.length > 0) {
|
|
252283
252268
|
return roots[0];
|
|
252284
252269
|
}
|
|
252285
252270
|
return path11.basename(req.command);
|
|
@@ -275823,10 +275808,10 @@ var PREVIEW_GEMINI_MODEL = "gemini-3-pro-preview";
|
|
|
275823
275808
|
var PREVIEW_GEMINI_3_1_MODEL = "gemini-3.1-pro-preview";
|
|
275824
275809
|
var PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL = "gemini-3.1-pro-preview-customtools";
|
|
275825
275810
|
var PREVIEW_GEMINI_FLASH_MODEL = "gemini-3-flash-preview";
|
|
275826
|
-
var PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL = "gemini-3.1-flash-lite-preview";
|
|
275827
275811
|
var DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
|
|
275828
275812
|
var DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
|
|
275829
|
-
var DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-
|
|
275813
|
+
var DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-3.1-flash-lite";
|
|
275814
|
+
var PREVIEW_GEMINI_FLASH_LITE_MODEL = "none";
|
|
275830
275815
|
var GEMMA_4_31B_IT_MODEL = "gemma-4-31b-it";
|
|
275831
275816
|
var GEMMA_4_26B_A4B_IT_MODEL = "gemma-4-26b-a4b-it";
|
|
275832
275817
|
var VALID_GEMINI_MODELS = /* @__PURE__ */ new Set([
|
|
@@ -275834,7 +275819,7 @@ var VALID_GEMINI_MODELS = /* @__PURE__ */ new Set([
|
|
|
275834
275819
|
PREVIEW_GEMINI_3_1_MODEL,
|
|
275835
275820
|
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
|
275836
275821
|
PREVIEW_GEMINI_FLASH_MODEL,
|
|
275837
|
-
|
|
275822
|
+
PREVIEW_GEMINI_FLASH_LITE_MODEL,
|
|
275838
275823
|
DEFAULT_GEMINI_MODEL,
|
|
275839
275824
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
275840
275825
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
@@ -275850,16 +275835,15 @@ var GEMINI_MODEL_ALIAS_FLASH_LITE = "flash-lite";
|
|
|
275850
275835
|
var DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
|
|
275851
275836
|
var DEFAULT_THINKING_MODE = 8192;
|
|
275852
275837
|
function getAutoModelDescription(hasAccessToPreview, useGemini3_1 = false) {
|
|
275853
|
-
const proModel = hasAccessToPreview ? useGemini3_1 ?
|
|
275854
|
-
const flashModel = hasAccessToPreview ?
|
|
275838
|
+
const proModel = hasAccessToPreview ? useGemini3_1 ? PREVIEW_GEMINI_3_1_MODEL : PREVIEW_GEMINI_MODEL : DEFAULT_GEMINI_MODEL;
|
|
275839
|
+
const flashModel = hasAccessToPreview ? PREVIEW_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
275855
275840
|
return `Let Gemini CLI decide the best model for the task: ${proModel}, ${flashModel}`;
|
|
275856
275841
|
}
|
|
275857
|
-
function resolveModel(requestedModel, useGemini3_1 = false,
|
|
275842
|
+
function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config2) {
|
|
275858
275843
|
const normalizedModel = Array.isArray(requestedModel) ? String(requestedModel.at(-1) ?? "").trim() || "" : typeof requestedModel !== "string" ? String(requestedModel ?? "").trim() || "" : requestedModel.trim() || "";
|
|
275859
275844
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
275860
275845
|
const resolved2 = config2.modelConfigService.resolveModelId(normalizedModel, {
|
|
275861
275846
|
useGemini3_1,
|
|
275862
|
-
useGemini3_1FlashLite,
|
|
275863
275847
|
useCustomTools: useCustomToolModel,
|
|
275864
275848
|
hasAccessToPreview
|
|
275865
275849
|
});
|
|
@@ -275901,7 +275885,7 @@ function resolveModel(requestedModel, useGemini3_1 = false, useGemini3_1FlashLit
|
|
|
275901
275885
|
break;
|
|
275902
275886
|
}
|
|
275903
275887
|
case GEMINI_MODEL_ALIAS_FLASH_LITE: {
|
|
275904
|
-
resolved =
|
|
275888
|
+
resolved = DEFAULT_GEMINI_FLASH_LITE_MODEL;
|
|
275905
275889
|
break;
|
|
275906
275890
|
}
|
|
275907
275891
|
default: {
|
|
@@ -275909,12 +275893,13 @@ function resolveModel(requestedModel, useGemini3_1 = false, useGemini3_1FlashLit
|
|
|
275909
275893
|
break;
|
|
275910
275894
|
}
|
|
275911
275895
|
}
|
|
275896
|
+
if (resolved === "none") {
|
|
275897
|
+
return DEFAULT_GEMINI_FLASH_LITE_MODEL;
|
|
275898
|
+
}
|
|
275912
275899
|
if (!hasAccessToPreview && isPreviewModel(resolved)) {
|
|
275913
275900
|
switch (resolved) {
|
|
275914
275901
|
case PREVIEW_GEMINI_FLASH_MODEL:
|
|
275915
275902
|
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
275916
|
-
case PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL:
|
|
275917
|
-
return DEFAULT_GEMINI_FLASH_LITE_MODEL;
|
|
275918
275903
|
case PREVIEW_GEMINI_MODEL:
|
|
275919
275904
|
case PREVIEW_GEMINI_3_1_MODEL:
|
|
275920
275905
|
case PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL:
|
|
@@ -275931,11 +275916,10 @@ function resolveModel(requestedModel, useGemini3_1 = false, useGemini3_1FlashLit
|
|
|
275931
275916
|
}
|
|
275932
275917
|
return resolved;
|
|
275933
275918
|
}
|
|
275934
|
-
function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false,
|
|
275919
|
+
function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config2) {
|
|
275935
275920
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
275936
275921
|
return config2.modelConfigService.resolveClassifierModelId(modelAlias, requestedModel, {
|
|
275937
275922
|
useGemini3_1,
|
|
275938
|
-
useGemini3_1FlashLite,
|
|
275939
275923
|
useCustomTools: useCustomToolModel,
|
|
275940
275924
|
hasAccessToPreview
|
|
275941
275925
|
});
|
|
@@ -275947,9 +275931,9 @@ function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false
|
|
|
275947
275931
|
if (requestedModel === PREVIEW_GEMINI_MODEL_AUTO || requestedModel === PREVIEW_GEMINI_MODEL || requestedModel === GEMINI_MODEL_ALIAS_AUTO) {
|
|
275948
275932
|
return hasAccessToPreview ? PREVIEW_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
275949
275933
|
}
|
|
275950
|
-
return resolveModel(GEMINI_MODEL_ALIAS_FLASH, false, false,
|
|
275934
|
+
return resolveModel(GEMINI_MODEL_ALIAS_FLASH, false, false, hasAccessToPreview);
|
|
275951
275935
|
}
|
|
275952
|
-
return resolveModel(requestedModel, useGemini3_1,
|
|
275936
|
+
return resolveModel(requestedModel, useGemini3_1, useCustomToolModel, hasAccessToPreview, config2);
|
|
275953
275937
|
}
|
|
275954
275938
|
function getDisplayString(model, config2) {
|
|
275955
275939
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
@@ -275975,17 +275959,20 @@ function getDisplayString(model, config2) {
|
|
|
275975
275959
|
return PREVIEW_GEMINI_FLASH_MODEL;
|
|
275976
275960
|
case PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL:
|
|
275977
275961
|
return PREVIEW_GEMINI_3_1_MODEL;
|
|
275978
|
-
case
|
|
275979
|
-
return
|
|
275962
|
+
case PREVIEW_GEMINI_FLASH_LITE_MODEL:
|
|
275963
|
+
return PREVIEW_GEMINI_FLASH_LITE_MODEL;
|
|
275980
275964
|
default:
|
|
275981
275965
|
return model;
|
|
275982
275966
|
}
|
|
275983
275967
|
}
|
|
275984
275968
|
function isPreviewModel(model, config2) {
|
|
275969
|
+
if (model === "none") {
|
|
275970
|
+
return false;
|
|
275971
|
+
}
|
|
275985
275972
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
275986
275973
|
return config2.modelConfigService.getModelDefinition(model)?.isPreview === true;
|
|
275987
275974
|
}
|
|
275988
|
-
return model === PREVIEW_GEMINI_MODEL || model === PREVIEW_GEMINI_3_1_MODEL || model === PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_MODEL_AUTO || model === GEMINI_MODEL_ALIAS_AUTO || model ===
|
|
275975
|
+
return model === PREVIEW_GEMINI_MODEL || model === PREVIEW_GEMINI_3_1_MODEL || model === PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_MODEL_AUTO || model === GEMINI_MODEL_ALIAS_AUTO || model === PREVIEW_GEMINI_FLASH_LITE_MODEL;
|
|
275989
275976
|
}
|
|
275990
275977
|
function isProModel(model, config2) {
|
|
275991
275978
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
@@ -275995,7 +275982,7 @@ function isProModel(model, config2) {
|
|
|
275995
275982
|
}
|
|
275996
275983
|
function isGemini3Model(model, config2) {
|
|
275997
275984
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
275998
|
-
const resolved2 = resolveModel(model, false, false,
|
|
275985
|
+
const resolved2 = resolveModel(model, false, false, true, config2);
|
|
275999
275986
|
return config2.modelConfigService.getModelDefinition(resolved2)?.family === "gemini-3";
|
|
276000
275987
|
}
|
|
276001
275988
|
const resolved = resolveModel(model);
|
|
@@ -276006,7 +275993,7 @@ function isGemini2Model(model) {
|
|
|
276006
275993
|
}
|
|
276007
275994
|
function isCustomModel(model, config2) {
|
|
276008
275995
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
276009
|
-
const resolved2 = resolveModel(model, false, false,
|
|
275996
|
+
const resolved2 = resolveModel(model, false, false, true, config2);
|
|
276010
275997
|
return config2.modelConfigService.getModelDefinition(resolved2)?.tier === "custom" || !resolved2.startsWith("gemini-");
|
|
276011
275998
|
}
|
|
276012
275999
|
const resolved = resolveModel(model);
|
|
@@ -276029,15 +276016,15 @@ function supportsMultimodalFunctionResponse(model, config2) {
|
|
|
276029
276016
|
}
|
|
276030
276017
|
return model.startsWith("gemini-3-");
|
|
276031
276018
|
}
|
|
276032
|
-
function isActiveModel(model, useGemini3_1 = false,
|
|
276033
|
-
if (!VALID_GEMINI_MODELS.has(model)) {
|
|
276019
|
+
function isActiveModel(model, useGemini3_1 = false, useCustomToolModel = false, experimentalGemma = true) {
|
|
276020
|
+
if (!VALID_GEMINI_MODELS.has(model) || model === "none") {
|
|
276034
276021
|
return false;
|
|
276035
276022
|
}
|
|
276036
276023
|
if (model === GEMMA_4_31B_IT_MODEL || model === GEMMA_4_26B_A4B_IT_MODEL) {
|
|
276037
276024
|
return experimentalGemma;
|
|
276038
276025
|
}
|
|
276039
|
-
if (model ===
|
|
276040
|
-
return
|
|
276026
|
+
if (model === PREVIEW_GEMINI_FLASH_LITE_MODEL) {
|
|
276027
|
+
return false;
|
|
276041
276028
|
}
|
|
276042
276029
|
if (useGemini3_1) {
|
|
276043
276030
|
if (model === PREVIEW_GEMINI_MODEL) {
|
|
@@ -279292,8 +279279,8 @@ function isValidToolName(name3, options = {}) {
|
|
|
279292
279279
|
}
|
|
279293
279280
|
|
|
279294
279281
|
// packages/core/dist/src/generated/git-commit.js
|
|
279295
|
-
var GIT_COMMIT_INFO = "
|
|
279296
|
-
var CLI_VERSION = "0.
|
|
279282
|
+
var GIT_COMMIT_INFO = "5cac7c10f";
|
|
279283
|
+
var CLI_VERSION = "0.45.0-preview.0";
|
|
279297
279284
|
|
|
279298
279285
|
// packages/core/dist/src/ide/detect-ide.js
|
|
279299
279286
|
var IDE_DEFINITIONS = {
|
|
@@ -303458,7 +303445,7 @@ function getVersion() {
|
|
|
303458
303445
|
}
|
|
303459
303446
|
versionPromise = (async () => {
|
|
303460
303447
|
const pkgJson = await getPackageJson(__dirname4);
|
|
303461
|
-
return "0.
|
|
303448
|
+
return "0.45.0-preview.0";
|
|
303462
303449
|
})();
|
|
303463
303450
|
return versionPromise;
|
|
303464
303451
|
}
|
|
@@ -304292,7 +304279,7 @@ var FLASH_LITE_CHAIN = [
|
|
|
304292
304279
|
function getModelPolicyChain(options) {
|
|
304293
304280
|
const isAuto = options.isAutoSelection ?? false;
|
|
304294
304281
|
if (options.previewEnabled) {
|
|
304295
|
-
const proModel = resolveModel(PREVIEW_GEMINI_MODEL, options.useGemini31, options.
|
|
304282
|
+
const proModel = resolveModel(PREVIEW_GEMINI_MODEL, options.useGemini31, options.useCustomToolModel);
|
|
304296
304283
|
return [
|
|
304297
304284
|
definePolicy({
|
|
304298
304285
|
model: proModel,
|
|
@@ -304365,18 +304352,16 @@ function resolvePolicyChain(config2, preferredModel, wrapsAround = false) {
|
|
|
304365
304352
|
const configuredModel = normalizeModelId(config2.getModel());
|
|
304366
304353
|
let chain2;
|
|
304367
304354
|
const useGemini31 = config2.getGemini31LaunchedSync?.() ?? false;
|
|
304368
|
-
const useGemini31FlashLite = config2.getGemini31FlashLiteLaunchedSync?.() ?? false;
|
|
304369
304355
|
const useCustomToolModel = config2.getUseCustomToolModelSync?.() ?? false;
|
|
304370
304356
|
const hasAccessToPreview = config2.getHasAccessToPreviewModel?.() ?? false;
|
|
304371
304357
|
const isOriginallyGemini3 = isGemini3Model(modelFromConfig, config2);
|
|
304372
|
-
const resolvedModel = normalizeModelId(resolveModel(modelFromConfig, useGemini31,
|
|
304358
|
+
const resolvedModel = normalizeModelId(resolveModel(modelFromConfig, useGemini31, useCustomToolModel, hasAccessToPreview, config2));
|
|
304373
304359
|
const isAutoPreferred = normalizedPreferredModel ? isAutoModel(normalizedPreferredModel, config2) : false;
|
|
304374
304360
|
const isAutoConfigured = isAutoModel(configuredModel, config2);
|
|
304375
304361
|
const effectiveWrapsAround = wrapsAround || isAutoPreferred || isAutoConfigured || isOriginallyGemini3;
|
|
304376
304362
|
if (config2.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
304377
304363
|
const context2 = {
|
|
304378
304364
|
useGemini3_1: useGemini31,
|
|
304379
|
-
useGemini3_1FlashLite: useGemini31FlashLite,
|
|
304380
304365
|
useCustomTools: useCustomToolModel
|
|
304381
304366
|
};
|
|
304382
304367
|
if (resolvedModel === DEFAULT_GEMINI_FLASH_LITE_MODEL) {
|
|
@@ -304409,7 +304394,6 @@ function resolvePolicyChain(config2, preferredModel, wrapsAround = false) {
|
|
|
304409
304394
|
isAutoSelection,
|
|
304410
304395
|
userTier: config2.getUserTier(),
|
|
304411
304396
|
useGemini31,
|
|
304412
|
-
useGemini31FlashLite,
|
|
304413
304397
|
useCustomToolModel
|
|
304414
304398
|
});
|
|
304415
304399
|
} else {
|
|
@@ -304418,7 +304402,6 @@ function resolvePolicyChain(config2, preferredModel, wrapsAround = false) {
|
|
|
304418
304402
|
isAutoSelection,
|
|
304419
304403
|
userTier: config2.getUserTier(),
|
|
304420
304404
|
useGemini31,
|
|
304421
|
-
useGemini31FlashLite,
|
|
304422
304405
|
useCustomToolModel
|
|
304423
304406
|
});
|
|
304424
304407
|
}
|
|
@@ -308236,7 +308219,7 @@ async function createContentGenerator(config2, gcConfig, sessionId) {
|
|
|
308236
308219
|
return new LoggingContentGenerator(fakeGenerator, gcConfig);
|
|
308237
308220
|
}
|
|
308238
308221
|
const version4 = await getVersion();
|
|
308239
|
-
const model = resolveModel(gcConfig.getModel(), config2.authType === AuthType2.USE_GEMINI || config2.authType === AuthType2.USE_VERTEX_AI || (await gcConfig.getGemini31Launched?.() ?? false),
|
|
308222
|
+
const model = resolveModel(gcConfig.getModel(), config2.authType === AuthType2.USE_GEMINI || config2.authType === AuthType2.USE_VERTEX_AI || (await gcConfig.getGemini31Launched?.() ?? false), false, gcConfig.getHasAccessToPreviewModel?.() ?? true, gcConfig);
|
|
308240
308223
|
const customHeadersEnv = process.env["GEMINI_CLI_CUSTOM_HEADERS"] || void 0;
|
|
308241
308224
|
const clientName = gcConfig.getClientName();
|
|
308242
308225
|
const surface = determineSurface2();
|
|
@@ -319307,17 +319290,6 @@ function injectUtf8CodepageForPty(command, shell, isWindows3, usingPty) {
|
|
|
319307
319290
|
}
|
|
319308
319291
|
return command;
|
|
319309
319292
|
}
|
|
319310
|
-
function ensureHupIgnored(command, shell) {
|
|
319311
|
-
if (shell !== "bash") {
|
|
319312
|
-
return command;
|
|
319313
|
-
}
|
|
319314
|
-
const trimmed2 = command.trimStart();
|
|
319315
|
-
const prefix = `${BASH_HUP_GUARD} `;
|
|
319316
|
-
if (trimmed2.startsWith(prefix) || trimmed2 === BASH_HUP_GUARD) {
|
|
319317
|
-
return command;
|
|
319318
|
-
}
|
|
319319
|
-
return `${BASH_HUP_GUARD} ${command}`;
|
|
319320
|
-
}
|
|
319321
319293
|
var findLastContentLine = (buffer, startLine) => {
|
|
319322
319294
|
const lineCount = buffer.length;
|
|
319323
319295
|
for (let i4 = lineCount - 1; i4 >= startLine; i4--) {
|
|
@@ -319484,9 +319456,8 @@ ${truncated}`;
|
|
|
319484
319456
|
executable = "cmd.exe";
|
|
319485
319457
|
}
|
|
319486
319458
|
const resolvedExecutable = resolveExecutable(executable) ?? executable;
|
|
319487
|
-
const
|
|
319488
|
-
const
|
|
319489
|
-
const finalCommand = injectUtf8CodepageForPty(hupGuarded, shell, isWindows3, usingPty);
|
|
319459
|
+
const guardedCommand = ensurePromptvarsDisabled(commandToExecute, shell);
|
|
319460
|
+
const finalCommand = injectUtf8CodepageForPty(guardedCommand, shell, isWindows3, usingPty);
|
|
319490
319461
|
const spawnArgs = [...argsPrefix, finalCommand];
|
|
319491
319462
|
const gitConfigKeys = [];
|
|
319492
319463
|
if (!isInteractive) {
|
|
@@ -320264,8 +320235,9 @@ ${truncated}`;
|
|
|
320264
320235
|
} catch (e2) {
|
|
320265
320236
|
const err2 = e2;
|
|
320266
320237
|
const isEsrch = err2.code === "ESRCH";
|
|
320238
|
+
const isEbadf = err2.code === "EBADF" || err2.message?.includes("EBADF");
|
|
320267
320239
|
const isWindowsPtyError = err2.message?.includes("Cannot resize a pty that has already exited");
|
|
320268
|
-
if (isEsrch || isWindowsPtyError) {
|
|
320240
|
+
if (isEsrch || isEbadf || isWindowsPtyError) {
|
|
320269
320241
|
} else {
|
|
320270
320242
|
throw e2;
|
|
320271
320243
|
}
|
|
@@ -327692,7 +327664,8 @@ function convertSessionToClientHistory(messages) {
|
|
|
327692
327664
|
}
|
|
327693
327665
|
if (msg.type === "user") {
|
|
327694
327666
|
const contentString = partListUnionToString(msg.content);
|
|
327695
|
-
|
|
327667
|
+
const trimmedContent = contentString.trim();
|
|
327668
|
+
if (trimmedContent.startsWith("/") || trimmedContent.startsWith("?") || trimmedContent.startsWith("<session_context>") || trimmedContent.startsWith("<hook_context>")) {
|
|
327696
327669
|
continue;
|
|
327697
327670
|
}
|
|
327698
327671
|
clientHistory.push({
|
|
@@ -328162,11 +328135,10 @@ var GeminiChat = class {
|
|
|
328162
328135
|
const initialActiveModel = this.context.config.getActiveModel();
|
|
328163
328136
|
const apiCall = async () => {
|
|
328164
328137
|
const useGemini3_1 = await this.context.config.getGemini31Launched?.() ?? false;
|
|
328165
|
-
const useGemini3_1FlashLite = await this.context.config.getGemini31FlashLiteLaunched?.() ?? false;
|
|
328166
328138
|
const hasAccessToPreview = this.context.config.getHasAccessToPreviewModel?.() ?? true;
|
|
328167
|
-
let modelToUse = resolveModel(lastModelToUse, useGemini3_1,
|
|
328139
|
+
let modelToUse = resolveModel(lastModelToUse, useGemini3_1, false, hasAccessToPreview, this.context.config);
|
|
328168
328140
|
if (this.context.config.getActiveModel() !== initialActiveModel) {
|
|
328169
|
-
modelToUse = resolveModel(this.context.config.getActiveModel(), useGemini3_1,
|
|
328141
|
+
modelToUse = resolveModel(this.context.config.getActiveModel(), useGemini3_1, false, hasAccessToPreview, this.context.config);
|
|
328170
328142
|
}
|
|
328171
328143
|
if (modelToUse !== lastModelToUse) {
|
|
328172
328144
|
const { generateContentConfig: newConfig } = this.context.config.modelConfigService.getResolvedConfig({
|
|
@@ -328205,7 +328177,7 @@ var GeminiChat = class {
|
|
|
328205
328177
|
throw new AgentExecutionBlockedError(beforeModelResult.reason || "Model call blocked by hook", syntheticResponse);
|
|
328206
328178
|
}
|
|
328207
328179
|
if (beforeModelResult.modifiedModel) {
|
|
328208
|
-
modelToUse = resolveModel(beforeModelResult.modifiedModel, useGemini3_1,
|
|
328180
|
+
modelToUse = resolveModel(beforeModelResult.modifiedModel, useGemini3_1, false, hasAccessToPreview, this.context.config);
|
|
328209
328181
|
lastModelToUse = modelToUse;
|
|
328210
328182
|
contentsToUse = supportsModernFeatures(modelToUse) ? [...contentsForPreviewModel] : [...requestContents];
|
|
328211
328183
|
}
|
|
@@ -330563,7 +330535,7 @@ var PromptProvider = class {
|
|
|
330563
330535
|
const isTopicUpdateNarrationEnabled = topicUpdateNarrationOverride ?? context2.config.isTopicUpdateNarrationEnabled();
|
|
330564
330536
|
const enabledToolNames = new Set(toolNames);
|
|
330565
330537
|
const approvedPlanPath = context2.config.getApprovedPlanPath();
|
|
330566
|
-
const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false,
|
|
330538
|
+
const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false, false, context2.config.getHasAccessToPreviewModel?.() ?? true, context2.config);
|
|
330567
330539
|
const isModernModel = supportsModernFeatures(desiredModel);
|
|
330568
330540
|
const activeSnippets = isModernModel ? snippets_exports : snippets_legacy_exports;
|
|
330569
330541
|
const contextFilenames = getAllGeminiMdFilenames();
|
|
@@ -330681,7 +330653,7 @@ var PromptProvider = class {
|
|
|
330681
330653
|
return sanitizedPrompt;
|
|
330682
330654
|
}
|
|
330683
330655
|
getCompressionPrompt(context2) {
|
|
330684
|
-
const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false,
|
|
330656
|
+
const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false, false, context2.config.getHasAccessToPreviewModel?.() ?? true, context2.config);
|
|
330685
330657
|
const isModernModel = supportsModernFeatures(desiredModel);
|
|
330686
330658
|
const activeSnippets = isModernModel ? snippets_exports : snippets_legacy_exports;
|
|
330687
330659
|
return activeSnippets.getCompressionPrompt(context2.config.getApprovedPlanPath());
|
|
@@ -331321,14 +331293,16 @@ function modelStringToModelConfigAlias(model) {
|
|
|
331321
331293
|
return "chat-compression-3-pro";
|
|
331322
331294
|
case PREVIEW_GEMINI_FLASH_MODEL:
|
|
331323
331295
|
return "chat-compression-3-flash";
|
|
331324
|
-
case
|
|
331296
|
+
case PREVIEW_GEMINI_FLASH_LITE_MODEL:
|
|
331297
|
+
// fallthrough
|
|
331298
|
+
case DEFAULT_GEMINI_FLASH_LITE_MODEL:
|
|
331325
331299
|
return "chat-compression-3.1-flash-lite";
|
|
331300
|
+
case "gemini-2.5-flash-lite":
|
|
331301
|
+
return "chat-compression-2.5-flash-lite";
|
|
331326
331302
|
case DEFAULT_GEMINI_MODEL:
|
|
331327
331303
|
return "chat-compression-2.5-pro";
|
|
331328
331304
|
case DEFAULT_GEMINI_FLASH_MODEL:
|
|
331329
331305
|
return "chat-compression-2.5-flash";
|
|
331330
|
-
case DEFAULT_GEMINI_FLASH_LITE_MODEL:
|
|
331331
|
-
return "chat-compression-2.5-flash-lite";
|
|
331332
331306
|
default:
|
|
331333
331307
|
return "chat-compression-default";
|
|
331334
331308
|
}
|
|
@@ -335793,7 +335767,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
|
|
|
335793
335767
|
return provider;
|
|
335794
335768
|
}
|
|
335795
335769
|
case "oauth2": {
|
|
335796
|
-
const { OAuth2AuthProvider } = await import("./oauth2-provider-
|
|
335770
|
+
const { OAuth2AuthProvider } = await import("./oauth2-provider-RUFABDNL.js");
|
|
335797
335771
|
const provider = new OAuth2AuthProvider(authConfig, options.agentName ?? "unknown", agentCard, options.agentCardUrl);
|
|
335798
335772
|
await provider.initialize();
|
|
335799
335773
|
return provider;
|
|
@@ -335937,7 +335911,6 @@ var ModelConfigService = class _ModelConfigService {
|
|
|
335937
335911
|
const definitions = this.config.modelDefinitions ?? {};
|
|
335938
335912
|
const shouldShowPreviewModels = context2.hasAccessToPreview ?? false;
|
|
335939
335913
|
const useGemini31 = context2.useGemini3_1 ?? false;
|
|
335940
|
-
const useGemini31FlashLite = context2.useGemini3_1FlashLite ?? false;
|
|
335941
335914
|
const mainOptions = Object.entries(definitions).filter(([_2, m]) => {
|
|
335942
335915
|
if (m.isVisible !== true)
|
|
335943
335916
|
return false;
|
|
@@ -335971,14 +335944,11 @@ var ModelConfigService = class _ModelConfigService {
|
|
|
335971
335944
|
return false;
|
|
335972
335945
|
if (id === PREVIEW_GEMINI_3_1_MODEL && !useGemini31)
|
|
335973
335946
|
return false;
|
|
335974
|
-
if (id === PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL && !useGemini31FlashLite)
|
|
335975
|
-
return false;
|
|
335976
335947
|
return true;
|
|
335977
335948
|
}).map(([id, m]) => {
|
|
335978
335949
|
const resolvedId = this.resolveModelId(id, context2);
|
|
335979
335950
|
const titleId = this.resolveModelId(id, {
|
|
335980
|
-
useGemini3_1: useGemini31
|
|
335981
|
-
useGemini3_1FlashLite: useGemini31FlashLite
|
|
335951
|
+
useGemini3_1: useGemini31
|
|
335982
335952
|
});
|
|
335983
335953
|
return {
|
|
335984
335954
|
modelId: resolvedId,
|
|
@@ -340021,6 +339991,86 @@ var stressTestProfile = {
|
|
|
340021
339991
|
buildPipelines: generalistProfile.buildPipelines,
|
|
340022
339992
|
buildAsyncPipelines: generalistProfile.buildAsyncPipelines
|
|
340023
339993
|
};
|
|
339994
|
+
var powerUserProfile = {
|
|
339995
|
+
name: "Power User (Experimental)",
|
|
339996
|
+
sentinels: generalistProfile.sentinels,
|
|
339997
|
+
config: {
|
|
339998
|
+
budget: {
|
|
339999
|
+
retainedTokens: 65e3,
|
|
340000
|
+
normalizedTokens: 1e5,
|
|
340001
|
+
maxTokens: 15e4,
|
|
340002
|
+
coalescingThresholdTokens: 5e3
|
|
340003
|
+
},
|
|
340004
|
+
gcStrategy: "incremental"
|
|
340005
|
+
},
|
|
340006
|
+
buildPipelines: (env2, config2) => [
|
|
340007
|
+
{
|
|
340008
|
+
name: "Immediate Sanitization",
|
|
340009
|
+
triggers: ["new_message"],
|
|
340010
|
+
processors: [
|
|
340011
|
+
createToolMaskingProcessor("ToolMasking", env2, resolveProcessorOptions(config2, "ToolMasking", {
|
|
340012
|
+
stringLengthThresholdTokens: 8e3
|
|
340013
|
+
})),
|
|
340014
|
+
createBlobDegradationProcessor("BlobDegradation", env2),
|
|
340015
|
+
createNodeDistillationProcessor("ImmediateNodeDistillation", env2, resolveProcessorOptions(config2, "ImmediateNodeDistillation", {
|
|
340016
|
+
nodeThresholdTokens: 15e3
|
|
340017
|
+
}))
|
|
340018
|
+
]
|
|
340019
|
+
},
|
|
340020
|
+
{
|
|
340021
|
+
name: "Normalization",
|
|
340022
|
+
triggers: ["retained_exceeded"],
|
|
340023
|
+
processors: [
|
|
340024
|
+
createNodeDistillationProcessor("NodeDistillation", env2, resolveProcessorOptions(config2, "NodeDistillation", {
|
|
340025
|
+
nodeThresholdTokens: 3e3
|
|
340026
|
+
})),
|
|
340027
|
+
createNodeTruncationProcessor("NodeTruncation", env2, resolveProcessorOptions(config2, "NodeTruncation", {
|
|
340028
|
+
maxTokensPerNode: 4e3
|
|
340029
|
+
}))
|
|
340030
|
+
]
|
|
340031
|
+
},
|
|
340032
|
+
{
|
|
340033
|
+
name: "Archiving",
|
|
340034
|
+
triggers: ["normalized_exceeded"],
|
|
340035
|
+
processors: [
|
|
340036
|
+
createNodeDistillationProcessor("ArchiveNodeDistillation", env2, resolveProcessorOptions(config2, "ArchiveNodeDistillation", {
|
|
340037
|
+
nodeThresholdTokens: 1e3
|
|
340038
|
+
})),
|
|
340039
|
+
createNodeTruncationProcessor("ArchiveNodeTruncation", env2, resolveProcessorOptions(config2, "ArchiveNodeTruncation", {
|
|
340040
|
+
maxTokensPerNode: 1500
|
|
340041
|
+
}))
|
|
340042
|
+
]
|
|
340043
|
+
},
|
|
340044
|
+
{
|
|
340045
|
+
name: "Emergency Backstop",
|
|
340046
|
+
triggers: ["gc_backstop"],
|
|
340047
|
+
processors: [
|
|
340048
|
+
createStateSnapshotProcessor("StateSnapshotSync", env2, resolveProcessorOptions(config2, "StateSnapshotSync", {
|
|
340049
|
+
target: "max",
|
|
340050
|
+
maxStateTokens: 2e3,
|
|
340051
|
+
maxSummaryTurns: 10
|
|
340052
|
+
})),
|
|
340053
|
+
// If we STILL exceed max tokens, aggressively truncate
|
|
340054
|
+
createNodeTruncationProcessor("EmergencyNodeTruncation", env2, resolveProcessorOptions(config2, "EmergencyNodeTruncation", {
|
|
340055
|
+
maxTokensPerNode: 500
|
|
340056
|
+
}))
|
|
340057
|
+
]
|
|
340058
|
+
}
|
|
340059
|
+
],
|
|
340060
|
+
buildAsyncPipelines: (env2, config2) => [
|
|
340061
|
+
{
|
|
340062
|
+
name: "Async Background GC",
|
|
340063
|
+
triggers: ["nodes_aged_out"],
|
|
340064
|
+
processors: [
|
|
340065
|
+
createStateSnapshotAsyncProcessor("StateSnapshotAsync", env2, resolveProcessorOptions(config2, "StateSnapshotAsync", {
|
|
340066
|
+
type: "accumulate",
|
|
340067
|
+
maxStateTokens: 4e3,
|
|
340068
|
+
maxSummaryTurns: 5
|
|
340069
|
+
}))
|
|
340070
|
+
]
|
|
340071
|
+
}
|
|
340072
|
+
]
|
|
340073
|
+
};
|
|
340024
340074
|
|
|
340025
340075
|
// packages/core/dist/src/context/config/schema.js
|
|
340026
340076
|
function getContextManagementConfigSchema(registry2) {
|
|
@@ -340093,6 +340143,9 @@ async function loadContextManagementConfig(sidecarPath, registry2) {
|
|
|
340093
340143
|
if (sidecarPath === "stressTestProfile") {
|
|
340094
340144
|
return stressTestProfile;
|
|
340095
340145
|
}
|
|
340146
|
+
if (sidecarPath === "powerUserProfile") {
|
|
340147
|
+
return powerUserProfile;
|
|
340148
|
+
}
|
|
340096
340149
|
if (sidecarPath === "generalistProfile") {
|
|
340097
340150
|
return generalistProfile;
|
|
340098
340151
|
}
|
|
@@ -340202,6 +340255,12 @@ var ContextEventBus = class extends EventEmitter5 {
|
|
|
340202
340255
|
onConsolidationNeeded(listener) {
|
|
340203
340256
|
this.on("BUDGET_RETAINED_CROSSED", listener);
|
|
340204
340257
|
}
|
|
340258
|
+
emitNormalizeNeeded(event) {
|
|
340259
|
+
this.emit("BUDGET_NORMALIZED_CROSSED", event);
|
|
340260
|
+
}
|
|
340261
|
+
onNormalizeNeeded(listener) {
|
|
340262
|
+
this.on("BUDGET_NORMALIZED_CROSSED", listener);
|
|
340263
|
+
}
|
|
340205
340264
|
emitProcessorResult(event) {
|
|
340206
340265
|
this.emit("PROCESSOR_RESULT", event);
|
|
340207
340266
|
}
|
|
@@ -340339,13 +340398,13 @@ var ContextGraphBuilder = class {
|
|
|
340339
340398
|
const msg = turn.content;
|
|
340340
340399
|
if (!msg.parts)
|
|
340341
340400
|
continue;
|
|
340342
|
-
const
|
|
340401
|
+
const hasEnvHeader = msg.parts?.some((p2) => isTextPart3(p2) && p2.text.trim().startsWith("<session_context>"));
|
|
340402
|
+
const turnSalt = hasEnvHeader && turnIdx === 0 ? deriveStableId(["environment-context"]) : turn.id;
|
|
340343
340403
|
const turnId = turnSalt.startsWith("turn_") ? turnSalt : `turn_${turnSalt}`;
|
|
340344
340404
|
if (msg.role === "user") {
|
|
340345
340405
|
for (let partIdx = 0; partIdx < msg.parts.length; partIdx++) {
|
|
340346
340406
|
const part = msg.parts[partIdx];
|
|
340347
|
-
|
|
340348
|
-
if (isTextPart3(part) && part.text.trim().startsWith("<session_context>") && turnSalt !== envTurnId) {
|
|
340407
|
+
if (isTextPart3(part) && part.text.trim().startsWith("<session_context>") && turnIdx > 0) {
|
|
340349
340408
|
debugLogger.log("[ContextGraphBuilder] Skipping legacy environment header turn from graph.");
|
|
340350
340409
|
continue;
|
|
340351
340410
|
}
|
|
@@ -340745,13 +340804,13 @@ var PipelineOrchestrator = class {
|
|
|
340745
340804
|
isNodeAllowed(node, triggerTargets, protectedTurnIds = /* @__PURE__ */ new Set()) {
|
|
340746
340805
|
return triggerTargets.has(node.id) && !protectedTurnIds.has(node.id) && !protectedTurnIds.has(node.turnId);
|
|
340747
340806
|
}
|
|
340748
|
-
async executeTriggerSync(trigger,
|
|
340807
|
+
async executeTriggerSync(trigger, buffer, triggerTargets, protectedTurnIds = /* @__PURE__ */ new Set()) {
|
|
340749
340808
|
this.tracer.logEvent("Orchestrator", "Strategy Intent", {
|
|
340750
340809
|
trigger,
|
|
340751
|
-
totalNodes: nodes.length,
|
|
340810
|
+
totalNodes: buffer.nodes.length,
|
|
340752
340811
|
targetNodes: triggerTargets.size
|
|
340753
340812
|
});
|
|
340754
|
-
let currentBuffer =
|
|
340813
|
+
let currentBuffer = buffer;
|
|
340755
340814
|
const triggerPipelines = this.pipelines.filter((p2) => p2.triggers.includes(trigger));
|
|
340756
340815
|
const inboxSnapshot = new InboxSnapshotImpl(this.env.inbox.getMessages() || []);
|
|
340757
340816
|
for (const pipeline of triggerPipelines) {
|
|
@@ -340786,7 +340845,7 @@ var PipelineOrchestrator = class {
|
|
|
340786
340845
|
}
|
|
340787
340846
|
void this.executeTriggerAsync(trigger, currentBuffer.nodes, triggerTargets);
|
|
340788
340847
|
this.env.inbox.drainConsumed(inboxSnapshot.getConsumedIds());
|
|
340789
|
-
return currentBuffer
|
|
340848
|
+
return currentBuffer;
|
|
340790
340849
|
}
|
|
340791
340850
|
async executeTriggerAsync(trigger, nodes, triggerTargets) {
|
|
340792
340851
|
const asyncPipelines = this.asyncPipelines.filter((p2) => p2.triggers.includes(trigger));
|
|
@@ -340950,7 +341009,15 @@ async function render2(nodes, orchestrator, sidecar, tracer, env2, advancedToken
|
|
|
340950
341009
|
const nodeTokens = env2.tokenCalculator.calculateConcreteListTokens([node]);
|
|
340951
341010
|
rollingTokens += nodeTokens;
|
|
340952
341011
|
if (priorTokens > sidecar.config.budget.retainedTokens) {
|
|
340953
|
-
|
|
341012
|
+
if (sidecar.config.gcStrategy === "incremental") {
|
|
341013
|
+
if (priorTokens > maxTokens) {
|
|
341014
|
+
agedOutNodes.add(node.id);
|
|
341015
|
+
} else if (rollingTokens > maxTokens) {
|
|
341016
|
+
agedOutNodes.add(node.id);
|
|
341017
|
+
}
|
|
341018
|
+
} else {
|
|
341019
|
+
agedOutNodes.add(node.id);
|
|
341020
|
+
}
|
|
340954
341021
|
}
|
|
340955
341022
|
}
|
|
340956
341023
|
if (lateBindPrompt && lastTurnId) {
|
|
@@ -340960,7 +341027,8 @@ async function render2(nodes, orchestrator, sidecar, tracer, env2, advancedToken
|
|
|
340960
341027
|
}
|
|
340961
341028
|
}
|
|
340962
341029
|
}
|
|
340963
|
-
const
|
|
341030
|
+
const processedBuffer = await orchestrator.executeTriggerSync("gc_backstop", ContextWorkingBufferImpl.initialize(nodes), agedOutNodes, protectedIds);
|
|
341031
|
+
const processedNodes = processedBuffer.nodes;
|
|
340964
341032
|
const skipList = /* @__PURE__ */ new Set();
|
|
340965
341033
|
for (const node of processedNodes) {
|
|
340966
341034
|
if (node.abstractsIds) {
|
|
@@ -341033,6 +341101,7 @@ var ContextManager = class {
|
|
|
341033
341101
|
evaluatedNodeIds = /* @__PURE__ */ new Set();
|
|
341034
341102
|
// Hysteresis tracking to prevent utility call churn
|
|
341035
341103
|
lastTriggeredDeficit = 0;
|
|
341104
|
+
lastTriggeredNormalizeDeficit = 0;
|
|
341036
341105
|
// Cache for Anomaly 3 (Redundant Renders)
|
|
341037
341106
|
lastRenderCache;
|
|
341038
341107
|
hasPerformedHotStart = false;
|
|
@@ -341047,107 +341116,14 @@ var ContextManager = class {
|
|
|
341047
341116
|
this.orchestrator = orchestrator;
|
|
341048
341117
|
this.orchestrator.setNodeProvider(() => this.buffer.nodes);
|
|
341049
341118
|
this.eventBus.onProcessorResult((event) => {
|
|
341050
|
-
const
|
|
341051
|
-
|
|
341052
|
-
|
|
341053
|
-
debugLogger.log(`[ContextManager] Dropping stale processor result from ${event.processorId}. One or more targets were already removed.`);
|
|
341119
|
+
const bufferIds = new Set(this.buffer.nodes.map((n3) => n3.id));
|
|
341120
|
+
if (!event.targets.every((t3) => bufferIds.has(t3.id))) {
|
|
341121
|
+
debugLogger.warn(`[ContextManager] Dropping processor result from ${event.processorId}: targets no longer in buffer.`);
|
|
341054
341122
|
return;
|
|
341055
341123
|
}
|
|
341056
341124
|
this.buffer = this.buffer.applyProcessorResult(event.processorId, event.targets, event.returnedNodes);
|
|
341057
341125
|
});
|
|
341058
341126
|
}
|
|
341059
|
-
/**
|
|
341060
|
-
* Returns a promise that resolves when all currently executing async pipelines have finished.
|
|
341061
|
-
*/
|
|
341062
|
-
async waitForPipelines() {
|
|
341063
|
-
return this.orchestrator.waitForPipelines();
|
|
341064
|
-
}
|
|
341065
|
-
/**
|
|
341066
|
-
* Safely stops background async pipelines and clears event listeners.
|
|
341067
|
-
*/
|
|
341068
|
-
shutdown() {
|
|
341069
|
-
this.orchestrator.shutdown();
|
|
341070
|
-
}
|
|
341071
|
-
/**
|
|
341072
|
-
* Evaluates if the current working buffer exceeds configured budget thresholds,
|
|
341073
|
-
* firing consolidation events if necessary.
|
|
341074
|
-
*/
|
|
341075
|
-
async evaluateTriggers(newNodes) {
|
|
341076
|
-
if (!this.sidecar.config.budget)
|
|
341077
|
-
return;
|
|
341078
|
-
if (newNodes.size > 0) {
|
|
341079
|
-
await this.orchestrator.executeTriggerSync("new_message", this.buffer.nodes, newNodes);
|
|
341080
|
-
}
|
|
341081
|
-
const currentTokens = this.env.tokenCalculator.calculateConcreteListTokens(this.buffer.nodes);
|
|
341082
|
-
if (currentTokens > this.sidecar.config.budget.retainedTokens) {
|
|
341083
|
-
const agedOutNodes = /* @__PURE__ */ new Set();
|
|
341084
|
-
let rollingTokens = 0;
|
|
341085
|
-
const protectedIds = this.getProtectedNodeIds(this.buffer.nodes);
|
|
341086
|
-
for (let i4 = this.buffer.nodes.length - 1; i4 >= 0; i4--) {
|
|
341087
|
-
const node = this.buffer.nodes[i4];
|
|
341088
|
-
const priorTokens = rollingTokens;
|
|
341089
|
-
rollingTokens += this.env.tokenCalculator.calculateConcreteListTokens([
|
|
341090
|
-
node
|
|
341091
|
-
]);
|
|
341092
|
-
if (priorTokens > this.sidecar.config.budget.retainedTokens) {
|
|
341093
|
-
if (!protectedIds.has(node.id)) {
|
|
341094
|
-
agedOutNodes.add(node.id);
|
|
341095
|
-
}
|
|
341096
|
-
}
|
|
341097
|
-
}
|
|
341098
|
-
if (agedOutNodes.size > 0) {
|
|
341099
|
-
const targetDeficit = currentTokens - this.sidecar.config.budget.retainedTokens;
|
|
341100
|
-
if (targetDeficit < this.lastTriggeredDeficit) {
|
|
341101
|
-
this.lastTriggeredDeficit = targetDeficit;
|
|
341102
|
-
}
|
|
341103
|
-
const threshold = this.sidecar.config.budget.coalescingThresholdTokens || 0;
|
|
341104
|
-
const growthSinceLast = targetDeficit - this.lastTriggeredDeficit;
|
|
341105
|
-
if (targetDeficit >= threshold && (growthSinceLast >= threshold || this.lastTriggeredDeficit === 0)) {
|
|
341106
|
-
this.lastTriggeredDeficit = targetDeficit;
|
|
341107
|
-
this.env.tokenCalculator.garbageCollectCache(new Set(this.buffer.nodes.map((n3) => n3.id)));
|
|
341108
|
-
await this.orchestrator.executeTriggerSync("nodes_aged_out", this.buffer.nodes, agedOutNodes, new Set(protectedIds.keys()));
|
|
341109
|
-
}
|
|
341110
|
-
} else {
|
|
341111
|
-
this.lastTriggeredDeficit = 0;
|
|
341112
|
-
}
|
|
341113
|
-
}
|
|
341114
|
-
}
|
|
341115
|
-
getProtectedNodeIds(nodes, extraProtectedIds = /* @__PURE__ */ new Set()) {
|
|
341116
|
-
const protectionMap = /* @__PURE__ */ new Map();
|
|
341117
|
-
if (nodes.length === 0)
|
|
341118
|
-
return protectionMap;
|
|
341119
|
-
const lastNode = nodes[nodes.length - 1];
|
|
341120
|
-
const lastTurnId = lastNode.turnId;
|
|
341121
|
-
const envTurnId = `turn_${deriveStableId(["environment-context"])}`;
|
|
341122
|
-
for (const node of nodes) {
|
|
341123
|
-
if (node.turnId === lastTurnId) {
|
|
341124
|
-
protectionMap.set(node.id, "recent_turn");
|
|
341125
|
-
} else if (node.turnId === envTurnId) {
|
|
341126
|
-
protectionMap.set(node.id, "environment_context");
|
|
341127
|
-
}
|
|
341128
|
-
}
|
|
341129
|
-
for (const id of extraProtectedIds) {
|
|
341130
|
-
protectionMap.set(id, "external_active_task");
|
|
341131
|
-
}
|
|
341132
|
-
return protectionMap;
|
|
341133
|
-
}
|
|
341134
|
-
getPristineGraph() {
|
|
341135
|
-
const pristineSet = /* @__PURE__ */ new Map();
|
|
341136
|
-
for (const node of this.buffer.nodes) {
|
|
341137
|
-
const roots = this.buffer.getPristineNodes(node.id);
|
|
341138
|
-
for (const root of roots) {
|
|
341139
|
-
pristineSet.set(root.id, root);
|
|
341140
|
-
}
|
|
341141
|
-
}
|
|
341142
|
-
return Array.from(pristineSet.values()).sort((a2, b2) => a2.timestamp - b2.timestamp);
|
|
341143
|
-
}
|
|
341144
|
-
getNodes() {
|
|
341145
|
-
return [...this.buffer.nodes];
|
|
341146
|
-
}
|
|
341147
|
-
/**
|
|
341148
|
-
* Generates a virtual view of the pristine graph, substituting in variants
|
|
341149
|
-
* up to the configured token budget.
|
|
341150
|
-
*/
|
|
341151
341127
|
async renderHistory(pendingRequest, activeTaskIds = /* @__PURE__ */ new Set(), abortSignal) {
|
|
341152
341128
|
this.tracer.logEvent("ContextManager", "Starting rendering of LLM context");
|
|
341153
341129
|
const currentHistory = this.chatHistory.get();
|
|
@@ -341162,11 +341138,12 @@ var ContextManager = class {
|
|
|
341162
341138
|
}
|
|
341163
341139
|
let previewNodes = [];
|
|
341164
341140
|
if (pendingRequest) {
|
|
341165
|
-
|
|
341166
|
-
const previewNodeIds2 = new Set(
|
|
341167
|
-
|
|
341141
|
+
const syncedNodes = this.env.graphMapper.sync([pendingRequest]);
|
|
341142
|
+
const previewNodeIds2 = new Set(syncedNodes.map((n3) => n3.id));
|
|
341143
|
+
const previewBuffer = ContextWorkingBufferImpl.initialize(syncedNodes);
|
|
341144
|
+
const processedPreviewBuffer = await this.orchestrator.executeTriggerSync("new_message", previewBuffer, previewNodeIds2);
|
|
341145
|
+
previewNodes = processedPreviewBuffer.nodes;
|
|
341168
341146
|
}
|
|
341169
|
-
await this.evaluateTriggers(newPrimalNodes);
|
|
341170
341147
|
const hotStartPromise = (async () => {
|
|
341171
341148
|
if (!this.hasPerformedHotStart) {
|
|
341172
341149
|
this.hasPerformedHotStart = true;
|
|
@@ -341180,17 +341157,20 @@ var ContextManager = class {
|
|
|
341180
341157
|
let nodes = this.buffer.nodes;
|
|
341181
341158
|
const previewNodeIds = /* @__PURE__ */ new Set();
|
|
341182
341159
|
if (previewNodes.length > 0) {
|
|
341183
|
-
for (const n3 of previewNodes) {
|
|
341184
|
-
previewNodeIds.add(n3.id);
|
|
341185
|
-
}
|
|
341186
341160
|
nodes = [...nodes, ...previewNodes];
|
|
341161
|
+
for (const node of previewNodes) {
|
|
341162
|
+
previewNodeIds.add(node.id);
|
|
341163
|
+
}
|
|
341187
341164
|
}
|
|
341165
|
+
await this.evaluateTriggers(nodes, newPrimalNodes, activeTaskIds);
|
|
341166
|
+
nodes = [...this.buffer.nodes, ...previewNodes];
|
|
341188
341167
|
const header = this.headerProvider ? await this.headerProvider() : void 0;
|
|
341189
|
-
const
|
|
341190
|
-
|
|
341191
|
-
|
|
341192
|
-
|
|
341193
|
-
|
|
341168
|
+
const nodesHash = deriveStableId([
|
|
341169
|
+
...nodes.map((n3) => n3.id),
|
|
341170
|
+
header ? JSON.stringify(header.parts) : "no-header"
|
|
341171
|
+
]);
|
|
341172
|
+
if (this.lastRenderCache?.nodesHash === nodesHash) {
|
|
341173
|
+
this.tracer.logEvent("ContextManager", "Render Cache Hit", { nodesHash });
|
|
341194
341174
|
return this.lastRenderCache.result;
|
|
341195
341175
|
}
|
|
341196
341176
|
const protectionReasons = this.getProtectedNodeIds(nodes, activeTaskIds);
|
|
@@ -341201,41 +341181,168 @@ var ContextManager = class {
|
|
|
341201
341181
|
});
|
|
341202
341182
|
const { history: renderedHistory, pendingHistory, didApplyManagement, baseUnits, processedNodes } = renderResult;
|
|
341203
341183
|
if (didApplyManagement) {
|
|
341204
|
-
|
|
341184
|
+
const masterIdsInResult = new Set(this.buffer.nodes.map((n3) => n3.id));
|
|
341185
|
+
const processedMasterNodes = processedNodes.filter((n3) => !previewNodeIds.has(n3.id) || masterIdsInResult.has(n3.id));
|
|
341186
|
+
this.buffer = this.buffer.applyProcessorResult("sync_backstop", this.buffer.nodes, processedMasterNodes);
|
|
341205
341187
|
}
|
|
341206
341188
|
checkContextInvariants(this.buffer.nodes, "RenderHistory");
|
|
341207
|
-
|
|
341208
|
-
const
|
|
341209
|
-
const hardenedAllHistory = hardenHistory(allHistory, {
|
|
341189
|
+
const fullHistoryToHarden = [...renderedHistory, ...pendingHistory];
|
|
341190
|
+
const hardenedFullHistory = hardenHistory(fullHistoryToHarden, {
|
|
341210
341191
|
sentinels: this.sidecar.sentinels
|
|
341211
341192
|
});
|
|
341212
|
-
const
|
|
341213
|
-
|
|
341214
|
-
|
|
341215
|
-
|
|
341216
|
-
|
|
341217
|
-
|
|
341193
|
+
const envContextId = deriveStableId(["environment-context"]);
|
|
341194
|
+
const pendingIds = new Set(pendingHistory.map((t3) => t3.id));
|
|
341195
|
+
const resultHistory = [];
|
|
341196
|
+
const resultPending = [];
|
|
341197
|
+
let foundPending = false;
|
|
341198
|
+
for (const turn of hardenedFullHistory) {
|
|
341199
|
+
if (!foundPending && (pendingIds.has(turn.id) || turn.id.startsWith("turn_") && pendingIds.has(turn.id.substring(5))) && turn.id !== envContextId && turn.id !== `turn_${envContextId}`) {
|
|
341200
|
+
foundPending = true;
|
|
341201
|
+
}
|
|
341202
|
+
if (foundPending) {
|
|
341203
|
+
resultPending.push(turn);
|
|
341204
|
+
} else {
|
|
341205
|
+
resultHistory.push(turn);
|
|
341218
341206
|
}
|
|
341219
341207
|
}
|
|
341220
|
-
const apiHistory = hardenedAllHistory.slice(0, splitIndex).map((h3) => h3.content);
|
|
341221
|
-
const pendingApiHistory = hardenedAllHistory.slice(splitIndex).map((h3) => h3.content);
|
|
341222
|
-
if (header) {
|
|
341223
|
-
apiHistory.unshift(header);
|
|
341224
|
-
}
|
|
341225
341208
|
const result2 = {
|
|
341226
341209
|
history: renderedHistory,
|
|
341227
|
-
apiHistory,
|
|
341228
|
-
pendingApiHistory,
|
|
341210
|
+
apiHistory: resultHistory.map((h3) => h3.content),
|
|
341211
|
+
pendingApiHistory: resultPending.map((h3) => h3.content),
|
|
341229
341212
|
didApplyManagement,
|
|
341230
341213
|
baseUnits,
|
|
341231
341214
|
processedNodes
|
|
341232
341215
|
};
|
|
341233
|
-
|
|
341234
|
-
|
|
341235
|
-
|
|
341236
|
-
};
|
|
341216
|
+
if (header) {
|
|
341217
|
+
result2.apiHistory.unshift(header);
|
|
341218
|
+
}
|
|
341219
|
+
this.lastRenderCache = { nodesHash, result: result2 };
|
|
341220
|
+
this.tracer.logEvent("ContextManager", "Rendering Complete", {
|
|
341221
|
+
historySize: renderedHistory.length,
|
|
341222
|
+
pendingSize: pendingHistory.length,
|
|
341223
|
+
didApplyManagement
|
|
341224
|
+
});
|
|
341237
341225
|
return result2;
|
|
341238
341226
|
}
|
|
341227
|
+
async waitForPipelines() {
|
|
341228
|
+
await this.orchestrator.waitForPipelines();
|
|
341229
|
+
}
|
|
341230
|
+
shutdown() {
|
|
341231
|
+
this.orchestrator.shutdown();
|
|
341232
|
+
}
|
|
341233
|
+
getNodes() {
|
|
341234
|
+
return this.buffer.nodes;
|
|
341235
|
+
}
|
|
341236
|
+
getEnvironment() {
|
|
341237
|
+
return this.env;
|
|
341238
|
+
}
|
|
341239
|
+
getPristineGraph() {
|
|
341240
|
+
const pristineSet = /* @__PURE__ */ new Map();
|
|
341241
|
+
for (const node of this.buffer.nodes) {
|
|
341242
|
+
const roots = this.buffer.getPristineNodes(node.id);
|
|
341243
|
+
for (const root of roots) {
|
|
341244
|
+
pristineSet.set(root.id, root);
|
|
341245
|
+
}
|
|
341246
|
+
}
|
|
341247
|
+
return Array.from(pristineSet.values()).sort((a2, b2) => a2.timestamp - b2.timestamp);
|
|
341248
|
+
}
|
|
341249
|
+
async evaluateTriggers(nodes, newPrimalNodes, activeTaskIds) {
|
|
341250
|
+
if (newPrimalNodes.size > 0) {
|
|
341251
|
+
this.buffer = await this.orchestrator.executeTriggerSync("nodes_added", this.buffer, newPrimalNodes);
|
|
341252
|
+
}
|
|
341253
|
+
const bufferIds = new Set(this.buffer.nodes.map((n3) => n3.id));
|
|
341254
|
+
const previewNodes = nodes.filter((n3) => !bufferIds.has(n3.id));
|
|
341255
|
+
const currentNodes = [...this.buffer.nodes, ...previewNodes];
|
|
341256
|
+
const currentTokens = this.env.tokenCalculator.calculateConcreteListTokens(currentNodes);
|
|
341257
|
+
if (currentTokens > this.sidecar.config.budget.retainedTokens) {
|
|
341258
|
+
const agedOutRetainedNodes = /* @__PURE__ */ new Set();
|
|
341259
|
+
const agedOutNormalizedNodes = /* @__PURE__ */ new Set();
|
|
341260
|
+
const protectionMap = this.getProtectedNodeIds(currentNodes, activeTaskIds);
|
|
341261
|
+
const protectedIds = new Set(protectionMap.keys());
|
|
341262
|
+
const envTurnId = `turn_${deriveStableId(["environment-context"])}`;
|
|
341263
|
+
const turn0Nodes = currentNodes.filter((n3) => n3.turnId === envTurnId);
|
|
341264
|
+
for (const n3 of turn0Nodes) {
|
|
341265
|
+
protectedIds.add(n3.id);
|
|
341266
|
+
}
|
|
341267
|
+
let rollingTokens = 0;
|
|
341268
|
+
for (let i4 = currentNodes.length - 1; i4 >= 0; i4--) {
|
|
341269
|
+
const node = currentNodes[i4];
|
|
341270
|
+
const priorTokens = rollingTokens;
|
|
341271
|
+
rollingTokens += this.env.tokenCalculator.calculateConcreteListTokens([
|
|
341272
|
+
node
|
|
341273
|
+
]);
|
|
341274
|
+
if (priorTokens > this.sidecar.config.budget.retainedTokens) {
|
|
341275
|
+
if (!protectedIds.has(node.id)) {
|
|
341276
|
+
const hasNormalizedTier = this.sidecar.config.budget.normalizedTokens !== void 0;
|
|
341277
|
+
if (!hasNormalizedTier || priorTokens <= this.sidecar.config.budget.normalizedTokens) {
|
|
341278
|
+
agedOutRetainedNodes.add(node.id);
|
|
341279
|
+
}
|
|
341280
|
+
if (hasNormalizedTier && priorTokens > this.sidecar.config.budget.normalizedTokens) {
|
|
341281
|
+
agedOutNormalizedNodes.add(node.id);
|
|
341282
|
+
}
|
|
341283
|
+
}
|
|
341284
|
+
}
|
|
341285
|
+
}
|
|
341286
|
+
if (agedOutRetainedNodes.size > 0) {
|
|
341287
|
+
const targetDeficit = currentTokens - this.sidecar.config.budget.retainedTokens;
|
|
341288
|
+
const threshold = this.sidecar.config.budget.coalescingThresholdTokens || 0;
|
|
341289
|
+
if (targetDeficit < this.lastTriggeredDeficit) {
|
|
341290
|
+
this.lastTriggeredDeficit = targetDeficit;
|
|
341291
|
+
}
|
|
341292
|
+
if (targetDeficit > this.lastTriggeredDeficit + threshold) {
|
|
341293
|
+
this.lastTriggeredDeficit = targetDeficit;
|
|
341294
|
+
this.eventBus.emitConsolidationNeeded({
|
|
341295
|
+
nodes: this.buffer.nodes,
|
|
341296
|
+
targetDeficit,
|
|
341297
|
+
targetNodeIds: agedOutRetainedNodes
|
|
341298
|
+
});
|
|
341299
|
+
this.env.tokenCalculator.garbageCollectCache(new Set(this.buffer.nodes.map((n3) => n3.id)));
|
|
341300
|
+
this.buffer = await this.orchestrator.executeTriggerSync("nodes_aged_out", this.buffer, agedOutRetainedNodes, protectedIds);
|
|
341301
|
+
}
|
|
341302
|
+
} else {
|
|
341303
|
+
this.lastTriggeredDeficit = 0;
|
|
341304
|
+
}
|
|
341305
|
+
if (agedOutNormalizedNodes.size > 0) {
|
|
341306
|
+
const targetDeficit = currentTokens - this.sidecar.config.budget.normalizedTokens;
|
|
341307
|
+
const threshold = this.sidecar.config.budget.coalescingThresholdTokens || 0;
|
|
341308
|
+
if (targetDeficit < this.lastTriggeredNormalizeDeficit) {
|
|
341309
|
+
this.lastTriggeredNormalizeDeficit = targetDeficit;
|
|
341310
|
+
}
|
|
341311
|
+
if (targetDeficit > this.lastTriggeredNormalizeDeficit + threshold) {
|
|
341312
|
+
this.lastTriggeredNormalizeDeficit = targetDeficit;
|
|
341313
|
+
this.eventBus.emitNormalizeNeeded({
|
|
341314
|
+
nodes: this.buffer.nodes,
|
|
341315
|
+
targetDeficit,
|
|
341316
|
+
targetNodeIds: agedOutNormalizedNodes
|
|
341317
|
+
});
|
|
341318
|
+
this.buffer = await this.orchestrator.executeTriggerSync("normalized_exceeded", this.buffer, agedOutNormalizedNodes, protectedIds);
|
|
341319
|
+
}
|
|
341320
|
+
} else {
|
|
341321
|
+
this.lastTriggeredNormalizeDeficit = 0;
|
|
341322
|
+
}
|
|
341323
|
+
}
|
|
341324
|
+
}
|
|
341325
|
+
getProtectedNodeIds(nodes, extraProtectedIds = /* @__PURE__ */ new Set()) {
|
|
341326
|
+
const protectionMap = /* @__PURE__ */ new Map();
|
|
341327
|
+
if (nodes.length === 0)
|
|
341328
|
+
return protectionMap;
|
|
341329
|
+
const lastNode = nodes[nodes.length - 1];
|
|
341330
|
+
const lastTurnId = lastNode.turnId;
|
|
341331
|
+
const envContextId = deriveStableId(["environment-context"]);
|
|
341332
|
+
const envContextTurnId = `turn_${envContextId}`;
|
|
341333
|
+
for (const node of nodes) {
|
|
341334
|
+
if (node.turnId === envContextTurnId || node.turnId === envContextId) {
|
|
341335
|
+
protectionMap.set(node.id, "environment_context");
|
|
341336
|
+
}
|
|
341337
|
+
if (node.turnId === lastTurnId) {
|
|
341338
|
+
protectionMap.set(node.id, "recent_turn");
|
|
341339
|
+
}
|
|
341340
|
+
}
|
|
341341
|
+
for (const id of extraProtectedIds) {
|
|
341342
|
+
protectionMap.set(id, "external_active_task");
|
|
341343
|
+
}
|
|
341344
|
+
return protectionMap;
|
|
341345
|
+
}
|
|
341239
341346
|
async performHotStartCalibration(nodes, abortSignal) {
|
|
341240
341347
|
const history = this.env.graphMapper.fromGraph(nodes);
|
|
341241
341348
|
const contents = history.map((h3) => h3.content);
|
|
@@ -341255,9 +341362,6 @@ var ContextManager = class {
|
|
|
341255
341362
|
debugLogger.warn("[ContextManager] Hot start calibration failed", e2);
|
|
341256
341363
|
}
|
|
341257
341364
|
}
|
|
341258
|
-
getEnvironment() {
|
|
341259
|
-
return this.env;
|
|
341260
|
-
}
|
|
341261
341365
|
};
|
|
341262
341366
|
|
|
341263
341367
|
// packages/core/dist/src/context/processors/historyTruncationProcessor.js
|
|
@@ -342054,7 +342158,7 @@ var GeminiClient = class {
|
|
|
342054
342158
|
if (this.currentSequenceModel) {
|
|
342055
342159
|
return this.currentSequenceModel;
|
|
342056
342160
|
}
|
|
342057
|
-
return resolveModel(this.config.getActiveModel(), this.config.getGemini31LaunchedSync?.() ?? false,
|
|
342161
|
+
return resolveModel(this.config.getActiveModel(), this.config.getGemini31LaunchedSync?.() ?? false, false, this.config.getHasAccessToPreviewModel?.() ?? true, this.config);
|
|
342058
342162
|
}
|
|
342059
342163
|
async *processTurn(request, signal, prompt_id, boundedTurns, displayContent) {
|
|
342060
342164
|
let turn = new Turn(this.getChat(), prompt_id);
|
|
@@ -343226,6 +343330,9 @@ var Scheduler = class {
|
|
|
343226
343330
|
return false;
|
|
343227
343331
|
}
|
|
343228
343332
|
_isParallelizable(request) {
|
|
343333
|
+
if (request.name === UPDATE_TOPIC_TOOL_NAME) {
|
|
343334
|
+
return false;
|
|
343335
|
+
}
|
|
343229
343336
|
if (request.args) {
|
|
343230
343337
|
const wait = request.args["wait_for_previous"];
|
|
343231
343338
|
if (typeof wait === "boolean") {
|
|
@@ -355547,13 +355654,12 @@ ${formattedHistory}
|
|
|
355547
355654
|
const routerResponse = ClassifierResponseSchema.parse(jsonResponse);
|
|
355548
355655
|
const reasoning = routerResponse.reasoning;
|
|
355549
355656
|
const latencyMs = Date.now() - startTime;
|
|
355550
|
-
const [useGemini3_1,
|
|
355657
|
+
const [useGemini3_1, useCustomToolModel, hasAccessToPreview] = await Promise.all([
|
|
355551
355658
|
config2.getGemini31Launched(),
|
|
355552
|
-
config2.getGemini31FlashLiteLaunched(),
|
|
355553
355659
|
config2.getUseCustomToolModel(),
|
|
355554
|
-
config2.getHasAccessToPreviewModel
|
|
355660
|
+
config2.getHasAccessToPreviewModel()
|
|
355555
355661
|
]);
|
|
355556
|
-
const selectedModel = resolveClassifierModel(context2.requestedModel ?? config2.getModel(), routerResponse.model_choice, useGemini3_1,
|
|
355662
|
+
const selectedModel = resolveClassifierModel(context2.requestedModel ?? config2.getModel(), routerResponse.model_choice, useGemini3_1, useCustomToolModel, hasAccessToPreview, config2);
|
|
355557
355663
|
return {
|
|
355558
355664
|
model: selectedModel,
|
|
355559
355665
|
metadata: {
|
|
@@ -355573,7 +355679,7 @@ ${formattedHistory}
|
|
|
355573
355679
|
var DefaultStrategy = class {
|
|
355574
355680
|
name = "default";
|
|
355575
355681
|
async route(_context, config2, _baseLlmClient, _localLiteRtLmClient) {
|
|
355576
|
-
const defaultModel = resolveModel(config2.getModel(), config2.getGemini31LaunchedSync?.() ?? false,
|
|
355682
|
+
const defaultModel = resolveModel(config2.getModel(), config2.getGemini31LaunchedSync?.() ?? false, false, config2.getHasAccessToPreviewModel?.() ?? true, config2);
|
|
355577
355683
|
return {
|
|
355578
355684
|
model: defaultModel,
|
|
355579
355685
|
metadata: {
|
|
@@ -355690,6 +355796,10 @@ var ClassifierStrategy = class {
|
|
|
355690
355796
|
if (await config2.getNumericalRoutingEnabled() && isGemini3Model(model, config2)) {
|
|
355691
355797
|
return null;
|
|
355692
355798
|
}
|
|
355799
|
+
if (isFunctionResponse(createUserContent(context2.request))) {
|
|
355800
|
+
debugLogger.log("[Routing] Bypassing Classifier: request is FunctionResponse.");
|
|
355801
|
+
return null;
|
|
355802
|
+
}
|
|
355693
355803
|
const promptId = getPromptIdWithFallback("classifier-router");
|
|
355694
355804
|
const historySlice = context2.history.slice(-HISTORY_SEARCH_WINDOW2);
|
|
355695
355805
|
const cleanHistory = historySlice.filter((content) => !isFunctionCall(content) && !isFunctionResponse(content));
|
|
@@ -355706,12 +355816,11 @@ var ClassifierStrategy = class {
|
|
|
355706
355816
|
const routerResponse = ClassifierResponseSchema2.parse(jsonResponse);
|
|
355707
355817
|
const reasoning = routerResponse.reasoning;
|
|
355708
355818
|
const latencyMs = Date.now() - startTime;
|
|
355709
|
-
const [useGemini3_1,
|
|
355819
|
+
const [useGemini3_1, useCustomToolModel] = await Promise.all([
|
|
355710
355820
|
config2.getGemini31Launched(),
|
|
355711
|
-
config2.getGemini31FlashLiteLaunched(),
|
|
355712
355821
|
config2.getUseCustomToolModel()
|
|
355713
355822
|
]);
|
|
355714
|
-
const selectedModel = normalizeModelId(resolveClassifierModel(normalizeModelId(model), routerResponse.model_choice, useGemini3_1,
|
|
355823
|
+
const selectedModel = normalizeModelId(resolveClassifierModel(normalizeModelId(model), routerResponse.model_choice, useGemini3_1, useCustomToolModel, config2.getHasAccessToPreviewModel?.() ?? true, config2));
|
|
355715
355824
|
const service = config2.getModelAvailabilityService();
|
|
355716
355825
|
const snapshot = service.snapshot(selectedModel);
|
|
355717
355826
|
if (!snapshot.available) {
|
|
@@ -355825,6 +355934,10 @@ var NumericalClassifierStrategy = class {
|
|
|
355825
355934
|
}
|
|
355826
355935
|
const finalHistory = firstTextIndex === -1 ? [] : candidateSlice.slice(firstTextIndex);
|
|
355827
355936
|
const requestParts = Array.isArray(context2.request) ? context2.request : [context2.request];
|
|
355937
|
+
if (finalHistory.length === 0 && isFunctionResponse(createUserContent(context2.request))) {
|
|
355938
|
+
debugLogger.log("[Routing] Bypassing NumericalClassifier: request is FunctionResponse but history is empty after slicing.");
|
|
355939
|
+
return null;
|
|
355940
|
+
}
|
|
355828
355941
|
const sanitizedRequest = requestParts.map((part) => {
|
|
355829
355942
|
if (typeof part === "string") {
|
|
355830
355943
|
return { text: part };
|
|
@@ -355846,12 +355959,11 @@ var NumericalClassifierStrategy = class {
|
|
|
355846
355959
|
const routerResponse = ClassifierResponseSchema3.parse(jsonResponse);
|
|
355847
355960
|
const score = routerResponse.complexity_score;
|
|
355848
355961
|
const { threshold, groupLabel, modelAlias } = await this.getRoutingDecision(score, config2);
|
|
355849
|
-
const [useGemini3_1,
|
|
355962
|
+
const [useGemini3_1, useCustomToolModel] = await Promise.all([
|
|
355850
355963
|
config2.getGemini31Launched(),
|
|
355851
|
-
config2.getGemini31FlashLiteLaunched(),
|
|
355852
355964
|
config2.getUseCustomToolModel()
|
|
355853
355965
|
]);
|
|
355854
|
-
const selectedModel = normalizeModelId(resolveClassifierModel(normalizeModelId(model), modelAlias, useGemini3_1,
|
|
355966
|
+
const selectedModel = normalizeModelId(resolveClassifierModel(normalizeModelId(model), modelAlias, useGemini3_1, useCustomToolModel, config2.getHasAccessToPreviewModel?.() ?? true, config2));
|
|
355855
355967
|
const service = config2.getModelAvailabilityService();
|
|
355856
355968
|
const snapshot = service.snapshot(selectedModel);
|
|
355857
355969
|
if (!snapshot.available) {
|
|
@@ -355945,7 +356057,7 @@ var FallbackStrategy = class {
|
|
|
355945
356057
|
name = "fallback";
|
|
355946
356058
|
async route(context2, config2, _baseLlmClient, _localLiteRtLmClient) {
|
|
355947
356059
|
const requestedModel = context2.requestedModel ?? config2.getModel();
|
|
355948
|
-
const resolvedModel = resolveModel(requestedModel, config2.getGemini31LaunchedSync?.() ?? false,
|
|
356060
|
+
const resolvedModel = resolveModel(requestedModel, config2.getGemini31LaunchedSync?.() ?? false, false, config2.getHasAccessToPreviewModel?.() ?? true, config2);
|
|
355949
356061
|
const service = config2.getModelAvailabilityService();
|
|
355950
356062
|
const snapshot = service.snapshot(resolvedModel);
|
|
355951
356063
|
if (snapshot.available) {
|
|
@@ -355975,7 +356087,7 @@ var OverrideStrategy = class {
|
|
|
355975
356087
|
return null;
|
|
355976
356088
|
}
|
|
355977
356089
|
return {
|
|
355978
|
-
model: resolveModel(overrideModel, config2.getGemini31LaunchedSync?.() ?? false,
|
|
356090
|
+
model: resolveModel(overrideModel, config2.getGemini31LaunchedSync?.() ?? false, false, config2.getHasAccessToPreviewModel?.() ?? true, config2),
|
|
355979
356091
|
metadata: {
|
|
355980
356092
|
source: this.name,
|
|
355981
356093
|
latencyMs: 0,
|
|
@@ -355999,14 +356111,13 @@ var ApprovalModeStrategy = class {
|
|
|
355999
356111
|
const startTime = Date.now();
|
|
356000
356112
|
const approvalMode = config2.getApprovalMode();
|
|
356001
356113
|
const approvedPlanPath = config2.getApprovedPlanPath();
|
|
356002
|
-
const [useGemini3_1,
|
|
356114
|
+
const [useGemini3_1, useCustomToolModel, hasAccessToPreview] = await Promise.all([
|
|
356003
356115
|
config2.getGemini31Launched(),
|
|
356004
|
-
config2.getGemini31FlashLiteLaunched(),
|
|
356005
356116
|
config2.getUseCustomToolModel(),
|
|
356006
356117
|
config2.getHasAccessToPreviewModel()
|
|
356007
356118
|
]);
|
|
356008
356119
|
if (approvalMode === ApprovalMode.PLAN) {
|
|
356009
|
-
const proModel = resolveClassifierModel(model, GEMINI_MODEL_ALIAS_PRO, useGemini3_1,
|
|
356120
|
+
const proModel = resolveClassifierModel(model, GEMINI_MODEL_ALIAS_PRO, useGemini3_1, useCustomToolModel, hasAccessToPreview, config2);
|
|
356010
356121
|
return {
|
|
356011
356122
|
model: proModel,
|
|
356012
356123
|
metadata: {
|
|
@@ -356016,7 +356127,7 @@ var ApprovalModeStrategy = class {
|
|
|
356016
356127
|
}
|
|
356017
356128
|
};
|
|
356018
356129
|
} else if (approvedPlanPath) {
|
|
356019
|
-
const flashModel = resolveClassifierModel(model, GEMINI_MODEL_ALIAS_FLASH, useGemini3_1,
|
|
356130
|
+
const flashModel = resolveClassifierModel(model, GEMINI_MODEL_ALIAS_FLASH, useGemini3_1, useCustomToolModel, hasAccessToPreview, config2);
|
|
356020
356131
|
return {
|
|
356021
356132
|
model: flashModel,
|
|
356022
356133
|
metadata: {
|
|
@@ -356207,6 +356318,12 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356207
356318
|
model: "gemini-2.5-flash-lite"
|
|
356208
356319
|
}
|
|
356209
356320
|
},
|
|
356321
|
+
"gemini-3.1-flash-lite": {
|
|
356322
|
+
extends: "chat-base-3",
|
|
356323
|
+
modelConfig: {
|
|
356324
|
+
model: "gemini-3.1-flash-lite"
|
|
356325
|
+
}
|
|
356326
|
+
},
|
|
356210
356327
|
"gemma-4-31b-it": {
|
|
356211
356328
|
extends: "chat-base-3",
|
|
356212
356329
|
modelConfig: {
|
|
@@ -356235,7 +356352,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356235
356352
|
classifier: {
|
|
356236
356353
|
extends: "base",
|
|
356237
356354
|
modelConfig: {
|
|
356238
|
-
model: "
|
|
356355
|
+
model: "flash-lite",
|
|
356239
356356
|
generateContentConfig: {
|
|
356240
356357
|
maxOutputTokens: 1024,
|
|
356241
356358
|
thinkingConfig: {
|
|
@@ -356247,7 +356364,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356247
356364
|
"prompt-completion": {
|
|
356248
356365
|
extends: "base",
|
|
356249
356366
|
modelConfig: {
|
|
356250
|
-
model: "
|
|
356367
|
+
model: "flash-lite",
|
|
356251
356368
|
generateContentConfig: {
|
|
356252
356369
|
temperature: 0.3,
|
|
356253
356370
|
maxOutputTokens: 16e3,
|
|
@@ -356260,7 +356377,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356260
356377
|
"fast-ack-helper": {
|
|
356261
356378
|
extends: "base",
|
|
356262
356379
|
modelConfig: {
|
|
356263
|
-
model: "
|
|
356380
|
+
model: "flash-lite",
|
|
356264
356381
|
generateContentConfig: {
|
|
356265
356382
|
temperature: 0.2,
|
|
356266
356383
|
maxOutputTokens: 120,
|
|
@@ -356273,7 +356390,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356273
356390
|
"edit-corrector": {
|
|
356274
356391
|
extends: "base",
|
|
356275
356392
|
modelConfig: {
|
|
356276
|
-
model: "
|
|
356393
|
+
model: "flash-lite",
|
|
356277
356394
|
generateContentConfig: {
|
|
356278
356395
|
thinkingConfig: {
|
|
356279
356396
|
thinkingBudget: 0
|
|
@@ -356284,7 +356401,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356284
356401
|
"summarizer-default": {
|
|
356285
356402
|
extends: "base",
|
|
356286
356403
|
modelConfig: {
|
|
356287
|
-
model: "
|
|
356404
|
+
model: "flash-lite",
|
|
356288
356405
|
generateContentConfig: {
|
|
356289
356406
|
maxOutputTokens: 2e3
|
|
356290
356407
|
}
|
|
@@ -356293,7 +356410,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356293
356410
|
"summarizer-shell": {
|
|
356294
356411
|
extends: "base",
|
|
356295
356412
|
modelConfig: {
|
|
356296
|
-
model: "
|
|
356413
|
+
model: "flash-lite",
|
|
356297
356414
|
generateContentConfig: {
|
|
356298
356415
|
maxOutputTokens: 2e3
|
|
356299
356416
|
}
|
|
@@ -356363,7 +356480,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356363
356480
|
},
|
|
356364
356481
|
"chat-compression-3.1-flash-lite": {
|
|
356365
356482
|
modelConfig: {
|
|
356366
|
-
model: "gemini-3.1-flash-lite
|
|
356483
|
+
model: "gemini-3.1-flash-lite"
|
|
356367
356484
|
}
|
|
356368
356485
|
},
|
|
356369
356486
|
"chat-compression-2.5-pro": {
|
|
@@ -356404,10 +356521,10 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356404
356521
|
],
|
|
356405
356522
|
modelDefinitions: {
|
|
356406
356523
|
// Concrete Models
|
|
356407
|
-
"gemini-3.1-flash-lite
|
|
356524
|
+
"gemini-3.1-flash-lite": {
|
|
356408
356525
|
tier: "flash-lite",
|
|
356409
356526
|
family: "gemini-3",
|
|
356410
|
-
isPreview:
|
|
356527
|
+
isPreview: false,
|
|
356411
356528
|
isVisible: true,
|
|
356412
356529
|
features: { thinking: false, multimodalToolUse: true }
|
|
356413
356530
|
},
|
|
@@ -356589,14 +356706,8 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356589
356706
|
}
|
|
356590
356707
|
]
|
|
356591
356708
|
},
|
|
356592
|
-
"gemini-3.1-flash-lite
|
|
356593
|
-
default: "gemini-3.1-flash-lite
|
|
356594
|
-
contexts: [
|
|
356595
|
-
{
|
|
356596
|
-
condition: { useGemini3_1FlashLite: false },
|
|
356597
|
-
target: "gemini-2.5-flash-lite"
|
|
356598
|
-
}
|
|
356599
|
-
]
|
|
356709
|
+
"gemini-3.1-flash-lite": {
|
|
356710
|
+
default: "gemini-3.1-flash-lite"
|
|
356600
356711
|
},
|
|
356601
356712
|
flash: {
|
|
356602
356713
|
default: "gemini-3-flash-preview",
|
|
@@ -356608,13 +356719,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356608
356719
|
]
|
|
356609
356720
|
},
|
|
356610
356721
|
"flash-lite": {
|
|
356611
|
-
default: "gemini-
|
|
356612
|
-
contexts: [
|
|
356613
|
-
{
|
|
356614
|
-
condition: { useGemini3_1FlashLite: true },
|
|
356615
|
-
target: "gemini-3.1-flash-lite-preview"
|
|
356616
|
-
}
|
|
356617
|
-
]
|
|
356722
|
+
default: "gemini-3.1-flash-lite"
|
|
356618
356723
|
},
|
|
356619
356724
|
"auto-gemini-3": {
|
|
356620
356725
|
default: "gemini-3-pro-preview",
|
|
@@ -356811,7 +356916,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
356811
356916
|
],
|
|
356812
356917
|
lite: [
|
|
356813
356918
|
{
|
|
356814
|
-
model: "
|
|
356919
|
+
model: "flash-lite",
|
|
356815
356920
|
actions: {
|
|
356816
356921
|
terminal: "silent",
|
|
356817
356922
|
transient: "silent",
|
|
@@ -359939,7 +360044,6 @@ var ExperimentFlags = {
|
|
|
359939
360044
|
MASKING_PROTECT_LATEST_TURN: 45758819,
|
|
359940
360045
|
GEMINI_3_1_PRO_LAUNCHED: 45760185,
|
|
359941
360046
|
PRO_MODEL_NO_ACCESS: 45768879,
|
|
359942
|
-
GEMINI_3_1_FLASH_LITE_LAUNCHED: 45771641,
|
|
359943
360047
|
DEFAULT_REQUEST_TIMEOUT: 45773134
|
|
359944
360048
|
};
|
|
359945
360049
|
|
|
@@ -374411,7 +374515,7 @@ var Config = class {
|
|
|
374411
374515
|
if (!isAutoModel(model, this)) {
|
|
374412
374516
|
return {};
|
|
374413
374517
|
}
|
|
374414
|
-
const primaryModel = resolveModel(model, this.getGemini31LaunchedSync(), this.
|
|
374518
|
+
const primaryModel = resolveModel(model, this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
|
|
374415
374519
|
const isPreview2 = isPreviewModel(primaryModel, this);
|
|
374416
374520
|
const proModel = primaryModel;
|
|
374417
374521
|
const flashModel = isPreview2 ? PREVIEW_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
@@ -374432,7 +374536,7 @@ var Config = class {
|
|
|
374432
374536
|
if (pooled.remaining !== void 0) {
|
|
374433
374537
|
return pooled.remaining;
|
|
374434
374538
|
}
|
|
374435
|
-
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.
|
|
374539
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
|
|
374436
374540
|
return this.modelQuotas.get(primaryModel)?.remaining;
|
|
374437
374541
|
}
|
|
374438
374542
|
getQuotaLimit() {
|
|
@@ -374440,7 +374544,7 @@ var Config = class {
|
|
|
374440
374544
|
if (pooled.limit !== void 0) {
|
|
374441
374545
|
return pooled.limit;
|
|
374442
374546
|
}
|
|
374443
|
-
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.
|
|
374547
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
|
|
374444
374548
|
return this.modelQuotas.get(primaryModel)?.limit;
|
|
374445
374549
|
}
|
|
374446
374550
|
getQuotaResetTime() {
|
|
@@ -374448,7 +374552,7 @@ var Config = class {
|
|
|
374448
374552
|
if (pooled.resetTime !== void 0) {
|
|
374449
374553
|
return pooled.resetTime;
|
|
374450
374554
|
}
|
|
374451
|
-
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.
|
|
374555
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
|
|
374452
374556
|
return this.modelQuotas.get(primaryModel)?.resetTime;
|
|
374453
374557
|
}
|
|
374454
374558
|
getEmbeddingModel() {
|
|
@@ -375411,14 +375515,6 @@ ${sections.join("\n")}
|
|
|
375411
375515
|
await this.ensureExperimentsLoaded();
|
|
375412
375516
|
return this.getGemini31LaunchedSync();
|
|
375413
375517
|
}
|
|
375414
|
-
/**
|
|
375415
|
-
* Returns whether Gemini 3.1 Flash Lite has been launched.
|
|
375416
|
-
* This method is async and ensures that experiments are loaded before returning the result.
|
|
375417
|
-
*/
|
|
375418
|
-
async getGemini31FlashLiteLaunched() {
|
|
375419
|
-
await this.ensureExperimentsLoaded();
|
|
375420
|
-
return this.getGemini31FlashLiteLaunchedSync();
|
|
375421
|
-
}
|
|
375422
375518
|
/**
|
|
375423
375519
|
* Returns whether the custom tool model should be used.
|
|
375424
375520
|
*/
|
|
@@ -375467,20 +375563,6 @@ ${sections.join("\n")}
|
|
|
375467
375563
|
}
|
|
375468
375564
|
return void 0;
|
|
375469
375565
|
}
|
|
375470
|
-
/**
|
|
375471
|
-
* Returns whether Gemini 3.1 Flash Lite has been launched.
|
|
375472
|
-
*
|
|
375473
|
-
* Note: This method should only be called after startup, once experiments have been loaded.
|
|
375474
|
-
* If you need to call this during startup or from an async context, use
|
|
375475
|
-
* getGemini31FlashLiteLaunched instead.
|
|
375476
|
-
*/
|
|
375477
|
-
getGemini31FlashLiteLaunchedSync() {
|
|
375478
|
-
const authType = this.contentGeneratorConfig?.authType;
|
|
375479
|
-
if (this.isGemini31LaunchedForAuthType(authType)) {
|
|
375480
|
-
return true;
|
|
375481
|
-
}
|
|
375482
|
-
return this.experiments?.flags[ExperimentFlags.GEMINI_3_1_FLASH_LITE_LAUNCHED]?.boolValue ?? false;
|
|
375483
|
-
}
|
|
375484
375566
|
/**
|
|
375485
375567
|
* Returns the client version.
|
|
375486
375568
|
*/
|
|
@@ -392928,8 +393010,6 @@ export {
|
|
|
392928
393010
|
formatTruncatedToolOutput,
|
|
392929
393011
|
TOOL_OUTPUTS_DIR,
|
|
392930
393012
|
saveTruncatedToolOutput,
|
|
392931
|
-
BASH_HUP_GUARD,
|
|
392932
|
-
stripHupGuard,
|
|
392933
393013
|
getCommandName,
|
|
392934
393014
|
extractStringFromParseEntry,
|
|
392935
393015
|
SHELL_TOOL_NAMES,
|
|
@@ -393161,10 +393241,10 @@ export {
|
|
|
393161
393241
|
PREVIEW_GEMINI_3_1_MODEL,
|
|
393162
393242
|
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
|
393163
393243
|
PREVIEW_GEMINI_FLASH_MODEL,
|
|
393164
|
-
PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
|
|
393165
393244
|
DEFAULT_GEMINI_MODEL,
|
|
393166
393245
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
393167
393246
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
393247
|
+
PREVIEW_GEMINI_FLASH_LITE_MODEL,
|
|
393168
393248
|
GEMMA_4_31B_IT_MODEL,
|
|
393169
393249
|
GEMMA_4_26B_A4B_IT_MODEL,
|
|
393170
393250
|
VALID_GEMINI_MODELS,
|