@google/gemini-cli-a2a-server 0.29.2 → 0.29.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a2a-server.mjs +305 -30
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -38176,6 +38176,245 @@ var require_utils4 = __commonJS({
|
|
|
38176
38176
|
}
|
|
38177
38177
|
});
|
|
38178
38178
|
|
|
38179
|
+
// node_modules/punycode/punycode.js
|
|
38180
|
+
var require_punycode = __commonJS({
|
|
38181
|
+
"node_modules/punycode/punycode.js"(exports2, module2) {
|
|
38182
|
+
"use strict";
|
|
38183
|
+
var maxInt = 2147483647;
|
|
38184
|
+
var base = 36;
|
|
38185
|
+
var tMin = 1;
|
|
38186
|
+
var tMax = 26;
|
|
38187
|
+
var skew = 38;
|
|
38188
|
+
var damp = 700;
|
|
38189
|
+
var initialBias = 72;
|
|
38190
|
+
var initialN = 128;
|
|
38191
|
+
var delimiter3 = "-";
|
|
38192
|
+
var regexPunycode = /^xn--/;
|
|
38193
|
+
var regexNonASCII = /[^\0-\x7F]/;
|
|
38194
|
+
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
|
|
38195
|
+
var errors = {
|
|
38196
|
+
"overflow": "Overflow: input needs wider integers to process",
|
|
38197
|
+
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
38198
|
+
"invalid-input": "Invalid input"
|
|
38199
|
+
};
|
|
38200
|
+
var baseMinusTMin = base - tMin;
|
|
38201
|
+
var floor = Math.floor;
|
|
38202
|
+
var stringFromCharCode = String.fromCharCode;
|
|
38203
|
+
function error2(type2) {
|
|
38204
|
+
throw new RangeError(errors[type2]);
|
|
38205
|
+
}
|
|
38206
|
+
function map3(array2, callback) {
|
|
38207
|
+
const result2 = [];
|
|
38208
|
+
let length = array2.length;
|
|
38209
|
+
while (length--) {
|
|
38210
|
+
result2[length] = callback(array2[length]);
|
|
38211
|
+
}
|
|
38212
|
+
return result2;
|
|
38213
|
+
}
|
|
38214
|
+
function mapDomain(domain, callback) {
|
|
38215
|
+
const parts2 = domain.split("@");
|
|
38216
|
+
let result2 = "";
|
|
38217
|
+
if (parts2.length > 1) {
|
|
38218
|
+
result2 = parts2[0] + "@";
|
|
38219
|
+
domain = parts2[1];
|
|
38220
|
+
}
|
|
38221
|
+
domain = domain.replace(regexSeparators, ".");
|
|
38222
|
+
const labels = domain.split(".");
|
|
38223
|
+
const encoded = map3(labels, callback).join(".");
|
|
38224
|
+
return result2 + encoded;
|
|
38225
|
+
}
|
|
38226
|
+
function ucs2decode(string4) {
|
|
38227
|
+
const output = [];
|
|
38228
|
+
let counter = 0;
|
|
38229
|
+
const length = string4.length;
|
|
38230
|
+
while (counter < length) {
|
|
38231
|
+
const value = string4.charCodeAt(counter++);
|
|
38232
|
+
if (value >= 55296 && value <= 56319 && counter < length) {
|
|
38233
|
+
const extra = string4.charCodeAt(counter++);
|
|
38234
|
+
if ((extra & 64512) == 56320) {
|
|
38235
|
+
output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
|
|
38236
|
+
} else {
|
|
38237
|
+
output.push(value);
|
|
38238
|
+
counter--;
|
|
38239
|
+
}
|
|
38240
|
+
} else {
|
|
38241
|
+
output.push(value);
|
|
38242
|
+
}
|
|
38243
|
+
}
|
|
38244
|
+
return output;
|
|
38245
|
+
}
|
|
38246
|
+
var ucs2encode = (codePoints) => String.fromCodePoint(...codePoints);
|
|
38247
|
+
var basicToDigit = function(codePoint) {
|
|
38248
|
+
if (codePoint >= 48 && codePoint < 58) {
|
|
38249
|
+
return 26 + (codePoint - 48);
|
|
38250
|
+
}
|
|
38251
|
+
if (codePoint >= 65 && codePoint < 91) {
|
|
38252
|
+
return codePoint - 65;
|
|
38253
|
+
}
|
|
38254
|
+
if (codePoint >= 97 && codePoint < 123) {
|
|
38255
|
+
return codePoint - 97;
|
|
38256
|
+
}
|
|
38257
|
+
return base;
|
|
38258
|
+
};
|
|
38259
|
+
var digitToBasic = function(digit, flag) {
|
|
38260
|
+
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
|
38261
|
+
};
|
|
38262
|
+
var adapt = function(delta, numPoints, firstTime) {
|
|
38263
|
+
let k = 0;
|
|
38264
|
+
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
|
38265
|
+
delta += floor(delta / numPoints);
|
|
38266
|
+
for (; delta > baseMinusTMin * tMax >> 1; k += base) {
|
|
38267
|
+
delta = floor(delta / baseMinusTMin);
|
|
38268
|
+
}
|
|
38269
|
+
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
|
38270
|
+
};
|
|
38271
|
+
var decode3 = function(input) {
|
|
38272
|
+
const output = [];
|
|
38273
|
+
const inputLength = input.length;
|
|
38274
|
+
let i4 = 0;
|
|
38275
|
+
let n3 = initialN;
|
|
38276
|
+
let bias = initialBias;
|
|
38277
|
+
let basic = input.lastIndexOf(delimiter3);
|
|
38278
|
+
if (basic < 0) {
|
|
38279
|
+
basic = 0;
|
|
38280
|
+
}
|
|
38281
|
+
for (let j = 0; j < basic; ++j) {
|
|
38282
|
+
if (input.charCodeAt(j) >= 128) {
|
|
38283
|
+
error2("not-basic");
|
|
38284
|
+
}
|
|
38285
|
+
output.push(input.charCodeAt(j));
|
|
38286
|
+
}
|
|
38287
|
+
for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
|
|
38288
|
+
const oldi = i4;
|
|
38289
|
+
for (let w = 1, k = base; ; k += base) {
|
|
38290
|
+
if (index >= inputLength) {
|
|
38291
|
+
error2("invalid-input");
|
|
38292
|
+
}
|
|
38293
|
+
const digit = basicToDigit(input.charCodeAt(index++));
|
|
38294
|
+
if (digit >= base) {
|
|
38295
|
+
error2("invalid-input");
|
|
38296
|
+
}
|
|
38297
|
+
if (digit > floor((maxInt - i4) / w)) {
|
|
38298
|
+
error2("overflow");
|
|
38299
|
+
}
|
|
38300
|
+
i4 += digit * w;
|
|
38301
|
+
const t3 = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
38302
|
+
if (digit < t3) {
|
|
38303
|
+
break;
|
|
38304
|
+
}
|
|
38305
|
+
const baseMinusT = base - t3;
|
|
38306
|
+
if (w > floor(maxInt / baseMinusT)) {
|
|
38307
|
+
error2("overflow");
|
|
38308
|
+
}
|
|
38309
|
+
w *= baseMinusT;
|
|
38310
|
+
}
|
|
38311
|
+
const out2 = output.length + 1;
|
|
38312
|
+
bias = adapt(i4 - oldi, out2, oldi == 0);
|
|
38313
|
+
if (floor(i4 / out2) > maxInt - n3) {
|
|
38314
|
+
error2("overflow");
|
|
38315
|
+
}
|
|
38316
|
+
n3 += floor(i4 / out2);
|
|
38317
|
+
i4 %= out2;
|
|
38318
|
+
output.splice(i4++, 0, n3);
|
|
38319
|
+
}
|
|
38320
|
+
return String.fromCodePoint(...output);
|
|
38321
|
+
};
|
|
38322
|
+
var encode3 = function(input) {
|
|
38323
|
+
const output = [];
|
|
38324
|
+
input = ucs2decode(input);
|
|
38325
|
+
const inputLength = input.length;
|
|
38326
|
+
let n3 = initialN;
|
|
38327
|
+
let delta = 0;
|
|
38328
|
+
let bias = initialBias;
|
|
38329
|
+
for (const currentValue of input) {
|
|
38330
|
+
if (currentValue < 128) {
|
|
38331
|
+
output.push(stringFromCharCode(currentValue));
|
|
38332
|
+
}
|
|
38333
|
+
}
|
|
38334
|
+
const basicLength = output.length;
|
|
38335
|
+
let handledCPCount = basicLength;
|
|
38336
|
+
if (basicLength) {
|
|
38337
|
+
output.push(delimiter3);
|
|
38338
|
+
}
|
|
38339
|
+
while (handledCPCount < inputLength) {
|
|
38340
|
+
let m2 = maxInt;
|
|
38341
|
+
for (const currentValue of input) {
|
|
38342
|
+
if (currentValue >= n3 && currentValue < m2) {
|
|
38343
|
+
m2 = currentValue;
|
|
38344
|
+
}
|
|
38345
|
+
}
|
|
38346
|
+
const handledCPCountPlusOne = handledCPCount + 1;
|
|
38347
|
+
if (m2 - n3 > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
|
38348
|
+
error2("overflow");
|
|
38349
|
+
}
|
|
38350
|
+
delta += (m2 - n3) * handledCPCountPlusOne;
|
|
38351
|
+
n3 = m2;
|
|
38352
|
+
for (const currentValue of input) {
|
|
38353
|
+
if (currentValue < n3 && ++delta > maxInt) {
|
|
38354
|
+
error2("overflow");
|
|
38355
|
+
}
|
|
38356
|
+
if (currentValue === n3) {
|
|
38357
|
+
let q = delta;
|
|
38358
|
+
for (let k = base; ; k += base) {
|
|
38359
|
+
const t3 = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
38360
|
+
if (q < t3) {
|
|
38361
|
+
break;
|
|
38362
|
+
}
|
|
38363
|
+
const qMinusT = q - t3;
|
|
38364
|
+
const baseMinusT = base - t3;
|
|
38365
|
+
output.push(
|
|
38366
|
+
stringFromCharCode(digitToBasic(t3 + qMinusT % baseMinusT, 0))
|
|
38367
|
+
);
|
|
38368
|
+
q = floor(qMinusT / baseMinusT);
|
|
38369
|
+
}
|
|
38370
|
+
output.push(stringFromCharCode(digitToBasic(q, 0)));
|
|
38371
|
+
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
|
|
38372
|
+
delta = 0;
|
|
38373
|
+
++handledCPCount;
|
|
38374
|
+
}
|
|
38375
|
+
}
|
|
38376
|
+
++delta;
|
|
38377
|
+
++n3;
|
|
38378
|
+
}
|
|
38379
|
+
return output.join("");
|
|
38380
|
+
};
|
|
38381
|
+
var toUnicode = function(input) {
|
|
38382
|
+
return mapDomain(input, function(string4) {
|
|
38383
|
+
return regexPunycode.test(string4) ? decode3(string4.slice(4).toLowerCase()) : string4;
|
|
38384
|
+
});
|
|
38385
|
+
};
|
|
38386
|
+
var toASCII = function(input) {
|
|
38387
|
+
return mapDomain(input, function(string4) {
|
|
38388
|
+
return regexNonASCII.test(string4) ? "xn--" + encode3(string4) : string4;
|
|
38389
|
+
});
|
|
38390
|
+
};
|
|
38391
|
+
var punycode = {
|
|
38392
|
+
/**
|
|
38393
|
+
* A string representing the current Punycode.js version number.
|
|
38394
|
+
* @memberOf punycode
|
|
38395
|
+
* @type String
|
|
38396
|
+
*/
|
|
38397
|
+
"version": "2.3.1",
|
|
38398
|
+
/**
|
|
38399
|
+
* An object of methods to convert from JavaScript's internal character
|
|
38400
|
+
* representation (UCS-2) to Unicode code points, and back.
|
|
38401
|
+
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
38402
|
+
* @memberOf punycode
|
|
38403
|
+
* @type Object
|
|
38404
|
+
*/
|
|
38405
|
+
"ucs2": {
|
|
38406
|
+
"decode": ucs2decode,
|
|
38407
|
+
"encode": ucs2encode
|
|
38408
|
+
},
|
|
38409
|
+
"decode": decode3,
|
|
38410
|
+
"encode": encode3,
|
|
38411
|
+
"toASCII": toASCII,
|
|
38412
|
+
"toUnicode": toUnicode
|
|
38413
|
+
};
|
|
38414
|
+
module2.exports = punycode;
|
|
38415
|
+
}
|
|
38416
|
+
});
|
|
38417
|
+
|
|
38179
38418
|
// node_modules/node-fetch/node_modules/tr46/lib/mappingTable.json
|
|
38180
38419
|
var require_mappingTable = __commonJS({
|
|
38181
38420
|
"node_modules/node-fetch/node_modules/tr46/lib/mappingTable.json"(exports2, module2) {
|
|
@@ -38187,7 +38426,7 @@ var require_mappingTable = __commonJS({
|
|
|
38187
38426
|
var require_tr46 = __commonJS({
|
|
38188
38427
|
"node_modules/node-fetch/node_modules/tr46/index.js"(exports2, module2) {
|
|
38189
38428
|
"use strict";
|
|
38190
|
-
var punycode =
|
|
38429
|
+
var punycode = require_punycode();
|
|
38191
38430
|
var mappingTable = require_mappingTable();
|
|
38192
38431
|
var PROCESSING_OPTIONS = {
|
|
38193
38432
|
TRANSITIONAL: 0,
|
|
@@ -38348,7 +38587,7 @@ var require_tr46 = __commonJS({
|
|
|
38348
38587
|
var require_url_state_machine = __commonJS({
|
|
38349
38588
|
"node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js"(exports2, module2) {
|
|
38350
38589
|
"use strict";
|
|
38351
|
-
var punycode =
|
|
38590
|
+
var punycode = require_punycode();
|
|
38352
38591
|
var tr46 = require_tr46();
|
|
38353
38592
|
var specialSchemes = {
|
|
38354
38593
|
ftp: 21,
|
|
@@ -328488,6 +328727,8 @@ function getResponseText(response) {
|
|
|
328488
328727
|
|
|
328489
328728
|
// packages/core/dist/src/config/models.js
|
|
328490
328729
|
var PREVIEW_GEMINI_MODEL = "gemini-3-pro-preview";
|
|
328730
|
+
var PREVIEW_GEMINI_3_1_MODEL = "gemini-3.1-pro-preview";
|
|
328731
|
+
var PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL = "gemini-3.1-pro-preview-customtools";
|
|
328491
328732
|
var PREVIEW_GEMINI_FLASH_MODEL = "gemini-3-flash-preview";
|
|
328492
328733
|
var DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
|
|
328493
328734
|
var DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
|
|
@@ -328500,18 +328741,20 @@ var GEMINI_MODEL_ALIAS_FLASH = "flash";
|
|
|
328500
328741
|
var GEMINI_MODEL_ALIAS_FLASH_LITE = "flash-lite";
|
|
328501
328742
|
var DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
|
|
328502
328743
|
var DEFAULT_THINKING_MODE = 8192;
|
|
328503
|
-
function resolveModel(requestedModel) {
|
|
328744
|
+
function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel = false) {
|
|
328504
328745
|
switch (requestedModel) {
|
|
328505
|
-
case
|
|
328746
|
+
case PREVIEW_GEMINI_MODEL:
|
|
328747
|
+
case PREVIEW_GEMINI_MODEL_AUTO:
|
|
328748
|
+
case GEMINI_MODEL_ALIAS_AUTO:
|
|
328749
|
+
case GEMINI_MODEL_ALIAS_PRO: {
|
|
328750
|
+
if (useGemini3_1) {
|
|
328751
|
+
return useCustomToolModel ? PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL : PREVIEW_GEMINI_3_1_MODEL;
|
|
328752
|
+
}
|
|
328506
328753
|
return PREVIEW_GEMINI_MODEL;
|
|
328507
328754
|
}
|
|
328508
328755
|
case DEFAULT_GEMINI_MODEL_AUTO: {
|
|
328509
328756
|
return DEFAULT_GEMINI_MODEL;
|
|
328510
328757
|
}
|
|
328511
|
-
case GEMINI_MODEL_ALIAS_AUTO:
|
|
328512
|
-
case GEMINI_MODEL_ALIAS_PRO: {
|
|
328513
|
-
return PREVIEW_GEMINI_MODEL;
|
|
328514
|
-
}
|
|
328515
328758
|
case GEMINI_MODEL_ALIAS_FLASH: {
|
|
328516
328759
|
return PREVIEW_GEMINI_FLASH_MODEL;
|
|
328517
328760
|
}
|
|
@@ -328523,7 +328766,7 @@ function resolveModel(requestedModel) {
|
|
|
328523
328766
|
}
|
|
328524
328767
|
}
|
|
328525
328768
|
}
|
|
328526
|
-
function resolveClassifierModel(requestedModel, modelAlias) {
|
|
328769
|
+
function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false, useCustomToolModel = false) {
|
|
328527
328770
|
if (modelAlias === GEMINI_MODEL_ALIAS_FLASH) {
|
|
328528
328771
|
if (requestedModel === DEFAULT_GEMINI_MODEL_AUTO || requestedModel === DEFAULT_GEMINI_MODEL) {
|
|
328529
328772
|
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
@@ -328533,10 +328776,10 @@ function resolveClassifierModel(requestedModel, modelAlias) {
|
|
|
328533
328776
|
}
|
|
328534
328777
|
return resolveModel(GEMINI_MODEL_ALIAS_FLASH);
|
|
328535
328778
|
}
|
|
328536
|
-
return resolveModel(requestedModel);
|
|
328779
|
+
return resolveModel(requestedModel, useGemini3_1, useCustomToolModel);
|
|
328537
328780
|
}
|
|
328538
328781
|
function isPreviewModel(model) {
|
|
328539
|
-
return model === PREVIEW_GEMINI_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_MODEL_AUTO;
|
|
328782
|
+
return model === PREVIEW_GEMINI_MODEL || model === PREVIEW_GEMINI_3_1_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_MODEL_AUTO;
|
|
328540
328783
|
}
|
|
328541
328784
|
function isGemini3Model(model) {
|
|
328542
328785
|
const resolved = resolveModel(model);
|
|
@@ -328956,7 +329199,7 @@ var __filename = fileURLToPath5(import.meta.url);
|
|
|
328956
329199
|
var __dirname3 = path22.dirname(__filename);
|
|
328957
329200
|
async function getVersion() {
|
|
328958
329201
|
const pkgJson = await getPackageJson(__dirname3);
|
|
328959
|
-
return "0.29.
|
|
329202
|
+
return "0.29.4";
|
|
328960
329203
|
}
|
|
328961
329204
|
|
|
328962
329205
|
// packages/core/dist/src/code_assist/experiments/client_metadata.js
|
|
@@ -332501,8 +332744,8 @@ var Float64Vector = import_vector.default.Float64Vector;
|
|
|
332501
332744
|
var PointerVector = import_vector.default.PointerVector;
|
|
332502
332745
|
|
|
332503
332746
|
// packages/core/dist/src/generated/git-commit.js
|
|
332504
|
-
var GIT_COMMIT_INFO = "
|
|
332505
|
-
var CLI_VERSION = "0.29.
|
|
332747
|
+
var GIT_COMMIT_INFO = "069641f65";
|
|
332748
|
+
var CLI_VERSION = "0.29.4";
|
|
332506
332749
|
|
|
332507
332750
|
// packages/core/dist/src/ide/detect-ide.js
|
|
332508
332751
|
var IDE_DEFINITIONS = {
|
|
@@ -335982,7 +336225,7 @@ async function createContentGenerator(config3, gcConfig, sessionId2) {
|
|
|
335982
336225
|
return new LoggingContentGenerator(fakeGenerator, gcConfig);
|
|
335983
336226
|
}
|
|
335984
336227
|
const version4 = await getVersion();
|
|
335985
|
-
const model = resolveModel(gcConfig.getModel());
|
|
336228
|
+
const model = resolveModel(gcConfig.getModel(), config3.authType === AuthType2.USE_GEMINI || config3.authType === AuthType2.USE_VERTEX_AI || (await gcConfig.getGemini31Launched?.() ?? false));
|
|
335986
336229
|
const customHeadersEnv = process.env["GEMINI_CLI_CUSTOM_HEADERS"] || void 0;
|
|
335987
336230
|
const userAgent = `GeminiCLI/${version4}/${model} (${process.platform}; ${process.arch})`;
|
|
335988
336231
|
const customHeadersMap = parseCustomHeaders(customHeadersEnv);
|
|
@@ -374332,7 +374575,7 @@ function resolvePolicyChain(config3, preferredModel, wrapsAround = false) {
|
|
|
374332
374575
|
const modelFromConfig = preferredModel ?? config3.getActiveModel?.() ?? config3.getModel();
|
|
374333
374576
|
const configuredModel = config3.getModel();
|
|
374334
374577
|
let chain2;
|
|
374335
|
-
const resolvedModel = resolveModel(modelFromConfig);
|
|
374578
|
+
const resolvedModel = resolveModel(modelFromConfig, config3.getGemini31LaunchedSync?.() ?? false);
|
|
374336
374579
|
const isAutoPreferred = preferredModel ? isAutoModel(preferredModel) : false;
|
|
374337
374580
|
const isAutoConfigured = isAutoModel(configuredModel);
|
|
374338
374581
|
if (resolvedModel === DEFAULT_GEMINI_FLASH_LITE_MODEL) {
|
|
@@ -386612,9 +386855,10 @@ var GeminiChat = class {
|
|
|
386612
386855
|
const getAvailabilityContext = createAvailabilityContextProvider(this.config, () => lastModelToUse);
|
|
386613
386856
|
const initialActiveModel = this.config.getActiveModel();
|
|
386614
386857
|
const apiCall = async () => {
|
|
386615
|
-
|
|
386858
|
+
const useGemini3_1 = await this.config.getGemini31Launched?.() ?? false;
|
|
386859
|
+
let modelToUse = resolveModel(lastModelToUse, useGemini3_1);
|
|
386616
386860
|
if (this.config.getActiveModel() !== initialActiveModel) {
|
|
386617
|
-
modelToUse = resolveModel(this.config.getActiveModel());
|
|
386861
|
+
modelToUse = resolveModel(this.config.getActiveModel(), useGemini3_1);
|
|
386618
386862
|
}
|
|
386619
386863
|
if (modelToUse !== lastModelToUse) {
|
|
386620
386864
|
const { generateContentConfig: newConfig } = this.config.modelConfigService.getResolvedConfig({
|
|
@@ -388498,7 +388742,7 @@ var PromptProvider = class {
|
|
|
388498
388742
|
const toolNames = config3.getToolRegistry().getAllToolNames();
|
|
388499
388743
|
const enabledToolNames = new Set(toolNames);
|
|
388500
388744
|
const approvedPlanPath = config3.getApprovedPlanPath();
|
|
388501
|
-
const desiredModel = resolveModel(config3.getActiveModel());
|
|
388745
|
+
const desiredModel = resolveModel(config3.getActiveModel(), config3.getGemini31LaunchedSync?.() ?? false);
|
|
388502
388746
|
const isGemini3 = isPreviewModel(desiredModel);
|
|
388503
388747
|
const activeSnippets = isGemini3 ? snippets_exports : snippets_legacy_exports;
|
|
388504
388748
|
const contextFilenames = getAllGeminiMdFilenames();
|
|
@@ -388587,7 +388831,7 @@ ${mcpToolsList}`;
|
|
|
388587
388831
|
return sanitizedPrompt;
|
|
388588
388832
|
}
|
|
388589
388833
|
getCompressionPrompt(config3) {
|
|
388590
|
-
const desiredModel = resolveModel(config3.getActiveModel());
|
|
388834
|
+
const desiredModel = resolveModel(config3.getActiveModel(), config3.getGemini31LaunchedSync?.() ?? false);
|
|
388591
388835
|
const isGemini3 = isPreviewModel(desiredModel);
|
|
388592
388836
|
const activeSnippets = isGemini3 ? snippets_exports : snippets_legacy_exports;
|
|
388593
388837
|
return activeSnippets.getCompressionPrompt();
|
|
@@ -389101,6 +389345,7 @@ function findCompressSplitPoint(contents, fraction) {
|
|
|
389101
389345
|
function modelStringToModelConfigAlias(model) {
|
|
389102
389346
|
switch (model) {
|
|
389103
389347
|
case PREVIEW_GEMINI_MODEL:
|
|
389348
|
+
case PREVIEW_GEMINI_3_1_MODEL:
|
|
389104
389349
|
return "chat-compression-3-pro";
|
|
389105
389350
|
case PREVIEW_GEMINI_FLASH_MODEL:
|
|
389106
389351
|
return "chat-compression-3-flash";
|
|
@@ -389872,7 +390117,7 @@ var GeminiClient = class {
|
|
|
389872
390117
|
if (this.currentSequenceModel) {
|
|
389873
390118
|
return this.currentSequenceModel;
|
|
389874
390119
|
}
|
|
389875
|
-
return resolveModel(this.config.getActiveModel());
|
|
390120
|
+
return resolveModel(this.config.getActiveModel(), this.config.getGemini31LaunchedSync?.() ?? false);
|
|
389876
390121
|
}
|
|
389877
390122
|
async *processTurn(request3, signal, prompt_id, boundedTurns, isInvalidStreamRetry, displayContent) {
|
|
389878
390123
|
let turn = new Turn(this.getChat(), prompt_id);
|
|
@@ -395151,7 +395396,7 @@ var ModelAvailabilityService = class {
|
|
|
395151
395396
|
var DefaultStrategy = class {
|
|
395152
395397
|
name = "default";
|
|
395153
395398
|
async route(_context, config3, _baseLlmClient) {
|
|
395154
|
-
const defaultModel = resolveModel(config3.getModel());
|
|
395399
|
+
const defaultModel = resolveModel(config3.getModel(), config3.getGemini31LaunchedSync?.() ?? false);
|
|
395155
395400
|
return {
|
|
395156
395401
|
model: defaultModel,
|
|
395157
395402
|
metadata: {
|
|
@@ -395285,7 +395530,9 @@ var ClassifierStrategy = class {
|
|
|
395285
395530
|
const routerResponse = ClassifierResponseSchema.parse(jsonResponse);
|
|
395286
395531
|
const reasoning = routerResponse.reasoning;
|
|
395287
395532
|
const latencyMs = Date.now() - startTime;
|
|
395288
|
-
const
|
|
395533
|
+
const useGemini3_1 = await config3.getGemini31Launched?.() ?? false;
|
|
395534
|
+
const useCustomToolModel = useGemini3_1 && config3.getContentGeneratorConfig().authType === AuthType2.USE_GEMINI;
|
|
395535
|
+
const selectedModel = resolveClassifierModel(model, routerResponse.model_choice, useGemini3_1, useCustomToolModel);
|
|
395289
395536
|
return {
|
|
395290
395537
|
model: selectedModel,
|
|
395291
395538
|
metadata: {
|
|
@@ -395419,7 +395666,9 @@ var NumericalClassifierStrategy = class {
|
|
|
395419
395666
|
const routerResponse = ClassifierResponseSchema2.parse(jsonResponse);
|
|
395420
395667
|
const score = routerResponse.complexity_score;
|
|
395421
395668
|
const { threshold, groupLabel, modelAlias } = await this.getRoutingDecision(score, config3, config3.getSessionId() || "unknown-session");
|
|
395422
|
-
const
|
|
395669
|
+
const useGemini3_1 = await config3.getGemini31Launched?.() ?? false;
|
|
395670
|
+
const useCustomToolModel = useGemini3_1 && config3.getContentGeneratorConfig().authType === AuthType2.USE_GEMINI;
|
|
395671
|
+
const selectedModel = resolveClassifierModel(model, modelAlias, useGemini3_1, useCustomToolModel);
|
|
395423
395672
|
const latencyMs = Date.now() - startTime;
|
|
395424
395673
|
return {
|
|
395425
395674
|
model: selectedModel,
|
|
@@ -395511,7 +395760,7 @@ var FallbackStrategy = class {
|
|
|
395511
395760
|
name = "fallback";
|
|
395512
395761
|
async route(context2, config3, _baseLlmClient) {
|
|
395513
395762
|
const requestedModel = context2.requestedModel ?? config3.getModel();
|
|
395514
|
-
const resolvedModel = resolveModel(requestedModel);
|
|
395763
|
+
const resolvedModel = resolveModel(requestedModel, config3.getGemini31LaunchedSync?.() ?? false);
|
|
395515
395764
|
const service = config3.getModelAvailabilityService();
|
|
395516
395765
|
const snapshot = service.snapshot(resolvedModel);
|
|
395517
395766
|
if (snapshot.available) {
|
|
@@ -395541,7 +395790,7 @@ var OverrideStrategy = class {
|
|
|
395541
395790
|
return null;
|
|
395542
395791
|
}
|
|
395543
395792
|
return {
|
|
395544
|
-
model: resolveModel(overrideModel),
|
|
395793
|
+
model: resolveModel(overrideModel, config3.getGemini31LaunchedSync?.() ?? false),
|
|
395545
395794
|
metadata: {
|
|
395546
395795
|
source: this.name,
|
|
395547
395796
|
latencyMs: 0,
|
|
@@ -405117,7 +405366,8 @@ var ExperimentFlags = {
|
|
|
405117
405366
|
ENABLE_ADMIN_CONTROLS: 45752213,
|
|
405118
405367
|
MASKING_PROTECTION_THRESHOLD: 45758817,
|
|
405119
405368
|
MASKING_PRUNABLE_THRESHOLD: 45758818,
|
|
405120
|
-
MASKING_PROTECT_LATEST_TURN: 45758819
|
|
405369
|
+
MASKING_PROTECT_LATEST_TURN: 45758819,
|
|
405370
|
+
GEMINI_3_1_PRO_LAUNCHED: 45760185
|
|
405121
405371
|
};
|
|
405122
405372
|
|
|
405123
405373
|
// packages/core/dist/src/config/config.js
|
|
@@ -409038,6 +409288,9 @@ var Config = class {
|
|
|
409038
409288
|
this.geminiClient.stripThoughtsFromHistory();
|
|
409039
409289
|
}
|
|
409040
409290
|
this.modelAvailabilityService.reset();
|
|
409291
|
+
if (this.contentGeneratorConfig) {
|
|
409292
|
+
this.contentGeneratorConfig.authType = void 0;
|
|
409293
|
+
}
|
|
409041
409294
|
const newContentGeneratorConfig = await createContentGeneratorConfig(this, authMethod);
|
|
409042
409295
|
this.contentGenerator = await createContentGenerator(newContentGeneratorConfig, this, this.getSessionId());
|
|
409043
409296
|
this.contentGeneratorConfig = newContentGeneratorConfig;
|
|
@@ -409219,7 +409472,7 @@ var Config = class {
|
|
|
409219
409472
|
if (pooled.remaining !== void 0) {
|
|
409220
409473
|
return pooled.remaining;
|
|
409221
409474
|
}
|
|
409222
|
-
const primaryModel = resolveModel(this.getModel());
|
|
409475
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync());
|
|
409223
409476
|
return this.modelQuotas.get(primaryModel)?.remaining;
|
|
409224
409477
|
}
|
|
409225
409478
|
getQuotaLimit() {
|
|
@@ -409227,7 +409480,7 @@ var Config = class {
|
|
|
409227
409480
|
if (pooled.limit !== void 0) {
|
|
409228
409481
|
return pooled.limit;
|
|
409229
409482
|
}
|
|
409230
|
-
const primaryModel = resolveModel(this.getModel());
|
|
409483
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync());
|
|
409231
409484
|
return this.modelQuotas.get(primaryModel)?.limit;
|
|
409232
409485
|
}
|
|
409233
409486
|
getQuotaResetTime() {
|
|
@@ -409235,7 +409488,7 @@ var Config = class {
|
|
|
409235
409488
|
if (pooled.resetTime !== void 0) {
|
|
409236
409489
|
return pooled.resetTime;
|
|
409237
409490
|
}
|
|
409238
|
-
const primaryModel = resolveModel(this.getModel());
|
|
409491
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync());
|
|
409239
409492
|
return this.modelQuotas.get(primaryModel)?.resetTime;
|
|
409240
409493
|
}
|
|
409241
409494
|
getEmbeddingModel() {
|
|
@@ -409844,6 +410097,28 @@ var Config = class {
|
|
|
409844
410097
|
await this.ensureExperimentsLoaded();
|
|
409845
410098
|
return this.experiments?.flags[ExperimentFlags.BANNER_TEXT_CAPACITY_ISSUES]?.stringValue ?? "";
|
|
409846
410099
|
}
|
|
410100
|
+
/**
|
|
410101
|
+
* Returns whether Gemini 3.1 has been launched.
|
|
410102
|
+
* This method is async and ensures that experiments are loaded before returning the result.
|
|
410103
|
+
*/
|
|
410104
|
+
async getGemini31Launched() {
|
|
410105
|
+
await this.ensureExperimentsLoaded();
|
|
410106
|
+
return this.getGemini31LaunchedSync();
|
|
410107
|
+
}
|
|
410108
|
+
/**
|
|
410109
|
+
* Returns whether Gemini 3.1 has been launched.
|
|
410110
|
+
*
|
|
410111
|
+
* Note: This method should only be called after startup, once experiments have been loaded.
|
|
410112
|
+
* If you need to call this during startup or from an async context, use
|
|
410113
|
+
* getGemini31Launched instead.
|
|
410114
|
+
*/
|
|
410115
|
+
getGemini31LaunchedSync() {
|
|
410116
|
+
const authType = this.contentGeneratorConfig?.authType;
|
|
410117
|
+
if (authType === AuthType2.USE_GEMINI || authType === AuthType2.USE_VERTEX_AI) {
|
|
410118
|
+
return true;
|
|
410119
|
+
}
|
|
410120
|
+
return this.experiments?.flags[ExperimentFlags.GEMINI_3_1_PRO_LAUNCHED]?.boolValue ?? false;
|
|
410121
|
+
}
|
|
409847
410122
|
async ensureExperimentsLoaded() {
|
|
409848
410123
|
if (!this.experimentsPromise) {
|
|
409849
410124
|
return;
|