@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
|
@@ -250887,18 +250887,6 @@ async function saveTruncatedToolOutput(content, toolName, id, projectTempDir, se
|
|
|
250887
250887
|
}
|
|
250888
250888
|
|
|
250889
250889
|
// packages/core/src/utils/shell-utils.ts
|
|
250890
|
-
var BASH_HUP_GUARD = `trap '' HUP;`;
|
|
250891
|
-
function stripHupGuard(command) {
|
|
250892
|
-
const trimmed2 = command.trimStart();
|
|
250893
|
-
const prefix = `${BASH_HUP_GUARD} `;
|
|
250894
|
-
if (trimmed2.startsWith(prefix)) {
|
|
250895
|
-
return trimmed2.slice(prefix.length);
|
|
250896
|
-
}
|
|
250897
|
-
if (trimmed2 === BASH_HUP_GUARD) {
|
|
250898
|
-
return "";
|
|
250899
|
-
}
|
|
250900
|
-
return command;
|
|
250901
|
-
}
|
|
250902
250890
|
async function getCommandName(command, args2) {
|
|
250903
250891
|
await initializeShellParsers();
|
|
250904
250892
|
const fullCmd = [command, ...args2].join(" ");
|
|
@@ -250906,7 +250894,7 @@ async function getCommandName(command, args2) {
|
|
|
250906
250894
|
const roots = getCommandRoots(stripped).filter(
|
|
250907
250895
|
(r3) => r3 !== "shopt" && r3 !== "set"
|
|
250908
250896
|
);
|
|
250909
|
-
if (roots.length
|
|
250897
|
+
if (roots.length > 0) {
|
|
250910
250898
|
return roots[0];
|
|
250911
250899
|
}
|
|
250912
250900
|
return path8.basename(command);
|
|
@@ -251464,17 +251452,14 @@ function getCommandRoots(command) {
|
|
|
251464
251452
|
function stripShellWrapper(command) {
|
|
251465
251453
|
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;
|
|
251466
251454
|
const match2 = command.match(pattern);
|
|
251467
|
-
let result2;
|
|
251468
251455
|
if (match2) {
|
|
251469
251456
|
let newCommand = command.substring(match2[0].length).trim();
|
|
251470
251457
|
if (newCommand.startsWith('"') && newCommand.endsWith('"') || newCommand.startsWith("'") && newCommand.endsWith("'")) {
|
|
251471
251458
|
newCommand = newCommand.substring(1, newCommand.length - 1);
|
|
251472
251459
|
}
|
|
251473
|
-
|
|
251474
|
-
} else {
|
|
251475
|
-
result2 = command.trim();
|
|
251460
|
+
return newCommand;
|
|
251476
251461
|
}
|
|
251477
|
-
return
|
|
251462
|
+
return command.trim();
|
|
251478
251463
|
}
|
|
251479
251464
|
var spawnAsync = async (command, args2, options) => {
|
|
251480
251465
|
const sandboxManager = options?.sandboxManager ?? new NoopSandboxManager();
|
|
@@ -252388,7 +252373,7 @@ async function getCommandName2(req) {
|
|
|
252388
252373
|
const roots = getCommandRoots(stripped).filter(
|
|
252389
252374
|
(r3) => r3 !== "shopt" && r3 !== "set"
|
|
252390
252375
|
);
|
|
252391
|
-
if (roots.length
|
|
252376
|
+
if (roots.length > 0) {
|
|
252392
252377
|
return roots[0];
|
|
252393
252378
|
}
|
|
252394
252379
|
return path11.basename(req.command);
|
|
@@ -276249,10 +276234,10 @@ var PREVIEW_GEMINI_MODEL = "gemini-3-pro-preview";
|
|
|
276249
276234
|
var PREVIEW_GEMINI_3_1_MODEL = "gemini-3.1-pro-preview";
|
|
276250
276235
|
var PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL = "gemini-3.1-pro-preview-customtools";
|
|
276251
276236
|
var PREVIEW_GEMINI_FLASH_MODEL = "gemini-3-flash-preview";
|
|
276252
|
-
var PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL = "gemini-3.1-flash-lite-preview";
|
|
276253
276237
|
var DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
|
|
276254
276238
|
var DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
|
|
276255
|
-
var DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-
|
|
276239
|
+
var DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-3.1-flash-lite";
|
|
276240
|
+
var PREVIEW_GEMINI_FLASH_LITE_MODEL = "none";
|
|
276256
276241
|
var GEMMA_4_31B_IT_MODEL = "gemma-4-31b-it";
|
|
276257
276242
|
var GEMMA_4_26B_A4B_IT_MODEL = "gemma-4-26b-a4b-it";
|
|
276258
276243
|
var VALID_GEMINI_MODELS = /* @__PURE__ */ new Set([
|
|
@@ -276260,7 +276245,7 @@ var VALID_GEMINI_MODELS = /* @__PURE__ */ new Set([
|
|
|
276260
276245
|
PREVIEW_GEMINI_3_1_MODEL,
|
|
276261
276246
|
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
|
276262
276247
|
PREVIEW_GEMINI_FLASH_MODEL,
|
|
276263
|
-
|
|
276248
|
+
PREVIEW_GEMINI_FLASH_LITE_MODEL,
|
|
276264
276249
|
DEFAULT_GEMINI_MODEL,
|
|
276265
276250
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
276266
276251
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
@@ -276276,16 +276261,15 @@ var GEMINI_MODEL_ALIAS_FLASH_LITE = "flash-lite";
|
|
|
276276
276261
|
var DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
|
|
276277
276262
|
var DEFAULT_THINKING_MODE = 8192;
|
|
276278
276263
|
function getAutoModelDescription(hasAccessToPreview, useGemini3_1 = false) {
|
|
276279
|
-
const proModel = hasAccessToPreview ? useGemini3_1 ?
|
|
276280
|
-
const flashModel = hasAccessToPreview ?
|
|
276264
|
+
const proModel = hasAccessToPreview ? useGemini3_1 ? PREVIEW_GEMINI_3_1_MODEL : PREVIEW_GEMINI_MODEL : DEFAULT_GEMINI_MODEL;
|
|
276265
|
+
const flashModel = hasAccessToPreview ? PREVIEW_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
276281
276266
|
return `Let Gemini CLI decide the best model for the task: ${proModel}, ${flashModel}`;
|
|
276282
276267
|
}
|
|
276283
|
-
function resolveModel(requestedModel, useGemini3_1 = false,
|
|
276268
|
+
function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config2) {
|
|
276284
276269
|
const normalizedModel = Array.isArray(requestedModel) ? String(requestedModel.at(-1) ?? "").trim() || "" : typeof requestedModel !== "string" ? String(requestedModel ?? "").trim() || "" : requestedModel.trim() || "";
|
|
276285
276270
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
276286
276271
|
const resolved2 = config2.modelConfigService.resolveModelId(normalizedModel, {
|
|
276287
276272
|
useGemini3_1,
|
|
276288
|
-
useGemini3_1FlashLite,
|
|
276289
276273
|
useCustomTools: useCustomToolModel,
|
|
276290
276274
|
hasAccessToPreview
|
|
276291
276275
|
});
|
|
@@ -276327,7 +276311,7 @@ function resolveModel(requestedModel, useGemini3_1 = false, useGemini3_1FlashLit
|
|
|
276327
276311
|
break;
|
|
276328
276312
|
}
|
|
276329
276313
|
case GEMINI_MODEL_ALIAS_FLASH_LITE: {
|
|
276330
|
-
resolved =
|
|
276314
|
+
resolved = DEFAULT_GEMINI_FLASH_LITE_MODEL;
|
|
276331
276315
|
break;
|
|
276332
276316
|
}
|
|
276333
276317
|
default: {
|
|
@@ -276335,12 +276319,13 @@ function resolveModel(requestedModel, useGemini3_1 = false, useGemini3_1FlashLit
|
|
|
276335
276319
|
break;
|
|
276336
276320
|
}
|
|
276337
276321
|
}
|
|
276322
|
+
if (resolved === "none") {
|
|
276323
|
+
return DEFAULT_GEMINI_FLASH_LITE_MODEL;
|
|
276324
|
+
}
|
|
276338
276325
|
if (!hasAccessToPreview && isPreviewModel(resolved)) {
|
|
276339
276326
|
switch (resolved) {
|
|
276340
276327
|
case PREVIEW_GEMINI_FLASH_MODEL:
|
|
276341
276328
|
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
276342
|
-
case PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL:
|
|
276343
|
-
return DEFAULT_GEMINI_FLASH_LITE_MODEL;
|
|
276344
276329
|
case PREVIEW_GEMINI_MODEL:
|
|
276345
276330
|
case PREVIEW_GEMINI_3_1_MODEL:
|
|
276346
276331
|
case PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL:
|
|
@@ -276357,14 +276342,13 @@ function resolveModel(requestedModel, useGemini3_1 = false, useGemini3_1FlashLit
|
|
|
276357
276342
|
}
|
|
276358
276343
|
return resolved;
|
|
276359
276344
|
}
|
|
276360
|
-
function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false,
|
|
276345
|
+
function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config2) {
|
|
276361
276346
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
276362
276347
|
return config2.modelConfigService.resolveClassifierModelId(
|
|
276363
276348
|
modelAlias,
|
|
276364
276349
|
requestedModel,
|
|
276365
276350
|
{
|
|
276366
276351
|
useGemini3_1,
|
|
276367
|
-
useGemini3_1FlashLite,
|
|
276368
276352
|
useCustomTools: useCustomToolModel,
|
|
276369
276353
|
hasAccessToPreview
|
|
276370
276354
|
}
|
|
@@ -276381,16 +276365,15 @@ function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false
|
|
|
276381
276365
|
GEMINI_MODEL_ALIAS_FLASH,
|
|
276382
276366
|
false,
|
|
276383
276367
|
false,
|
|
276384
|
-
false,
|
|
276385
276368
|
hasAccessToPreview
|
|
276386
276369
|
);
|
|
276387
276370
|
}
|
|
276388
276371
|
return resolveModel(
|
|
276389
276372
|
requestedModel,
|
|
276390
276373
|
useGemini3_1,
|
|
276391
|
-
useGemini3_1FlashLite,
|
|
276392
276374
|
useCustomToolModel,
|
|
276393
|
-
hasAccessToPreview
|
|
276375
|
+
hasAccessToPreview,
|
|
276376
|
+
config2
|
|
276394
276377
|
);
|
|
276395
276378
|
}
|
|
276396
276379
|
function getDisplayString(model, config2) {
|
|
@@ -276417,17 +276400,20 @@ function getDisplayString(model, config2) {
|
|
|
276417
276400
|
return PREVIEW_GEMINI_FLASH_MODEL;
|
|
276418
276401
|
case PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL:
|
|
276419
276402
|
return PREVIEW_GEMINI_3_1_MODEL;
|
|
276420
|
-
case
|
|
276421
|
-
return
|
|
276403
|
+
case PREVIEW_GEMINI_FLASH_LITE_MODEL:
|
|
276404
|
+
return PREVIEW_GEMINI_FLASH_LITE_MODEL;
|
|
276422
276405
|
default:
|
|
276423
276406
|
return model;
|
|
276424
276407
|
}
|
|
276425
276408
|
}
|
|
276426
276409
|
function isPreviewModel(model, config2) {
|
|
276410
|
+
if (model === "none") {
|
|
276411
|
+
return false;
|
|
276412
|
+
}
|
|
276427
276413
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
276428
276414
|
return config2.modelConfigService.getModelDefinition(model)?.isPreview === true;
|
|
276429
276415
|
}
|
|
276430
|
-
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 ===
|
|
276416
|
+
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;
|
|
276431
276417
|
}
|
|
276432
276418
|
function isProModel(model, config2) {
|
|
276433
276419
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
@@ -276437,7 +276423,7 @@ function isProModel(model, config2) {
|
|
|
276437
276423
|
}
|
|
276438
276424
|
function isGemini3Model(model, config2) {
|
|
276439
276425
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
276440
|
-
const resolved2 = resolveModel(model, false, false,
|
|
276426
|
+
const resolved2 = resolveModel(model, false, false, true, config2);
|
|
276441
276427
|
return config2.modelConfigService.getModelDefinition(resolved2)?.family === "gemini-3";
|
|
276442
276428
|
}
|
|
276443
276429
|
const resolved = resolveModel(model);
|
|
@@ -276448,7 +276434,7 @@ function isGemini2Model(model) {
|
|
|
276448
276434
|
}
|
|
276449
276435
|
function isCustomModel(model, config2) {
|
|
276450
276436
|
if (config2?.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
276451
|
-
const resolved2 = resolveModel(model, false, false,
|
|
276437
|
+
const resolved2 = resolveModel(model, false, false, true, config2);
|
|
276452
276438
|
return config2.modelConfigService.getModelDefinition(resolved2)?.tier === "custom" || !resolved2.startsWith("gemini-");
|
|
276453
276439
|
}
|
|
276454
276440
|
const resolved = resolveModel(model);
|
|
@@ -276470,15 +276456,15 @@ function supportsMultimodalFunctionResponse(model, config2) {
|
|
|
276470
276456
|
}
|
|
276471
276457
|
return model.startsWith("gemini-3-");
|
|
276472
276458
|
}
|
|
276473
|
-
function isActiveModel(model, useGemini3_1 = false,
|
|
276474
|
-
if (!VALID_GEMINI_MODELS.has(model)) {
|
|
276459
|
+
function isActiveModel(model, useGemini3_1 = false, useCustomToolModel = false, experimentalGemma = true) {
|
|
276460
|
+
if (!VALID_GEMINI_MODELS.has(model) || model === "none") {
|
|
276475
276461
|
return false;
|
|
276476
276462
|
}
|
|
276477
276463
|
if (model === GEMMA_4_31B_IT_MODEL || model === GEMMA_4_26B_A4B_IT_MODEL) {
|
|
276478
276464
|
return experimentalGemma;
|
|
276479
276465
|
}
|
|
276480
|
-
if (model ===
|
|
276481
|
-
return
|
|
276466
|
+
if (model === PREVIEW_GEMINI_FLASH_LITE_MODEL) {
|
|
276467
|
+
return false;
|
|
276482
276468
|
}
|
|
276483
276469
|
if (useGemini3_1) {
|
|
276484
276470
|
if (model === PREVIEW_GEMINI_MODEL) {
|
|
@@ -279549,8 +279535,8 @@ function isValidToolName(name3, options = {}) {
|
|
|
279549
279535
|
}
|
|
279550
279536
|
|
|
279551
279537
|
// packages/core/src/generated/git-commit.ts
|
|
279552
|
-
var GIT_COMMIT_INFO = "
|
|
279553
|
-
var CLI_VERSION = "0.
|
|
279538
|
+
var GIT_COMMIT_INFO = "5cac7c10f";
|
|
279539
|
+
var CLI_VERSION = "0.45.0-preview.0";
|
|
279554
279540
|
|
|
279555
279541
|
// packages/core/src/ide/detect-ide.ts
|
|
279556
279542
|
var IDE_DEFINITIONS = {
|
|
@@ -304019,7 +304005,7 @@ function getVersion() {
|
|
|
304019
304005
|
}
|
|
304020
304006
|
versionPromise = (async () => {
|
|
304021
304007
|
const pkgJson = await getPackageJson(__dirname4);
|
|
304022
|
-
return "0.
|
|
304008
|
+
return "0.45.0-preview.0";
|
|
304023
304009
|
})();
|
|
304024
304010
|
return versionPromise;
|
|
304025
304011
|
}
|
|
@@ -304982,7 +304968,6 @@ function getModelPolicyChain(options) {
|
|
|
304982
304968
|
const proModel = resolveModel(
|
|
304983
304969
|
PREVIEW_GEMINI_MODEL,
|
|
304984
304970
|
options.useGemini31,
|
|
304985
|
-
options.useGemini31FlashLite,
|
|
304986
304971
|
options.useCustomToolModel
|
|
304987
304972
|
);
|
|
304988
304973
|
return [
|
|
@@ -305059,7 +305044,6 @@ function resolvePolicyChain(config2, preferredModel, wrapsAround = false) {
|
|
|
305059
305044
|
const configuredModel = normalizeModelId(config2.getModel());
|
|
305060
305045
|
let chain2;
|
|
305061
305046
|
const useGemini31 = config2.getGemini31LaunchedSync?.() ?? false;
|
|
305062
|
-
const useGemini31FlashLite = config2.getGemini31FlashLiteLaunchedSync?.() ?? false;
|
|
305063
305047
|
const useCustomToolModel = config2.getUseCustomToolModelSync?.() ?? false;
|
|
305064
305048
|
const hasAccessToPreview = config2.getHasAccessToPreviewModel?.() ?? false;
|
|
305065
305049
|
const isOriginallyGemini3 = isGemini3Model(modelFromConfig, config2);
|
|
@@ -305067,7 +305051,6 @@ function resolvePolicyChain(config2, preferredModel, wrapsAround = false) {
|
|
|
305067
305051
|
resolveModel(
|
|
305068
305052
|
modelFromConfig,
|
|
305069
305053
|
useGemini31,
|
|
305070
|
-
useGemini31FlashLite,
|
|
305071
305054
|
useCustomToolModel,
|
|
305072
305055
|
hasAccessToPreview,
|
|
305073
305056
|
config2
|
|
@@ -305079,7 +305062,6 @@ function resolvePolicyChain(config2, preferredModel, wrapsAround = false) {
|
|
|
305079
305062
|
if (config2.getExperimentalDynamicModelConfiguration?.() === true) {
|
|
305080
305063
|
const context2 = {
|
|
305081
305064
|
useGemini3_1: useGemini31,
|
|
305082
|
-
useGemini3_1FlashLite: useGemini31FlashLite,
|
|
305083
305065
|
useCustomTools: useCustomToolModel
|
|
305084
305066
|
};
|
|
305085
305067
|
if (resolvedModel === DEFAULT_GEMINI_FLASH_LITE_MODEL) {
|
|
@@ -305118,7 +305100,6 @@ function resolvePolicyChain(config2, preferredModel, wrapsAround = false) {
|
|
|
305118
305100
|
isAutoSelection,
|
|
305119
305101
|
userTier: config2.getUserTier(),
|
|
305120
305102
|
useGemini31,
|
|
305121
|
-
useGemini31FlashLite,
|
|
305122
305103
|
useCustomToolModel
|
|
305123
305104
|
});
|
|
305124
305105
|
} else {
|
|
@@ -305127,7 +305108,6 @@ function resolvePolicyChain(config2, preferredModel, wrapsAround = false) {
|
|
|
305127
305108
|
isAutoSelection,
|
|
305128
305109
|
userTier: config2.getUserTier(),
|
|
305129
305110
|
useGemini31,
|
|
305130
|
-
useGemini31FlashLite,
|
|
305131
305111
|
useCustomToolModel
|
|
305132
305112
|
});
|
|
305133
305113
|
}
|
|
@@ -309630,7 +309610,6 @@ async function createContentGenerator(config2, gcConfig, sessionId) {
|
|
|
309630
309610
|
const model = resolveModel(
|
|
309631
309611
|
gcConfig.getModel(),
|
|
309632
309612
|
config2.authType === "gemini-api-key" /* USE_GEMINI */ || config2.authType === "vertex-ai" /* USE_VERTEX_AI */ || (await gcConfig.getGemini31Launched?.() ?? false),
|
|
309633
|
-
config2.authType === "gemini-api-key" /* USE_GEMINI */ || config2.authType === "vertex-ai" /* USE_VERTEX_AI */ || (await gcConfig.getGemini31FlashLiteLaunched?.() ?? false),
|
|
309634
309613
|
false,
|
|
309635
309614
|
gcConfig.getHasAccessToPreviewModel?.() ?? true,
|
|
309636
309615
|
gcConfig
|
|
@@ -321138,17 +321117,6 @@ function injectUtf8CodepageForPty(command, shell, isWindows3, usingPty) {
|
|
|
321138
321117
|
}
|
|
321139
321118
|
return command;
|
|
321140
321119
|
}
|
|
321141
|
-
function ensureHupIgnored(command, shell) {
|
|
321142
|
-
if (shell !== "bash") {
|
|
321143
|
-
return command;
|
|
321144
|
-
}
|
|
321145
|
-
const trimmed2 = command.trimStart();
|
|
321146
|
-
const prefix = `${BASH_HUP_GUARD} `;
|
|
321147
|
-
if (trimmed2.startsWith(prefix) || trimmed2 === BASH_HUP_GUARD) {
|
|
321148
|
-
return command;
|
|
321149
|
-
}
|
|
321150
|
-
return `${BASH_HUP_GUARD} ${command}`;
|
|
321151
|
-
}
|
|
321152
321120
|
var findLastContentLine = (buffer, startLine) => {
|
|
321153
321121
|
const lineCount = buffer.length;
|
|
321154
321122
|
for (let i4 = lineCount - 1; i4 >= startLine; i4--) {
|
|
@@ -321326,10 +321294,9 @@ ${truncated}`;
|
|
|
321326
321294
|
executable = "cmd.exe";
|
|
321327
321295
|
}
|
|
321328
321296
|
const resolvedExecutable = resolveExecutable(executable) ?? executable;
|
|
321329
|
-
const
|
|
321330
|
-
const hupGuarded = !isWindows3 ? ensureHupIgnored(promptGuarded, shell) : promptGuarded;
|
|
321297
|
+
const guardedCommand = ensurePromptvarsDisabled(commandToExecute, shell);
|
|
321331
321298
|
const finalCommand = injectUtf8CodepageForPty(
|
|
321332
|
-
|
|
321299
|
+
guardedCommand,
|
|
321333
321300
|
shell,
|
|
321334
321301
|
isWindows3,
|
|
321335
321302
|
usingPty
|
|
@@ -322180,10 +322147,11 @@ ${truncated}`;
|
|
|
322180
322147
|
} catch (e2) {
|
|
322181
322148
|
const err2 = e2;
|
|
322182
322149
|
const isEsrch = err2.code === "ESRCH";
|
|
322150
|
+
const isEbadf = err2.code === "EBADF" || err2.message?.includes("EBADF");
|
|
322183
322151
|
const isWindowsPtyError = err2.message?.includes(
|
|
322184
322152
|
"Cannot resize a pty that has already exited"
|
|
322185
322153
|
);
|
|
322186
|
-
if (isEsrch || isWindowsPtyError) {
|
|
322154
|
+
if (isEsrch || isEbadf || isWindowsPtyError) {
|
|
322187
322155
|
} else {
|
|
322188
322156
|
throw e2;
|
|
322189
322157
|
}
|
|
@@ -329852,7 +329820,8 @@ function convertSessionToClientHistory(messages) {
|
|
|
329852
329820
|
}
|
|
329853
329821
|
if (msg.type === "user") {
|
|
329854
329822
|
const contentString = partListUnionToString(msg.content);
|
|
329855
|
-
|
|
329823
|
+
const trimmedContent = contentString.trim();
|
|
329824
|
+
if (trimmedContent.startsWith("/") || trimmedContent.startsWith("?") || trimmedContent.startsWith("<session_context>") || trimmedContent.startsWith("<hook_context>")) {
|
|
329856
329825
|
continue;
|
|
329857
329826
|
}
|
|
329858
329827
|
clientHistory.push({
|
|
@@ -330364,12 +330333,10 @@ var GeminiChat = class {
|
|
|
330364
330333
|
const initialActiveModel = this.context.config.getActiveModel();
|
|
330365
330334
|
const apiCall = async () => {
|
|
330366
330335
|
const useGemini3_1 = await this.context.config.getGemini31Launched?.() ?? false;
|
|
330367
|
-
const useGemini3_1FlashLite = await this.context.config.getGemini31FlashLiteLaunched?.() ?? false;
|
|
330368
330336
|
const hasAccessToPreview = this.context.config.getHasAccessToPreviewModel?.() ?? true;
|
|
330369
330337
|
let modelToUse = resolveModel(
|
|
330370
330338
|
lastModelToUse,
|
|
330371
330339
|
useGemini3_1,
|
|
330372
|
-
useGemini3_1FlashLite,
|
|
330373
330340
|
false,
|
|
330374
330341
|
hasAccessToPreview,
|
|
330375
330342
|
this.context.config
|
|
@@ -330378,7 +330345,6 @@ var GeminiChat = class {
|
|
|
330378
330345
|
modelToUse = resolveModel(
|
|
330379
330346
|
this.context.config.getActiveModel(),
|
|
330380
330347
|
useGemini3_1,
|
|
330381
|
-
useGemini3_1FlashLite,
|
|
330382
330348
|
false,
|
|
330383
330349
|
hasAccessToPreview,
|
|
330384
330350
|
this.context.config
|
|
@@ -330429,7 +330395,6 @@ var GeminiChat = class {
|
|
|
330429
330395
|
modelToUse = resolveModel(
|
|
330430
330396
|
beforeModelResult.modifiedModel,
|
|
330431
330397
|
useGemini3_1,
|
|
330432
|
-
useGemini3_1FlashLite,
|
|
330433
330398
|
false,
|
|
330434
330399
|
hasAccessToPreview,
|
|
330435
330400
|
this.context.config
|
|
@@ -332871,7 +332836,6 @@ var PromptProvider = class {
|
|
|
332871
332836
|
const desiredModel = resolveModel(
|
|
332872
332837
|
context2.config.getActiveModel(),
|
|
332873
332838
|
context2.config.getGemini31LaunchedSync?.() ?? false,
|
|
332874
|
-
context2.config.getGemini31FlashLiteLaunchedSync?.() ?? false,
|
|
332875
332839
|
false,
|
|
332876
332840
|
context2.config.getHasAccessToPreviewModel?.() ?? true,
|
|
332877
332841
|
context2.config
|
|
@@ -333048,7 +333012,6 @@ var PromptProvider = class {
|
|
|
333048
333012
|
const desiredModel = resolveModel(
|
|
333049
333013
|
context2.config.getActiveModel(),
|
|
333050
333014
|
context2.config.getGemini31LaunchedSync?.() ?? false,
|
|
333051
|
-
context2.config.getGemini31FlashLiteLaunchedSync?.() ?? false,
|
|
333052
333015
|
false,
|
|
333053
333016
|
context2.config.getHasAccessToPreviewModel?.() ?? true,
|
|
333054
333017
|
context2.config
|
|
@@ -333704,14 +333667,16 @@ function modelStringToModelConfigAlias(model) {
|
|
|
333704
333667
|
return "chat-compression-3-pro";
|
|
333705
333668
|
case PREVIEW_GEMINI_FLASH_MODEL:
|
|
333706
333669
|
return "chat-compression-3-flash";
|
|
333707
|
-
case
|
|
333670
|
+
case PREVIEW_GEMINI_FLASH_LITE_MODEL:
|
|
333671
|
+
// fallthrough
|
|
333672
|
+
case DEFAULT_GEMINI_FLASH_LITE_MODEL:
|
|
333708
333673
|
return "chat-compression-3.1-flash-lite";
|
|
333674
|
+
case "gemini-2.5-flash-lite":
|
|
333675
|
+
return "chat-compression-2.5-flash-lite";
|
|
333709
333676
|
case DEFAULT_GEMINI_MODEL:
|
|
333710
333677
|
return "chat-compression-2.5-pro";
|
|
333711
333678
|
case DEFAULT_GEMINI_FLASH_MODEL:
|
|
333712
333679
|
return "chat-compression-2.5-flash";
|
|
333713
|
-
case DEFAULT_GEMINI_FLASH_LITE_MODEL:
|
|
333714
|
-
return "chat-compression-2.5-flash-lite";
|
|
333715
333680
|
default:
|
|
333716
333681
|
return "chat-compression-default";
|
|
333717
333682
|
}
|
|
@@ -338358,7 +338323,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
|
|
|
338358
338323
|
return provider;
|
|
338359
338324
|
}
|
|
338360
338325
|
case "oauth2": {
|
|
338361
|
-
const { OAuth2AuthProvider } = await import("./oauth2-provider-
|
|
338326
|
+
const { OAuth2AuthProvider } = await import("./oauth2-provider-U72EWZHQ.js");
|
|
338362
338327
|
const provider = new OAuth2AuthProvider(
|
|
338363
338328
|
authConfig,
|
|
338364
338329
|
options.agentName ?? "unknown",
|
|
@@ -338529,7 +338494,6 @@ var ModelConfigService = class _ModelConfigService {
|
|
|
338529
338494
|
const definitions = this.config.modelDefinitions ?? {};
|
|
338530
338495
|
const shouldShowPreviewModels = context2.hasAccessToPreview ?? false;
|
|
338531
338496
|
const useGemini31 = context2.useGemini3_1 ?? false;
|
|
338532
|
-
const useGemini31FlashLite = context2.useGemini3_1FlashLite ?? false;
|
|
338533
338497
|
const mainOptions = Object.entries(definitions).filter(([_2, m]) => {
|
|
338534
338498
|
if (m.isVisible !== true) return false;
|
|
338535
338499
|
if (m.isPreview && !shouldShowPreviewModels) return false;
|
|
@@ -338559,14 +338523,11 @@ var ModelConfigService = class _ModelConfigService {
|
|
|
338559
338523
|
if (context2.hasAccessToProModel === false && isProModel(id))
|
|
338560
338524
|
return false;
|
|
338561
338525
|
if (id === PREVIEW_GEMINI_3_1_MODEL && !useGemini31) return false;
|
|
338562
|
-
if (id === PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL && !useGemini31FlashLite)
|
|
338563
|
-
return false;
|
|
338564
338526
|
return true;
|
|
338565
338527
|
}).map(([id, m]) => {
|
|
338566
338528
|
const resolvedId = this.resolveModelId(id, context2);
|
|
338567
338529
|
const titleId = this.resolveModelId(id, {
|
|
338568
|
-
useGemini3_1: useGemini31
|
|
338569
|
-
useGemini3_1FlashLite: useGemini31FlashLite
|
|
338530
|
+
useGemini3_1: useGemini31
|
|
338570
338531
|
});
|
|
338571
338532
|
return {
|
|
338572
338533
|
modelId: resolvedId,
|
|
@@ -343001,6 +342962,122 @@ var stressTestProfile = {
|
|
|
343001
342962
|
buildPipelines: generalistProfile.buildPipelines,
|
|
343002
342963
|
buildAsyncPipelines: generalistProfile.buildAsyncPipelines
|
|
343003
342964
|
};
|
|
342965
|
+
var powerUserProfile = {
|
|
342966
|
+
name: "Power User (Experimental)",
|
|
342967
|
+
sentinels: generalistProfile.sentinels,
|
|
342968
|
+
config: {
|
|
342969
|
+
budget: {
|
|
342970
|
+
retainedTokens: 65e3,
|
|
342971
|
+
normalizedTokens: 1e5,
|
|
342972
|
+
maxTokens: 15e4,
|
|
342973
|
+
coalescingThresholdTokens: 5e3
|
|
342974
|
+
},
|
|
342975
|
+
gcStrategy: "incremental"
|
|
342976
|
+
},
|
|
342977
|
+
buildPipelines: (env2, config2) => [
|
|
342978
|
+
{
|
|
342979
|
+
name: "Immediate Sanitization",
|
|
342980
|
+
triggers: ["new_message"],
|
|
342981
|
+
processors: [
|
|
342982
|
+
createToolMaskingProcessor(
|
|
342983
|
+
"ToolMasking",
|
|
342984
|
+
env2,
|
|
342985
|
+
resolveProcessorOptions(config2, "ToolMasking", {
|
|
342986
|
+
stringLengthThresholdTokens: 8e3
|
|
342987
|
+
})
|
|
342988
|
+
),
|
|
342989
|
+
createBlobDegradationProcessor("BlobDegradation", env2),
|
|
342990
|
+
createNodeDistillationProcessor(
|
|
342991
|
+
"ImmediateNodeDistillation",
|
|
342992
|
+
env2,
|
|
342993
|
+
resolveProcessorOptions(config2, "ImmediateNodeDistillation", {
|
|
342994
|
+
nodeThresholdTokens: 15e3
|
|
342995
|
+
})
|
|
342996
|
+
)
|
|
342997
|
+
]
|
|
342998
|
+
},
|
|
342999
|
+
{
|
|
343000
|
+
name: "Normalization",
|
|
343001
|
+
triggers: ["retained_exceeded"],
|
|
343002
|
+
processors: [
|
|
343003
|
+
createNodeDistillationProcessor(
|
|
343004
|
+
"NodeDistillation",
|
|
343005
|
+
env2,
|
|
343006
|
+
resolveProcessorOptions(config2, "NodeDistillation", {
|
|
343007
|
+
nodeThresholdTokens: 3e3
|
|
343008
|
+
})
|
|
343009
|
+
),
|
|
343010
|
+
createNodeTruncationProcessor(
|
|
343011
|
+
"NodeTruncation",
|
|
343012
|
+
env2,
|
|
343013
|
+
resolveProcessorOptions(config2, "NodeTruncation", {
|
|
343014
|
+
maxTokensPerNode: 4e3
|
|
343015
|
+
})
|
|
343016
|
+
)
|
|
343017
|
+
]
|
|
343018
|
+
},
|
|
343019
|
+
{
|
|
343020
|
+
name: "Archiving",
|
|
343021
|
+
triggers: ["normalized_exceeded"],
|
|
343022
|
+
processors: [
|
|
343023
|
+
createNodeDistillationProcessor(
|
|
343024
|
+
"ArchiveNodeDistillation",
|
|
343025
|
+
env2,
|
|
343026
|
+
resolveProcessorOptions(config2, "ArchiveNodeDistillation", {
|
|
343027
|
+
nodeThresholdTokens: 1e3
|
|
343028
|
+
})
|
|
343029
|
+
),
|
|
343030
|
+
createNodeTruncationProcessor(
|
|
343031
|
+
"ArchiveNodeTruncation",
|
|
343032
|
+
env2,
|
|
343033
|
+
resolveProcessorOptions(config2, "ArchiveNodeTruncation", {
|
|
343034
|
+
maxTokensPerNode: 1500
|
|
343035
|
+
})
|
|
343036
|
+
)
|
|
343037
|
+
]
|
|
343038
|
+
},
|
|
343039
|
+
{
|
|
343040
|
+
name: "Emergency Backstop",
|
|
343041
|
+
triggers: ["gc_backstop"],
|
|
343042
|
+
processors: [
|
|
343043
|
+
createStateSnapshotProcessor(
|
|
343044
|
+
"StateSnapshotSync",
|
|
343045
|
+
env2,
|
|
343046
|
+
resolveProcessorOptions(config2, "StateSnapshotSync", {
|
|
343047
|
+
target: "max",
|
|
343048
|
+
maxStateTokens: 2e3,
|
|
343049
|
+
maxSummaryTurns: 10
|
|
343050
|
+
})
|
|
343051
|
+
),
|
|
343052
|
+
// If we STILL exceed max tokens, aggressively truncate
|
|
343053
|
+
createNodeTruncationProcessor(
|
|
343054
|
+
"EmergencyNodeTruncation",
|
|
343055
|
+
env2,
|
|
343056
|
+
resolveProcessorOptions(config2, "EmergencyNodeTruncation", {
|
|
343057
|
+
maxTokensPerNode: 500
|
|
343058
|
+
})
|
|
343059
|
+
)
|
|
343060
|
+
]
|
|
343061
|
+
}
|
|
343062
|
+
],
|
|
343063
|
+
buildAsyncPipelines: (env2, config2) => [
|
|
343064
|
+
{
|
|
343065
|
+
name: "Async Background GC",
|
|
343066
|
+
triggers: ["nodes_aged_out"],
|
|
343067
|
+
processors: [
|
|
343068
|
+
createStateSnapshotAsyncProcessor(
|
|
343069
|
+
"StateSnapshotAsync",
|
|
343070
|
+
env2,
|
|
343071
|
+
resolveProcessorOptions(config2, "StateSnapshotAsync", {
|
|
343072
|
+
type: "accumulate",
|
|
343073
|
+
maxStateTokens: 4e3,
|
|
343074
|
+
maxSummaryTurns: 5
|
|
343075
|
+
})
|
|
343076
|
+
)
|
|
343077
|
+
]
|
|
343078
|
+
}
|
|
343079
|
+
]
|
|
343080
|
+
};
|
|
343004
343081
|
|
|
343005
343082
|
// packages/core/src/context/config/schema.ts
|
|
343006
343083
|
function getContextManagementConfigSchema(registry2) {
|
|
@@ -343082,6 +343159,9 @@ async function loadContextManagementConfig(sidecarPath, registry2) {
|
|
|
343082
343159
|
if (sidecarPath === "stressTestProfile") {
|
|
343083
343160
|
return stressTestProfile;
|
|
343084
343161
|
}
|
|
343162
|
+
if (sidecarPath === "powerUserProfile") {
|
|
343163
|
+
return powerUserProfile;
|
|
343164
|
+
}
|
|
343085
343165
|
if (sidecarPath === "generalistProfile") {
|
|
343086
343166
|
return generalistProfile;
|
|
343087
343167
|
}
|
|
@@ -343193,6 +343273,12 @@ var ContextEventBus = class extends EventEmitter5 {
|
|
|
343193
343273
|
onConsolidationNeeded(listener) {
|
|
343194
343274
|
this.on("BUDGET_RETAINED_CROSSED", listener);
|
|
343195
343275
|
}
|
|
343276
|
+
emitNormalizeNeeded(event) {
|
|
343277
|
+
this.emit("BUDGET_NORMALIZED_CROSSED", event);
|
|
343278
|
+
}
|
|
343279
|
+
onNormalizeNeeded(listener) {
|
|
343280
|
+
this.on("BUDGET_NORMALIZED_CROSSED", listener);
|
|
343281
|
+
}
|
|
343196
343282
|
emitProcessorResult(event) {
|
|
343197
343283
|
this.emit("PROCESSOR_RESULT", event);
|
|
343198
343284
|
}
|
|
@@ -343335,13 +343421,15 @@ var ContextGraphBuilder = class {
|
|
|
343335
343421
|
const turn = history[turnIdx];
|
|
343336
343422
|
const msg = turn.content;
|
|
343337
343423
|
if (!msg.parts) continue;
|
|
343338
|
-
const
|
|
343424
|
+
const hasEnvHeader = msg.parts?.some(
|
|
343425
|
+
(p2) => isTextPart3(p2) && p2.text.trim().startsWith("<session_context>")
|
|
343426
|
+
);
|
|
343427
|
+
const turnSalt = hasEnvHeader && turnIdx === 0 ? deriveStableId(["environment-context"]) : turn.id;
|
|
343339
343428
|
const turnId = turnSalt.startsWith("turn_") ? turnSalt : `turn_${turnSalt}`;
|
|
343340
343429
|
if (msg.role === "user") {
|
|
343341
343430
|
for (let partIdx = 0; partIdx < msg.parts.length; partIdx++) {
|
|
343342
343431
|
const part = msg.parts[partIdx];
|
|
343343
|
-
|
|
343344
|
-
if (isTextPart3(part) && part.text.trim().startsWith("<session_context>") && turnSalt !== envTurnId) {
|
|
343432
|
+
if (isTextPart3(part) && part.text.trim().startsWith("<session_context>") && turnIdx > 0) {
|
|
343345
343433
|
debugLogger.log(
|
|
343346
343434
|
"[ContextGraphBuilder] Skipping legacy environment header turn from graph."
|
|
343347
343435
|
);
|
|
@@ -343746,13 +343834,13 @@ var PipelineOrchestrator = class {
|
|
|
343746
343834
|
isNodeAllowed(node, triggerTargets, protectedTurnIds = /* @__PURE__ */ new Set()) {
|
|
343747
343835
|
return triggerTargets.has(node.id) && !protectedTurnIds.has(node.id) && !protectedTurnIds.has(node.turnId);
|
|
343748
343836
|
}
|
|
343749
|
-
async executeTriggerSync(trigger,
|
|
343837
|
+
async executeTriggerSync(trigger, buffer, triggerTargets, protectedTurnIds = /* @__PURE__ */ new Set()) {
|
|
343750
343838
|
this.tracer.logEvent("Orchestrator", "Strategy Intent", {
|
|
343751
343839
|
trigger,
|
|
343752
|
-
totalNodes: nodes.length,
|
|
343840
|
+
totalNodes: buffer.nodes.length,
|
|
343753
343841
|
targetNodes: triggerTargets.size
|
|
343754
343842
|
});
|
|
343755
|
-
let currentBuffer =
|
|
343843
|
+
let currentBuffer = buffer;
|
|
343756
343844
|
const triggerPipelines = this.pipelines.filter(
|
|
343757
343845
|
(p2) => p2.triggers.includes(trigger)
|
|
343758
343846
|
);
|
|
@@ -343808,7 +343896,7 @@ var PipelineOrchestrator = class {
|
|
|
343808
343896
|
}
|
|
343809
343897
|
void this.executeTriggerAsync(trigger, currentBuffer.nodes, triggerTargets);
|
|
343810
343898
|
this.env.inbox.drainConsumed(inboxSnapshot.getConsumedIds());
|
|
343811
|
-
return currentBuffer
|
|
343899
|
+
return currentBuffer;
|
|
343812
343900
|
}
|
|
343813
343901
|
async executeTriggerAsync(trigger, nodes, triggerTargets) {
|
|
343814
343902
|
const asyncPipelines = this.asyncPipelines.filter(
|
|
@@ -343988,7 +344076,15 @@ async function render2(nodes, orchestrator, sidecar, tracer, env2, advancedToken
|
|
|
343988
344076
|
const nodeTokens = env2.tokenCalculator.calculateConcreteListTokens([node]);
|
|
343989
344077
|
rollingTokens += nodeTokens;
|
|
343990
344078
|
if (priorTokens > sidecar.config.budget.retainedTokens) {
|
|
343991
|
-
|
|
344079
|
+
if (sidecar.config.gcStrategy === "incremental") {
|
|
344080
|
+
if (priorTokens > maxTokens) {
|
|
344081
|
+
agedOutNodes.add(node.id);
|
|
344082
|
+
} else if (rollingTokens > maxTokens) {
|
|
344083
|
+
agedOutNodes.add(node.id);
|
|
344084
|
+
}
|
|
344085
|
+
} else {
|
|
344086
|
+
agedOutNodes.add(node.id);
|
|
344087
|
+
}
|
|
343992
344088
|
}
|
|
343993
344089
|
}
|
|
343994
344090
|
if (lateBindPrompt && lastTurnId) {
|
|
@@ -343998,12 +344094,13 @@ async function render2(nodes, orchestrator, sidecar, tracer, env2, advancedToken
|
|
|
343998
344094
|
}
|
|
343999
344095
|
}
|
|
344000
344096
|
}
|
|
344001
|
-
const
|
|
344097
|
+
const processedBuffer = await orchestrator.executeTriggerSync(
|
|
344002
344098
|
"gc_backstop",
|
|
344003
|
-
nodes,
|
|
344099
|
+
ContextWorkingBufferImpl.initialize(nodes),
|
|
344004
344100
|
agedOutNodes,
|
|
344005
344101
|
protectedIds
|
|
344006
344102
|
);
|
|
344103
|
+
const processedNodes = processedBuffer.nodes;
|
|
344007
344104
|
const skipList = /* @__PURE__ */ new Set();
|
|
344008
344105
|
for (const node of processedNodes) {
|
|
344009
344106
|
if (node.abstractsIds) {
|
|
@@ -344080,13 +344177,10 @@ var ContextManager = class {
|
|
|
344080
344177
|
this.orchestrator = orchestrator;
|
|
344081
344178
|
this.orchestrator.setNodeProvider(() => this.buffer.nodes);
|
|
344082
344179
|
this.eventBus.onProcessorResult((event) => {
|
|
344083
|
-
const
|
|
344084
|
-
|
|
344085
|
-
|
|
344086
|
-
|
|
344087
|
-
if (!allTargetsPresent) {
|
|
344088
|
-
debugLogger.log(
|
|
344089
|
-
`[ContextManager] Dropping stale processor result from ${event.processorId}. One or more targets were already removed.`
|
|
344180
|
+
const bufferIds = new Set(this.buffer.nodes.map((n3) => n3.id));
|
|
344181
|
+
if (!event.targets.every((t3) => bufferIds.has(t3.id))) {
|
|
344182
|
+
debugLogger.warn(
|
|
344183
|
+
`[ContextManager] Dropping processor result from ${event.processorId}: targets no longer in buffer.`
|
|
344090
344184
|
);
|
|
344091
344185
|
return;
|
|
344092
344186
|
}
|
|
@@ -344105,114 +344199,10 @@ var ContextManager = class {
|
|
|
344105
344199
|
evaluatedNodeIds = /* @__PURE__ */ new Set();
|
|
344106
344200
|
// Hysteresis tracking to prevent utility call churn
|
|
344107
344201
|
lastTriggeredDeficit = 0;
|
|
344202
|
+
lastTriggeredNormalizeDeficit = 0;
|
|
344108
344203
|
// Cache for Anomaly 3 (Redundant Renders)
|
|
344109
344204
|
lastRenderCache;
|
|
344110
344205
|
hasPerformedHotStart = false;
|
|
344111
|
-
/**
|
|
344112
|
-
* Returns a promise that resolves when all currently executing async pipelines have finished.
|
|
344113
|
-
*/
|
|
344114
|
-
async waitForPipelines() {
|
|
344115
|
-
return this.orchestrator.waitForPipelines();
|
|
344116
|
-
}
|
|
344117
|
-
/**
|
|
344118
|
-
* Safely stops background async pipelines and clears event listeners.
|
|
344119
|
-
*/
|
|
344120
|
-
shutdown() {
|
|
344121
|
-
this.orchestrator.shutdown();
|
|
344122
|
-
}
|
|
344123
|
-
/**
|
|
344124
|
-
* Evaluates if the current working buffer exceeds configured budget thresholds,
|
|
344125
|
-
* firing consolidation events if necessary.
|
|
344126
|
-
*/
|
|
344127
|
-
async evaluateTriggers(newNodes) {
|
|
344128
|
-
if (!this.sidecar.config.budget) return;
|
|
344129
|
-
if (newNodes.size > 0) {
|
|
344130
|
-
await this.orchestrator.executeTriggerSync(
|
|
344131
|
-
"new_message",
|
|
344132
|
-
this.buffer.nodes,
|
|
344133
|
-
newNodes
|
|
344134
|
-
);
|
|
344135
|
-
}
|
|
344136
|
-
const currentTokens = this.env.tokenCalculator.calculateConcreteListTokens(
|
|
344137
|
-
this.buffer.nodes
|
|
344138
|
-
);
|
|
344139
|
-
if (currentTokens > this.sidecar.config.budget.retainedTokens) {
|
|
344140
|
-
const agedOutNodes = /* @__PURE__ */ new Set();
|
|
344141
|
-
let rollingTokens = 0;
|
|
344142
|
-
const protectedIds = this.getProtectedNodeIds(this.buffer.nodes);
|
|
344143
|
-
for (let i4 = this.buffer.nodes.length - 1; i4 >= 0; i4--) {
|
|
344144
|
-
const node = this.buffer.nodes[i4];
|
|
344145
|
-
const priorTokens = rollingTokens;
|
|
344146
|
-
rollingTokens += this.env.tokenCalculator.calculateConcreteListTokens([
|
|
344147
|
-
node
|
|
344148
|
-
]);
|
|
344149
|
-
if (priorTokens > this.sidecar.config.budget.retainedTokens) {
|
|
344150
|
-
if (!protectedIds.has(node.id)) {
|
|
344151
|
-
agedOutNodes.add(node.id);
|
|
344152
|
-
}
|
|
344153
|
-
}
|
|
344154
|
-
}
|
|
344155
|
-
if (agedOutNodes.size > 0) {
|
|
344156
|
-
const targetDeficit = currentTokens - this.sidecar.config.budget.retainedTokens;
|
|
344157
|
-
if (targetDeficit < this.lastTriggeredDeficit) {
|
|
344158
|
-
this.lastTriggeredDeficit = targetDeficit;
|
|
344159
|
-
}
|
|
344160
|
-
const threshold = this.sidecar.config.budget.coalescingThresholdTokens || 0;
|
|
344161
|
-
const growthSinceLast = targetDeficit - this.lastTriggeredDeficit;
|
|
344162
|
-
if (targetDeficit >= threshold && (growthSinceLast >= threshold || this.lastTriggeredDeficit === 0)) {
|
|
344163
|
-
this.lastTriggeredDeficit = targetDeficit;
|
|
344164
|
-
this.env.tokenCalculator.garbageCollectCache(
|
|
344165
|
-
new Set(this.buffer.nodes.map((n3) => n3.id))
|
|
344166
|
-
);
|
|
344167
|
-
await this.orchestrator.executeTriggerSync(
|
|
344168
|
-
"nodes_aged_out",
|
|
344169
|
-
this.buffer.nodes,
|
|
344170
|
-
agedOutNodes,
|
|
344171
|
-
new Set(protectedIds.keys())
|
|
344172
|
-
);
|
|
344173
|
-
}
|
|
344174
|
-
} else {
|
|
344175
|
-
this.lastTriggeredDeficit = 0;
|
|
344176
|
-
}
|
|
344177
|
-
}
|
|
344178
|
-
}
|
|
344179
|
-
getProtectedNodeIds(nodes, extraProtectedIds = /* @__PURE__ */ new Set()) {
|
|
344180
|
-
const protectionMap = /* @__PURE__ */ new Map();
|
|
344181
|
-
if (nodes.length === 0) return protectionMap;
|
|
344182
|
-
const lastNode = nodes[nodes.length - 1];
|
|
344183
|
-
const lastTurnId = lastNode.turnId;
|
|
344184
|
-
const envTurnId = `turn_${deriveStableId(["environment-context"])}`;
|
|
344185
|
-
for (const node of nodes) {
|
|
344186
|
-
if (node.turnId === lastTurnId) {
|
|
344187
|
-
protectionMap.set(node.id, "recent_turn");
|
|
344188
|
-
} else if (node.turnId === envTurnId) {
|
|
344189
|
-
protectionMap.set(node.id, "environment_context");
|
|
344190
|
-
}
|
|
344191
|
-
}
|
|
344192
|
-
for (const id of extraProtectedIds) {
|
|
344193
|
-
protectionMap.set(id, "external_active_task");
|
|
344194
|
-
}
|
|
344195
|
-
return protectionMap;
|
|
344196
|
-
}
|
|
344197
|
-
getPristineGraph() {
|
|
344198
|
-
const pristineSet = /* @__PURE__ */ new Map();
|
|
344199
|
-
for (const node of this.buffer.nodes) {
|
|
344200
|
-
const roots = this.buffer.getPristineNodes(node.id);
|
|
344201
|
-
for (const root of roots) {
|
|
344202
|
-
pristineSet.set(root.id, root);
|
|
344203
|
-
}
|
|
344204
|
-
}
|
|
344205
|
-
return Array.from(pristineSet.values()).sort(
|
|
344206
|
-
(a2, b2) => a2.timestamp - b2.timestamp
|
|
344207
|
-
);
|
|
344208
|
-
}
|
|
344209
|
-
getNodes() {
|
|
344210
|
-
return [...this.buffer.nodes];
|
|
344211
|
-
}
|
|
344212
|
-
/**
|
|
344213
|
-
* Generates a virtual view of the pristine graph, substituting in variants
|
|
344214
|
-
* up to the configured token budget.
|
|
344215
|
-
*/
|
|
344216
344206
|
async renderHistory(pendingRequest, activeTaskIds = /* @__PURE__ */ new Set(), abortSignal) {
|
|
344217
344207
|
this.tracer.logEvent("ContextManager", "Starting rendering of LLM context");
|
|
344218
344208
|
const currentHistory = this.chatHistory.get();
|
|
@@ -344227,15 +344217,16 @@ var ContextManager = class {
|
|
|
344227
344217
|
}
|
|
344228
344218
|
let previewNodes = [];
|
|
344229
344219
|
if (pendingRequest) {
|
|
344230
|
-
|
|
344231
|
-
const previewNodeIds2 = new Set(
|
|
344232
|
-
|
|
344220
|
+
const syncedNodes = this.env.graphMapper.sync([pendingRequest]);
|
|
344221
|
+
const previewNodeIds2 = new Set(syncedNodes.map((n3) => n3.id));
|
|
344222
|
+
const previewBuffer = ContextWorkingBufferImpl.initialize(syncedNodes);
|
|
344223
|
+
const processedPreviewBuffer = await this.orchestrator.executeTriggerSync(
|
|
344233
344224
|
"new_message",
|
|
344234
|
-
|
|
344225
|
+
previewBuffer,
|
|
344235
344226
|
previewNodeIds2
|
|
344236
344227
|
);
|
|
344228
|
+
previewNodes = processedPreviewBuffer.nodes;
|
|
344237
344229
|
}
|
|
344238
|
-
await this.evaluateTriggers(newPrimalNodes);
|
|
344239
344230
|
const hotStartPromise = (async () => {
|
|
344240
344231
|
if (!this.hasPerformedHotStart) {
|
|
344241
344232
|
this.hasPerformedHotStart = true;
|
|
@@ -344249,19 +344240,20 @@ var ContextManager = class {
|
|
|
344249
344240
|
let nodes = this.buffer.nodes;
|
|
344250
344241
|
const previewNodeIds = /* @__PURE__ */ new Set();
|
|
344251
344242
|
if (previewNodes.length > 0) {
|
|
344252
|
-
for (const n3 of previewNodes) {
|
|
344253
|
-
previewNodeIds.add(n3.id);
|
|
344254
|
-
}
|
|
344255
344243
|
nodes = [...nodes, ...previewNodes];
|
|
344244
|
+
for (const node of previewNodes) {
|
|
344245
|
+
previewNodeIds.add(node.id);
|
|
344246
|
+
}
|
|
344256
344247
|
}
|
|
344248
|
+
await this.evaluateTriggers(nodes, newPrimalNodes, activeTaskIds);
|
|
344249
|
+
nodes = [...this.buffer.nodes, ...previewNodes];
|
|
344257
344250
|
const header = this.headerProvider ? await this.headerProvider() : void 0;
|
|
344258
|
-
const
|
|
344259
|
-
|
|
344260
|
-
|
|
344261
|
-
|
|
344262
|
-
|
|
344263
|
-
|
|
344264
|
-
);
|
|
344251
|
+
const nodesHash = deriveStableId([
|
|
344252
|
+
...nodes.map((n3) => n3.id),
|
|
344253
|
+
header ? JSON.stringify(header.parts) : "no-header"
|
|
344254
|
+
]);
|
|
344255
|
+
if (this.lastRenderCache?.nodesHash === nodesHash) {
|
|
344256
|
+
this.tracer.logEvent("ContextManager", "Render Cache Hit", { nodesHash });
|
|
344265
344257
|
return this.lastRenderCache.result;
|
|
344266
344258
|
}
|
|
344267
344259
|
const protectionReasons = this.getProtectedNodeIds(nodes, activeTaskIds);
|
|
@@ -344286,47 +344278,194 @@ var ContextManager = class {
|
|
|
344286
344278
|
processedNodes
|
|
344287
344279
|
} = renderResult;
|
|
344288
344280
|
if (didApplyManagement) {
|
|
344281
|
+
const masterIdsInResult = new Set(this.buffer.nodes.map((n3) => n3.id));
|
|
344282
|
+
const processedMasterNodes = processedNodes.filter(
|
|
344283
|
+
(n3) => !previewNodeIds.has(n3.id) || masterIdsInResult.has(n3.id)
|
|
344284
|
+
);
|
|
344289
344285
|
this.buffer = this.buffer.applyProcessorResult(
|
|
344290
344286
|
"sync_backstop",
|
|
344291
344287
|
this.buffer.nodes,
|
|
344292
|
-
|
|
344288
|
+
processedMasterNodes
|
|
344293
344289
|
);
|
|
344294
344290
|
}
|
|
344295
344291
|
checkContextInvariants(this.buffer.nodes, "RenderHistory");
|
|
344296
|
-
|
|
344297
|
-
const
|
|
344298
|
-
const hardenedAllHistory = hardenHistory(allHistory, {
|
|
344292
|
+
const fullHistoryToHarden = [...renderedHistory, ...pendingHistory];
|
|
344293
|
+
const hardenedFullHistory = hardenHistory(fullHistoryToHarden, {
|
|
344299
344294
|
sentinels: this.sidecar.sentinels
|
|
344300
344295
|
});
|
|
344301
|
-
const
|
|
344302
|
-
|
|
344303
|
-
|
|
344304
|
-
|
|
344305
|
-
|
|
344306
|
-
|
|
344307
|
-
if (
|
|
344308
|
-
|
|
344296
|
+
const envContextId = deriveStableId(["environment-context"]);
|
|
344297
|
+
const pendingIds = new Set(pendingHistory.map((t3) => t3.id));
|
|
344298
|
+
const resultHistory = [];
|
|
344299
|
+
const resultPending = [];
|
|
344300
|
+
let foundPending = false;
|
|
344301
|
+
for (const turn of hardenedFullHistory) {
|
|
344302
|
+
if (!foundPending && (pendingIds.has(turn.id) || turn.id.startsWith("turn_") && pendingIds.has(turn.id.substring(5))) && turn.id !== envContextId && turn.id !== `turn_${envContextId}`) {
|
|
344303
|
+
foundPending = true;
|
|
344304
|
+
}
|
|
344305
|
+
if (foundPending) {
|
|
344306
|
+
resultPending.push(turn);
|
|
344307
|
+
} else {
|
|
344308
|
+
resultHistory.push(turn);
|
|
344309
344309
|
}
|
|
344310
344310
|
}
|
|
344311
|
-
const apiHistory = hardenedAllHistory.slice(0, splitIndex).map((h3) => h3.content);
|
|
344312
|
-
const pendingApiHistory = hardenedAllHistory.slice(splitIndex).map((h3) => h3.content);
|
|
344313
|
-
if (header) {
|
|
344314
|
-
apiHistory.unshift(header);
|
|
344315
|
-
}
|
|
344316
344311
|
const result2 = {
|
|
344317
344312
|
history: renderedHistory,
|
|
344318
|
-
apiHistory,
|
|
344319
|
-
pendingApiHistory,
|
|
344313
|
+
apiHistory: resultHistory.map((h3) => h3.content),
|
|
344314
|
+
pendingApiHistory: resultPending.map((h3) => h3.content),
|
|
344320
344315
|
didApplyManagement,
|
|
344321
344316
|
baseUnits,
|
|
344322
344317
|
processedNodes
|
|
344323
344318
|
};
|
|
344324
|
-
|
|
344325
|
-
|
|
344326
|
-
|
|
344327
|
-
};
|
|
344319
|
+
if (header) {
|
|
344320
|
+
result2.apiHistory.unshift(header);
|
|
344321
|
+
}
|
|
344322
|
+
this.lastRenderCache = { nodesHash, result: result2 };
|
|
344323
|
+
this.tracer.logEvent("ContextManager", "Rendering Complete", {
|
|
344324
|
+
historySize: renderedHistory.length,
|
|
344325
|
+
pendingSize: pendingHistory.length,
|
|
344326
|
+
didApplyManagement
|
|
344327
|
+
});
|
|
344328
344328
|
return result2;
|
|
344329
344329
|
}
|
|
344330
|
+
async waitForPipelines() {
|
|
344331
|
+
await this.orchestrator.waitForPipelines();
|
|
344332
|
+
}
|
|
344333
|
+
shutdown() {
|
|
344334
|
+
this.orchestrator.shutdown();
|
|
344335
|
+
}
|
|
344336
|
+
getNodes() {
|
|
344337
|
+
return this.buffer.nodes;
|
|
344338
|
+
}
|
|
344339
|
+
getEnvironment() {
|
|
344340
|
+
return this.env;
|
|
344341
|
+
}
|
|
344342
|
+
getPristineGraph() {
|
|
344343
|
+
const pristineSet = /* @__PURE__ */ new Map();
|
|
344344
|
+
for (const node of this.buffer.nodes) {
|
|
344345
|
+
const roots = this.buffer.getPristineNodes(node.id);
|
|
344346
|
+
for (const root of roots) {
|
|
344347
|
+
pristineSet.set(root.id, root);
|
|
344348
|
+
}
|
|
344349
|
+
}
|
|
344350
|
+
return Array.from(pristineSet.values()).sort(
|
|
344351
|
+
(a2, b2) => a2.timestamp - b2.timestamp
|
|
344352
|
+
);
|
|
344353
|
+
}
|
|
344354
|
+
async evaluateTriggers(nodes, newPrimalNodes, activeTaskIds) {
|
|
344355
|
+
if (newPrimalNodes.size > 0) {
|
|
344356
|
+
this.buffer = await this.orchestrator.executeTriggerSync(
|
|
344357
|
+
"nodes_added",
|
|
344358
|
+
this.buffer,
|
|
344359
|
+
newPrimalNodes
|
|
344360
|
+
);
|
|
344361
|
+
}
|
|
344362
|
+
const bufferIds = new Set(this.buffer.nodes.map((n3) => n3.id));
|
|
344363
|
+
const previewNodes = nodes.filter((n3) => !bufferIds.has(n3.id));
|
|
344364
|
+
const currentNodes = [...this.buffer.nodes, ...previewNodes];
|
|
344365
|
+
const currentTokens = this.env.tokenCalculator.calculateConcreteListTokens(currentNodes);
|
|
344366
|
+
if (currentTokens > this.sidecar.config.budget.retainedTokens) {
|
|
344367
|
+
const agedOutRetainedNodes = /* @__PURE__ */ new Set();
|
|
344368
|
+
const agedOutNormalizedNodes = /* @__PURE__ */ new Set();
|
|
344369
|
+
const protectionMap = this.getProtectedNodeIds(
|
|
344370
|
+
currentNodes,
|
|
344371
|
+
activeTaskIds
|
|
344372
|
+
);
|
|
344373
|
+
const protectedIds = new Set(protectionMap.keys());
|
|
344374
|
+
const envTurnId = `turn_${deriveStableId(["environment-context"])}`;
|
|
344375
|
+
const turn0Nodes = currentNodes.filter((n3) => n3.turnId === envTurnId);
|
|
344376
|
+
for (const n3 of turn0Nodes) {
|
|
344377
|
+
protectedIds.add(n3.id);
|
|
344378
|
+
}
|
|
344379
|
+
let rollingTokens = 0;
|
|
344380
|
+
for (let i4 = currentNodes.length - 1; i4 >= 0; i4--) {
|
|
344381
|
+
const node = currentNodes[i4];
|
|
344382
|
+
const priorTokens = rollingTokens;
|
|
344383
|
+
rollingTokens += this.env.tokenCalculator.calculateConcreteListTokens([
|
|
344384
|
+
node
|
|
344385
|
+
]);
|
|
344386
|
+
if (priorTokens > this.sidecar.config.budget.retainedTokens) {
|
|
344387
|
+
if (!protectedIds.has(node.id)) {
|
|
344388
|
+
const hasNormalizedTier = this.sidecar.config.budget.normalizedTokens !== void 0;
|
|
344389
|
+
if (!hasNormalizedTier || priorTokens <= this.sidecar.config.budget.normalizedTokens) {
|
|
344390
|
+
agedOutRetainedNodes.add(node.id);
|
|
344391
|
+
}
|
|
344392
|
+
if (hasNormalizedTier && priorTokens > this.sidecar.config.budget.normalizedTokens) {
|
|
344393
|
+
agedOutNormalizedNodes.add(node.id);
|
|
344394
|
+
}
|
|
344395
|
+
}
|
|
344396
|
+
}
|
|
344397
|
+
}
|
|
344398
|
+
if (agedOutRetainedNodes.size > 0) {
|
|
344399
|
+
const targetDeficit = currentTokens - this.sidecar.config.budget.retainedTokens;
|
|
344400
|
+
const threshold = this.sidecar.config.budget.coalescingThresholdTokens || 0;
|
|
344401
|
+
if (targetDeficit < this.lastTriggeredDeficit) {
|
|
344402
|
+
this.lastTriggeredDeficit = targetDeficit;
|
|
344403
|
+
}
|
|
344404
|
+
if (targetDeficit > this.lastTriggeredDeficit + threshold) {
|
|
344405
|
+
this.lastTriggeredDeficit = targetDeficit;
|
|
344406
|
+
this.eventBus.emitConsolidationNeeded({
|
|
344407
|
+
nodes: this.buffer.nodes,
|
|
344408
|
+
targetDeficit,
|
|
344409
|
+
targetNodeIds: agedOutRetainedNodes
|
|
344410
|
+
});
|
|
344411
|
+
this.env.tokenCalculator.garbageCollectCache(
|
|
344412
|
+
new Set(this.buffer.nodes.map((n3) => n3.id))
|
|
344413
|
+
);
|
|
344414
|
+
this.buffer = await this.orchestrator.executeTriggerSync(
|
|
344415
|
+
"nodes_aged_out",
|
|
344416
|
+
this.buffer,
|
|
344417
|
+
agedOutRetainedNodes,
|
|
344418
|
+
protectedIds
|
|
344419
|
+
);
|
|
344420
|
+
}
|
|
344421
|
+
} else {
|
|
344422
|
+
this.lastTriggeredDeficit = 0;
|
|
344423
|
+
}
|
|
344424
|
+
if (agedOutNormalizedNodes.size > 0) {
|
|
344425
|
+
const targetDeficit = currentTokens - this.sidecar.config.budget.normalizedTokens;
|
|
344426
|
+
const threshold = this.sidecar.config.budget.coalescingThresholdTokens || 0;
|
|
344427
|
+
if (targetDeficit < this.lastTriggeredNormalizeDeficit) {
|
|
344428
|
+
this.lastTriggeredNormalizeDeficit = targetDeficit;
|
|
344429
|
+
}
|
|
344430
|
+
if (targetDeficit > this.lastTriggeredNormalizeDeficit + threshold) {
|
|
344431
|
+
this.lastTriggeredNormalizeDeficit = targetDeficit;
|
|
344432
|
+
this.eventBus.emitNormalizeNeeded({
|
|
344433
|
+
nodes: this.buffer.nodes,
|
|
344434
|
+
targetDeficit,
|
|
344435
|
+
targetNodeIds: agedOutNormalizedNodes
|
|
344436
|
+
});
|
|
344437
|
+
this.buffer = await this.orchestrator.executeTriggerSync(
|
|
344438
|
+
"normalized_exceeded",
|
|
344439
|
+
this.buffer,
|
|
344440
|
+
agedOutNormalizedNodes,
|
|
344441
|
+
protectedIds
|
|
344442
|
+
);
|
|
344443
|
+
}
|
|
344444
|
+
} else {
|
|
344445
|
+
this.lastTriggeredNormalizeDeficit = 0;
|
|
344446
|
+
}
|
|
344447
|
+
}
|
|
344448
|
+
}
|
|
344449
|
+
getProtectedNodeIds(nodes, extraProtectedIds = /* @__PURE__ */ new Set()) {
|
|
344450
|
+
const protectionMap = /* @__PURE__ */ new Map();
|
|
344451
|
+
if (nodes.length === 0) return protectionMap;
|
|
344452
|
+
const lastNode = nodes[nodes.length - 1];
|
|
344453
|
+
const lastTurnId = lastNode.turnId;
|
|
344454
|
+
const envContextId = deriveStableId(["environment-context"]);
|
|
344455
|
+
const envContextTurnId = `turn_${envContextId}`;
|
|
344456
|
+
for (const node of nodes) {
|
|
344457
|
+
if (node.turnId === envContextTurnId || node.turnId === envContextId) {
|
|
344458
|
+
protectionMap.set(node.id, "environment_context");
|
|
344459
|
+
}
|
|
344460
|
+
if (node.turnId === lastTurnId) {
|
|
344461
|
+
protectionMap.set(node.id, "recent_turn");
|
|
344462
|
+
}
|
|
344463
|
+
}
|
|
344464
|
+
for (const id of extraProtectedIds) {
|
|
344465
|
+
protectionMap.set(id, "external_active_task");
|
|
344466
|
+
}
|
|
344467
|
+
return protectionMap;
|
|
344468
|
+
}
|
|
344330
344469
|
async performHotStartCalibration(nodes, abortSignal) {
|
|
344331
344470
|
const history = this.env.graphMapper.fromGraph(nodes);
|
|
344332
344471
|
const contents = history.map((h3) => h3.content);
|
|
@@ -344346,9 +344485,6 @@ var ContextManager = class {
|
|
|
344346
344485
|
debugLogger.warn("[ContextManager] Hot start calibration failed", e2);
|
|
344347
344486
|
}
|
|
344348
344487
|
}
|
|
344349
|
-
getEnvironment() {
|
|
344350
|
-
return this.env;
|
|
344351
|
-
}
|
|
344352
344488
|
};
|
|
344353
344489
|
|
|
344354
344490
|
// packages/core/src/context/processors/historyTruncationProcessor.ts
|
|
@@ -345231,7 +345367,6 @@ var GeminiClient = class {
|
|
|
345231
345367
|
return resolveModel(
|
|
345232
345368
|
this.config.getActiveModel(),
|
|
345233
345369
|
this.config.getGemini31LaunchedSync?.() ?? false,
|
|
345234
|
-
this.config.getGemini31FlashLiteLaunchedSync?.() ?? false,
|
|
345235
345370
|
false,
|
|
345236
345371
|
this.config.getHasAccessToPreviewModel?.() ?? true,
|
|
345237
345372
|
this.config
|
|
@@ -346710,6 +346845,9 @@ var Scheduler = class {
|
|
|
346710
346845
|
return false;
|
|
346711
346846
|
}
|
|
346712
346847
|
_isParallelizable(request) {
|
|
346848
|
+
if (request.name === UPDATE_TOPIC_TOOL_NAME) {
|
|
346849
|
+
return false;
|
|
346850
|
+
}
|
|
346713
346851
|
if (request.args) {
|
|
346714
346852
|
const wait = request.args["wait_for_previous"];
|
|
346715
346853
|
if (typeof wait === "boolean") {
|
|
@@ -359851,22 +359989,15 @@ ${formattedHistory}
|
|
|
359851
359989
|
const routerResponse = ClassifierResponseSchema.parse(jsonResponse);
|
|
359852
359990
|
const reasoning = routerResponse.reasoning;
|
|
359853
359991
|
const latencyMs = Date.now() - startTime;
|
|
359854
|
-
const [
|
|
359855
|
-
useGemini3_1,
|
|
359856
|
-
useGemini3_1FlashLite,
|
|
359857
|
-
useCustomToolModel,
|
|
359858
|
-
hasAccessToPreview
|
|
359859
|
-
] = await Promise.all([
|
|
359992
|
+
const [useGemini3_1, useCustomToolModel, hasAccessToPreview] = await Promise.all([
|
|
359860
359993
|
config2.getGemini31Launched(),
|
|
359861
|
-
config2.getGemini31FlashLiteLaunched(),
|
|
359862
359994
|
config2.getUseCustomToolModel(),
|
|
359863
|
-
config2.getHasAccessToPreviewModel
|
|
359995
|
+
config2.getHasAccessToPreviewModel()
|
|
359864
359996
|
]);
|
|
359865
359997
|
const selectedModel = resolveClassifierModel(
|
|
359866
359998
|
context2.requestedModel ?? config2.getModel(),
|
|
359867
359999
|
routerResponse.model_choice,
|
|
359868
360000
|
useGemini3_1,
|
|
359869
|
-
useGemini3_1FlashLite,
|
|
359870
360001
|
useCustomToolModel,
|
|
359871
360002
|
hasAccessToPreview,
|
|
359872
360003
|
config2
|
|
@@ -359893,7 +360024,6 @@ var DefaultStrategy = class {
|
|
|
359893
360024
|
const defaultModel = resolveModel(
|
|
359894
360025
|
config2.getModel(),
|
|
359895
360026
|
config2.getGemini31LaunchedSync?.() ?? false,
|
|
359896
|
-
config2.getGemini31FlashLiteLaunchedSync?.() ?? false,
|
|
359897
360027
|
false,
|
|
359898
360028
|
config2.getHasAccessToPreviewModel?.() ?? true,
|
|
359899
360029
|
config2
|
|
@@ -360014,6 +360144,12 @@ var ClassifierStrategy = class {
|
|
|
360014
360144
|
if (await config2.getNumericalRoutingEnabled() && isGemini3Model(model, config2)) {
|
|
360015
360145
|
return null;
|
|
360016
360146
|
}
|
|
360147
|
+
if (isFunctionResponse(createUserContent(context2.request))) {
|
|
360148
|
+
debugLogger.log(
|
|
360149
|
+
"[Routing] Bypassing Classifier: request is FunctionResponse."
|
|
360150
|
+
);
|
|
360151
|
+
return null;
|
|
360152
|
+
}
|
|
360017
360153
|
const promptId = getPromptIdWithFallback("classifier-router");
|
|
360018
360154
|
const historySlice = context2.history.slice(-HISTORY_SEARCH_WINDOW2);
|
|
360019
360155
|
const cleanHistory = historySlice.filter(
|
|
@@ -360032,9 +360168,8 @@ var ClassifierStrategy = class {
|
|
|
360032
360168
|
const routerResponse = ClassifierResponseSchema2.parse(jsonResponse);
|
|
360033
360169
|
const reasoning = routerResponse.reasoning;
|
|
360034
360170
|
const latencyMs = Date.now() - startTime;
|
|
360035
|
-
const [useGemini3_1,
|
|
360171
|
+
const [useGemini3_1, useCustomToolModel] = await Promise.all([
|
|
360036
360172
|
config2.getGemini31Launched(),
|
|
360037
|
-
config2.getGemini31FlashLiteLaunched(),
|
|
360038
360173
|
config2.getUseCustomToolModel()
|
|
360039
360174
|
]);
|
|
360040
360175
|
const selectedModel = normalizeModelId(
|
|
@@ -360042,7 +360177,6 @@ var ClassifierStrategy = class {
|
|
|
360042
360177
|
normalizeModelId(model),
|
|
360043
360178
|
routerResponse.model_choice,
|
|
360044
360179
|
useGemini3_1,
|
|
360045
|
-
useGemini3_1FlashLite,
|
|
360046
360180
|
useCustomToolModel,
|
|
360047
360181
|
config2.getHasAccessToPreviewModel?.() ?? true,
|
|
360048
360182
|
config2
|
|
@@ -360163,6 +360297,12 @@ var NumericalClassifierStrategy = class {
|
|
|
360163
360297
|
}
|
|
360164
360298
|
const finalHistory = firstTextIndex === -1 ? [] : candidateSlice.slice(firstTextIndex);
|
|
360165
360299
|
const requestParts = Array.isArray(context2.request) ? context2.request : [context2.request];
|
|
360300
|
+
if (finalHistory.length === 0 && isFunctionResponse(createUserContent(context2.request))) {
|
|
360301
|
+
debugLogger.log(
|
|
360302
|
+
"[Routing] Bypassing NumericalClassifier: request is FunctionResponse but history is empty after slicing."
|
|
360303
|
+
);
|
|
360304
|
+
return null;
|
|
360305
|
+
}
|
|
360166
360306
|
const sanitizedRequest = requestParts.map((part) => {
|
|
360167
360307
|
if (typeof part === "string") {
|
|
360168
360308
|
return { text: part };
|
|
@@ -360184,9 +360324,8 @@ var NumericalClassifierStrategy = class {
|
|
|
360184
360324
|
const routerResponse = ClassifierResponseSchema3.parse(jsonResponse);
|
|
360185
360325
|
const score = routerResponse.complexity_score;
|
|
360186
360326
|
const { threshold, groupLabel, modelAlias } = await this.getRoutingDecision(score, config2);
|
|
360187
|
-
const [useGemini3_1,
|
|
360327
|
+
const [useGemini3_1, useCustomToolModel] = await Promise.all([
|
|
360188
360328
|
config2.getGemini31Launched(),
|
|
360189
|
-
config2.getGemini31FlashLiteLaunched(),
|
|
360190
360329
|
config2.getUseCustomToolModel()
|
|
360191
360330
|
]);
|
|
360192
360331
|
const selectedModel = normalizeModelId(
|
|
@@ -360194,7 +360333,6 @@ var NumericalClassifierStrategy = class {
|
|
|
360194
360333
|
normalizeModelId(model),
|
|
360195
360334
|
modelAlias,
|
|
360196
360335
|
useGemini3_1,
|
|
360197
|
-
useGemini3_1FlashLite,
|
|
360198
360336
|
useCustomToolModel,
|
|
360199
360337
|
config2.getHasAccessToPreviewModel?.() ?? true,
|
|
360200
360338
|
config2
|
|
@@ -360318,7 +360456,6 @@ var FallbackStrategy = class {
|
|
|
360318
360456
|
const resolvedModel = resolveModel(
|
|
360319
360457
|
requestedModel,
|
|
360320
360458
|
config2.getGemini31LaunchedSync?.() ?? false,
|
|
360321
|
-
config2.getGemini31FlashLiteLaunchedSync?.() ?? false,
|
|
360322
360459
|
false,
|
|
360323
360460
|
config2.getHasAccessToPreviewModel?.() ?? true,
|
|
360324
360461
|
config2
|
|
@@ -360355,7 +360492,6 @@ var OverrideStrategy = class {
|
|
|
360355
360492
|
model: resolveModel(
|
|
360356
360493
|
overrideModel,
|
|
360357
360494
|
config2.getGemini31LaunchedSync?.() ?? false,
|
|
360358
|
-
config2.getGemini31FlashLiteLaunchedSync?.() ?? false,
|
|
360359
360495
|
false,
|
|
360360
360496
|
config2.getHasAccessToPreviewModel?.() ?? true,
|
|
360361
360497
|
config2
|
|
@@ -360383,14 +360519,8 @@ var ApprovalModeStrategy = class {
|
|
|
360383
360519
|
const startTime = Date.now();
|
|
360384
360520
|
const approvalMode = config2.getApprovalMode();
|
|
360385
360521
|
const approvedPlanPath = config2.getApprovedPlanPath();
|
|
360386
|
-
const [
|
|
360387
|
-
useGemini3_1,
|
|
360388
|
-
useGemini3_1FlashLite,
|
|
360389
|
-
useCustomToolModel,
|
|
360390
|
-
hasAccessToPreview
|
|
360391
|
-
] = await Promise.all([
|
|
360522
|
+
const [useGemini3_1, useCustomToolModel, hasAccessToPreview] = await Promise.all([
|
|
360392
360523
|
config2.getGemini31Launched(),
|
|
360393
|
-
config2.getGemini31FlashLiteLaunched(),
|
|
360394
360524
|
config2.getUseCustomToolModel(),
|
|
360395
360525
|
config2.getHasAccessToPreviewModel()
|
|
360396
360526
|
]);
|
|
@@ -360399,7 +360529,6 @@ var ApprovalModeStrategy = class {
|
|
|
360399
360529
|
model,
|
|
360400
360530
|
GEMINI_MODEL_ALIAS_PRO,
|
|
360401
360531
|
useGemini3_1,
|
|
360402
|
-
useGemini3_1FlashLite,
|
|
360403
360532
|
useCustomToolModel,
|
|
360404
360533
|
hasAccessToPreview,
|
|
360405
360534
|
config2
|
|
@@ -360417,7 +360546,6 @@ var ApprovalModeStrategy = class {
|
|
|
360417
360546
|
model,
|
|
360418
360547
|
GEMINI_MODEL_ALIAS_FLASH,
|
|
360419
360548
|
useGemini3_1,
|
|
360420
|
-
useGemini3_1FlashLite,
|
|
360421
360549
|
useCustomToolModel,
|
|
360422
360550
|
hasAccessToPreview,
|
|
360423
360551
|
config2
|
|
@@ -360634,6 +360762,12 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
360634
360762
|
model: "gemini-2.5-flash-lite"
|
|
360635
360763
|
}
|
|
360636
360764
|
},
|
|
360765
|
+
"gemini-3.1-flash-lite": {
|
|
360766
|
+
extends: "chat-base-3",
|
|
360767
|
+
modelConfig: {
|
|
360768
|
+
model: "gemini-3.1-flash-lite"
|
|
360769
|
+
}
|
|
360770
|
+
},
|
|
360637
360771
|
"gemma-4-31b-it": {
|
|
360638
360772
|
extends: "chat-base-3",
|
|
360639
360773
|
modelConfig: {
|
|
@@ -360662,7 +360796,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
360662
360796
|
classifier: {
|
|
360663
360797
|
extends: "base",
|
|
360664
360798
|
modelConfig: {
|
|
360665
|
-
model: "
|
|
360799
|
+
model: "flash-lite",
|
|
360666
360800
|
generateContentConfig: {
|
|
360667
360801
|
maxOutputTokens: 1024,
|
|
360668
360802
|
thinkingConfig: {
|
|
@@ -360674,7 +360808,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
360674
360808
|
"prompt-completion": {
|
|
360675
360809
|
extends: "base",
|
|
360676
360810
|
modelConfig: {
|
|
360677
|
-
model: "
|
|
360811
|
+
model: "flash-lite",
|
|
360678
360812
|
generateContentConfig: {
|
|
360679
360813
|
temperature: 0.3,
|
|
360680
360814
|
maxOutputTokens: 16e3,
|
|
@@ -360687,7 +360821,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
360687
360821
|
"fast-ack-helper": {
|
|
360688
360822
|
extends: "base",
|
|
360689
360823
|
modelConfig: {
|
|
360690
|
-
model: "
|
|
360824
|
+
model: "flash-lite",
|
|
360691
360825
|
generateContentConfig: {
|
|
360692
360826
|
temperature: 0.2,
|
|
360693
360827
|
maxOutputTokens: 120,
|
|
@@ -360700,7 +360834,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
360700
360834
|
"edit-corrector": {
|
|
360701
360835
|
extends: "base",
|
|
360702
360836
|
modelConfig: {
|
|
360703
|
-
model: "
|
|
360837
|
+
model: "flash-lite",
|
|
360704
360838
|
generateContentConfig: {
|
|
360705
360839
|
thinkingConfig: {
|
|
360706
360840
|
thinkingBudget: 0
|
|
@@ -360711,7 +360845,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
360711
360845
|
"summarizer-default": {
|
|
360712
360846
|
extends: "base",
|
|
360713
360847
|
modelConfig: {
|
|
360714
|
-
model: "
|
|
360848
|
+
model: "flash-lite",
|
|
360715
360849
|
generateContentConfig: {
|
|
360716
360850
|
maxOutputTokens: 2e3
|
|
360717
360851
|
}
|
|
@@ -360720,7 +360854,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
360720
360854
|
"summarizer-shell": {
|
|
360721
360855
|
extends: "base",
|
|
360722
360856
|
modelConfig: {
|
|
360723
|
-
model: "
|
|
360857
|
+
model: "flash-lite",
|
|
360724
360858
|
generateContentConfig: {
|
|
360725
360859
|
maxOutputTokens: 2e3
|
|
360726
360860
|
}
|
|
@@ -360790,7 +360924,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
360790
360924
|
},
|
|
360791
360925
|
"chat-compression-3.1-flash-lite": {
|
|
360792
360926
|
modelConfig: {
|
|
360793
|
-
model: "gemini-3.1-flash-lite
|
|
360927
|
+
model: "gemini-3.1-flash-lite"
|
|
360794
360928
|
}
|
|
360795
360929
|
},
|
|
360796
360930
|
"chat-compression-2.5-pro": {
|
|
@@ -360831,10 +360965,10 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
360831
360965
|
],
|
|
360832
360966
|
modelDefinitions: {
|
|
360833
360967
|
// Concrete Models
|
|
360834
|
-
"gemini-3.1-flash-lite
|
|
360968
|
+
"gemini-3.1-flash-lite": {
|
|
360835
360969
|
tier: "flash-lite",
|
|
360836
360970
|
family: "gemini-3",
|
|
360837
|
-
isPreview:
|
|
360971
|
+
isPreview: false,
|
|
360838
360972
|
isVisible: true,
|
|
360839
360973
|
features: { thinking: false, multimodalToolUse: true }
|
|
360840
360974
|
},
|
|
@@ -361016,14 +361150,8 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
361016
361150
|
}
|
|
361017
361151
|
]
|
|
361018
361152
|
},
|
|
361019
|
-
"gemini-3.1-flash-lite
|
|
361020
|
-
default: "gemini-3.1-flash-lite
|
|
361021
|
-
contexts: [
|
|
361022
|
-
{
|
|
361023
|
-
condition: { useGemini3_1FlashLite: false },
|
|
361024
|
-
target: "gemini-2.5-flash-lite"
|
|
361025
|
-
}
|
|
361026
|
-
]
|
|
361153
|
+
"gemini-3.1-flash-lite": {
|
|
361154
|
+
default: "gemini-3.1-flash-lite"
|
|
361027
361155
|
},
|
|
361028
361156
|
flash: {
|
|
361029
361157
|
default: "gemini-3-flash-preview",
|
|
@@ -361035,13 +361163,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
361035
361163
|
]
|
|
361036
361164
|
},
|
|
361037
361165
|
"flash-lite": {
|
|
361038
|
-
default: "gemini-
|
|
361039
|
-
contexts: [
|
|
361040
|
-
{
|
|
361041
|
-
condition: { useGemini3_1FlashLite: true },
|
|
361042
|
-
target: "gemini-3.1-flash-lite-preview"
|
|
361043
|
-
}
|
|
361044
|
-
]
|
|
361166
|
+
default: "gemini-3.1-flash-lite"
|
|
361045
361167
|
},
|
|
361046
361168
|
"auto-gemini-3": {
|
|
361047
361169
|
default: "gemini-3-pro-preview",
|
|
@@ -361238,7 +361360,7 @@ var DEFAULT_MODEL_CONFIGS = {
|
|
|
361238
361360
|
],
|
|
361239
361361
|
lite: [
|
|
361240
361362
|
{
|
|
361241
|
-
model: "
|
|
361363
|
+
model: "flash-lite",
|
|
361242
361364
|
actions: {
|
|
361243
361365
|
terminal: "silent",
|
|
361244
361366
|
transient: "silent",
|
|
@@ -364791,7 +364913,6 @@ var ExperimentFlags = {
|
|
|
364791
364913
|
MASKING_PROTECT_LATEST_TURN: 45758819,
|
|
364792
364914
|
GEMINI_3_1_PRO_LAUNCHED: 45760185,
|
|
364793
364915
|
PRO_MODEL_NO_ACCESS: 45768879,
|
|
364794
|
-
GEMINI_3_1_FLASH_LITE_LAUNCHED: 45771641,
|
|
364795
364916
|
DEFAULT_REQUEST_TIMEOUT: 45773134
|
|
364796
364917
|
};
|
|
364797
364918
|
|
|
@@ -380103,7 +380224,6 @@ var Config = class {
|
|
|
380103
380224
|
const primaryModel = resolveModel(
|
|
380104
380225
|
model,
|
|
380105
380226
|
this.getGemini31LaunchedSync(),
|
|
380106
|
-
this.getGemini31FlashLiteLaunchedSync(),
|
|
380107
380227
|
this.getUseCustomToolModelSync(),
|
|
380108
380228
|
this.getHasAccessToPreviewModel(),
|
|
380109
380229
|
this
|
|
@@ -380131,7 +380251,6 @@ var Config = class {
|
|
|
380131
380251
|
const primaryModel = resolveModel(
|
|
380132
380252
|
this.getModel(),
|
|
380133
380253
|
this.getGemini31LaunchedSync(),
|
|
380134
|
-
this.getGemini31FlashLiteLaunchedSync(),
|
|
380135
380254
|
this.getUseCustomToolModelSync(),
|
|
380136
380255
|
this.getHasAccessToPreviewModel(),
|
|
380137
380256
|
this
|
|
@@ -380146,7 +380265,6 @@ var Config = class {
|
|
|
380146
380265
|
const primaryModel = resolveModel(
|
|
380147
380266
|
this.getModel(),
|
|
380148
380267
|
this.getGemini31LaunchedSync(),
|
|
380149
|
-
this.getGemini31FlashLiteLaunchedSync(),
|
|
380150
380268
|
this.getUseCustomToolModelSync(),
|
|
380151
380269
|
this.getHasAccessToPreviewModel(),
|
|
380152
380270
|
this
|
|
@@ -380161,7 +380279,6 @@ var Config = class {
|
|
|
380161
380279
|
const primaryModel = resolveModel(
|
|
380162
380280
|
this.getModel(),
|
|
380163
380281
|
this.getGemini31LaunchedSync(),
|
|
380164
|
-
this.getGemini31FlashLiteLaunchedSync(),
|
|
380165
380282
|
this.getUseCustomToolModelSync(),
|
|
380166
380283
|
this.getHasAccessToPreviewModel(),
|
|
380167
380284
|
this
|
|
@@ -381184,14 +381301,6 @@ ${sections.join("\n")}
|
|
|
381184
381301
|
await this.ensureExperimentsLoaded();
|
|
381185
381302
|
return this.getGemini31LaunchedSync();
|
|
381186
381303
|
}
|
|
381187
|
-
/**
|
|
381188
|
-
* Returns whether Gemini 3.1 Flash Lite has been launched.
|
|
381189
|
-
* This method is async and ensures that experiments are loaded before returning the result.
|
|
381190
|
-
*/
|
|
381191
|
-
async getGemini31FlashLiteLaunched() {
|
|
381192
|
-
await this.ensureExperimentsLoaded();
|
|
381193
|
-
return this.getGemini31FlashLiteLaunchedSync();
|
|
381194
|
-
}
|
|
381195
381304
|
/**
|
|
381196
381305
|
* Returns whether the custom tool model should be used.
|
|
381197
381306
|
*/
|
|
@@ -381240,20 +381349,6 @@ ${sections.join("\n")}
|
|
|
381240
381349
|
}
|
|
381241
381350
|
return void 0;
|
|
381242
381351
|
}
|
|
381243
|
-
/**
|
|
381244
|
-
* Returns whether Gemini 3.1 Flash Lite has been launched.
|
|
381245
|
-
*
|
|
381246
|
-
* Note: This method should only be called after startup, once experiments have been loaded.
|
|
381247
|
-
* If you need to call this during startup or from an async context, use
|
|
381248
|
-
* getGemini31FlashLiteLaunched instead.
|
|
381249
|
-
*/
|
|
381250
|
-
getGemini31FlashLiteLaunchedSync() {
|
|
381251
|
-
const authType = this.contentGeneratorConfig?.authType;
|
|
381252
|
-
if (this.isGemini31LaunchedForAuthType(authType)) {
|
|
381253
|
-
return true;
|
|
381254
|
-
}
|
|
381255
|
-
return this.experiments?.flags[ExperimentFlags.GEMINI_3_1_FLASH_LITE_LAUNCHED]?.boolValue ?? false;
|
|
381256
|
-
}
|
|
381257
381352
|
/**
|
|
381258
381353
|
* Returns the client version.
|
|
381259
381354
|
*/
|
|
@@ -399423,8 +399518,6 @@ export {
|
|
|
399423
399518
|
formatTruncatedToolOutput,
|
|
399424
399519
|
TOOL_OUTPUTS_DIR,
|
|
399425
399520
|
saveTruncatedToolOutput,
|
|
399426
|
-
BASH_HUP_GUARD,
|
|
399427
|
-
stripHupGuard,
|
|
399428
399521
|
getCommandName,
|
|
399429
399522
|
extractStringFromParseEntry,
|
|
399430
399523
|
SHELL_TOOL_NAMES,
|
|
@@ -399656,10 +399749,10 @@ export {
|
|
|
399656
399749
|
PREVIEW_GEMINI_3_1_MODEL,
|
|
399657
399750
|
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
|
399658
399751
|
PREVIEW_GEMINI_FLASH_MODEL,
|
|
399659
|
-
PREVIEW_GEMINI_3_1_FLASH_LITE_MODEL,
|
|
399660
399752
|
DEFAULT_GEMINI_MODEL,
|
|
399661
399753
|
DEFAULT_GEMINI_FLASH_MODEL,
|
|
399662
399754
|
DEFAULT_GEMINI_FLASH_LITE_MODEL,
|
|
399755
|
+
PREVIEW_GEMINI_FLASH_LITE_MODEL,
|
|
399663
399756
|
GEMMA_4_31B_IT_MODEL,
|
|
399664
399757
|
GEMMA_4_26B_A4B_IT_MODEL,
|
|
399665
399758
|
VALID_GEMINI_MODELS,
|